X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=730e7f964c016cf523b9766df95f5dd23553f39a;hb=7c35eb648613504ac47e5605d79f93112f569134;hp=f535c75d35b9b9a901a4ddeb2f7d65d9c4f76480;hpb=fb733fa9f63c8922ed3fcaeb48f11938becf94c8;p=16.git diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index f535c75d..730e7f96 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -49,7 +49,7 @@ typedef struct { } bitmap_t; typedef struct { - byte huge **data; + byte far **data; word ntiles; /* the number of tiles */ word twidth; /* width of the tiles */ word theight; /* height of the tiles */ @@ -57,52 +57,191 @@ typedef struct { } tileset_t; typedef struct { - byte huge *plane[4]; /* 4 planes of image data */ - word width; /* width of the image (spread across 4 planes) */ - word height; /* height of the image (spread across 4 planes) */ - word pwidth; /* the number of bytes in each plane */ + byte far *plane[4]; // 4 planes of image data + word width; // width of the image (spread across 4 planes) + word height; // height of the image (spread across 4 planes) + word pwidth; // the number of bytes in each plane byte *palette; } planar_buf_t; - -enum direction {STOP, UP, DOWN, LEFT, RIGHT}; +//TODO: 16_mm and 16_ca must handle this typedef struct { - int dx, dy; //backwards compait - word id; /* the Identification number of the page~ For layering~ */ - byte far* data; /* the data for the page */ - word sw; /* screen width */ - word sh; /* screen heigth */ + 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 width; /* virtual width of the page */ - word height; /* virtual height of the page */ word tilesw; /* virtual screen width in tiles */ word tilesh; /* virtual screen height in tiles */ - sword tilemidposscreenx; /* middle tile position */ - sword tilemidposscreeny; /* middle tile position */ - sword tileplayerposscreenx; /* player position on screen */ - sword tileplayerposscreeny; /* player position on screen */ - word stridew; /*width/4*/ + 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 */ +} ti_t; + +typedef struct { + nibble/*word*/ id; /* the Identification number of the page~ For layering~ */ + byte far* data; /* the data for 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 tw; /* screen width in tiles */ + word th; /* screen height in tiles */ + word width; /* virtual width of the page */ + word height; /* virtual height of the page */ + 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 */ + word stridew; /* width/4 */ /* VGA */ word pagesize; /* page size */ - word pi; /* incremention page by this much to preserve location */ - word delta; // How much should we shift the page for smooth scrolling - enum direction d; // Direction we should shift the page + 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; + +//new 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 + struct sprite *spri; // sprite used by entity + 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; + +//TODO: MAKE THIS WWWW typedef struct { //sprite .... boolean wwww; } spri_t; +//TODO: MAKE THIS TO WWWW typedef struct { //vrs with sprite .... spri_t *spri; } vrs_t; +//from 16_in +//========================================================================== +typedef byte ScanCode; + +typedef enum { + //ctrl_None, // MDM (GAMERS EDGE) - added + ctrl_Keyboard, + ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2, + ctrl_Joystick, + ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2, + ctrl_Mouse, + } ControlType; +typedef enum { + motion_Left = -1,motion_Up = -1, + motion_None = 0, + motion_Right = 1,motion_Down = 1 + } Motion; +typedef enum { + dir_North,//dir_NorthEast, + dir_West,//dir_Nortinest, + dir_None, + dir_East,//,dir_SouthEast, + dir_South,//dir_Soutinest, + } Direction; +typedef struct { + boolean near button0,button1,button2,button3; + int near x,y; + Motion near xaxis,yaxis; + Direction near dir; + } CursorInfo; + +typedef struct { + ScanCode near button0,button1, + //upleft, + up, + down, + left, + right + //upright, + //downleft, + //,downright + ; + } KeyboardDef; +typedef struct { + word near joyMinX,joyMinY, + threshMinX,threshMinY, + threshMaxX,threshMaxY, + joyMaxX,joyMaxY, + joyMultXL,joyMultYL, + joyMultXH,joyMultYH; + } JoystickDef; + +//========================================================================== + +typedef struct +{ + entity_t near enti; +#ifdef __WATCOMC__ + //struct sprite *spri; //supposively the sprite sheet data + memptr gr; +#endif + 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() + CursorInfo info; + ControlType Controls; + word walktype; +//newer vars + int dx, dy, delta; //TODO: what is this? ^^ +} player_t; + +//===========================================// + typedef struct { - int profilehandle,debughandle,showmemhandle; + int profilehandle,debughandle,showmemhandle; int heaphandle; } loghandle_t; @@ -116,25 +255,34 @@ typedef struct boolean fpscap; //cap the fps var } kurokku_t; -typedef struct -{ - word pn; -} pan_t; - //video #define NUMCHUNKS 416 //keen typedef struct { char old_mode; //old video mode before game! - byte grneeded[NUMCHUNKS]; - page_t page[MAXPAGE]; //pointer to root page[0] + byte palette[768]; //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 - boolean __near p; //render page number - boolean __near r; //page flip if true - word pr[MAXPAGE][4]; //render sections of pages + //doslib origi vars + byte far * omemptr; + byte vga_draw_stride; + byte vga_draw_stride_limit; // further X clipping + //end of doslib origi vars + boolean __near rss; //render sprite switch + sword __near sprifilei; //player file's i + boolean __near p; //render page number //BLEH + boolean __near r; //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. + nibble panp; //pan_t replacement + word vh; //video combined height //0000word startclk; float clk, tickclk; //timer +//newer vars +//TODO: find out how they are used + byte grneeded[NUMCHUNKS]; } video_t; //from 16_mm @@ -150,7 +298,6 @@ typedef struct mmblockstruct word blob; //for data larger than 64k unsigned attributes; memptr *useptr; // pointer to the segment start - //huge struct mmblockstruct huge *next; struct mmblockstruct far *next; } mmblocktype; @@ -164,7 +311,6 @@ typedef struct { memptr bufferseg; boolean mmstarted, bombonerror, mmerror; - //huge void huge *farheap; void far *farheap; #ifdef __BORLANDC__ void *nearheap; @@ -176,7 +322,6 @@ typedef struct word numUMBs,UMBbase[MAXUMBS]; word totalEMSpages, freeEMSpages, EMSpagesmapped, EMSHandle, EMSPageFrame; //dword numUMBs,UMBbase[MAXUMBS]; - //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew; mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; } mminfo_t; @@ -331,6 +476,14 @@ typedef struct //========================================================================== //actual global game varables! +typedef enum { + ENGI_EXIT, + ENGI_QUIT, + ENGI_RUN, + ENGI_INPUT, + ENGI_PAUSE +} engi_stat_t; + typedef struct { video_t video; // video settings variable