]> 4ch.mooo.com Git - 16.git/commitdiff
oddly enough defining __NEWMAPTILEDATAVARS__ in 16_tdef.h will cause a limbo to appea...
authorsparky4 <sparky4@cock.li>
Mon, 13 Feb 2017 21:20:43 +0000 (15:20 -0600)
committersparky4 <sparky4@cock.li>
Mon, 13 Feb 2017 21:20:43 +0000 (15:20 -0600)
src/lib/16_map.c
src/lib/16_tdef.h
src/lib/scroll16.c
src/lib/scroll16.h
src/maptest.c
src/scroll.c
src/zcroll.c

index defa4a9abb2cc33447e70a244c24019c03f94cd6..37179ab76d120cb44ecc0952fe6bc3bdf9e2ea1a 100755 (executable)
@@ -257,7 +257,7 @@ void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {
        while(i<count) {\r
                if(jsoneq(js, &(t[i]), "layers") == 0) {\r
                        i++;\r
-                       map->layerdata = malloc(sizeof(byte*) * t[i].size);\r
+                       //map->layerdata = malloc(sizeof(byte*) * t[i].size);\r
                        inner_end = t[i].end;\r
                        k = 0;\r
                        while(t[i].start < inner_end) {\r
@@ -268,14 +268,13 @@ void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {
 #ifdef DEBUG_MAPDATA\r
                                        printf("Layer %d data: [\n", k);\r
 #endif\r
-                                       map->layerdata[k] = malloc(sizeof(byte) * t[i+1].size);\r
-                                       map->data = map->layerdata[k];\r
+                                       map->MAPDATAPTK = malloc(sizeof(byte) * t[i+1].size);\r
+                                       //for backwards compatibility for rest of code\r
+//                                     map->data = map->MAPDATAPTK;\r
                                        for(j = 0; j < t[i+1].size; j++) {\r
-                                               map->layerdata[k][j] = (byte)atoi(js + t[i+2+j].start);\r
-                                               //for backwards compatibility for rest of code\r
-//                                             map->data[j] = map->layerdata[k][j];//(byte)atoi(js + t[i+2+j].start);//(byte)atoi(js+t->start);\r
+                                               map->MAPDATAPTK[j] = (byte)atoi(js + t[i+2+j].start);\r
 #ifdef DEBUG_MAPDATA\r
-                                               //printf("[%d,%d]%d", k, j, map->layerdata[k][j]);\r
+                                               //printf("[%d,%d]%d", k, j, map->MAPDATAPTK[j]);\r
                                                fprintf(stdout, "%c", map->data[j]+44);\r
 #endif\r
                                        }\r
@@ -295,24 +294,24 @@ void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {
                        k = 0;\r
                        while(t[i].start < inner_end) {\r
                                if(jsoneq(js, &(t[i]), "image") == 0) {\r
-                                       map->layertile[k] = malloc(sizeof(tiles_t));\r
+                                       map->MAPTILESPTK = malloc(sizeof(tiles_t));\r
                                        s = remove_ext((char *)js+t[i+1].start, '.', '/');\r
-                                       strcpy(map->layertile[k]->imgname, s);\r
+                                       strcpy(map->MAPTILESPTK->imgname, s);\r
                                        //And move to vrs, probably\r
 //                                     bp = bitmapLoadPcx("data/ed.pcx");\r
-//                                     map->layertile[k]->btdata = &bp;\r
-                                       //map->layertile[k]->btdata = malloc(sizeof(bitmap_t));\r
-                                       map->layertile[k]->rows = 1;\r
-                                       map->layertile[k]->cols = 1;\r
+//                                     map->MAPTILESPTK->btdata = &bp;\r
+                                       //map->MAPTILESPTK->btdata = malloc(sizeof(bitmap_t));\r
+                                       map->MAPTILESPTK->rows = 1;\r
+                                       map->MAPTILESPTK->cols = 1;\r
 #ifdef __DEBUG_MAP__\r
                                        dbg_maptext=false;\r
 #endif\r
                                        i++;\r
                                }else if(jsoneq(js, &(t[i]), "tileheight") == 0) {\r
-                                       map->layertile[k]->tileHeight = atoi(js + t[i+1].start);\r
+                                       map->MAPTILESPTK->tileHeight = atoi(js + t[i+1].start);\r
                                        i++;\r
                                }else if(jsoneq(js, &(t[i]), "tilewidth") == 0) {\r
-                                       map->layertile[k]->tileWidth = atoi(js + t[i+1].start);\r
+                                       map->MAPTILESPTK->tileWidth = atoi(js + t[i+1].start);\r
                                        i++;\r
                                }\r
                                i++;\r
index b638071c1686c6c99462765435971f29bbc719a7..38fd2260f04af464ee6acd7144bbd04eb3c6954b 100755 (executable)
@@ -79,14 +79,30 @@ typedef struct {
 \r
 //TODO: 16_mm and 16_ca must handle this\r
 //TODO: add variables from 16_ca\r
-#define MAPLAYERS 2\r
+//#define __NEWMAPTILEDATAVARS__\r
+\r
+#ifdef __NEWMAPTILEDATAVARS__\r
+#define MAPLAYERS 4\r
+#define MAPTILESPTR            layertile[0]\r
+#define MAPTILESPTK            layertile[k]\r
+#define MAPDATAPTR             layerdata[0]\r
+#define MAPDATAPTK             layerdata[k]\r
+#else\r
+#define MAPTILESPTR            tiles//layertile[0]\r
+#define MAPTILESPTK            tiles//layertile[k]\r
+#define MAPDATAPTR             data//layerdata[0]\r
+#define MAPDATAPTK             data//layerdata[k]\r
+#endif\r
 typedef struct {\r
        //long          planestart[3];\r
        //unsigned      planelength[3];\r
+#ifndef __NEWMAPTILEDATAVARS__\r
        byte *data;                     //TODO: 16_mm and 16_ca must handle this\r
+       tiles_t *tiles;         //TODO: 16_mm and 16_ca must handle this\r
+#else\r
        byte * far *layerdata;  //TODO: 16_mm and 16_ca must handle this\r
-       //tiles_t *tiles;               //TODO: 16_mm and 16_ca must handle this\r
        tiles_t far *layertile[MAPLAYERS];      //TODO: 16_mm and 16_ca must handle this\r
+#endif\r
        int width, height;              //this has to be signed!\r
        byte name[16];\r
 } map_t;\r
index d99f5db163e0a0175e8b29a0d93794c911a99c84..9a4708abedfe2daf0e7ec74287c36db2849cd680 100755 (executable)
@@ -37,7 +37,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                //right movement\r
                case 3:\r
                        if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->ti.tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->ti.tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
+                       !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))    //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -48,7 +48,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -70,7 +70,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                //left movement\r
                case 1:\r
                        if(pip[0].tx > 0 && pip[0].tx+pip[0].page->ti.tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->ti.tilemidposscreenx &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))        //collision detection!\r
+                       !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -81,7 +81,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -103,7 +103,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                //down movement\r
                case 4:\r
                        if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->ti.th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->ti.tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))  //collision detection!\r
+                       !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))    //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -114,7 +114,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -136,7 +136,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                //up movement\r
                case 0:\r
                        if(pip[0].ty > 0 && pip[0].ty+pip[0].page->ti.th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->ti.tilemidposscreeny &&\r
-                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))        //collision detection!\r
+                       !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))  //collision detection!\r
                        {\r
                                player[pn].walktype=2;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -147,7 +147,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
                                } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->MAPDATAPTR[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
                        {\r
                                player[pn].walktype=1;\r
                                if(player[pn].enti.q<=player[pn].enti.spt)\r
@@ -318,8 +318,8 @@ initMap(map_t *map) {
        i=0;\r
        for(y=0; y<map->height; y++) {\r
                for(x=0; x<map->width; x++) {\r
-                       map->data[i]=255;\r
-//                     printf("[%d]", map->data[i]);\r
+                       map->MAPDATAPTR[i]=255;\r
+//                     printf("[%d]", map->MAPDATAPTR[i]);\r
                        tile = tile ? 0 : 1;\r
                        i++;\r
                }\r
@@ -337,7 +337,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        ScrollRight(mv, player, id, plid);\r
 \r
        /* draw the next column */\r
-       x= mv[0].page->sw + mv[0].map->layertile[0]->tileWidth;\r
+       x= mv[0].page->sw + mv[0].map->MAPTILESPTR->tileWidth;\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%4)\r
 #else\r
@@ -347,7 +347,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
                        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->layertile[0]->tileWidth, mv[0].page->height);\r
+//                             modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->MAPTILESPTR->tileWidth, mv[0].page->height);\r
        //mv[0].video->dorender=1;//ScrollRight\r
 }\r
 \r
@@ -369,7 +369,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
                        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->layertile[0]->tileWidth, mv[0].page->height);\r
