]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
hmmm layers in map_t ....
[16.git] / src / lib / 16_tdef.h
index ec6caf5b6e37250d7135d947f42250cf20173f59..d1220d54c67826e1af1020a116b95e934f10ab2a 100755 (executable)
@@ -50,10 +50,10 @@ typedef struct {
 \r
 typedef struct {\r
        byte far **data;\r
-       word ntiles;   /* the number of tiles */\r
-       word twidth;   /* width of the tiles */\r
-       word theight;  /* height of the tiles */\r
-       byte *palette; /* palette for the tile set */\r
+       word ntiles;            // the number of tiles\r
+       word twidth;    // width of the tiles\r
+       word theight;   // height of the tiles\r
+       byte *palette;  // palette for the tile set\r
 } tileset_t;\r
 \r
 typedef struct {\r
@@ -64,31 +64,48 @@ 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 *btdata;           //old\r
-       planar_buf_t far *data; //old\r
-       word tileHeight, tileWidth;\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
-} 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
+//#define __NEWMAPTILEDATAVARS__\r
+#define MAPLAYERS 4\r
+#ifdef __NEWMAPTILEDATAVARS__\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
-       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;       //TODO: 16_mm and 16_ca must handle this\r
+#else\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
-       char            name[16];\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
@@ -98,12 +115,12 @@ typedef struct{
        sword tilemidposscreeny;        /* middle tile y position */    /* needed for scroll system to work accordingly */\r
        sword tileplayerposscreenx;     /* player position on screen */ /* needed for scroll and map system to work accordingly */\r
        sword tileplayerposscreeny;     /* player position on screen */ /* needed for scroll and map system to work accordingly */\r
-} tileinfo_t;\r
+} pagetileinfo_t;\r
 \r
 typedef struct {\r
        nibble/*word*/ id;      /* the Identification number of the page~ For layering~ */\r
        byte far* data; /* the data for the page */\r
-       tileinfo_t      ti;\r
+       pagetileinfo_t  ti;\r
        word dx;                /* col we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the left size */\r
        word dy;                /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */\r
        word sw;                /* screen width */      /* resolution */\r
@@ -494,9 +511,10 @@ typedef struct
 typedef struct\r
 {\r
        int             mapon, mapnum;\r
-       __SEGA  *mapsegs[4];\r
-       __SEGA  *mapheaderseg[NUMMAPS];\r
-       __SEGA  *tinf;\r
+       //__SEGA        *mapsegs[4];\r
+       //__SEGA        *mapheaderseg[NUMMAPS];\r
+       //__SEGA        *tinf;\r
+       memptr  mapsegs;\r
 } ca_mapinfo_t;\r
 \r
 typedef struct\r
@@ -540,6 +558,7 @@ typedef struct
 \r
 #ifdef __WATCOMC__\r
 extern char global_temp_status_text[512];\r
+extern char global_temp_status_text2[512];\r
 #define EINVFMT EMFILE\r
 #endif\r
 #endif /* _TYPEDEFSTRUCT_H_ */\r