- performance changes... (problem found by titi) most debug calls line are skipped when the debug flag is disabled even BEFORE getting into the handledebug method.

This improves performance VERY MUCH.
This commit is contained in:
Mark Vejvoda
2011-03-28 03:54:23 +00:00
parent 453e5a12e6
commit 3b56aa4475
58 changed files with 1573 additions and 2312 deletions

View File

@@ -844,7 +844,6 @@ void Pixmap2D::init(int w, int h, int components) {
this->h= h;
this->components= components;
deletePixels();
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] w = %d, h = %d, components = %d, getPixelByteCount() = %llu\n",__FILE__,__FUNCTION__,__LINE__,w,h,components,(long long unsigned)getPixelByteCount());
if(getPixelByteCount() <= 0 || (h <= 0 || w <= 0 || components <= 0)) {
char szBuf[1024];
@@ -852,7 +851,6 @@ void Pixmap2D::init(int w, int h, int components) {
throw runtime_error(szBuf);
}
pixels= new uint8[(std::size_t)getPixelByteCount()];
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
uint64 Pixmap2D::getPixelByteCount() const {
@@ -861,10 +859,8 @@ uint64 Pixmap2D::getPixelByteCount() const {
void Pixmap2D::deletePixels() {
if(pixels) {
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
delete [] pixels;
pixels = NULL;
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}