I’m trying to make a Q3BSP map information debugger.
I’m stuck at texture debugger part, this is the code used in that part:
for( i = 0; i < nTextures; i++ ) {
printf( "Texture id %d\n", i );
printf( "\tTexture name %s\n", Texture[i].name );
printf( "\tTexture flags %d\n", Texture[i].flags );
printf( "\tTexture contents %d\n", Texture[i].contents );
}
But this kind error appears to show up:
error C2676: binary ‘[‘ : ‘Q3BSPTexture’ does not define this operator or a conversion to a type acceptable to the predefined operator
Here is the Q3BSPTexture structure:
typedef struct {
char name[64]; // Texture name.
int flags; // Surface flags.
int contents; // Surface contents
} Q3BSPTexture;
I’m suspecting that the structure hasn’t the limit setted like char [32]
But I like to hear solution from professionals!
You haven’t shown us the definition of
Texture.You’re treating
Textureas an array ofQ2BSPTeztures. Apparently it’s a singleQ2BSPTeztureobject, so indexing it doesn’t make sense. You probably just need to declare it as an array, or perhaps as a pointer to the first element of an array that you the need to allocate.Also, the error message implies that you’re compiling C++, not C (in C it wouldn’t be possible for the type to define any operators).