ScrollRight(mv, player, id, plid);\r
\r
/* draw the next column */\r
- x= mv[0].page->sw + mv[0].map->MAPTILESPTR->tileWidth;\r
+ x= mv[0].page->sw + mv[0].map->tiles->tileWidth;\r
#ifndef FULLRCREND\r
if(player[plid].enti.q%4)\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawCol(mv, id, mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+ mapDrawCol(&mv[id], mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player, DRAWCOLNUM);\r
// else\r
// if(mv[0].video->bgps)\r
-// modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->MAPTILESPTR->tileWidth, mv[0].page->height);\r
+// modexCopyPageRegion(mv->page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
//mv[0].video->dorender=1;//ScrollRight\r
}\r
\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawCol(mv, id, mv[0].tx - 1, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+ mapDrawCol(&mv[id], mv[0].tx - 1, mv[0].ty-1, x, player, DRAWCOLNUM);\r
// else\r
// if(mv[0].video->bgps)\r
-// modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->MAPTILESPTR->tileWidth, mv[0].page->height);\r
+// modexCopyPageRegion(mv->page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
//mv[0].video->dorender=1;//ScrollLeft\r
}\r
\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawRow(mv, id, mv[0].tx - 1, mv[0].ty-1, y, player, DRAWROWNUM);\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWROWNUM);\r
// else\r
// if(mv[0].video->bgps)\r
-// modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->MAPTILESPTR->tileHeight);\r
+// modexCopyPageRegion(mv->page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
//mv[0].video->dorender=1;//ScrollUp\r
}\r
\r
ScrollDown(mv, player, id, plid);\r
\r
/* draw the next row */\r
- y= mv[0].page->sh + mv[0].map->MAPTILESPTR->tileHeight;\r
+ y= mv[0].page->sh + mv[0].map->tiles->tileHeight;\r
#ifndef FULLRCREND\r
if(player[plid].enti.q%3)\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
// if(id==0)\r
- mapDrawRow(mv, id, mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWROWNUM);\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWROWNUM);\r
// else\r
// if(mv[0].video->bgps)\r
-// modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->MAPTILESPTR->tileHeight);\r
+// modexCopyPageRegion(mv->page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
//mv[0].video->dorender=1;//ScrollDown\r
}\r
\r
map->height=MAPH;///2;\r
// map->layerdata[0].data = malloc(((map->width*map->height)+1)*sizeof(byte));\r
map->layerdata[0].data = &x;\r
- map->MAPTILESPTR = malloc(sizeof(tiles_t));\r
+ map->tiles = malloc(sizeof(tiles_t));\r
//fix this to be far~\r
// bp = bitmapLoadPcx("data/ed.pcx");\r
-// map->MAPTILESPTR->data = &bp;\r
- map->MAPTILESPTR->tileHeight = 16;\r
- map->MAPTILESPTR->tileWidth = 16;\r
- map->MAPTILESPTR->rows = 1;\r
- map->MAPTILESPTR->cols = 1;\r
+// map->tiles->data = &bp;\r
+ map->tiles->tileHeight = 16;\r
+ map->tiles->tileWidth = 16;\r
+ map->tiles->rows = 1;\r
+ map->tiles->cols = 1;\r
#ifdef __DEBUG_MAP__\r
dbg_maptext = true;\r
#endif\r
/* set up the coordinates */\r
mv[0].tx = mv[1].tx = tx;\r
mv[0].ty = mv[1].ty = ty;\r
- mv[0].page->dx = mv[1].page->dx = mv[2].page->dx = mv[3].page->dx = mv->map->MAPTILESPTR->tileWidth;\r
- mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->MAPTILESPTR->tileHeight;\r
+ mv[0].page->dx = mv[1].page->dx = mv[2].page->dx = mv[3].page->dx = mv->map->tiles->tileWidth;\r
+ mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->tiles->tileHeight;\r
\r
/* set up the thresholds */\r
- mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->MAPTILESPTR->tileWidth * 2;\r
- mv[0].dyThresh = mv[1].dyThresh = mv[2].dyThresh = mv[3].dyThresh = mv->map->MAPTILESPTR->tileHeight * 2;\r
+ mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2;\r
+ mv[0].dyThresh = mv[1].dyThresh = mv[2].dyThresh = mv[3].dyThresh = mv->map->tiles->tileHeight * 2;\r
}\r
\r
void ZC_mapredraw(map_view_t *mv, int tx, int ty)\r
\r
py=0;\r
i=mv[0].ty * mv[0].map->width + mv[0].tx;\r
- for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->MAPTILESPTR->tileHeight) {\r
+ for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->tiles->tileHeight) {\r
mapDrawWRow(&mv[0], tx-1, ty, py);\r
mapDrawWRow(&mv[1], tx-1, ty, py);\r
i+=mv->map->width - tx;\r
}\r
}\r
#define PALMAPDRAWW 13\r
-void near mapDrawRow(map_view_t *mv, nibble id, int tx, int ty, word y, player_t *player, word poopoffset)\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset)\r
{\r
int i; nibble z;\r
if(pagedelayrendermap) if(!y) y+=TILEWH; else y-=TILEWH;\r
poopoffset%=player[0].enti.speed;\r
//printf("y: %d\n", poopoffset);\r
-if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv[id].dx); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 1, 2, 1, global_temp_status_text); }\r
+if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dx); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 0, PALMAPDRAWW, 1, global_temp_status_text); }\r
/* the position within the map array */\r
- i=ty * mv[id].map->width + tx;\r
- for( mv[id].dx=poopoffset; mv[id].dx<(mv[id].page->sw+mv[id].dxThresh)/(poopoffset+1) && tx < mv[id].map->width; mv[id].dx+=mv[id].map->MAPTILESPTR->tileWidth, tx++) {\r
+ i=ty * mv->map->width + tx;\r
+ for( mv->dx=poopoffset; mv->dx<(mv->page->sw+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
if(i>=0){\r
- mapDrawTile(mv[id].map->MAPTILESPTR, mv[id].map->layerdata[0].data[i], mv[id].page, mv[id].dx, y);\r
+ mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
for(z=1;z<=2;z++){\r
- if(mv[id].map->layerdata[z].data[i]){\r
- sprintf(global_temp_status_text2, "%u", mv[id].map->layerdata[z].data[i]); modexprint(mv[id].page, mv[id].dx, (y+((z-1)*4))>>2, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
- //mapDrawTile(mv[id].map->MAPTILESPTR, mv[id].map->layerdata[z].data[i], mv[id].page, mv[id].dx, y);\r
+ if(mv->map->layerdata[z].data[i]){\r
+ sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, mv->dx, y, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
+ //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
}\r
}\r
}\r
if(pagedelayrendermap) delay(200);\r
}\r
\r
-void near mapDrawCol(map_view_t *mv, nibble id, int tx, int ty, word x, player_t *player, word poopoffset)\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
{\r
int i; nibble z;\r
if(pagedelayrendermap) if(!x) x+=TILEWH; else x-=TILEWH;\r
poopoffset%=player[0].enti.speed;\r
//printf("x: %d\n", poopoffset);\r
-if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv[id].dy); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 1, 2, 1, global_temp_status_text); }\r
+if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dy); modexprint(mv[0].page, player[0].enti.x, player[0].enti.y-28-(poopoffset*8) , 1, 0, PALMAPDRAWW, 1, global_temp_status_text); }\r
/* location in the map array */\r
- i=ty * mv[id].map->width + tx;\r
+ i=ty * mv->map->width + tx;\r
/* We'll copy all of the columns in the screen,\r
i + 1 row above and one below */\r
- for( mv[id].dy=poopoffset; mv[id].dy<(mv[id].page->sh+mv[id].dyThresh)/(poopoffset+1) && ty < mv[id].map->height; mv[id].dy+=mv[id].map->MAPTILESPTR->tileHeight, ty++) {\r
+ for( mv->dy=poopoffset; mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
if(i>=0){\r
- mapDrawTile(mv[id].map->MAPTILESPTR, mv[id].map->layerdata[0].data[i], mv[id].page, x, mv[id].dy);\r
+ mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
for(z=1;z<=2;z++){\r
- if(mv[id].map->layerdata[z].data[i]){\r
- sprintf(global_temp_status_text2, "%u", mv[id].map->layerdata[z].data[i]); modexprint(mv[id].page, (x+((z-1)*4))>>2, mv[id].dy, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
- //mapDrawTile(mv[id].map->MAPTILESPTR, mv[id].map->layerdata[z].data[i], mv[id].page, x, mv[id].dy);\r
+ if(mv->map->layerdata[z].data[i]){\r
+ sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, x, mv->dy, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
+ //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
}\r
}\r
}\r
- i += mv[id].map->width;\r
+ i += mv->map->width;\r
}\r
if(pagedelayrendermap) delay(200);\r
}\r
\r
/* the position within the map array */\r
i=ty * mv->map->width + tx;\r
- for(mv->dx=0; mv->dx<mv->page->sw+mv->dxThresh && tx < mv->map->width; mv->dx+=mv->map->MAPTILESPTR->tileWidth, tx++) {\r
+ for(mv->dx=0; mv->dx<mv->page->sw+mv->dxThresh && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
if(i>=0){ /* we are in the map, so copy! */\r
- mapDrawTile(mv->map->MAPTILESPTR, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
+ mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
for(z=1;z<=2;z++){\r
if(mv->map->layerdata[z].data[i]){\r
sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, mv->dx, y, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
- //mapDrawTile(mv->map->MAPTILESPTR, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
+ //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
}\r
}\r
}\r
\r
/* We'll copy all of the columns in the screen,\r
i + 1 row above and one below */\r
- for(mv->dy=0; mv->dy<mv->page->sh+mv->dyThresh && ty < mv->map->height; mv->dy+=mv->map->MAPTILESPTR->tileHeight, ty++) {\r
+ for(mv->dy=0; mv->dy<mv->page->sh+mv->dyThresh && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
if(i>=0){ /* we are in the map, so copy away! */\r
- mapDrawTile(mv->map->MAPTILESPTR, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
+ mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
for(z=1;z<=2;z++){\r
if(mv->map->layerdata[z].data[i]){\r
sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, x, mv->dy, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
- //mapDrawTile(mv->map->MAPTILESPTR, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
+ //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
}\r
}\r
}\r
break;\r
}\r
x-=4;\r
- y-=pip[0].map->MAPTILESPTR->tileHeight;\r
+ y-=pip[0].map->tiles->tileHeight;\r
switch (player[pn].enti.d)\r
{\r
case 0:\r