32 |
|
|
33 |
int theMap[MAP_HEIGHT][MAP_WIDTH]; |
int theMap[MAP_HEIGHT][MAP_WIDTH]; |
34 |
|
|
35 |
//rendering functionprototype |
//rendering function prototype |
36 |
void RenderFunc(SDL_Surface* dst, RECT* clipRect, int xDst, int yDst, int xMap, int yMap); |
void RenderFunc(SDL_Surface* dst, RECT* clipRect, int xDst, int yDst, int xMap, int yMap); |
37 |
|
|
38 |
void loadTileSets() { |
void loadTileSets() { |
44 |
|
|
45 |
void initializeEngine() { |
void initializeEngine() { |
46 |
//load in the mousemap |
//load in the mousemap |
47 |
mouseMap.create(tsBack.getTileList()[0].rcSrc.right - tsBack.getTileList()[0].rcSrc.left, tsBack.getTileList()[0].rcSrc.bottom - tsBack.getTileList()[0].rcSrc.top); |
//mouseMap.create(tsBack.getTileList()[0].rcSrc.right - tsBack.getTileList()[0].rcSrc.left, tsBack.getTileList()[0].rcSrc.bottom - tsBack.getTileList()[0].rcSrc.top); |
48 |
|
mouseMap.load("MouseMap.bmp"); |
49 |
|
|
50 |
//set up the tile plotter |
//set up the tile plotter |
51 |
|
//tilePlotter.setMapType(ISOMAP_RECTANGULAR); |
52 |
|
tilePlotter.setMapType(ISOMAP_STAGGERED); |
53 |
tilePlotter.setTileSize(mouseMap.getWidth(), mouseMap.getHeight()); |
tilePlotter.setTileSize(mouseMap.getWidth(), mouseMap.getHeight()); |
54 |
|
|
55 |
|
//set up tile walker to diamond mode |
56 |
|
//tileWalker.setMapType(ISOMAP_RECTANGULAR); |
57 |
|
tileWalker.setMapType(ISOMAP_STAGGERED); |
58 |
|
|
59 |
//set up screeen space |
//set up screeen space |
60 |
RECT temp; |
RECT temp; |
61 |
setRect(&temp, 0, 0, 640, 480); |
setRect(&temp, 0, 0, 640, 480); |
212 |
void testEngine() { |
void testEngine() { |
213 |
|
|
214 |
/* Seed the random-number generator with current time so that |
/* Seed the random-number generator with current time so that |
215 |
* the map will be different every time we run. */ |
* the map will be different every time we run. */ |
216 |
srand((unsigned)time(NULL)); |
srand((unsigned)time(NULL)); |
217 |
|
|
218 |
loadTileSets(); |
loadTileSets(); |