Quote:Original post by Twiggy
Thanks! :)
Again -> So how can I determine the size of the arrays before run-time?
multiply together all of the sizes.
multiply that by sizeof(type);
divide that by 1048576
Quote:Original post by Twiggy
Thanks! :)
Again -> So how can I determine the size of the arrays before run-time?
Quote:Original post by Twiggy
But, dude, I can't create a MapTile *Map[][] inside the class. I have to determine it sizes, which is changeable. It should be Map_Size_X and Map_Size_Y
But i'm gonna change the class so that the Map_Size_X and Map_Size_Y can be changed by the programmer. <I'm creating it to be distributed to other folks>
^----Unlike in the block of code of GameCore.h above (I changed it)
// define it like thisMapTile **map;...// create a new, custom sized map on the heap ...*map = new MapTile[ map_size_x ];for( int x=0; x<map_size_x; x++ ) map[x]=new MapTile[ map_size_y ];// access it as usual withmap[x][y] = ...// delete it properly..for( int x=0; x<map_size_x; x++ ) delete [] map[x];