Page 1 of 1

namespace bug (+fix) breaking on mac

Posted: Sat Sep 01, 2007 2:48 pm
by maddanio
Hi,

Just did an update of my svn copy, and it breaks compiling due to incorrect (or so the compiler says) reference of VSImage (seems it needs to be referenced in some places as ::VSImage). My system is an up to date Tiger OSX on an MBP. Here is the patch (or rather the dump of an svn diff) that fixes it for me:

>>>

Index: src/gui/guitexture.cpp
===================================================================
--- src/gui/guitexture.cpp (Revision 11457)
+++ src/gui/guitexture.cpp (Arbeitskopie)
@@ -95,7 +95,7 @@
} else {
int mode = img.mode;
unsigned char *data = ddsDecompress(image,width,height,mode);
- img.mode = (VSImage::VSImageMode)mode;
+ img.mode = (::VSImage::VSImageMode)mode;
success = texture.bindRawData(data, width, height, hasAlpha, fileName);
free(image); // Make sure this gets freed before we return.
free(data);
Index: src/gui/glut_support.cpp
===================================================================
--- src/gui/glut_support.cpp (Revision 11457)
+++ src/gui/glut_support.cpp (Arbeitskopie)
@@ -63,7 +63,7 @@
if(!gl_options.s3tc){
int mode = img.mode;
unsigned char *data = ddsDecompress(image,img.sizeX,img.sizeY,mode);
- img.mode = (VSImage::VSImageMode)mode;
+ img.mode = (::VSImage::VSImageMode)(mode);
free(image);
glTexImage2D(GL_TEXTURE_2D,0,(colortype&PNG_HAS_ALPHA)?GL_RGBA8:GL_RGB8,img.sizeX,img.sizeY,0,(colortype&PNG_HAS_ALPHA)?GL_RGBA:GL_RGB,GL_UNSIGNED_BYTE,data);
free(data);

Posted: Sat Sep 01, 2007 9:08 pm
by ace123
Thanks. I applied your patch in revision 11461.