X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=5621be818b2ccc31088f20f719028ff966e8dce0;hb=29204d5f82b02c730907d7cdf6760f291ae8e93e;hp=9a225c8fb23b8a525c1bdb0230c802ac563e9b73;hpb=17ec26395419ff775f29661e50265dfbccfda3b0;p=16.git diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 9a225c8f..5621be81 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -50,10 +50,10 @@ typedef struct { typedef struct { byte far **data; - word ntiles; /* the number of tiles */ - word twidth; /* width of the tiles */ - word theight; /* height of the tiles */ - byte *palette; /* palette for the tile set */ + word ntiles; // the number of tiles + word twidth; // width of the tiles + word theight; // height of the tiles + byte *palette; // palette for the tile set } tileset_t; typedef struct { @@ -64,61 +64,6 @@ typedef struct { byte *palette; } planar_buf_t; -//TODO: 16_mm and 16_ca must handle this -typedef struct { - bitmap_t far *btdata; //old - planar_buf_t far *data; //old - word tileHeight, tileWidth; - unsigned int rows, cols; -// #ifdef __DEBUG__ -// boolean debug_text; //show the value of the tile! wwww -// byte *debug_data; -// #endif -} tiles_t; - -//TODO: 16_mm and 16_ca must handle this -//TODO: add variables from 16_ca -typedef struct { - //long planestart[3]; - //unsigned planelength[3]; - byte *data; //TODO: 16_mm and 16_ca must handle this - byte * far *layerdata; //TODO: 16_mm and 16_ca must handle this - tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this - tiles_t * far *layertile; //TODO: 16_mm and 16_ca must handle this - int width, height; //this has to be signed! - char name[16]; -} map_t; - -//TODO USE THIS tile info -typedef struct{ - word tw; /* screen width in tiles */ - word th; /* screen height in tiles */ - word tilesw; /* virtual screen width in tiles */ - word tilesh; /* virtual screen height in tiles */ - sword tilemidposscreenx; /* middle tile x position */ /* needed for scroll system to work accordingly */ - sword tilemidposscreeny; /* middle tile y position */ /* needed for scroll system to work accordingly */ - sword tileplayerposscreenx; /* player position on screen */ /* needed for scroll and map system to work accordingly */ - sword tileplayerposscreeny; /* player position on screen */ /* needed for scroll and map system to work accordingly */ -} tileinfo_t; - -typedef struct { - nibble/*word*/ id; /* the Identification number of the page~ For layering~ */ - byte far* data; /* the data for the page */ - tileinfo_t ti; - word dx; /* col we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the left size */ - word dy; /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */ - word sw; /* screen width */ /* resolution */ - word sh; /* screen heigth */ /* resolution */ - word width; /* virtual width of the page */ - word height; /* virtual height of the page */ - word stridew; /* width/4 */ /* VGA */ - word pagesize; /* page size */ - word pi; /* increment page by this much to preserve location */ -//newer vars -//TODO: find where they are used - sword delta; // How much should we shift the page for smooth scrolling -} page_t; - //from 16_sprit.h #ifdef __WATCOMC__ typedef struct sprite @@ -160,7 +105,7 @@ typedef struct word speed; //entity speed! word spt; //speed per tile #ifdef __WATCOMC__ - sprite_t *spri; // sprite used by entity + sprite_t spri; // sprite used by entity #endif sword hp; //hitpoints of the entity nibble overdraww, overdrawh; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks. @@ -168,6 +113,80 @@ typedef struct nibble /*int*/ persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default } entity_t; +typedef struct +{ + int x; //entity exact position on the viewable map + int y; //entity exact position on the viewable map + int tx; //entity tile position on the viewable map + int ty; //entity tile position on the viewable map + +#ifdef __WATCOMC__ + sprite_t spri; // sprite used by entity +#endif + sword hp; //hitpoints of the entity +} static_map_entity_t; + +//===========================================================================// + +//TODO: 16_mm and 16_ca must handle this +typedef struct { +#ifdef __WATCOMC__ + sprite_t *spri; // I will probibaly use this --sparky4 +#endif + word tileHeight, tileWidth; //defined by mapfile + unsigned int rows, cols; + byte imgname[8]; //image file of tileset (set to 8 because DOS ^^;) +} tiles_t; //seems to be the tileset properties + +//TODO: 16_mm and 16_ca must handle this +//TODO: add variables from 16_ca +typedef struct { + byte layername[8]; + byte *data; //TODO: 16_mm and 16_ca must handle this +} mapl_t; //map layer array type def + +#define MAP_LAYERS 3 +typedef struct { + //long planestart[3]; + //unsigned planelength[3]; + mapl_t layerdata[MAP_LAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile) + tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this // tilesets for layers (currently ony 4 can be loaded wwww) + int width, height; //this has to be signed! + byte name[16]; +} map_t; + +//===================================// + +typedef struct{ + word tw; /* screen width in tiles */ + word th; /* screen height in tiles */ + word tilesw; /* virtual screen width in tiles */ + word tilesh; /* virtual screen height in tiles */ + sword tilemidposscreenx; /* middle tile x position */ /* needed for scroll system to work accordingly */ + sword tilemidposscreeny; /* middle tile y position */ /* needed for scroll system to work accordingly */ + sword tileplayerposscreenx; /* player position on screen */ /* needed for scroll and map system to work accordingly */ + sword tileplayerposscreeny; /* player position on screen */ /* needed for scroll and map system to work accordingly */ +} pagetileinfo_t; + +typedef struct { + nibble/*word*/ id; /* the Identification number of the page~ For layering~ */ + byte far* data; /* the data for the page */ + pagetileinfo_t ti; // the tile information of the page + word dx; /* col we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the left size */ + word dy; /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */ + word sw; /* screen width */ /* resolution */ + word sh; /* screen heigth */ /* resolution */ + word width; /* virtual width of the page */ + word height; /* virtual height of the page */ + word stridew; /* width/4 */ /* VGA */ + word pagesize; /* page size */ + word pi; /* increment page by this much to preserve location */ + int tlx,tly; +//newer vars +//TODO: find where they are used + sword delta; // How much should we shift the page for smooth scrolling +} page_t; + //from 16_in //========================================================================== typedef byte ScanCode; @@ -227,10 +246,10 @@ typedef struct entity_t near enti; #ifdef __WATCOMC__ //struct sprite *spri; //supposively the sprite sheet data - memptr gr; + //memptr gr; #endif - bitmap_t *data; //supposively the sprite sheet data//old format - bitmap_t bmp; +// bitmap_t *data; //supposively the sprite sheet data//old format +// bitmap_t bmp; //input byte near pdir; //previous direction~ used in IN_16 in IN_ReadControl() @@ -257,20 +276,23 @@ typedef struct word clock_start; //timer start word *clock; //current time on clock boolean fpscap; //cap the fps var + nibble wcpu; //stored value of cpu type } kurokku_t; +//===================================// +#define PALSIZE 768 +#define NUMCHUNKS 416 //keen //video typedef struct { unsigned int offscreen_ofs; unsigned int pattern_ofs; -} ofs_t; -#define NUMCHUNKS 416 //keen +} ofs_t; //unfinished typedef struct { char old_mode; //old video mode before game! - byte palette[768]; //palette array + byte palette[PALSIZE], dpal[PALSIZE]; //palette array page_t page[MAXPAGE]; //can be used as a pointer to root page[0] word vmem_remain; //remaining video memory byte num_of_pages; //number of actual pages @@ -279,11 +301,12 @@ typedef struct byte vga_draw_stride; byte vga_draw_stride_limit; // further X clipping //end of doslib origi vars - boolean __near rss; //render sprite switch + boolean __near rss; //render sprite switch + boolean __near bgps; //bg preservation render switch between old and new sword __near sprifilei; //player file's i nibble __near p; //render page number nibble __near sp; //show page number(for showpage) - boolean __near r; //page flip, showpage, or render if true + boolean __near dorender; //page flip, showpage, or render if true word pr[MAXPAGE][4]; //render sections of pages (this is supposed to be set up to draw sections of the screen if updated) nibble sfip; //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible. @@ -493,9 +516,10 @@ typedef struct typedef struct { int mapon, mapnum; - __SEGA *mapsegs[4]; - __SEGA *mapheaderseg[NUMMAPS]; - __SEGA *tinf; + //__SEGA *mapsegs[4]; + //__SEGA *mapheaderseg[NUMMAPS]; + //__SEGA *tinf; + memptr mapsegs; } ca_mapinfo_t; typedef struct @@ -539,6 +563,7 @@ typedef struct #ifdef __WATCOMC__ extern char global_temp_status_text[512]; +extern char global_temp_status_text2[512]; #define EINVFMT EMFILE #endif #endif /* _TYPEDEFSTRUCT_H_ */