+//                             modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->MAPTILESPTR->tileWidth, mv[0].page->height);\r
        //mv[0].video->dorender=1;//ScrollLeft\r
 }\r
 \r
@@ -391,7 +391,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
                        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->layertile[0]->tileHeight);\r
+//                             modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->MAPTILESPTR->tileHeight);\r
        //mv[0].video->dorender=1;//ScrollUp\r
 }\r
 \r
@@ -403,7 +403,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        ScrollDown(mv, player, id, plid);\r
 \r
        /* draw the next row */\r
-       y= mv[0].page->sh + mv[0].map->layertile[0]->tileHeight;\r
+       y= mv[0].page->sh + mv[0].map->MAPTILESPTR->tileHeight;\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%3)\r
 #else\r
@@ -413,7 +413,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
                        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->layertile[0]->tileHeight);\r
+//                             modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->MAPTILESPTR->tileHeight);\r
        //mv[0].video->dorender=1;//ScrollDown\r
 }\r
 \r
@@ -498,16 +498,16 @@ sword chkmap(map_t *map, word q)
                //initiate a null map!\r
                map->width=MAPW;///2;\r
                map->height=MAPH;///2;\r
-//             map->data = malloc(((map->width*map->height)+1)*sizeof(byte));\r
-               map->data = &x;\r
-               map->layertile[0] = malloc(sizeof(tiles_t));\r
+//             map->MAPDATAPTR = malloc(((map->width*map->height)+1)*sizeof(byte));\r
+               map->MAPDATAPTR = &x;\r
+               map->MAPTILESPTR = malloc(sizeof(tiles_t));\r
                //fix this to be far~\r
 //             bp = bitmapLoadPcx("data/ed.pcx");\r
