]> 4ch.mooo.com Git - 16.git/commitdiff
hmmm layers in map_t ....
authorsparky4 <sparky4@cock.li>
Tue, 14 Feb 2017 22:02:37 +0000 (16:02 -0600)
committersparky4 <sparky4@cock.li>
Tue, 14 Feb 2017 22:02:37 +0000 (16:02 -0600)
src/lib/16_tdef.h
src/lib/scroll16.c
src/zcroll.c

index 54ec8b9c3b3406fb64dd936e49344866ddca05ee..d1220d54c67826e1af1020a116b95e934f10ab2a 100755 (executable)
@@ -64,18 +64,16 @@ typedef struct {
        byte *palette;\r
 } planar_buf_t;\r
 \r
+//===========================================================================//\r
+\r
 //TODO: 16_mm and 16_ca must handle this\r
 typedef struct {\r
-       bitmap_t far *pcximg;           //old\r
-       //planar_buf_t far *data;       //old\r
+       bitmap_t far *pcximg;           //I will probibaly use this --sparky4\r
+       //planar_buf_t far *pbdata;     //old\r
        word tileHeight, tileWidth;     //defined by mapfile\r
        unsigned int rows, cols;\r
-//     #ifdef __DEBUG__\r
-//     boolean debug_text;     //show the value of the tile! wwww\r
-//     byte *debug_data;\r
-//     #endif\r
-       byte    imgname[8];             //image file of tileset\r
-} tiles_t;\r
+       byte    imgname[8];             //image file of tileset (set to 8 because DOS ^^;)\r
+} tiles_t;     //seems to be the tileset properties\r
 \r
 //TODO: 16_mm and 16_ca must handle this\r
 //TODO: add variables from 16_ca\r
@@ -99,13 +97,15 @@ typedef struct {
        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;\r
-       tiles_t far *layertile[MAPLAYERS];\r
+       byte far *layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
+       tiles_t far *layertile[MAPLAYERS];      // tilesets for layers (currently ony 4 can be loaded wwww)\r
 #endif\r
        int width, height;              //this has to be signed!\r
        byte name[16];\r
 } map_t;\r
 \r
+//===================================//\r
+\r
 typedef struct{\r
        word tw;                /* screen width in tiles */\r
        word th;                /* screen height in tiles */\r
index 6f5665ec1002f96b82c18403cc222b584d745003..e421fd915ab56f32dc030e8470dcd9250226238d 100755 (executable)
@@ -567,38 +567,34 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
        word ry;\r
        //word textx=0, texty=0;\r
        //if(i==0) i=2;\r
-       if(i==0)\r
+       switch(i)\r
        {\r
-               //wwww\r
-               modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 1); //currently the over scan color!\r
-       }\r
-       else\r
-       {\r
-               rx = (((i-1) % ((t->pcximg->width)/t->tileWidth)) * t->tileWidth);\r
-               ry = (((i-1) / ((t->pcximg->height)/t->tileHeight)) * t->tileHeight);\r
+               case 0:\r
+                       //wwww\r
+                       modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 1); //currently the over scan color!\r
+               break;\r
+               default:\r
+                       rx = (((i-1) % ((t->pcximg->width)/t->tileWidth)) * t->tileWidth);\r
+                       ry = (((i-1) / ((t->pcximg->height)/t->tileHeight)) * t->tileHeight);\r
 ////0000printf("i=%d\n", i);\r
-#ifdef __DEBUG_MAP__\r
-               switch(dbg_maptext)\r
-               {\r
-                       case 0:\r
-#endif\r
 #ifndef TILERENDER\r
-                               if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i+1);\r
+                       if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i+1);\r
 #else\r
-                               modexDrawBmpRegion              (page, x, y, rx, ry, t->tileWidth, t->tileHeight, i);\r
-                               /* then the sprite. note modding ram ptr means we just draw to (x&3,0) */\r
-                               //draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
-                               //modexDrawBmpRegion    (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data));\r
-#endif\r
-#ifdef __DEBUG_MAP__\r
-                       break;\r
-                       case 1:\r
-                               if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i);\r
-                               sprintf(global_temp_status_text2, "%d", i);\r
-                               modexprint(page, x, y, 1, 1, 2, global_temp_status_text2);\r
-                       break;\r
-               }\r
+                       modexDrawBmpRegion              (page, x, y, rx, ry, t->tileWidth, t->tileHeight, i);\r
+                       //draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header));\r
+                       //modexDrawBmpRegion    (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data));\r
 #endif\r
+/*#ifdef __DEBUG_MAP__\r
+                       switch(dbg_maptext)\r
+                       {\r
+                               case 0:\r
+                               break;\r
+                               case 1:\r
+                                       sprintf(global_temp_status_text2, "%u", i); modexprint(page, x, y, 1, 1, 2, global_temp_status_text2);\r
+                               break;\r
+                       }\r
+#endif*/\r
+               break;\r
        }\r
 }\r
 \r
index b398a8e8d6fa4db88719bd0df62df1dcca62640d..342f3ba54b058bdce07d85e2db539793fc0578ac 100755 (executable)
@@ -147,7 +147,7 @@ void main(int argc, char *argv[])
        gvar.video.page[0].tlx=mv[0].tx*TILEWH;\r
        gvar.video.page[0].tly=mv[0].ty*TILEWH;\r
        shinku(&gvar);\r
-       modexpdump(mv[0].page);\r
+//modexpdump(mv[0].page);\r
 #ifdef FADE\r
        modexFadeOn(4, gpal);\r
 #endif\r