]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
LAYERING WORKS NOW!
[16.git] / src / lib / 16_tdef.h
index e99be1de54cea98f560801cab6b930117025655c..1aa2d52ea2201cb40801215a901e623c919f1f09 100755 (executable)
@@ -64,11 +64,37 @@ typedef struct {
        byte *palette;\r
 } planar_buf_t;\r
 \r
+//from 16_sprit.h\r
+#ifdef __WATCOMC__\r
+typedef struct sprite\r
+{\r
+       // VRS container from which we will extract animation and image data\r
+       struct vrs_container *spritesheet;\r
+       // Container for a vrl sprite\r
+       struct vrl_container *sprite_vrl_cont;\r
+       // Current sprite id\r
+       int curr_spri_id;\r
+       // Index of a current sprite in an animation sequence\r
+       int curr_anim_spri;\r
+       // Current animation sequence\r
+       struct vrs_animation_list_entry_t *curr_anim_list;\r
+       // Index of current animation in relevant VRS offsets table\r
+       int curr_anim;\r
+       // Delay in time units untill we should change sprite\r
+       int delay;\r
+       // Position of sprite on screen\r
+       int x, y;\r
+} sprite_t;\r
+#endif\r
+\r
 //===========================================================================//\r
 \r
 //TODO: 16_mm and 16_ca must handle this\r
 typedef struct {\r
-       bitmap_t far *pcximg;           //I will probibaly use this --sparky4\r
+       bitmap_t far *pcximg;           // old\r
+#ifdef __WATCOMC__\r
+       sprite_t *spri;                 // I will probibaly use this --sparky4\r
+#endif\r
        //planar_buf_t far *pbdata;     //old\r
        word tileHeight, tileWidth;     //defined by mapfile\r
        unsigned int rows, cols;\r
@@ -77,29 +103,21 @@ typedef struct {
 \r
 //TODO: 16_mm and 16_ca must handle this\r
 //TODO: add variables from 16_ca\r
-//#define __NEWMAPTILEDATAVARS__\r
+typedef struct {\r
+       byte    *data;                  //TODO: 16_mm and 16_ca must handle this\r
+} mapl_t;      //map layer array type def\r
+\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
+\r
+#define MAPDATAPTR             layerdata[0].data\r
+#define MAPDATAPTK             layerdata[k].data\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
-       byte *data;                     //TODO: 16_mm and 16_ca must handle this\r
-       byte far *layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
-#ifndef __NEWMAPTILEDATAVARS__\r
-       tiles_t *tiles;         //TODO: 16_mm and 16_ca must handle this\r
-#else\r
-       tiles_t far *layertile[MAPLAYERS];      // tilesets for layers (currently ony 4 can be loaded wwww)\r
-#endif\r
+       mapl_t layerdata[MAPLAYERS];    // mapdata for multilayer (map index values for rendering which image on the tile)\r
+       tiles_t *tiles;         //TODO: 16_mm and 16_ca must handle this        // tilesets for layers (currently ony 4 can be loaded wwww)\r
        int width, height;              //this has to be signed!\r
        byte name[16];\r
 } map_t;\r
@@ -136,29 +154,6 @@ typedef struct {
        sword delta;                    // How much should we shift the page for smooth scrolling\r
 } page_t;\r
 \r
-//from 16_sprit.h\r
-#ifdef __WATCOMC__\r
-typedef struct sprite\r
-{\r
-       // VRS container from which we will extract animation and image data\r
-       struct vrs_container *spritesheet;\r
-       // Container for a vrl sprite\r
-       struct vrl_container *sprite_vrl_cont;\r
-       // Current sprite id\r
-       int curr_spri_id;\r
-       // Index of a current sprite in an animation sequence\r
-       int curr_anim_spri;\r
-       // Current animation sequence\r
-       struct vrs_animation_list_entry_t *curr_anim_list;\r
-       // Index of current animation in relevant VRS offsets table\r
-       int curr_anim;\r
-       // Delay in time units untill we should change sprite\r
-       int delay;\r
-       // Position of sprite on screen\r
-       int x, y;\r
-} sprite_t;\r
-#endif\r
-\r
 //newer structs\r
 typedef        struct\r
 {\r