-//             map->layertile[0]->data = &bp;\r
-               map->layertile[0]->tileHeight = 16;\r
-               map->layertile[0]->tileWidth = 16;\r
-               map->layertile[0]->rows = 1;\r
-               map->layertile[0]->cols = 1;\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
 #ifdef __DEBUG_MAP__\r
                dbg_maptext = true;\r
 #endif\r
@@ -538,12 +538,12 @@ void ZC_mapinitMV(map_view_t *mv, int tx, int ty)
        /* 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->layertile[0]->tileWidth;\r
-       mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->layertile[0]->tileHeight;\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
 \r
        /* set up the thresholds */\r
-       mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->layertile[0]->tileWidth * 2;\r
-       mv[0].dyThresh = mv[1].dyThresh = mv[2].dyThresh = mv[3].dyThresh = mv->map->layertile[0]->tileHeight * 2;\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
 }\r
 \r
 void ZC_mapredraw(map_view_t *mv, int tx, int ty)\r
@@ -553,7 +553,7 @@ void ZC_mapredraw(map_view_t *mv, int tx, int ty)
 \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->layertile[0]->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->MAPTILESPTR->tileHeight) {\r
                mapDrawWRow(&mv[0], tx-1, ty, py);\r
                mapDrawWRow(&mv[1], tx-1, ty, py);\r
                i+=mv->map->width - tx;\r
@@ -611,9 +611,9 @@ if(pagedelayrendermap)              if(!y)  y+=TILEWH;      else    y-=TILEWH;
 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, 2, 1, global_temp_status_text); }\r
        /* the position within the map array */\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->layertile[0]->tileWidth, tx++) {\r
+       for(    mv->dx=poopoffset;      mv->dx<(mv->page->sw+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width;       mv->dx+=mv->map->MAPTILESPTR->tileWidth, tx++) {\r
                if(i>=0)\r
-                       mapDrawTile(mv->map->layertile[0], mv->map->data[i], mv->page, mv->dx, y);\r
+                       mapDrawTile(mv->map->MAPTILESPTR, mv->map->MAPDATAPTR[i], mv->page, mv->dx, y);\r
                i++; /* next! */\r
        }\r
 if(pagedelayrendermap) delay(200);\r
@@ -630,9 +630,9 @@ if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dy); modexp
        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->dy=poopoffset;      mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height;      mv->dy+=mv->map->layertile[0]->tileHeight, ty++) {\r
+       for(    mv->dy=poopoffset;      mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height;      mv->dy+=mv->map->MAPTILESPTR->tileHeight, ty++) {\r
                if(i>=0)\r
-                       mapDrawTile(mv->map->layertile[0], mv->map->data[i], mv->page, x, mv->dy);\r
+                       mapDrawTile(mv->map->MAPTILESPTR, mv->map->MAPDATAPTR[i], mv->page, x, mv->dy);\r
                i += mv->map->width;\r
        }\r
 if(pagedelayrendermap) delay(200);\r
@@ -644,9 +644,9 @@ void mapDrawWRow(map_view_t *mv, int tx, int ty, word y)
 \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->layertile[0]->tileWidth, 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
                if(i>=0)        /* we are in the map, so copy! */\r
-                       mapDrawTile(mv->map->layertile[0], mv->map->data[i], mv->page, mv->dx, y);\r
+                       mapDrawTile(mv->map->MAPTILESPTR, mv->map->MAPDATAPTR[i], mv->page, mv->dx, y);\r
                i++; /* next! */\r
        }\r
 }\r
