- bugfix for chrono class calcs causing group camera recall to fail (And numerous other problems)

- added better tracking of mutexes by assigning them location info
This commit is contained in:
SoftCoder
2013-12-24 22:27:44 -08:00
parent 25326c64b1
commit 3111b733e2
32 changed files with 337 additions and 315 deletions

View File

@@ -1073,15 +1073,15 @@ void Pixmap2D::getPixel(int x, int y, uint8 *value) const {
}
void Pixmap2D::getPixel(int x, int y, float32 *value) const {
for(int i=0; i<components; ++i) {
std::size_t index = (w*y+x)*components+i;
for(int i = 0; i < components; ++i) {
std::size_t index = (w * y + x) * components + i;
if(index >= getPixelByteCount()) {
char szBuf[8096];
snprintf(szBuf,8096,"Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n",index,path.c_str(),h,w,components,x,y);
throw megaglest_runtime_error(szBuf);
}
value[i]= pixels[index]/255.f;
value[i] = pixels[index] / 255.f;
}
}
@@ -1093,7 +1093,7 @@ void Pixmap2D::getComponent(int x, int y, int component, uint8 &value) const {
throw megaglest_runtime_error(szBuf);
}
value= pixels[index];
value = pixels[index];
}
void Pixmap2D::getComponent(int x, int y, int component, float32 &value) const {
@@ -1104,7 +1104,7 @@ void Pixmap2D::getComponent(int x, int y, int component, float32 &value) const {
throw megaglest_runtime_error(szBuf);
}
value= pixels[index]/255.f;
value= pixels[index] / 255.f;
}
//vector get
@@ -1118,7 +1118,7 @@ Vec4f Pixmap2D::getPixel4f(int x, int y) const {
throw megaglest_runtime_error(szBuf);
}
v.ptr()[i]= pixels[index]/255.f;
v.ptr()[i]= pixels[index] / 255.f;
}
return v;
}
@@ -1133,19 +1133,19 @@ Vec3f Pixmap2D::getPixel3f(int x, int y) const {
throw megaglest_runtime_error(szBuf);
}
v.ptr()[i]= pixels[index]/255.f;
v.ptr()[i]= pixels[index] / 255.f;
}
return v;
}
float Pixmap2D::getPixelf(int x, int y) const {
std::size_t index = (w*y+x)*components;
std::size_t index = (w * y + x) * components;
if(index >= getPixelByteCount()) {
char szBuf[8096];
snprintf(szBuf,8096,"Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n",index,path.c_str(),h,w,components,x,y);
throw megaglest_runtime_error(szBuf);
}
return pixels[index]/255.f;
return pixels[index] / 255.f;
}
float Pixmap2D::getComponentf(int x, int y, int component) const {
@@ -1187,7 +1187,7 @@ void Pixmap2D::setPixel(int x, int y, const float32 *value, int arraySize) {
snprintf(szBuf,8096,"Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n",index,path.c_str(),h,w,components,x,y);
throw megaglest_runtime_error(szBuf);
}
pixels[index]= static_cast<uint8>(value[i]*255.f);
pixels[index] = static_cast<uint8>(value[i] * 255.f);
}
CalculatePixelsCRC(pixels,getPixelByteCount(), crc);
}
@@ -1212,7 +1212,7 @@ void Pixmap2D::setComponent(int x, int y, int component, float32 value) {
throw megaglest_runtime_error(szBuf);
}
pixels[index]= static_cast<uint8>(value*255.f);
pixels[index] = static_cast<uint8>(value * 255.f);
CalculatePixelsCRC(pixels,getPixelByteCount(), crc);
}
@@ -1225,7 +1225,7 @@ void Pixmap2D::setPixel(int x, int y, const Vec3f &p) {
snprintf(szBuf,8096,"Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n",index,path.c_str(),h,w,components,x,y);
throw megaglest_runtime_error(szBuf);
}
pixels[index]= static_cast<uint8>(p.ptr()[i]*255.f);
pixels[index] = static_cast<uint8>(p.ptr()[i] * 255.f);
}
CalculatePixelsCRC(pixels,getPixelByteCount(), crc);
}
@@ -1238,7 +1238,7 @@ void Pixmap2D::setPixel(int x, int y, const Vec4f &p) {
snprintf(szBuf,8096,"Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n",index,path.c_str(),h,w,components,x,y);
throw megaglest_runtime_error(szBuf);
}
pixels[index]= static_cast<uint8>(p.ptr()[i]*255.f);
pixels[index] = static_cast<uint8>(p.ptr()[i] * 255.f);
}
CalculatePixelsCRC(pixels,getPixelByteCount(), crc);
}
@@ -1251,7 +1251,7 @@ void Pixmap2D::setPixel(int x, int y, float p) {
throw megaglest_runtime_error(szBuf);
}
pixels[index]= static_cast<uint8>(p*255.f);
pixels[index] = static_cast<uint8>(p * 255.f);
CalculatePixelsCRC(pixels,getPixelByteCount(), crc);
}