]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
==== INITIAL LAYER MAP STUFF DONE, added mapdraw layer ontop of bg, going to implemen...
[16.git] / src / lib / 16_tdef.h
index 50bc22614e2f3bd512b30334d51677a6689e3886..24552c73877b3810d6bce11013e8ede783aa0d51 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,32 +64,65 @@ 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 *data;             //old\r
-       //planar_buf_t far *data;       //old\r
-       word tileHeight, tileWidth;\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
-//     #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
+typedef struct {\r
+       byte    *layername;\r
+       byte    *data;                  //TODO: 16_mm and 16_ca must handle this\r
+} mapl_t;      //map layer array type def\r
+\r
+#define MAPLAYERS 3\r
+\r
+#define MAPTILESPTR            tiles//layertile[0]\r
+#define MAPTILESPTK            tiles//layertile[k]\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;  //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 *layertile[2];  //TODO: 16_mm and 16_ca must handle this\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
 \r
+//===================================//\r
+\r
 typedef struct{\r
        word tw;                /* screen width in tiles */\r
        word th;                /* screen height in tiles */\r
@@ -99,12 +132,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
@@ -120,29 +153,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
@@ -258,6 +268,7 @@ typedef struct
        word clock_start;       //timer start\r
        word *clock;    //current time on clock\r
        boolean fpscap; //cap the fps var\r
+       nibble wcpu;    //stored value of cpu type\r
 } kurokku_t;\r
 \r
 //video\r
@@ -309,6 +320,7 @@ typedef struct
        nibble __near *p;       // pointer to video's render page num\r
        nibble __near *sp;      // pointer to video's show page num\r
        int dx, dy;     // draw row and col var\r
+       word dxt,dyt;\r
 //newer vars!\r
        int delta, d;\r
 } map_view_t;\r