X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=2107a4de66c869420a259d146796be456d89dd03;hb=c060c91a1c7e418122606fdc5cd7c9ce5a55495d;hp=1aa2d52ea2201cb40801215a901e623c919f1f09;hpb=9f7ffee2115e5b995c5470117e426d2c89b58979;p=16.git diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 1aa2d52e..2107a4de 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -87,15 +87,52 @@ typedef struct sprite } sprite_t; #endif +//newer structs +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 + int triggerx; //entity's trigger box tile position on the viewable map + int triggery; //entity's trigger box tile position on the viewable map +// int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x +// int sheetsety; //NOT USED YET! entity sprite sheet set on the image y + nibble d; //direction to render sprite!! wwww + nibble pred; //prev. direction for animation changing + word dire; //sprite in use + nibble q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www + word speed; //entity speed! + word spt; //speed per tile +#ifdef __WATCOMC__ + 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. + // if the sprite's edge pixels are clear anyway, you can set this to 0. + 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 { - bitmap_t far *pcximg; // old #ifdef __WATCOMC__ sprite_t *spri; // I will probibaly use this --sparky4 #endif - //planar_buf_t far *pbdata; //old word tileHeight, tileWidth; //defined by mapfile unsigned int rows, cols; byte imgname[8]; //image file of tileset (set to 8 because DOS ^^;) @@ -104,19 +141,15 @@ typedef struct { //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 MAPLAYERS 4 - -#define MAPDATAPTR layerdata[0].data -#define MAPDATAPTK layerdata[k].data -#define MAPTILESPTR tiles//layertile[0] -#define MAPTILESPTK tiles//layertile[k] +#define MAP_LAYERS 3 typedef struct { //long planestart[3]; //unsigned planelength[3]; - mapl_t layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile) + 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]; @@ -125,10 +158,10 @@ typedef struct { //===================================// 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 */ + 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 */ @@ -138,48 +171,22 @@ typedef struct{ typedef struct { nibble/*word*/ id; /* the Identification number of the page~ For layering~ */ byte far* data; /* the data for the page */ - pagetileinfo_t ti; + 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 */ + 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; -//newer structs -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 - int triggerx; //entity's trigger box tile position on the viewable map - int triggery; //entity's trigger box tile position on the viewable map -// int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x -// int sheetsety; //NOT USED YET! entity sprite sheet set on the image y - nibble d; //direction to render sprite!! wwww - nibble pred; //prev. direction for animation changing - word dire; //sprite in use - nibble q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www - word speed; //entity speed! - word spt; //speed per tile -#ifdef __WATCOMC__ - 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. - // if the sprite's edge pixels are clear anyway, you can set this to 0. - nibble /*int*/ persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default -} entity_t; - //from 16_in //========================================================================== typedef byte ScanCode; @@ -239,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() @@ -272,18 +279,20 @@ typedef struct 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 @@ -367,7 +376,7 @@ typedef struct boolean mmstarted, bombonerror, mmerror; void far *farheap; #ifdef __BORLANDC__ - void *nearheap; + void *nearheap; #endif #ifdef __WATCOMC__ void __near *nearheap; @@ -484,7 +493,7 @@ typedef struct PMNumBlocks; long PMFrameCount; PageListStruct far *PMPages; - __SEGA *PMSegPages; + memptr/*__SEGA*/ *PMSegPages; pm_mmi_t mm; pm_emmi_t emm; pm_xmmi_t xmm; @@ -498,6 +507,7 @@ typedef struct #define NUMMAPS 4//39 #define MAPPLANES 3 +#define NUMSNDCHUNKS 84 typedef struct { @@ -507,24 +517,33 @@ typedef struct typedef struct { int mapon, mapnum; - //__SEGA *mapsegs[4]; //__SEGA *mapheaderseg[NUMMAPS]; - //__SEGA *tinf; - memptr mapsegs; } ca_mapinfo_t; typedef struct { int maphandle[4]; // handle to MAPTEMP / GAMEMAPS + int grhandle[4]; // handle to EGAGRAPH + int audiohandle[4]; // handle to AUDIOT / AUDIO } ca_handle_t; -typedef struct +typedef struct //TODO: USE THIS!!!! { - byte ca_levelbit,ca_levelnum; - ca_handle_t file; //files to open + byte ca_levelbit,ca_levelnum; + ca_handle_t file; //files to open ca_mapinfo_t camap; - __SEGA *grsegs[NUMCHUNKS]; - byte far grneeded[NUMCHUNKS]; + + memptr/*__SEGA*/ mapsegs[MAP_LAYERS]; + memptr/*__SEGA*/ *grsegs[NUMCHUNKS]; + byte far grneeded[NUMCHUNKS]; + memptr/*byte _seg*/ *audiosegs[NUMSNDCHUNKS]; + + long _seg *grstarts; // array of offsets in egagraph, -1 for sparse + long _seg *audiostarts; // array of offsets in audio / audiot + + //misc memptr + memptr tinf[4]; + huffnode huffnode; //TODO: extend! and learn from keen/wolf/catacomb's code wwww