@@ -660,9 +660,9 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x)
 \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->layertile[0]->tileHeight, ty++) {\r
+       for(mv->dy=0; mv->dy<mv->page->sh+mv->dyThresh && ty < mv->map->height; mv->dy+=mv->map->MAPTILESPTR->tileHeight, ty++) {\r
                if(i>=0)        /* we are in the map, so copy away! */\r
-                       mapDrawTile(mv->map->layertile[0], mv->map->data[i], mv->page, x, mv->dy);\r
+                       mapDrawTile(mv->map->MAPTILESPTR, mv->map->MAPDATAPTR[i], mv->page, x, mv->dy);\r
                i += mv->map->width;\r
        }\r
 }\r
@@ -751,7 +751,7 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn)
                break;\r
        }\r
        x-=4;\r
-       y-=pip[0].map->layertile[0]->tileHeight;\r
+       y-=pip[0].map->MAPTILESPTR->tileHeight;\r
        switch (player[pn].enti.d)\r
        {\r
                case 0:\r
index c33d99c35e1b21a9e5c7f200798df9d8505ebf2f..fc187954663f4a3fbfdf0d8fe805146f437dfde7 100755 (executable)
@@ -81,7 +81,7 @@
 #define SCROLLEXITMESG         printf("page[0]dxy: %dx%d", gvar.video.page[0].dx, gvar.video.page[0].dy);\\r
        printf("\n\n");\\r
        printf("player vars:\n");\\r
-       printf("        xy: %dx%d", player[0].enti.x, player[0].enti.y); printf("       txy: %dx%d", player[0].enti.tx, player[0].enti.ty); printf("    triggxy: %dx%d", player[0].enti.triggerx, player[0].enti.triggery); printf("    value: %d\n", mv[1].map->layerdata[0][(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\\r
+       printf("        xy: %dx%d", player[0].enti.x, player[0].enti.y); printf("       txy: %dx%d", player[0].enti.tx, player[0].enti.ty); printf("    triggxy: %dx%d", player[0].enti.triggerx, player[0].enti.triggery); printf("    value: %d\n", mv[1].map->MAPDATAPTR[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\\r
        printf("        hp: %d", (player[0].enti.hp));  printf("        q: %u", player[0].enti.q);      printf("        info.dir: %u", player[0].info.dir);     printf("        d: %u", player[0].enti.d);      printf("        dire: %u", player[0].enti.dire);\\r
                printf("        pdir: %u\n", player[0].pdir); printf("  delay=%u", player[0].enti.spri->delay);\\r
 printf("\n\n");\\r
@@ -132,7 +132,7 @@ inline void near ScrollRight(map_view_t *mv, player_t *player, word id, word pli
                /* Snap the origin forward */\r
                mv[id].page->data += 4;\r
 \r
-               mv[id].page->dx = mv[id].map->layertile[0]->tileWidth;\r
+               mv[id].page->dx = mv[id].map->MAPTILESPTR->tileWidth;\r
        }\r
 }\r
 \r
@@ -149,7 +149,7 @@ inline void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid
                /* Snap the origin backward */\r
                mv[id].page->data -= 4;\r
 \r
-               mv[id].page->dx = mv[id].map->layertile[0]->tileWidth;\r
+               mv[id].page->dx = mv[id].map->MAPTILESPTR->tileWidth;\r
        }\r
 }\r
 \r
@@ -166,7 +166,7 @@ inline void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)
                /* Snap the origin upward */\r
                mv[id].page->data -= mv[id].page->pi;\r
 \r
-               mv[id].page->dy = mv[id].map->layertile[0]->tileHeight;\r
+               mv[id].page->dy = mv[id].map->MAPTILESPTR->tileHeight;\r
        }\r
 }\r
 \r
