]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
==== animation fram walk ==== i polished the shit out of it and it works MUCH better...
[16.git] / src / lib / 16_tdef.h
index 6f15b7cc81010481b114136147065b644b9dd4f6..730e7f964c016cf523b9766df95f5dd23553f39a 100755 (executable)
@@ -57,30 +57,67 @@ typedef struct {
 } tileset_t;\r
 \r
 typedef struct {\r
-       byte far *plane[4];     /* 4 planes of image data */\r
-       word width;         /* width of the image (spread across 4 planes) */\r
-       word height;        /* height of the image (spread across 4 planes) */\r
-       word pwidth;        /* the number of bytes in each plane */\r
+       byte far *plane[4];     // 4 planes of image data\r
+       word width;                     // width of the image (spread across 4 planes)\r
+       word height;            // height of the image (spread across 4 planes)\r
+       word pwidth;            // the number of bytes in each plane\r
        byte *palette;\r
 } planar_buf_t;\r
 \r
+//TODO: 16_mm and 16_ca must handle this\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
-       word dx;                /* col we are viewing on the virtual screen */  /* off screen buffer on the left size */\r
-       word dy;                /* row we are viewing on the virtual screen */  /* off screen buffer on the top size */\r
-       word sw;                /* screen width */      /* resolution */\r
-       word sh;                /* screen heigth */     /* resolution */\r
+       bitmap_t far *btdata;           //old\r
+       planar_buf_t far *data; //old\r
+       word tileHeight, tileWidth;\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
+\r
+//TODO: 16_mm and 16_ca must handle this\r
+//TODO: add variables from 16_ca\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 * far *layertile;       //TODO: 16_mm and 16_ca must handle this\r
+       int width, height;              //this has to be signed!\r
+       char            name[16];\r
+} map_t;\r
+\r
+//TODO USE THIS tile info\r
+typedef struct{\r
        word tw;                /* screen width in tiles */\r
        word th;                /* screen height in tiles */\r
-       word width;             /* virtual width of the page */\r
-       word height;    /* virtual height of the page */\r
        word tilesw;            /* virtual screen width in tiles */\r
        word tilesh;            /* virtual screen height in tiles */\r
        sword tilemidposscreenx;        /* middle tile x position */    /* needed for scroll system to work accordingly */\r
        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
+} ti_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
+       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
+       word sh;                /* screen heigth */     /* resolution */\r
+               word tw;                /* screen width in tiles */\r
+               word th;                /* screen height in tiles */\r
+       word width;             /* virtual width of the page */\r
+       word height;    /* virtual height of the page */\r
+               word tilesw;            /* virtual screen width in tiles */\r
+               word tilesh;            /* virtual screen height in tiles */\r
+               sword tilemidposscreenx;        /* middle tile x position */    /* needed for scroll system to work accordingly */\r
+               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
        word stridew;                   /* width/4 */   /* VGA */\r
        word pagesize;                  /* page size */\r
        word pi;                                /* increment page by this much to preserve location */\r
@@ -89,6 +126,30 @@ typedef struct {
        sword delta;                    // How much should we shift the page for smooth scrolling\r
 } page_t;\r
 \r
+//new structs\r
+typedef        struct\r
+{\r
+       int x; //entity exact position on the viewable map\r
+       int y; //entity exact position on the viewable map\r
+       int tx; //entity tile position on the viewable map\r
+       int ty; //entity tile position on the viewable map\r
+       int triggerx; //entity's trigger box tile position on the viewable map\r
+       int triggery; //entity's trigger box tile position on the viewable map\r
+       int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x\r
+       int sheetsety; //NOT USED YET! entity sprite sheet set on the image y\r
+       nibble d;               //direction to render sprite!! wwww\r
+       nibble pred;    //prev. direction for animation changing\r
+       word dire;              //sprite in use\r
+       nibble q;               //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
+       word speed;             //entity speed!\r
+       word spt;               //speed per tile\r
+       struct sprite *spri; // sprite used by entity\r
+       sword hp; //hitpoints of the entity\r
+       nibble overdraww, overdrawh;    // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.\r
+                                               // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
+       nibble /*int*/ persist_aniframe;    // gonna be increased to 1 before being used, so 0 is ok for default\r
+} entity_t;\r
+\r
 //TODO: MAKE THIS WWWW\r
 typedef struct\r
 {\r
@@ -103,6 +164,81 @@ typedef struct
        spri_t *spri;\r
 } vrs_t;\r
 \r
