이미지 그리드를 화면에 표시하는 프로젝트에서 작업 중입니다. 그런 다음 각 타일에 개별적으로 액세스 할 수 있어야하므로 각 타일의 개별 정보를 나타 내기 위해 다음 클래스를 만들어야한다는 것을 알았습니다. 나는 그런 cTile tiles[5]
이 클래스의 배열을 delare 할 때클래스의 배열이 많은 메모리에 그립니다.
class cTile
{
//a class representing position in the graphics api im using (irrlicht)
position2d<s32> Position;
int imgIndex_x;
int imgIndex_y;
int offset;
// a class representing a square in the graphics api im using (irrlicht)
rect<s32> TextureSq;
// initialized at a negative number because zero is a valid number represent the global id number of tile ie its texture
int Gid = -1;
public:
cTile();
~cTile();
bool isSolid;
void animate();
void setGid(int gid);
int getGid();
void setSolid(bool state);
void draw(IVideoDriver* vdr, ITexture * sourceImage);
};
내가 얻을 :
Error 1 error C2148: total size of array must not exceed 0x7fffffff bytes
무엇이'sizeof (cTile)'입니까? – Robert
@ 로버트 그래, 내 추측은 ~ 40 이상일 수 없다고 생각합니다. 그래서 뭔가 다른 것입니다. – IdeaHat
@IdeaHat 어쩌면'position2d' 또는'rect'에 문제가있을 수 있습니다. 그래서 크기를 알고 싶습니다 ^^ – Robert