@@ -183,7 +183,7 @@ inline void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid
                /* Snap the origin downward */\r
                mv[id].page->data += mv[id].page->pi;\r
 \r
-               mv[id].page->dy = mv[id].map->layertile[0]->tileHeight;\r
+               mv[id].page->dy = mv[id].map->MAPTILESPTR->tileHeight;\r
        }\r
 }\r
 \r
index c73ea3dd403f3f32c22c940f4ab902dea676637d..f426b2c66bf7f8f5eb161c0d2ee007f2a2355486 100755 (executable)
@@ -61,7 +61,7 @@ main(int argc, char *argv[])
        for(i=0; i<(map.width*map.height); i++)\r
        {\r
                //fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
-               fprintf(stdout, "%c", map.layerdata[0][i]+44);\r
+               fprintf(stdout, "%c", map.MAPDATAPTR[i]+44);\r
                if(!((i+1)%map.width)){\r
                        //fprintf(stdout, "[%d]", i);\r
                        fprintf(stdout, "\n"); }\r
index 7c3dd4fe5266f9a193978893db57593bcceb139c..beaff2b2c7fc19e1f4ed959ebf2e35871268cb80 100755 (executable)
@@ -180,7 +180,7 @@ void main(int argc, char *argv[])
 \r
        //the scripting stuff....\r
        //if(((player[0].enti.triggerx == TRIGGX && player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
-       if(((mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
+       if(((mv[0].map->MAPDATAPTR[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
        {\r
                short i;\r
                for(i=800; i>=400; i--)\r
index ed2341bb37e629d758bcafe5ab8e1227c3009c97..16213d6b2b72eedf737c74572dca5e48425dcf3d 100755 (executable)
@@ -170,7 +170,7 @@ void main(int argc, char *argv[])
 \r
                //the scripting stuff....\r
                //if(((player[0].enti.triggerx == TRIGGX && player[0].enti.triggery == TRIGGY) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
-               if(((mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
+               if(((mv[0].map->MAPDATAPTR[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))] == 0) && IN_KeyDown(0x1C))||(player[0].enti.tx == 5 && player[0].enti.ty == 5))\r
                {\r
                        short i;\r
                        for(i=800; i>=400; i--)\r