Is it possible to declare a struct inside a class? I seem to be having a crash issues since I declared a struct inside my class. Here is my code ...
#ifndef Sprite_H
#define Sprite_H
class Sprite
{
public:
int armor;
int speed;
char *weapon1;
char *weapon2;
char *weapon3;
char *name;
unsigned int textures[1];
struct TGAFILE
{
unsigned char imageTypeCode;
short int imageWidth;
short int imageHeight;
unsigned char bitCount;
unsigned char *imageData;
}*myTGA;
Sprite();
~Sprite();
void LoadTexture(void);
void Draw(void);
void Update(void);
bool LoadTGAFile(char *filename, TGAFILE *tgaFile);
};
#endif
now for my sprite.cpp file
Sprite::Sprite()
{
armor = 0;
speed = 0;
weapon1 = "None";
weapon2 = "None";
weapon3 = "None";
name = "None";
myTGA->bitCount = ' ';
myTGA->imageHeight = 0;
myTGA->imageTypeCode = ' ';
myTGA->imageWidth = 0;
}
not sure whats going on or the problem but am new to the whole class thing. Thanks
Bill Gates is my Pool Boy!!
Nothing is to good for me!!
[edited by - Mars_999 on May 5, 2002 11:25:49 PM]