map_tile atile;
int i;
int j;
//empty
//map_data.clear();
//set default
atile.tileID = 0;
for(i = 0; i < TILES_ON_W; i++) {
for(j = 0; j < TILES_ON_H; j++) {
map_data.push_back(atile);
}
}
Do you know a vector tutorial?
multidimensioned vectors
I''m making a map class for my game. It''s supposed to load the map into a multidimensioned array. I thought it would be better to use vectors because the map will not always be the same size. Is there something wrong with this? I can''t get it to work. It causes the core to dump(or maybe it''s called fatal signal)
The vector is declared as vector< vector<map_tile> > map_data;
and the code is
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement