]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
[16_ca needs huge amounts of work and I should remember what needs to be done soon...
[16.git] / src / lib / 16_tdef.h
index 3aa8e1452c8b3d93fa5ab08d696efbbd1819a7e2..08b9699624d2e35b85c6abcaa82bc49d6794ae71 100755 (executable)
@@ -66,12 +66,38 @@ typedef struct {
 \r
 //from 16_sprit.h\r
 #ifdef __WATCOMC__\r
+#include <hw/vga/vrl.h>\r
+\r
+typedef struct vrs_container{\r
+       // Size of a .vrs blob in memory\r
+       // minus header\r
+       dword data_size;\r
+       union{\r
+               byte far *buffer;\r
+               struct vrs_header far *vrs_hdr;\r
+       };\r
+       // Array of corresponding vrl line offsets\r
+       vrl1_vgax_offset_t **vrl_line_offsets;\r
+} vrs_container_t;\r
+\r
+typedef struct vrl_container{\r
+       // Size of a .vrl blob in memory\r
+       // minus header\r
+       dword data_size;\r
+       union{\r
+               byte far *buffer;\r
+               struct vrl1_vgax_header far *vrl_header;\r
+       };\r
+       // Pointer to a corresponding vrl line offsets struct\r
+       vrl1_vgax_offset_t *line_offsets;\r
+} vrl_container_t;\r
+\r
 typedef struct sprite\r
 {\r
        // VRS container from which we will extract animation and image data\r
-       struct vrs_container *spritesheet;\r
+       vrs_container_t spritesheet;\r
        // Container for a vrl sprite\r
-       struct vrl_container *sprite_vrl_cont;\r
+       vrl_container_t sprite_vrl_cont;\r
        // Current sprite id\r
        int curr_spri_id;\r
        // Index of a current sprite in an animation sequence\r
@@ -261,33 +287,32 @@ typedef   struct          {
                                                                        joyMultXH,joyMultYH;\r
                                        } JoystickDef;\r
 \r
-typedef struct// instat\r
-{\r
-       boolean         IN_Started;\r
+typedef struct instat {\r
        boolean         CapsLock;\r
        ScanCode        CurCode,LastCode;\r
-} in_status_t;\r
+\r
+       boolean         Keyboard[NumCodes];\r
+       boolean         Paused;\r
+       char            LastASCII;\r
+       ScanCode        LastScan;\r
+} inst_t;\r
 \r
 typedef struct// inconfig\r
 {\r
-       in_status_t instat;\r
+       boolean         IN_Started;\r
 //\r
 // configuration variables\r
 //\r
-       boolean         Keyboard[NumCodes],\r
-                                       JoysPresent[MaxJoys],\r
+       boolean         JoysPresent[MaxJoys],\r
                                        MousePresent,\r
                                        JoyPadPresent;\r
 \r
 //     Global variables\r
-       boolean         Paused;\r
-       char            LastASCII;\r
-       ScanCode        LastScan;\r
-\r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
+       //struct        instat  *inst;\r
+       inst_t  *inst;\r
 } in_info_t;\r
-#define ININFO_                        gvar->in.\r
 \r
 //==========================================================================\r
 \r
@@ -408,7 +433,7 @@ typedef struct mmblockstruct
 {\r
        word    start,length;\r
        //word  start;  dword length;\r
-       word    blob;   //for data larger than 64k\r
+//++++ word    blob;   //for data larger than 64k\r
        unsigned        attributes;\r
        memptr          *useptr;        // pointer to the segment start\r
        struct mmblockstruct far *next;\r
@@ -542,8 +567,8 @@ typedef struct
                                        MainPagesUsed,\r
                                        PMNumBlocks;\r
        long                    PMFrameCount;\r
-       PageListStruct  far *PMPages;\r
-       memptr/*__SEGA*/ *PMSegPages;\r
+       PageListStruct  far *PMPages,\r
+                                       _seg *PMSegPages;\r
        pm_mmi_t        mm;\r
        pm_emmi_t       emm;\r
        pm_xmmi_t       xmm;\r
@@ -567,7 +592,7 @@ typedef struct
 typedef struct\r
 {\r
        int             mapon, mapnum;\r
-       //__SEGA        *mapheaderseg[NUMMAPS];\r
+       //maptype               _seg    *mapheaderseg[NUMMAPS];\r
 } ca_mapinfo_t;\r
 \r
 typedef struct\r
@@ -576,23 +601,37 @@ typedef struct
        int                     grhandle[4];            // handle to EGAGRAPH\r
        int                     audiohandle[4]; // handle to AUDIOT / AUDIO\r
 } ca_handle_t;\r
-\r
+/*\r
+ 16/wf3d8086/id_ca.c:byte              _seg    *tinf;\r
+16/wf3d8086/id_ca.c:unsigned   _seg    *mapsegs[MAPPLANES];\r
+16/wf3d8086/id_ca.c:maptype            _seg    *mapheaderseg[NUMMAPS];\r
+16/wf3d8086/id_ca.c:byte               _seg    *audiosegs[NUMSNDCHUNKS];\r
+16/wf3d8086/id_ca.c:void               _seg    *grsegs[NUMCHUNKS];\r
+16/wf3d8086/id_ca.c:long               _seg *grstarts; // array of offsets in egagraph, -1 for sparse\r
+16/wf3d8086/id_ca.c:long               _seg *audiostarts;      // array of offsets in audio / audiot\r
+16/wf3d8086/id_ca.c:   grstarts = (long _seg *)FP_SEG(&EGAhead);\r
+16/wf3d8086/id_ca.c:   tinf = (byte _seg *)FP_SEG(&maphead);\r
+16/wf3d8086/id_ca.c:           pos = ((mapfiletype     _seg *)tinf)->headeroffsets[i];\r
+16/wf3d8086/id_ca.c:   audiostarts = (long _seg *)FP_SEG(&audiohead);\r
+16/wf3d8086/id_ca.c:           ((mapfiletype _seg *)tinf)->RLEWtag);\r
+16/wf3d8086/id_ca.c:           ((mapfiletype _seg *)tinf)->RLEWtag);\r
+16/wf3d8086/id_ca.c:                                   source = (byte _seg *)bufferseg+(pos-bufferstart);*/\r
 typedef struct //TODO: USE THIS!!!!\r
 {\r
        byte    ca_levelbit,ca_levelnum;\r
        ca_handle_t             file;           //files to open\r
        ca_mapinfo_t    camap;\r
 \r
-       memptr/*__SEGA*/        mapsegs[MAP_LAYERS];\r
-       memptr/*__SEGA*/        *grsegs[NUMCHUNKS];\r
+       unsigned        _seg    *mapsegs[MAP_LAYERS];\r
+       void            _seg    *grsegs[NUMCHUNKS];\r
        byte            far             grneeded[NUMCHUNKS];\r
-       memptr/*byte _seg*/     *audiosegs[NUMSNDCHUNKS];\r
+       word            _seg *audiosegs[NUMSNDCHUNKS];//long\r
 \r
-       long            _seg *grstarts; // array of offsets in egagraph, -1 for sparse\r
-       long            _seg *audiostarts;      // array of offsets in audio / audiot\r
+       word            _seg    *grstarts;      // array of offsets in egagraph, -1 for sparse//long\r
+       word            _seg    *audiostarts;   // array of offsets in audio / audiot//long\r
 \r
        //misc memptr\r
-       memptr tinf[4];\r
+       byte            _seg    *tinf[4];\r
 \r
        huffnode huffnode;\r
 \r
@@ -604,15 +643,16 @@ typedef struct    //TODO: USE THIS!!!!
 \r
 //actual global game varables!\r
 typedef enum {\r
-       ENGI_EXIT,\r
        ENGI_QUIT,\r
        ENGI_RUN,\r
-       ENGI_INPUT,\r
+       ENGI_MENU,\r
        ENGI_PAUSE\r
 } engi_stat_t;\r
+//ENGI_INPUT,\r
 \r
 typedef struct\r
 {\r
+       engi_stat_t     engi_stat;\r
        video_t video;  // video settings variable\r
        ca_t            ca;     // ca stuff\r
        pm_t            pm;     // pm stuff\r
@@ -621,7 +661,7 @@ typedef struct
        mminfo_t        mm; mminfotype  mmi;    // mm stuff\r
        in_info_t       in;             // 16_in info\r
        player_t        player[MaxPlayers];     // player vars\r
-//==== word far*       clockw;         /* 18.2hz clock */\r
+       map_view_t      mv[4];\r
 } global_game_variables_t;\r
 \r
 #ifdef __WATCOMC__\r