byte *data; //TODO: 16_mm and 16_ca must handle this\r
} mapl_t; //map layer array type def\r
\r
-#define MAP_LAYERS 3\r
+#define MAPPLANES 3\r
typedef struct {\r
//long planestart[3];\r
//unsigned planelength[3];\r
- mapl_t layerdata[MAP_LAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
+ mapl_t layerdata[MAPPLANES]; // 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
joyMultXH,joyMultYH;\r
} JoystickDef;\r
\r
+typedef struct instat {\r
+ boolean CapsLock;\r
+ ScanCode CurCode,LastCode;\r
+\r
+ boolean Keyboard[NumCodes];\r
+ boolean Paused;\r
+ char LastASCII;\r
+ ScanCode LastScan;\r
+} inst_t;\r
+\r
typedef struct// inconfig\r
{\r
boolean IN_Started;\r
-// boolean CapsLock;\r
-// ScanCode CurCode,LastCode;\r
//\r
// configuration variables\r
//\r
-// boolean Keyboard[NumCodes],\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
\r
//==========================================================================\r
} kurokku_t;\r
\r
//===================================//\r
-#define PALSIZE 768\r
+#define PALSIZE 768\r
#define NUMCHUNKS 416 //keen\r
+#define MAXSCANLINES 240 // size of ylookup table\r
+\r
//video\r
+typedef struct\r
+{\r
+ word tileHeight, tileWidth; //defined by mapfile\r
+ word quadwh; //preproccessed quad size of tilewidth and tileheight\r
+} tile_dimention_t;\r
+\r
typedef struct\r
{\r
unsigned int offscreen_ofs;\r
unsigned int pattern_ofs;\r
+ unsigned bufferofs, ylookup[MAXSCANLINES], linewidth,displayofs;\r
} ofs_t; //unfinished\r
\r
typedef struct\r
{\r
- char old_mode; //old video mode before game!\r
- byte palette[PALSIZE], dpal[PALSIZE]; //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
- //doslib origi vars\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
+//end of doslib origi vars\r
boolean __near rss; //render sprite switch\r
boolean __near bgps; //bg preservation render switch between old and new\r
+} vga_state_t;\r
+\r
+typedef struct\r
+{\r
+ boolean VL_Started;\r
+ char old_mode; //old video mode before game!\r
+ byte palette[PALSIZE], dpal[PALSIZE]; //palette array\r
+ byte far palette1[256][3],far palette2[256][3];\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
+ vga_state_t vga_state;\r
sword __near sprifilei; //player file's i\r
nibble __near p; //render page number\r
nibble __near sp; //show page number(for showpage)\r
nibble sfip; //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
ofs_t ofs; //offset vars used for doslib\r
word vh; //video combined height\r
+ tile_dimention_t td;\r
//0000word startclk; float clk, tickclk; //timer\r
-//newer vars\r
-//TODO: find out how they are used\r
- byte grneeded[NUMCHUNKS];\r
+ //wolf3d vars\r
+ boolean screenfaded;\r
+ word bordercolor;\r
+ boolean fastpalette;\r
} video_t;\r
\r
//from scroll16\r
//==========================================================================\r
\r
#define NUMMAPS 4//39\r
-#define MAPPLANES 3\r
#define NUMSNDCHUNKS 84\r
\r
typedef struct\r
word bit0,bit1; // 0-255 is a character, > is a pointer to a node\r
} huffnode;\r
\r
+typedef struct\r
+{\r
+ long planestart[3];\r
+ unsigned planelength[3];\r
+ unsigned width,height;\r
+ char name[16];\r
+} maptype;\r
+\r
typedef struct\r
{\r
int mapon, mapnum;\r
- //maptype _seg *mapheaderseg[NUMMAPS];\r
+ maptype _seg *mapheaderseg[NUMMAPS];\r
} ca_mapinfo_t;\r
\r
typedef struct\r
int audiohandle[4]; // handle to AUDIOT / AUDIO\r
} ca_handle_t;\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
+16/wf3d8086/id_ca.c: source = (byte _seg *)bufferseg+(pos-bufferstart);\r
+*/\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
- unsigned _seg *mapsegs[MAP_LAYERS];\r
+ byte _seg *tinf;//?? where in the id engine is this used and what is it? --sparky4\r
+ unsigned _seg *mapsegs[MAPPLANES];\r
void _seg *grsegs[NUMCHUNKS];\r
byte far grneeded[NUMCHUNKS];\r
word _seg *audiosegs[NUMSNDCHUNKS];//long\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
- byte _seg *tinf[4];\r
-\r
huffnode huffnode;\r
\r
//TODO: extend! and learn from keen/wolf/catacomb's code wwww\r
//==========================================================================\r
\r
//actual global game varables!\r
-typedef enum {\r
- ENGI_QUIT,\r
- ENGI_RUN,\r
- ENGI_MENU,\r
- ENGI_PAUSE\r
-} engi_stat_t;\r
-//ENGI_INPUT,\r
+/*typedef struct {\r
+ boolean clearmem;\r
+} vidsw_t;\r
\r
-typedef struct\r
+typedef struct {\r
+ vidsw_t vsw;\r
+} sw_t;*/\r
+\r
+\r
+\r
+typedef struct glob_game_vars\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
in_info_t in; // 16_in info\r
player_t player[MaxPlayers]; // player vars\r
map_view_t mv[4];\r
+// sw_t sw;\r
} global_game_variables_t;\r
\r
#ifdef __WATCOMC__\r