OK, there''s a couple of things I''d like to say about your code :-)
Each element of array texture is a pointer to a CTexture object, so you only have to write
texture[i] = new CTexture;
|
Actually, I''ve noticed that you use the array notation for single data items, e.g
AUX_RGBImageRec* textureImage[1];
|
There''s no need to do this.
Also, be careful with your use of char pointers. It''s good practice to allocate memory for a string, e.g
texture[i]->filename = new char[strlen("data/wall.bmp")+1];strcpy(texture[i]->filename,"data/wall.bmp");
|
Then your object has it''s own personal copy of the string. But remember to delete this memory when the object is destroyed!
In your fopen call, you should set the translation mode as binary as the default is text mode, e.g
file = fopen( filename, "rb" );
|
But, perhaps the auxDIBImageLoad function takes care of this anyway?
Hope this helps?
Andy.