+//from 16_in\r
+//==========================================================================\r
+typedef        byte            ScanCode;\r
+\r
+typedef        enum            {\r
+                                               //ctrl_None,                            // MDM (GAMERS EDGE) - added\r
+                                               ctrl_Keyboard,\r
+                                                       ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,\r
+                                               ctrl_Joystick,\r
+                                                       ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,\r
+                                               ctrl_Mouse,\r
+                                       } ControlType;\r
+typedef        enum            {\r
+                                               motion_Left = -1,motion_Up = -1,\r
+                                               motion_None = 0,\r
+                                               motion_Right = 1,motion_Down = 1\r
+                                       } Motion;\r
+typedef        enum            {\r
+                                               dir_North,//dir_NorthEast,\r
+                                               dir_West,//dir_Nortinest,\r
+                                               dir_None,\r
+                                               dir_East,//,dir_SouthEast,\r
+                                               dir_South,//dir_Soutinest,\r
+                                       } Direction;\r
+typedef        struct          {\r
+                                               boolean near    button0,button1,button2,button3;\r
+                                               int     near            x,y;\r
+                                               Motion  near    xaxis,yaxis;\r
+                                               Direction near  dir;\r
+                                       } CursorInfo;\r
+\r
+typedef        struct          {\r
+                                               ScanCode near   button0,button1,\r
+                                                                       //upleft,\r
+                                                                       up,\r
+                                                                       down,\r
+                                                                       left,\r
+                                                                       right\r
+                                                                       //upright,\r
+                                                                       //downleft,\r
+                                                                       //,downright\r
+                                                                       ;\r
+                                       } KeyboardDef;\r
+typedef        struct          {\r
+                                               word    near    joyMinX,joyMinY,\r
+                                                                       threshMinX,threshMinY,\r
+                                                                       threshMaxX,threshMaxY,\r
+                                                                       joyMaxX,joyMaxY,\r
+                                                                       joyMultXL,joyMultYL,\r
+                                                                       joyMultXH,joyMultYH;\r
+                                       } JoystickDef;\r
+\r
+//==========================================================================\r
+\r
+typedef        struct\r
+{\r
+       entity_t near   enti;\r
+#ifdef __WATCOMC__\r
+       //struct sprite *spri;  //supposively the sprite sheet data\r
+       memptr          gr;\r
+#endif\r
+       bitmap_t        *data;          //supposively the sprite sheet data//old format\r
+       bitmap_t        bmp;\r
+\r
+       //input\r
+       byte near               pdir;   //previous direction~ used in IN_16 in IN_ReadControl()\r
+       CursorInfo              info;\r
+       ControlType     Controls;\r
+       word walktype;\r
+//newer vars\r
+       int dx, dy, delta;      //TODO: what is this? ^^\r
+} player_t;\r
+\r
+//===========================================//\r
+\r
 typedef struct\r
 {\r
        int profilehandle,debughandle,showmemhandle;\r
@@ -119,25 +255,34 @@ typedef struct
        boolean fpscap; //cap the fps var\r
 } kurokku_t;\r
 \r
-typedef struct\r
-{\r
-       word    pn;\r
-} pan_t;\r
-\r
 //video\r
 #define NUMCHUNKS      416     //keen\r
 \r
 typedef struct\r
 {\r
        char old_mode;          //old video mode before game!\r
-       byte grneeded[NUMCHUNKS];\r
-       page_t page[MAXPAGE];           //pointer to root page[0]\r
+       byte palette[768];              //palette array\r
+       page_t page[MAXPAGE];   //can be used as a pointer to root page[0]\r
        word vmem_remain;       //remaining video memory\r
        byte num_of_pages;      //number of actual pages\r
-       boolean __near p;                       //render page number\r
-       boolean __near r;                       //page flip if true\r
+       //doslib origi vars\r
+       byte far * omemptr;\r
+       byte vga_draw_stride;\r
+       byte vga_draw_stride_limit;             // further X clipping\r
+       //end of doslib origi vars\r
+       boolean __near rss;                     //render sprite switch\r
+       sword __near sprifilei;         //player file's i\r
+       boolean __near p;                       //render page number //BLEH\r
+       boolean __near r;                       //page flip, showpage, or render        if true\r
        word pr[MAXPAGE][4];    //render sections of pages (this is supposed to be set up to draw sections of the screen if updated)\r
+\r
+       nibble sfip;            //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
+       nibble panp;            //pan_t replacement\r
+       word    vh;             //video combined height\r
        //0000word startclk; float clk, tickclk;        //timer\r
+//newer vars\r
+//TODO: find out how they are used\r
+       byte grneeded[NUMCHUNKS];\r
 } video_t;\r
 \r
 //from 16_mm\r