diff --git a/polymer/build/include/baselayer.h b/polymer/build/include/baselayer.h index 8a6410ad0..74854c8d3 100644 --- a/polymer/build/include/baselayer.h +++ b/polymer/build/include/baselayer.h @@ -1,19 +1,19 @@ -// Base services interface declaration -// for the Build Engine -// by Jonathon Fowler (jonof@edgenetwk.com) - -#ifndef __baselayer_h__ -#define __baselayer_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int _buildargc; -extern char **_buildargv; - -extern char quitevent, appactive; - +// Base services interface declaration +// for the Build Engine +// by Jonathon Fowler (jonof@edgenetwk.com) + +#ifndef __baselayer_h__ +#define __baselayer_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int _buildargc; +extern char **_buildargv; + +extern char quitevent, appactive; + // NOTE: these are implemented in game-land so they may be overridden in game specific ways extern int startwin_open(void); extern int startwin_close(void); @@ -21,119 +21,119 @@ extern int startwin_puts(const char *); extern int startwin_settitle(const char *); extern int startwin_idle(void *); -// video -extern long xres, yres, bpp, fullscreen, bytesperline, imageSize, frameplace; -extern char offscreenrendering; - -extern void (*baselayer_onvideomodechange)(int); - -#ifdef USE_OPENGL -struct glinfo { - const char *vendor; - const char *renderer; - const char *version; - const char *extensions; - - float maxanisotropy; - char bgra; - char clamptoedge; - char texcompr; - char texnpot; - char multisample; - char nvmultisamplehint; - char arbfp; - char depthtex; - char shadow; - char fbos; - char rect; - char multitex; - char envcombine; -}; -extern struct glinfo glinfo; -#endif - -extern char inputdevices; - -// keys -#define KEYFIFOSIZ 64 -extern char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend; -extern unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend; - -// mouse -extern long mousex, mousey, mouseb; - -// joystick -extern long *joyaxis, *joyhat, joyb; -extern char joyisgamepad, joynumaxes, joynumbuttons, joynumhats; -extern long joyaxespresent; - - - -int initsystem(void); -void uninitsystem(void); - -void initprintf(const char *, ...); -void debugprintf(const char *,...); - -int handleevents(void); +// video +extern long xres, yres, bpp, fullscreen, bytesperline, imageSize, frameplace; +extern char offscreenrendering; + +extern void (*baselayer_onvideomodechange)(int); + +#ifdef USE_OPENGL +struct glinfo { + const char *vendor; + const char *renderer; + const char *version; + const char *extensions; + + float maxanisotropy; + char bgra; + char clamptoedge; + char texcompr; + char texnpot; + char multisample; + char nvmultisamplehint; + char arbfp; + char depthtex; + char shadow; + char fbos; + char rect; + char multitex; + char envcombine; +}; +extern struct glinfo glinfo; +#endif + +extern char inputdevices; + +// keys +#define KEYFIFOSIZ 64 +extern char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend; +extern unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend; + +// mouse +extern long mousex, mousey, mouseb; + +// joystick +extern long *joyaxis, *joyhat, joyb; +extern char joyisgamepad, joynumaxes, joynumbuttons, joynumhats; +extern long joyaxespresent; + + + +int initsystem(void); +void uninitsystem(void); + +void initprintf(const char *, ...); +void debugprintf(const char *,...); + +int handleevents(void); extern inline void idle(void); - -typedef void (*KeyPressCallback)(long,long); -typedef void (*MousePressCallback)(long,long); -typedef void (*JoyPressCallback)(long,long); -int initinput(void); -void uninitinput(void); -void releaseallbuttons(void); -void setkeypresscallback(void (*callback)(long,long)); -void setmousepresscallback(void (*callback)(long,long)); -void setjoypresscallback(void (*callback)(long,long)); -const unsigned char *getkeyname(int num); -const unsigned char *getjoyname(int what, int num); // what: 0=axis, 1=button, 2=hat - -unsigned char bgetchar(void); -int bkbhit(void); -void bflushchars(void); - -int initmouse(void); -void uninitmouse(void); -void grabmouse(char a); -void readmousexy(long *x, long *y); -void readmousebstatus(long *b); -void setjoydeadzone(int axis, unsigned short dead, unsigned short satur); -void getjoydeadzone(int axis, unsigned short *dead, unsigned short *satur); - -int inittimer(int); -void uninittimer(void); -void sampletimer(void); -unsigned long getticks(void); -int gettimerfreq(void); -void (*installusertimercallback(void (*callback)(void)))(void); - -int checkvideomode(int *x, int *y, int c, int fs, int forced); -int setvideomode(int x, int y, int c, int fs); -void getvalidmodes(void); -void resetvideomode(void); - -void begindrawing(void); -void enddrawing(void); -void showframe(int); - -int setpalette(int start, int num, char *dapal); -//int getpalette(int start, int num, char *dapal); -int setgamma(float ro, float go, float bo); - -int switchrendermethod(int,int); // 0 = software, 1 = opengl | bool = reinit - -int wm_msgbox(char *name, char *fmt, ...); -int wm_ynbox(char *name, char *fmt, ...); -void wm_setapptitle(char *name); - -// baselayer.c -int baselayer_init(); - -#ifdef __cplusplus -} -#endif - -#endif // __baselayer_h__ - + +typedef void (*KeyPressCallback)(long,long); +typedef void (*MousePressCallback)(long,long); +typedef void (*JoyPressCallback)(long,long); +int initinput(void); +void uninitinput(void); +void releaseallbuttons(void); +void setkeypresscallback(void (*callback)(long,long)); +void setmousepresscallback(void (*callback)(long,long)); +void setjoypresscallback(void (*callback)(long,long)); +const unsigned char *getkeyname(int num); +const unsigned char *getjoyname(int what, int num); // what: 0=axis, 1=button, 2=hat + +unsigned char bgetchar(void); +int bkbhit(void); +void bflushchars(void); + +int initmouse(void); +void uninitmouse(void); +void grabmouse(char a); +void readmousexy(long *x, long *y); +void readmousebstatus(long *b); +void setjoydeadzone(int axis, unsigned short dead, unsigned short satur); +void getjoydeadzone(int axis, unsigned short *dead, unsigned short *satur); + +int inittimer(int); +void uninittimer(void); +void sampletimer(void); +unsigned long getticks(void); +int gettimerfreq(void); +void (*installusertimercallback(void (*callback)(void)))(void); + +int checkvideomode(int *x, int *y, int c, int fs, int forced); +int setvideomode(int x, int y, int c, int fs); +void getvalidmodes(void); +void resetvideomode(void); + +void begindrawing(void); +void enddrawing(void); +void showframe(int); + +int setpalette(int start, int num, char *dapal); +//int getpalette(int start, int num, char *dapal); +int setgamma(float ro, float go, float bo); + +int switchrendermethod(int,int); // 0 = software, 1 = opengl | bool = reinit + +int wm_msgbox(char *name, char *fmt, ...); +int wm_ynbox(char *name, char *fmt, ...); +void wm_setapptitle(char *name); + +// baselayer.c +int baselayer_init(); + +#ifdef __cplusplus +} +#endif + +#endif // __baselayer_h__ + diff --git a/polymer/build/include/build.h b/polymer/build/include/build.h index 217686e28..294681eeb 100644 --- a/polymer/build/include/build.h +++ b/polymer/build/include/build.h @@ -1,538 +1,538 @@ -// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman -// Ken Silverman's official web site: "http://www.advsys.net/ken" -// See the included license file "BUILDLIC.TXT" for license info. -// -// This file has been modified from Ken Silverman's original release -// by Jonathon Fowler (jonof@edgenetwk.com) - - -#ifndef __build_h__ -#define __build_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAXSECTORSV8 4096 -#define MAXWALLSV8 16384 -#define MAXSPRITESV8 16384 - -#define MAXSECTORSV7 1024 -#define MAXWALLSV7 8192 -#define MAXSPRITESV7 4096 - -#define MAXSECTORS MAXSECTORSV8 -#define MAXWALLS MAXWALLSV8 -#define MAXSPRITES MAXSPRITESV8 - -#define MAXTILES 15360 -#define MAXVOXELS 4096 -#define MAXSTATUS 1024 -#define MAXPLAYERS 16 -#define MAXXDIM 1600 -#define MAXYDIM 1200 -#define MAXPALOOKUPS 256 -#define MAXPSKYTILES 256 -#define MAXSPRITESONSCREEN 4096 -#define MAXUNIQHUDID 256 //Extra slots so HUD models can store animation state without messing game sprites - -#define RESERVEDPALS 1 -#define DETAILPAL MAXPALOOKUPS - 1 - -#define CLIPMASK0 (((1L)<<16)+1L) -#define CLIPMASK1 (((256L)<<16)+64L) - - //Make all variables in BUILD.H defined in the ENGINE, - //and externed in GAME -#ifdef ENGINE -# define EXTERN -#else -# define EXTERN extern -#endif - -#ifdef __GNUC__ -#define BPACK __attribute__ ((packed)) -#else -#define BPACK -#endif - -#ifdef _MSC_VER -#pragma pack(1) -#endif - -#ifdef __WATCOMC__ -#pragma pack(push,1); -#endif - - -//ceilingstat/floorstat: -// bit 0: 1 = parallaxing, 0 = not "P" -// bit 1: 1 = groudraw, 0 = not -// bit 2: 1 = swap x&y, 0 = not "F" -// bit 3: 1 = double smooshiness "E" -// bit 4: 1 = x-flip "F" -// bit 5: 1 = y-flip "F" -// bit 6: 1 = Align texture to first wall of sector "R" -// bits 7-8: "T" -// 00 = normal floors -// 01 = masked floors -// 10 = transluscent masked floors -// 11 = reverse transluscent masked floors -// bits 9-15: reserved - - //40 bytes -typedef struct BPACK -{ - short wallptr, wallnum; - long ceilingz, floorz; - short ceilingstat, floorstat; - short ceilingpicnum, ceilingheinum; - signed char ceilingshade; - char ceilingpal, ceilingxpanning, ceilingypanning; - short floorpicnum, floorheinum; - signed char floorshade; - char floorpal, floorxpanning, floorypanning; - char visibility, filler; - short lotag, hitag, extra; -} sectortype; - -//cstat: -// bit 0: 1 = Blocking wall (use with clipmove, getzrange) "B" -// bit 1: 1 = bottoms of invisible walls swapped, 0 = not "2" -// bit 2: 1 = align picture on bottom (for doors), 0 = top "O" -// bit 3: 1 = x-flipped, 0 = normal "F" -// bit 4: 1 = masking wall, 0 = not "M" -// bit 5: 1 = 1-way wall, 0 = not "1" -// bit 6: 1 = Blocking wall (use with hitscan / cliptype 1) "H" -// bit 7: 1 = Transluscence, 0 = not "T" -// bit 8: 1 = y-flipped, 0 = normal "F" -// bit 9: 1 = Transluscence reversing, 0 = normal "T" -// bits 10-15: reserved - - //32 bytes -typedef struct BPACK -{ - long x, y; - short point2, nextwall, nextsector, cstat; - short picnum, overpicnum; - signed char shade; - char pal, xrepeat, yrepeat, xpanning, ypanning; - short lotag, hitag, extra; -} walltype; - -//cstat: -// bit 0: 1 = Blocking sprite (use with clipmove, getzrange) "B" -// bit 1: 1 = transluscence, 0 = normal "T" -// bit 2: 1 = x-flipped, 0 = normal "F" -// bit 3: 1 = y-flipped, 0 = normal "F" -// bits 5-4: 00 = FACE sprite (default) "R" -// 01 = WALL sprite (like masked walls) -// 10 = FLOOR sprite (parallel to ceilings&floors) -// bit 6: 1 = 1-sided sprite, 0 = normal "1" -// bit 7: 1 = Real centered centering, 0 = foot center "C" -// bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H" -// bit 9: 1 = Transluscence reversing, 0 = normal "T" -// bits 10-14: reserved -// bit 15: 1 = Invisible sprite, 0 = not invisible - - //44 bytes -typedef struct BPACK -{ - long x, y, z; - short cstat, picnum; - signed char shade; - char pal, clipdist, filler; - unsigned char xrepeat, yrepeat; - signed char xoffset, yoffset; - short sectnum, statnum; - short ang, owner, xvel, yvel, zvel; - short lotag, hitag, extra; -} spritetype; - -typedef struct BPACK { - unsigned long mdanimtims; - short mdanimcur; - short angoff; - short pitch, roll; - long xoff, yoff, zoff; - unsigned char flags; - char filler[3]; -} spriteexttype; -#define SPREXT_NOTMD 1 -#define SPREXT_NOMDANIM 2 -EXTERN spriteexttype spriteext[MAXSPRITES+MAXUNIQHUDID]; -EXTERN long guniqhudid; - -EXTERN sectortype sector[MAXSECTORS]; -EXTERN walltype wall[MAXWALLS]; -EXTERN spritetype sprite[MAXSPRITES]; - -EXTERN long spritesortcnt; -EXTERN spritetype tsprite[MAXSPRITESONSCREEN]; - -EXTERN long xdim, ydim, ylookup[MAXYDIM+1], numpages; -EXTERN long yxaspect, viewingrange; - -#define MAXVALIDMODES 256 -EXTERN long validmodecnt; -struct validmode_t { - long xdim,ydim; - char bpp; - char fs; // bit 0 = fullscreen flag - char filler[2]; - long extra; // internal use -}; -EXTERN struct validmode_t validmode[MAXVALIDMODES]; - -EXTERN short numsectors, numwalls; -EXTERN /*volatile*/ long totalclock; -EXTERN long numframes, randomseed; -EXTERN short sintable[2048]; -EXTERN char palette[768]; -EXTERN short numpalookups; -EXTERN char *palookup[MAXPALOOKUPS]; -EXTERN char parallaxtype, showinvisibility; -EXTERN long parallaxyoffs, parallaxyscale; -EXTERN long visibility, parallaxvisibility; - -EXTERN long windowx1, windowy1, windowx2, windowy2; -EXTERN short startumost[MAXXDIM], startdmost[MAXXDIM]; - -EXTERN short pskyoff[MAXPSKYTILES], pskybits; - -EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1]; -EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES]; -EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES]; - -EXTERN short tilesizx[MAXTILES], tilesizy[MAXTILES]; -EXTERN char picsiz[MAXTILES]; -EXTERN char walock[MAXTILES]; -EXTERN long pow2long[32]; -EXTERN long numtiles, picanm[MAXTILES], waloff[MAXTILES]; - - //These variables are for auto-mapping with the draw2dscreen function. - //When you load a new board, these bits are all set to 0 - since - //you haven't mapped out anything yet. Note that these arrays are - //bit-mapped. - //If you want draw2dscreen() to show sprite #54 then you say: - // spritenum = 54; - // show2dsprite[spritenum>>3] |= (1<<(spritenum&7)); - //And if you want draw2dscreen() to not show sprite #54 then you say: - // spritenum = 54; - // show2dsprite[spritenum>>3] &= ~(1<<(spritenum&7)); - //Automapping defaults to 0 (do nothing). If you set automapping to 1, - // then in 3D mode, the walls and sprites that you see will show up the - // next time you flip to 2D mode. - -EXTERN char show2dsector[(MAXSECTORS+7)>>3]; -EXTERN char show2dwall[(MAXWALLS+7)>>3]; -EXTERN char show2dsprite[(MAXSPRITES+7)>>3]; -EXTERN char automapping; - -EXTERN char gotpic[(MAXTILES+7)>>3]; -EXTERN char gotsector[(MAXSECTORS+7)>>3]; - -EXTERN char captureformat; -extern char vgapalette[5*256]; -extern unsigned long drawlinepat; - -extern void faketimerhandler(void); - -extern char apptitle[256]; -typedef struct { - unsigned char r,g,b,f; -} palette_t; -extern palette_t curpalette[256], curpalettefaded[256], palfadergb; -extern char palfadedelta; - -extern long dommxoverlay, novoxmips; - -#ifdef SUPERBUILD -extern long tiletovox[MAXTILES]; -extern long usevoxels, voxscale[MAXVOXELS]; -#endif -#ifdef POLYMOST -extern long usemodels, usehightile; -#endif - -extern char *engineerrstr; -extern char noclip; - -/************************************************************************* -POSITION VARIABLES: - - POSX is your x - position ranging from 0 to 65535 - POSY is your y - position ranging from 0 to 65535 - (the length of a side of the grid in EDITBORD would be 1024) - POSZ is your z - position (height) ranging from 0 to 65535, 0 highest. - ANG is your angle ranging from 0 to 2047. Instead of 360 degrees, or - 2 * PI radians, I use 2048 different angles, so 90 degrees would - be 512 in my system. - -SPRITE VARIABLES: - - EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1]; - EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES]; - EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES]; - - Example: if the linked lists look like the following: - �������������������������������Ŀ - Sector lists: Status lists: - �������������������������������Ĵ - Sector0: 4, 5, 8 Status0: 2, 0, 8 - Sector1: 16, 2, 0, 7 Status1: 4, 5, 16, 7, 3, 9 - Sector2: 3, 9 - �������������������������������� - Notice that each number listed above is shown exactly once on both the - left and right side. This is because any sprite that exists must - be in some sector, and must have some kind of status that you define. - - -Coding example #1: - To go through all the sprites in sector 1, the code can look like this: - - sectnum = 1; - i = headspritesect[sectnum]; - while (i != -1) - { - nexti = nextspritesect[i]; - - //your code goes here - //ex: printf("Sprite %d is in sector %d\n",i,sectnum); - - i = nexti; - } - -Coding example #2: - To go through all sprites with status = 1, the code can look like this: - - statnum = 1; //status 1 - i = headspritestat[statnum]; - while (i != -1) - { - nexti = nextspritestat[i]; - - //your code goes here - //ex: printf("Sprite %d has a status of 1 (active)\n",i,statnum); - - i = nexti; - } - - insertsprite(short sectnum, short statnum); - deletesprite(short spritenum); - changespritesect(short spritenum, short newsectnum); - changespritestat(short spritenum, short newstatnum); - -TILE VARIABLES: - NUMTILES - the number of tiles found TILES.DAT. - TILESIZX[MAXTILES] - simply the x-dimension of the tile number. - TILESIZY[MAXTILES] - simply the y-dimension of the tile number. - WALOFF[MAXTILES] - the actual 32-bit offset pointing to the top-left - corner of the tile. - PICANM[MAXTILES] - flags for animating the tile. - -TIMING VARIABLES: - TOTALCLOCK - When the engine is initialized, TOTALCLOCK is set to zero. - From then on, it is incremented 120 times a second by 1. That - means that the number of seconds elapsed is totalclock / 120. - NUMFRAMES - The number of times the draw3dscreen function was called - since the engine was initialized. This helps to determine frame - rate. (Frame rate = numframes * 120 / totalclock.) - -OTHER VARIABLES: - - STARTUMOST[320] is an array of the highest y-coordinates on each column - that my engine is allowed to write to. You need to set it only - once. - STARTDMOST[320] is an array of the lowest y-coordinates on each column - that my engine is allowed to write to. You need to set it only - once. - SINTABLE[2048] is a sin table with 2048 angles rather than the - normal 360 angles for higher precision. Also since SINTABLE is in - all integers, the range is multiplied by 16383, so instead of the - normal -1>3] |= (1<<(spritenum&7)); + //And if you want draw2dscreen() to not show sprite #54 then you say: + // spritenum = 54; + // show2dsprite[spritenum>>3] &= ~(1<<(spritenum&7)); + //Automapping defaults to 0 (do nothing). If you set automapping to 1, + // then in 3D mode, the walls and sprites that you see will show up the + // next time you flip to 2D mode. + +EXTERN char show2dsector[(MAXSECTORS+7)>>3]; +EXTERN char show2dwall[(MAXWALLS+7)>>3]; +EXTERN char show2dsprite[(MAXSPRITES+7)>>3]; +EXTERN char automapping; + +EXTERN char gotpic[(MAXTILES+7)>>3]; +EXTERN char gotsector[(MAXSECTORS+7)>>3]; + +EXTERN char captureformat; +extern char vgapalette[5*256]; +extern unsigned long drawlinepat; + +extern void faketimerhandler(void); + +extern char apptitle[256]; +typedef struct { + unsigned char r,g,b,f; +} palette_t; +extern palette_t curpalette[256], curpalettefaded[256], palfadergb; +extern char palfadedelta; + +extern long dommxoverlay, novoxmips; + +#ifdef SUPERBUILD +extern long tiletovox[MAXTILES]; +extern long usevoxels, voxscale[MAXVOXELS]; +#endif +#ifdef POLYMOST +extern long usemodels, usehightile; +#endif + +extern char *engineerrstr; +extern char noclip; + +/************************************************************************* +POSITION VARIABLES: + + POSX is your x - position ranging from 0 to 65535 + POSY is your y - position ranging from 0 to 65535 + (the length of a side of the grid in EDITBORD would be 1024) + POSZ is your z - position (height) ranging from 0 to 65535, 0 highest. + ANG is your angle ranging from 0 to 2047. Instead of 360 degrees, or + 2 * PI radians, I use 2048 different angles, so 90 degrees would + be 512 in my system. + +SPRITE VARIABLES: + + EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1]; + EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES]; + EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES]; + + Example: if the linked lists look like the following: + �������������������������������Ŀ + Sector lists: Status lists: + �������������������������������Ĵ + Sector0: 4, 5, 8 Status0: 2, 0, 8 + Sector1: 16, 2, 0, 7 Status1: 4, 5, 16, 7, 3, 9 + Sector2: 3, 9 + �������������������������������� + Notice that each number listed above is shown exactly once on both the + left and right side. This is because any sprite that exists must + be in some sector, and must have some kind of status that you define. + + +Coding example #1: + To go through all the sprites in sector 1, the code can look like this: + + sectnum = 1; + i = headspritesect[sectnum]; + while (i != -1) + { + nexti = nextspritesect[i]; + + //your code goes here + //ex: printf("Sprite %d is in sector %d\n",i,sectnum); + + i = nexti; + } + +Coding example #2: + To go through all sprites with status = 1, the code can look like this: + + statnum = 1; //status 1 + i = headspritestat[statnum]; + while (i != -1) + { + nexti = nextspritestat[i]; + + //your code goes here + //ex: printf("Sprite %d has a status of 1 (active)\n",i,statnum); + + i = nexti; + } + + insertsprite(short sectnum, short statnum); + deletesprite(short spritenum); + changespritesect(short spritenum, short newsectnum); + changespritestat(short spritenum, short newstatnum); + +TILE VARIABLES: + NUMTILES - the number of tiles found TILES.DAT. + TILESIZX[MAXTILES] - simply the x-dimension of the tile number. + TILESIZY[MAXTILES] - simply the y-dimension of the tile number. + WALOFF[MAXTILES] - the actual 32-bit offset pointing to the top-left + corner of the tile. + PICANM[MAXTILES] - flags for animating the tile. + +TIMING VARIABLES: + TOTALCLOCK - When the engine is initialized, TOTALCLOCK is set to zero. + From then on, it is incremented 120 times a second by 1. That + means that the number of seconds elapsed is totalclock / 120. + NUMFRAMES - The number of times the draw3dscreen function was called + since the engine was initialized. This helps to determine frame + rate. (Frame rate = numframes * 120 / totalclock.) + +OTHER VARIABLES: + + STARTUMOST[320] is an array of the highest y-coordinates on each column + that my engine is allowed to write to. You need to set it only + once. + STARTDMOST[320] is an array of the lowest y-coordinates on each column + that my engine is allowed to write to. You need to set it only + once. + SINTABLE[2048] is a sin table with 2048 angles rather than the + normal 360 angles for higher precision. Also since SINTABLE is in + all integers, the range is multiplied by 16383, so instead of the + normal -1=0 for a particular palette -// how: pass -1 to invalidate all instances of the tile in texture memory, or a bitfield -// bit 0: opaque or masked (non-translucent) texture, using repeating -// bit 1: ignored -// bit 2: 33% translucence, using repeating -// bit 3: 67% translucence, using repeating -// bit 4: opaque or masked (non-translucent) texture, using clamping -// bit 5: ignored -// bit 6: 33% translucence, using clamping -// bit 7: 67% translucence, using clamping -// clamping is for sprites, repeating is for walls -void invalidatetile(short tilenume, long pal, long how); - +_equation equation(long x1, long y1, long x2, long y2); +int sameside(_equation* eq, _point2d* p1, _point2d* p2); + +#define STATUS2DSIZ 144 +void qsetmode640350(void); +void qsetmode640480(void); +void qsetmodeany(long,long); +void clear2dscreen(void); +void draw2dgrid(long posxe, long posye, short ange, long zoome, short gride); +void draw2dscreen(long posxe, long posye, short ange, long zoome, short gride); +void drawline16(long x1, long y1, long x2, long y2, char col); +void drawcircle16(long x1, long y1, long r, char col); + +int setrendermode(int renderer); +int getrendermode(void); + +void setrollangle(long rolla); + +// pal: pass -1 to invalidate all palettes for the tile, or >=0 for a particular palette +// how: pass -1 to invalidate all instances of the tile in texture memory, or a bitfield +// bit 0: opaque or masked (non-translucent) texture, using repeating +// bit 1: ignored +// bit 2: 33% translucence, using repeating +// bit 3: 67% translucence, using repeating +// bit 4: opaque or masked (non-translucent) texture, using clamping +// bit 5: ignored +// bit 6: 33% translucence, using clamping +// bit 7: 67% translucence, using clamping +// clamping is for sprites, repeating is for walls +void invalidatetile(short tilenume, long pal, long how); + long animateoffs(short tilenum, short fakevar); - -void setpolymost2dview(void); // sets up GL for 2D drawing - -long polymost_drawtilescreen(long tilex, long tiley, long wallnum, long dimen); -void polymost_glreset(void); -void polymost_precache(long dapicnum, long dapalnum, long datype); - -#if defined(POLYMOST) && defined(USE_OPENGL) -extern long glanisotropy; -extern long glusetexcompr; -extern long gltexfiltermode; -extern long glredbluemode; -extern long glusetexcache, glusetexcachecompression; + +void setpolymost2dview(void); // sets up GL for 2D drawing + +long polymost_drawtilescreen(long tilex, long tiley, long wallnum, long dimen); +void polymost_glreset(void); +void polymost_precache(long dapicnum, long dapalnum, long datype); + +#if defined(POLYMOST) && defined(USE_OPENGL) +extern long glanisotropy; +extern long glusetexcompr; +extern long gltexfiltermode; +extern long glredbluemode; +extern long glusetexcache, glusetexcachecompression; extern long glmultisample, glnvmultisamplehint; -extern long glwidescreen, glprojectionhacks; -void gltexapplyprops (void); - -extern long r_depthpeeling, r_peelscount; -extern long r_detailmapping; -#endif - -void hicinit(void); -// effect bitset: 1 = greyscale, 2 = invert -void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect); -// flags bitset: 1 = don't compress -int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, char flags); -int hicsetskybox(long picnum, long palnum, char *faces[6]); -int hicclearsubst(long picnum, long palnum); - -int md_loadmodel(const char *fn); -int md_setmisc(int modelid, float scale, int shadeoff, float zadd); -int md_tilehasmodel(int tilenume); -int md_defineframe(int modelid, const char *framename, int tilenume, int skinnum); -int md_defineanimation(int modelid, const char *framestart, const char *frameend, int fps, int flags); -int md_defineskin(int modelid, const char *skinfn, int palnum, int skinnum, int surfnum); -int md_definehud (int modelid, int tilex, double xadd, double yadd, double zadd, double angadd, int flags); -int md_undefinetile(int tile); -int md_undefinemodel(int modelid); - -int loaddefinitionsfile(char *fn); - -extern long mapversion; // if loadboard() fails with -2 return, try loadoldboard(). if it fails with -2, board is dodgy -long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum); - -#ifdef _MSC_VER -#pragma pack() -#endif - -#ifdef __WATCOMC__ -#pragma pack(pop) -#endif - -#undef BPACK - -#ifdef __cplusplus -} -#endif - -#endif // __build_h__ +extern long glwidescreen, glprojectionhacks; +void gltexapplyprops (void); + +extern long r_depthpeeling, r_peelscount; +extern long r_detailmapping; +#endif + +void hicinit(void); +// effect bitset: 1 = greyscale, 2 = invert +void hicsetpalettetint(long palnum, unsigned char r, unsigned char g, unsigned char b, unsigned char effect); +// flags bitset: 1 = don't compress +int hicsetsubsttex(long picnum, long palnum, char *filen, float alphacut, char flags); +int hicsetskybox(long picnum, long palnum, char *faces[6]); +int hicclearsubst(long picnum, long palnum); + +int md_loadmodel(const char *fn); +int md_setmisc(int modelid, float scale, int shadeoff, float zadd); +int md_tilehasmodel(int tilenume); +int md_defineframe(int modelid, const char *framename, int tilenume, int skinnum); +int md_defineanimation(int modelid, const char *framestart, const char *frameend, int fps, int flags); +int md_defineskin(int modelid, const char *skinfn, int palnum, int skinnum, int surfnum); +int md_definehud (int modelid, int tilex, double xadd, double yadd, double zadd, double angadd, int flags); +int md_undefinetile(int tile); +int md_undefinemodel(int modelid); + +int loaddefinitionsfile(char *fn); + +extern long mapversion; // if loadboard() fails with -2 return, try loadoldboard(). if it fails with -2, board is dodgy +long loadoldboard(char *filename, char fromwhere, long *daposx, long *daposy, long *daposz, short *daang, short *dacursectnum); + +#ifdef _MSC_VER +#pragma pack() +#endif + +#ifdef __WATCOMC__ +#pragma pack(pop) +#endif + +#undef BPACK + +#ifdef __cplusplus +} +#endif + +#endif // __build_h__ diff --git a/polymer/build/include/compat.h b/polymer/build/include/compat.h index 88eb325db..3c8f54078 100644 --- a/polymer/build/include/compat.h +++ b/polymer/build/include/compat.h @@ -66,7 +66,7 @@ # define int64 __int64 # define uint64 unsigned __int64 # define longlong(x) x##i64 -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) # define inline __inline # define int64 __int64 # define uint64 unsigned __int64 diff --git a/polymer/build/include/crc32.h b/polymer/build/include/crc32.h index d05dc5c0f..5f0984175 100644 --- a/polymer/build/include/crc32.h +++ b/polymer/build/include/crc32.h @@ -1,20 +1,20 @@ -#ifndef __crc32_h__ -#define __crc32_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -void initcrc32table(void); - -unsigned long crc32once(unsigned char *blk, unsigned long len); - -void crc32init(unsigned long *crcvar); -void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len); -unsigned long crc32finish(unsigned long *crcvar); - -#ifdef __cplusplus -} -#endif - -#endif +#ifndef __crc32_h__ +#define __crc32_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +void initcrc32table(void); + +unsigned long crc32once(unsigned char *blk, unsigned long len); + +void crc32init(unsigned long *crcvar); +void crc32block(unsigned long *crcvar, unsigned char *blk, unsigned long len); +unsigned long crc32finish(unsigned long *crcvar); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/polymer/build/include/editor.h b/polymer/build/include/editor.h index 167271b97..81488a4fe 100644 --- a/polymer/build/include/editor.h +++ b/polymer/build/include/editor.h @@ -1,70 +1,70 @@ -// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman -// Ken Silverman's official web site: "http://www.advsys.net/ken" -// See the included license file "BUILDLIC.TXT" for license info. - -#ifndef __editor_h__ -#define __editor_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define NUMBUILDKEYS 20 - -extern long qsetmode; -extern short searchsector, searchwall, searchstat; -extern long zmode, kensplayerheight; -extern short defaultspritecstat; - -extern short temppicnum, tempcstat, templotag, temphitag, tempextra; -extern unsigned char tempshade, temppal, tempxrepeat, tempyrepeat; -extern unsigned char somethingintab; - -extern unsigned char buildkeys[NUMBUILDKEYS]; - -extern long ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup; - - -extern int ExtInit(void); -extern int ExtPreInit(int argc,char **argv); -extern void ExtUnInit(void); -extern void ExtPreCheckKeys(void); -#ifdef SUPERBUILD -extern void ExtAnalyzeSprites(void); -#endif -extern void ExtCheckKeys(void); -extern void ExtPreLoadMap(void); -extern void ExtLoadMap(const char *mapname); -extern void ExtPreSaveMap(void); -extern void ExtSaveMap(const char *mapname); -extern const char *ExtGetSectorCaption(short sectnum); -extern const char *ExtGetWallCaption(short wallnum); -extern const char *ExtGetSpriteCaption(short spritenum); -extern void ExtShowSectorData(short sectnum); -extern void ExtShowWallData(short wallnum); -extern void ExtShowSpriteData(short spritenum); -extern void ExtEditSectorData(short sectnum); -extern void ExtEditWallData(short wallnum); -extern void ExtEditSpriteData(short spritenum); -extern char ExtCustomSpriteColor(short picnum); -extern void ExtSetupSpecialSpriteCols(void); - -int loadsetup(const char *fn); // from config.c -int writesetup(const char *fn); // from config.c - -void editinput(void); -void clearmidstatbar16(void); - -long getnumber256(char namestart[80], long num, long maxnumber, char sign); -long getnumber16(char namestart[80], long num, long maxnumber, char sign); -void printmessage256(char name[82]); -void printmessage16(char name[82]); - -void getpoint(long searchxe, long searchye, long *x, long *y); -long getpointhighlight(long xplc, long yplc); - -#ifdef __cplusplus -} -#endif - -#endif +// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman +// Ken Silverman's official web site: "http://www.advsys.net/ken" +// See the included license file "BUILDLIC.TXT" for license info. + +#ifndef __editor_h__ +#define __editor_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define NUMBUILDKEYS 20 + +extern long qsetmode; +extern short searchsector, searchwall, searchstat; +extern long zmode, kensplayerheight; +extern short defaultspritecstat; + +extern short temppicnum, tempcstat, templotag, temphitag, tempextra; +extern unsigned char tempshade, temppal, tempxrepeat, tempyrepeat; +extern unsigned char somethingintab; + +extern unsigned char buildkeys[NUMBUILDKEYS]; + +extern long ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup; + + +extern int ExtInit(void); +extern int ExtPreInit(int argc,char **argv); +extern void ExtUnInit(void); +extern void ExtPreCheckKeys(void); +#ifdef SUPERBUILD +extern void ExtAnalyzeSprites(void); +#endif +extern void ExtCheckKeys(void); +extern void ExtPreLoadMap(void); +extern void ExtLoadMap(const char *mapname); +extern void ExtPreSaveMap(void); +extern void ExtSaveMap(const char *mapname); +extern const char *ExtGetSectorCaption(short sectnum); +extern const char *ExtGetWallCaption(short wallnum); +extern const char *ExtGetSpriteCaption(short spritenum); +extern void ExtShowSectorData(short sectnum); +extern void ExtShowWallData(short wallnum); +extern void ExtShowSpriteData(short spritenum); +extern void ExtEditSectorData(short sectnum); +extern void ExtEditWallData(short wallnum); +extern void ExtEditSpriteData(short spritenum); +extern char ExtCustomSpriteColor(short picnum); +extern void ExtSetupSpecialSpriteCols(void); + +int loadsetup(const char *fn); // from config.c +int writesetup(const char *fn); // from config.c + +void editinput(void); +void clearmidstatbar16(void); + +long getnumber256(char namestart[80], long num, long maxnumber, char sign); +long getnumber16(char namestart[80], long num, long maxnumber, char sign); +void printmessage256(char name[82]); +void printmessage16(char name[82]); + +void getpoint(long searchxe, long searchye, long *x, long *y); +long getpointhighlight(long xplc, long yplc); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/polymer/build/include/glbuild.h b/polymer/build/include/glbuild.h index 6d982751b..93a05ae1e 100644 --- a/polymer/build/include/glbuild.h +++ b/polymer/build/include/glbuild.h @@ -1,129 +1,129 @@ -#ifdef USE_OPENGL - -#ifdef RENDERTYPEWIN -#define WIN32_LEAN_AND_MEAN -#include -#endif - -#if defined(__APPLE__) -# include -# include -#else -# include -# include -#endif - -// get this header from http://oss.sgi.com/projects/ogl-sample/registry/ -// if you are missing it -//#include -#if defined(__APPLE__) -# include -#else -# include "glext.h" -#endif - -#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT -#error You should get an updated copy of glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ -#endif - -#ifndef APIENTRY -# define APIENTRY -#endif - -# ifdef _WIN32 -# define PR_CALLBACK __stdcall -# else -# define PR_CALLBACK -# endif - -// those defines are somehow missing from glext.h +#ifdef USE_OPENGL + +#ifdef RENDERTYPEWIN +#define WIN32_LEAN_AND_MEAN +#include +#endif + +#if defined(__APPLE__) +# include +# include +#else +# include +# include +#endif + +// get this header from http://oss.sgi.com/projects/ogl-sample/registry/ +// if you are missing it +//#include +#if defined(__APPLE__) +# include +#else +# include "glext.h" +#endif + +#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT +#error You should get an updated copy of glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ +#endif + +#ifndef APIENTRY +# define APIENTRY +#endif + +# ifdef _WIN32 +# define PR_CALLBACK __stdcall +# else +# define PR_CALLBACK +# endif + +// those defines are somehow missing from glext.h #define GL_FRAMEBUFFER_EXT 0x8D40 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_TEXTURE_RECTANGLE 0x84F5 - -extern void (APIENTRY * bglClearColor)( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); -extern void (APIENTRY * bglClear)( GLbitfield mask ); -extern void (APIENTRY * bglColorMask)( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); -extern void (APIENTRY * bglAlphaFunc)( GLenum func, GLclampf ref ); -extern void (APIENTRY * bglBlendFunc)( GLenum sfactor, GLenum dfactor ); -extern void (APIENTRY * bglCullFace)( GLenum mode ); -extern void (APIENTRY * bglFrontFace)( GLenum mode ); -extern void (APIENTRY * bglPolygonOffset)( GLfloat factor, GLfloat units ); -extern void (APIENTRY * bglPolygonMode)( GLenum face, GLenum mode ); -extern void (APIENTRY * bglEnable)( GLenum cap ); -extern void (APIENTRY * bglDisable)( GLenum cap ); -extern void (APIENTRY * bglGetFloatv)( GLenum pname, GLfloat *params ); -extern void (APIENTRY * bglGetIntegerv)( GLenum pname, GLint *params ); -extern void (APIENTRY * bglPushAttrib)( GLbitfield mask ); -extern void (APIENTRY * bglPopAttrib)( void ); -extern GLenum (APIENTRY * bglGetError)( void ); -extern const GLubyte* (APIENTRY * bglGetString)( GLenum name ); -extern void (APIENTRY * bglHint)( GLenum target, GLenum mode ); -extern void (APIENTRY * bglDrawBuffer)(GLenum mode); -extern void (APIENTRY * bglReadBuffer)(GLenum mode); - -// Depth -extern void (APIENTRY * bglDepthFunc)( GLenum func ); -extern void (APIENTRY * bglDepthMask)( GLboolean flag ); -extern void (APIENTRY * bglDepthRange)( GLclampd near_val, GLclampd far_val ); - -// Matrix -extern void (APIENTRY * bglMatrixMode)( GLenum mode ); -extern void (APIENTRY * bglOrtho)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); -extern void (APIENTRY * bglFrustum)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); -extern void (APIENTRY * bglViewport)( GLint x, GLint y, GLsizei width, GLsizei height ); -extern void (APIENTRY * bglPushMatrix)( void ); -extern void (APIENTRY * bglPopMatrix)( void ); -extern void (APIENTRY * bglLoadIdentity)( void ); -extern void (APIENTRY * bglLoadMatrixf)( const GLfloat *m ); + +extern void (APIENTRY * bglClearColor)( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); +extern void (APIENTRY * bglClear)( GLbitfield mask ); +extern void (APIENTRY * bglColorMask)( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); +extern void (APIENTRY * bglAlphaFunc)( GLenum func, GLclampf ref ); +extern void (APIENTRY * bglBlendFunc)( GLenum sfactor, GLenum dfactor ); +extern void (APIENTRY * bglCullFace)( GLenum mode ); +extern void (APIENTRY * bglFrontFace)( GLenum mode ); +extern void (APIENTRY * bglPolygonOffset)( GLfloat factor, GLfloat units ); +extern void (APIENTRY * bglPolygonMode)( GLenum face, GLenum mode ); +extern void (APIENTRY * bglEnable)( GLenum cap ); +extern void (APIENTRY * bglDisable)( GLenum cap ); +extern void (APIENTRY * bglGetFloatv)( GLenum pname, GLfloat *params ); +extern void (APIENTRY * bglGetIntegerv)( GLenum pname, GLint *params ); +extern void (APIENTRY * bglPushAttrib)( GLbitfield mask ); +extern void (APIENTRY * bglPopAttrib)( void ); +extern GLenum (APIENTRY * bglGetError)( void ); +extern const GLubyte* (APIENTRY * bglGetString)( GLenum name ); +extern void (APIENTRY * bglHint)( GLenum target, GLenum mode ); +extern void (APIENTRY * bglDrawBuffer)(GLenum mode); +extern void (APIENTRY * bglReadBuffer)(GLenum mode); + +// Depth +extern void (APIENTRY * bglDepthFunc)( GLenum func ); +extern void (APIENTRY * bglDepthMask)( GLboolean flag ); +extern void (APIENTRY * bglDepthRange)( GLclampd near_val, GLclampd far_val ); + +// Matrix +extern void (APIENTRY * bglMatrixMode)( GLenum mode ); +extern void (APIENTRY * bglOrtho)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); +extern void (APIENTRY * bglFrustum)( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ); +extern void (APIENTRY * bglViewport)( GLint x, GLint y, GLsizei width, GLsizei height ); +extern void (APIENTRY * bglPushMatrix)( void ); +extern void (APIENTRY * bglPopMatrix)( void ); +extern void (APIENTRY * bglLoadIdentity)( void ); +extern void (APIENTRY * bglLoadMatrixf)( const GLfloat *m ); extern void (APIENTRY * bglMultMatrixf)( const GLfloat *m ); -extern void (APIENTRY * bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -extern void (APIENTRY * bglScalef)(GLfloat x, GLfloat y, GLfloat z); -extern void (APIENTRY * bglTranslatef)(GLfloat x, GLfloat y, GLfloat z); - -// Drawing -extern void (APIENTRY * bglBegin)( GLenum mode ); -extern void (APIENTRY * bglEnd)( void ); -extern void (APIENTRY * bglVertex2f)( GLfloat x, GLfloat y ); -extern void (APIENTRY * bglVertex2i)( GLint x, GLint y ); -extern void (APIENTRY * bglVertex3f)( GLfloat x, GLfloat y, GLfloat z ); -extern void (APIENTRY * bglVertex3d)( GLdouble x, GLdouble y, GLdouble z ); -extern void (APIENTRY * bglVertex3fv)( const GLfloat *v ); -extern void (APIENTRY * bglVertex3dv)( const GLdouble *v ); -extern void (APIENTRY * bglColor4f)( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void (APIENTRY * bglColor4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ); -extern void (APIENTRY * bglTexCoord2d)( GLdouble s, GLdouble t ); -extern void (APIENTRY * bglTexCoord2f)( GLfloat s, GLfloat t ); - -// Lighting -extern void (APIENTRY * bglShadeModel)( GLenum mode ); - -// Raster funcs -extern void (APIENTRY * bglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ); - -// Texture mapping -extern void (APIENTRY * bglTexEnvf)( GLenum target, GLenum pname, GLfloat param ); -extern void (APIENTRY * bglGenTextures)( GLsizei n, GLuint *textures ); // 1.1 -extern void (APIENTRY * bglDeleteTextures)( GLsizei n, const GLuint *textures); // 1.1 -extern void (APIENTRY * bglBindTexture)( GLenum target, GLuint texture ); // 1.1 -extern void (APIENTRY * bglTexImage2D)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); -extern void (APIENTRY * bglCopyTexImage2D)( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); -extern void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -extern void (APIENTRY * bglTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); // 1.1 -extern void (APIENTRY * bglTexParameterf)( GLenum target, GLenum pname, GLfloat param ); -extern void (APIENTRY * bglTexParameteri)( GLenum target, GLenum pname, GLint param ); -extern void (APIENTRY * bglGetTexLevelParameteriv)( GLenum target, GLint level, GLenum pname, GLint *params ); -extern void (APIENTRY * bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -extern void (APIENTRY * bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *); -extern void (APIENTRY * bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); - -// Fog -extern void (APIENTRY * bglFogf)( GLenum pname, GLfloat param ); -extern void (APIENTRY * bglFogi)( GLenum pname, GLint param ); -extern void (APIENTRY * bglFogfv)( GLenum pname, const GLfloat *params ); +extern void (APIENTRY * bglRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +extern void (APIENTRY * bglScalef)(GLfloat x, GLfloat y, GLfloat z); +extern void (APIENTRY * bglTranslatef)(GLfloat x, GLfloat y, GLfloat z); + +// Drawing +extern void (APIENTRY * bglBegin)( GLenum mode ); +extern void (APIENTRY * bglEnd)( void ); +extern void (APIENTRY * bglVertex2f)( GLfloat x, GLfloat y ); +extern void (APIENTRY * bglVertex2i)( GLint x, GLint y ); +extern void (APIENTRY * bglVertex3f)( GLfloat x, GLfloat y, GLfloat z ); +extern void (APIENTRY * bglVertex3d)( GLdouble x, GLdouble y, GLdouble z ); +extern void (APIENTRY * bglVertex3fv)( const GLfloat *v ); +extern void (APIENTRY * bglVertex3dv)( const GLdouble *v ); +extern void (APIENTRY * bglColor4f)( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); +extern void (APIENTRY * bglColor4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ); +extern void (APIENTRY * bglTexCoord2d)( GLdouble s, GLdouble t ); +extern void (APIENTRY * bglTexCoord2f)( GLfloat s, GLfloat t ); + +// Lighting +extern void (APIENTRY * bglShadeModel)( GLenum mode ); + +// Raster funcs +extern void (APIENTRY * bglReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ); + +// Texture mapping +extern void (APIENTRY * bglTexEnvf)( GLenum target, GLenum pname, GLfloat param ); +extern void (APIENTRY * bglGenTextures)( GLsizei n, GLuint *textures ); // 1.1 +extern void (APIENTRY * bglDeleteTextures)( GLsizei n, const GLuint *textures); // 1.1 +extern void (APIENTRY * bglBindTexture)( GLenum target, GLuint texture ); // 1.1 +extern void (APIENTRY * bglTexImage2D)( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); +extern void (APIENTRY * bglCopyTexImage2D)( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ); +extern void (APIENTRY * bglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +extern void (APIENTRY * bglTexSubImage2D)( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ); // 1.1 +extern void (APIENTRY * bglTexParameterf)( GLenum target, GLenum pname, GLfloat param ); +extern void (APIENTRY * bglTexParameteri)( GLenum target, GLenum pname, GLint param ); +extern void (APIENTRY * bglGetTexLevelParameteriv)( GLenum target, GLint level, GLenum pname, GLint *params ); +extern void (APIENTRY * bglCompressedTexImage2DARB)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +extern void (APIENTRY * bglGetCompressedTexImageARB)(GLenum, GLint, GLvoid *); +extern void (APIENTRY * bglTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params); + +// Fog +extern void (APIENTRY * bglFogf)( GLenum pname, GLfloat param ); +extern void (APIENTRY * bglFogi)( GLenum pname, GLint param ); +extern void (APIENTRY * bglFogfv)( GLenum pname, const GLfloat *params ); // Display Lists extern void (APIENTRY * bglNewList)(GLuint list, GLenum mode); @@ -157,10 +157,10 @@ extern void (APIENTRY * bglMultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat // Frame Buffer Objects extern void (APIENTRY * bglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers); -extern void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer); -extern void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -extern GLenum (APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target); -extern void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); +extern void (APIENTRY * bglBindFramebufferEXT)(GLenum target, GLuint framebuffer); +extern void (APIENTRY * bglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +extern GLenum (APIENTRY * bglCheckFramebufferStatusEXT)(GLenum target); +extern void (APIENTRY * bglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); // GLU extern void (APIENTRY * bgluTessBeginContour) (GLUtesselator* tess); @@ -174,27 +174,27 @@ extern void (APIENTRY * bgluTessVertex) (GLUtesselator* tess, GLdouble *location extern GLUtesselator* (APIENTRY * bgluNewTess) (void); extern void (APIENTRY * bgluPerspective) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); extern const GLubyte * (APIENTRY * bgluErrorString) (GLenum error); - -#ifdef RENDERTYPEWIN -// Windows -extern HGLRC (WINAPI * bwglCreateContext)(HDC); -extern BOOL (WINAPI * bwglDeleteContext)(HGLRC); -extern PROC (WINAPI * bwglGetProcAddress)(LPCSTR); -extern BOOL (WINAPI * bwglMakeCurrent)(HDC,HGLRC); - -extern BOOL (WINAPI * bwglSwapBuffers)(HDC); -extern int (WINAPI * bwglChoosePixelFormat)(HDC,CONST PIXELFORMATDESCRIPTOR*); -extern int (WINAPI * bwglDescribePixelFormat)(HDC,int,UINT,LPPIXELFORMATDESCRIPTOR); -extern int (WINAPI * bwglGetPixelFormat)(HDC); -extern BOOL (WINAPI * bwglSetPixelFormat)(HDC,int,const PIXELFORMATDESCRIPTOR*); -#endif - -#endif //USE_OPENGL - -extern char *gldriver; - -int loadgldriver(const char *driver); -int loadglextensions(void); -int unloadgldriver(void); + +#ifdef RENDERTYPEWIN +// Windows +extern HGLRC (WINAPI * bwglCreateContext)(HDC); +extern BOOL (WINAPI * bwglDeleteContext)(HGLRC); +extern PROC (WINAPI * bwglGetProcAddress)(LPCSTR); +extern BOOL (WINAPI * bwglMakeCurrent)(HDC,HGLRC); + +extern BOOL (WINAPI * bwglSwapBuffers)(HDC); +extern int (WINAPI * bwglChoosePixelFormat)(HDC,CONST PIXELFORMATDESCRIPTOR*); +extern int (WINAPI * bwglDescribePixelFormat)(HDC,int,UINT,LPPIXELFORMATDESCRIPTOR); +extern int (WINAPI * bwglGetPixelFormat)(HDC); +extern BOOL (WINAPI * bwglSetPixelFormat)(HDC,int,const PIXELFORMATDESCRIPTOR*); +#endif + +#endif //USE_OPENGL + +extern char *gldriver; + +int loadgldriver(const char *driver); +int loadglextensions(void); +int unloadgldriver(void); int loadglulibrary(const char *driver); int unloadglulibrary(void); diff --git a/polymer/build/include/kplib.h b/polymer/build/include/kplib.h index 20aaa6b6e..32f063ec8 100644 --- a/polymer/build/include/kplib.h +++ b/polymer/build/include/kplib.h @@ -1,21 +1,21 @@ - //High-level (easy) picture loading function: -extern void kpzload (const char *, long *, long *, long *, long *); - //Low-level PNG/JPG functions: -extern void kpgetdim (const char *, long, long *, long *); -extern long kprender (const char *, long, long, long, long, long, long, long); - - //ZIP functions: -extern long kzaddstack (const char *); -extern void kzuninit (); -extern long kzopen (const char *); -extern long kzread (void *, long); -extern long kzfilelength (); -extern long kzseek (long, long); -extern long kztell (); -extern long kzgetc (); -extern long kzeof (); -extern void kzclose (); - -extern void kzfindfilestart (const char *); //pass wildcard string -extern long kzfindfile (char *); //you alloc buf, returns 1:found,0:~found - + //High-level (easy) picture loading function: +extern void kpzload (const char *, long *, long *, long *, long *); + //Low-level PNG/JPG functions: +extern void kpgetdim (const char *, long, long *, long *); +extern long kprender (const char *, long, long, long, long, long, long, long); + + //ZIP functions: +extern long kzaddstack (const char *); +extern void kzuninit (); +extern long kzopen (const char *); +extern long kzread (void *, long); +extern long kzfilelength (); +extern long kzseek (long, long); +extern long kztell (); +extern long kzgetc (); +extern long kzeof (); +extern void kzclose (); + +extern void kzfindfilestart (const char *); //pass wildcard string +extern long kzfindfile (char *); //you alloc buf, returns 1:found,0:~found + diff --git a/polymer/build/include/mmulti.h b/polymer/build/include/mmulti.h index b2c646276..5d5698631 100644 --- a/polymer/build/include/mmulti.h +++ b/polymer/build/include/mmulti.h @@ -1,34 +1,34 @@ -// mmulti.h - -#ifndef __mmulti_h__ -#define __mmulti_h__ - -#define MAXMULTIPLAYERS 16 - -extern long myconnectindex, numplayers; -extern long connecthead, connectpoint2[MAXMULTIPLAYERS]; -extern char syncstate; -extern int natfree; //Addfaz NatFree - -long initmultiplayersparms(long argc, char **argv); -long initmultiplayerscycle(void); - -void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority); -void setpackettimeout(long datimeoutcount, long daresendagaincount); -void uninitmultiplayers(void); -void sendlogon(void); -void sendlogoff(void); -long getoutputcirclesize(void); -void setsocket(short newsocket); -void sendpacket(long other, char *bufptr, long messleng); -long getpacket(long *other, char *bufptr); -void flushpackets(void); -void genericmultifunction(long other, char *bufptr, long messleng, long command); -long isvalidipaddress(char *st); - -void nfIncCP(void); //Addfaz NatFree -int nfCheckHF (long other); //Addfaz NatFree -int nfCheckCP(long other); //Addfaz NatFree - -#endif // __mmulti_h__ - +// mmulti.h + +#ifndef __mmulti_h__ +#define __mmulti_h__ + +#define MAXMULTIPLAYERS 16 + +extern long myconnectindex, numplayers; +extern long connecthead, connectpoint2[MAXMULTIPLAYERS]; +extern char syncstate; +extern int natfree; //Addfaz NatFree + +long initmultiplayersparms(long argc, char **argv); +long initmultiplayerscycle(void); + +void initmultiplayers(long argc, char **argv, char damultioption, char dacomrateoption, char dapriority); +void setpackettimeout(long datimeoutcount, long daresendagaincount); +void uninitmultiplayers(void); +void sendlogon(void); +void sendlogoff(void); +long getoutputcirclesize(void); +void setsocket(short newsocket); +void sendpacket(long other, char *bufptr, long messleng); +long getpacket(long *other, char *bufptr); +void flushpackets(void); +void genericmultifunction(long other, char *bufptr, long messleng, long command); +long isvalidipaddress(char *st); + +void nfIncCP(void); //Addfaz NatFree +int nfCheckHF (long other); //Addfaz NatFree +int nfCheckCP(long other); //Addfaz NatFree + +#endif // __mmulti_h__ + diff --git a/polymer/build/include/mmultimsgs.h b/polymer/build/include/mmultimsgs.h index 350ac2ce1..9fb1adb87 100644 --- a/polymer/build/include/mmultimsgs.h +++ b/polymer/build/include/mmultimsgs.h @@ -1,65 +1,65 @@ -#ifndef __MMULTIMSGS_H__ -#define __MMULTIMSGS_H__ - -/* - * Ok, so this header file defines the message bytes and outlines the basic - * message descriptions for out-of-band messages that are common to all games - * that utilize my net code. Once a game determines that it is indeed talking - * to another peer of the same genus, the rest is up to the game itself to - * decide, but for basic stuff, the interfaces will be identical. - * - * Why am I not choosing to implement all this engine-side? Because all the - * games are different and about the only thing they are guaranteed to use in - * common that I can be certain of is the services my net code will provide. - * So, since I can't code anything in particular with every Build game in mind, - * I'm putting handling all the game-visible messages into the game's domain. - * The engine will still handle its own internal messages because the game - * never sees them. Ever. - * - * CMDs are messages sent by a peer to another, and RSPs are the replies. - * - * The master of the network game, regardless if the eventual game is talking - * with a peer-to-peer design or not, shall enumerate each peer as it joins - * and the master will always assign itself peer number 0. This simplifies - * things all-round because each peer that joins automatically knows that - * id 0 is its master and it already knows the master's address. Technically - * every other peer who joins may get a sequential number for its id so maybe - * even transmitting the peer unique ids is unnecessary and we'd be easier - * just sending a number of players, but the less craftiness at this point - * in time, the better. - * - * -- Jonathon - */ - -#define MSGPROTOVER 0x00 - // 0x00 20031209 - - -#define MSG_CMD_GETGAMEINFO 0x10 - // char MSG_CMD_GETGAMEINFO - // char MSGPROTOVER -#define MSG_RSP_BADPROTO 0x11 - // char MSG_RSP_BADPROTO -#define MSG_RSP_NOGAME 0x12 - // char MSG_RSP_NOGAME - // char[8] gamename -#define MSG_RSP_GAMEINFO 0x13 - // char MSG_RSP_GAMEINFO - // char[8] gamename eg. DUKE3DSW/DUKE3D\x00\x00/DUKE3DAT - // ... other information particular to the game - - -#define MSG_CMD_JOINGAME 0x20 - // char MSG_CMD_JOINGAME -#define MSG_RSP_GAMEINPROG 0x21 - // char MSG_RSP_GAMEINPROG -#define MSG_RSP_JOINACCEPTED 0x22 - // char MSG_RSP_JOINACCEPTED - // short uniqueid - // char numtofollow - // short[numtofollow] peeruid - // ... other information particular to the game -#define MSG_RSP_GAMEFULL 0x23 - // char MSG_RSP_GAMEFULL - -#endif +#ifndef __MMULTIMSGS_H__ +#define __MMULTIMSGS_H__ + +/* + * Ok, so this header file defines the message bytes and outlines the basic + * message descriptions for out-of-band messages that are common to all games + * that utilize my net code. Once a game determines that it is indeed talking + * to another peer of the same genus, the rest is up to the game itself to + * decide, but for basic stuff, the interfaces will be identical. + * + * Why am I not choosing to implement all this engine-side? Because all the + * games are different and about the only thing they are guaranteed to use in + * common that I can be certain of is the services my net code will provide. + * So, since I can't code anything in particular with every Build game in mind, + * I'm putting handling all the game-visible messages into the game's domain. + * The engine will still handle its own internal messages because the game + * never sees them. Ever. + * + * CMDs are messages sent by a peer to another, and RSPs are the replies. + * + * The master of the network game, regardless if the eventual game is talking + * with a peer-to-peer design or not, shall enumerate each peer as it joins + * and the master will always assign itself peer number 0. This simplifies + * things all-round because each peer that joins automatically knows that + * id 0 is its master and it already knows the master's address. Technically + * every other peer who joins may get a sequential number for its id so maybe + * even transmitting the peer unique ids is unnecessary and we'd be easier + * just sending a number of players, but the less craftiness at this point + * in time, the better. + * + * -- Jonathon + */ + +#define MSGPROTOVER 0x00 + // 0x00 20031209 + + +#define MSG_CMD_GETGAMEINFO 0x10 + // char MSG_CMD_GETGAMEINFO + // char MSGPROTOVER +#define MSG_RSP_BADPROTO 0x11 + // char MSG_RSP_BADPROTO +#define MSG_RSP_NOGAME 0x12 + // char MSG_RSP_NOGAME + // char[8] gamename +#define MSG_RSP_GAMEINFO 0x13 + // char MSG_RSP_GAMEINFO + // char[8] gamename eg. DUKE3DSW/DUKE3D\x00\x00/DUKE3DAT + // ... other information particular to the game + + +#define MSG_CMD_JOINGAME 0x20 + // char MSG_CMD_JOINGAME +#define MSG_RSP_GAMEINPROG 0x21 + // char MSG_RSP_GAMEINPROG +#define MSG_RSP_JOINACCEPTED 0x22 + // char MSG_RSP_JOINACCEPTED + // short uniqueid + // char numtofollow + // short[numtofollow] peeruid + // ... other information particular to the game +#define MSG_RSP_GAMEFULL 0x23 + // char MSG_RSP_GAMEFULL + +#endif diff --git a/polymer/build/include/polymer.h b/polymer/build/include/polymer.h index 207d2aca3..aaddbba85 100644 --- a/polymer/build/include/polymer.h +++ b/polymer/build/include/polymer.h @@ -1,43 +1,43 @@ -// here lies the GREAT JUSTICE RENDERER -// TODO : -// - recursive drawrooms with cliplane stack (support for full portal engine with occlusion queries) -// - crossed walls (tier drops stones) -// - skies -// - mirrors -// - fullbright (multitexture OR) -// - masks and sprites ! (use sortcnt and regular drawmask or recode it ?) -// - classic shading -// --------------------- CLASSIC LIMIT --------------------- -// - mdsprites (tags) -// - lights (dynamic phong) -// - dynamic shadowmaps -// - normalmap palette (unified gpu program, parallax mapping) -// - shadow volumes -// - hardware particles -// - multitextured decals ? (on models too) -// --------------- FIRST PUBLIC RELEASE LIMIT -------------- -// - horizon mapping (precalculate the horizon maps and store them into the gl cache ?) -// - post processing ([HDR-]bloom and possibly DOF) -// - MD5 (hardware skinning ?) - -#ifndef _polymer_h_ -# define _polymer_h_ - -# include "compat.h" -# include "build.h" -# include "glbuild.h" -# include "osd.h" -# include "polymost.h" +// here lies the GREAT JUSTICE RENDERER +// TODO : +// - recursive drawrooms with cliplane stack (support for full portal engine with occlusion queries) +// - crossed walls (tier drops stones) +// - skies +// - mirrors +// - fullbright (multitexture OR) +// - masks and sprites ! (use sortcnt and regular drawmask or recode it ?) +// - classic shading +// --------------------- CLASSIC LIMIT --------------------- +// - mdsprites (tags) +// - lights (dynamic phong) +// - dynamic shadowmaps +// - normalmap palette (unified gpu program, parallax mapping) +// - shadow volumes +// - hardware particles +// - multitextured decals ? (on models too) +// --------------- FIRST PUBLIC RELEASE LIMIT -------------- +// - horizon mapping (precalculate the horizon maps and store them into the gl cache ?) +// - post processing ([HDR-]bloom and possibly DOF) +// - MD5 (hardware skinning ?) + +#ifndef _polymer_h_ +# define _polymer_h_ + +# include "compat.h" +# include "build.h" +# include "glbuild.h" +# include "osd.h" +# include "polymost.h" # include "pragmas.h" -// CVARS +// CVARS extern int pr_cliplanes; -extern int pr_fov; +extern int pr_fov; extern int pr_frustumculling; -extern int pr_verbosity; -extern int pr_wireframe; - -// DATA +extern int pr_verbosity; +extern int pr_wireframe; + +// DATA typedef struct s_prsector { // geometry GLdouble* verts; @@ -74,12 +74,12 @@ typedef struct s_cliplane { _point2d ref; } _cliplane; -extern _prsector* prsectors[MAXSECTORS]; -extern _prwall* prwalls[MAXWALLS]; - -// CONTROL +extern _prsector* prsectors[MAXSECTORS]; +extern _prwall* prwalls[MAXWALLS]; + +// CONTROL extern int updatesectors; - + // EXTERNAL FUNCTIONS int polymer_init(void); void polymer_glinit(void); @@ -99,17 +99,17 @@ int polymer_buildfloor(short sectnum); void polymer_drawsector(short sectnum); // WALLS int polymer_initwall(short wallnum); -void polymer_updatewall(short wallnum); -void polymer_drawwall(short wallnum); +void polymer_updatewall(short wallnum); +void polymer_drawwall(short wallnum); // HSR void polymer_extractfrustum(void); int polymer_portalinfrustum(short wallnum); void polymer_addcliplane(_equation clip, _equation left, _equation right, float refx, float refy); -int polymer_wallincliplanes(short wallnum); +int polymer_wallincliplanes(short wallnum); // SKIES void polymer_initskybox(void); void polymer_getsky(void); void polymer_drawskyquad(int p1, int p2, GLfloat height); -void polymer_drawartsky(short tilenum); - -#endif // !_polymer_h_ +void polymer_drawartsky(short tilenum); + +#endif // !_polymer_h_ diff --git a/polymer/build/include/polymost.h b/polymer/build/include/polymost.h index fe59c2134..7c2d14d85 100644 --- a/polymer/build/include/polymost.h +++ b/polymer/build/include/polymost.h @@ -1,5 +1,5 @@ -#ifndef _polymost_h_ -# define _polymost_h_ +#ifndef _polymost_h_ +# define _polymost_h_ # include "glbuild.h" @@ -30,11 +30,11 @@ typedef struct pthtyp_t unsigned short sizx, sizy; float scalex, scaley; struct pthtyp_t *ofb; // only fullbright -} pthtyp; - +} pthtyp; + pthtyp * gltexcache (long dapicnum, long dapalnum, long dameth); - + extern palette_t hictinting[MAXPALOOKUPS]; extern float gtang; - -#endif // !_polymost_h_ + +#endif // !_polymost_h_ diff --git a/polymer/build/include/scriptfile.h b/polymer/build/include/scriptfile.h index c27c46d2d..5027a1bc7 100644 --- a/polymer/build/include/scriptfile.h +++ b/polymer/build/include/scriptfile.h @@ -1,27 +1,27 @@ -typedef struct { - char *textbuf; - unsigned int textlength; - char *ltextptr; // pointer to start of the last token fetched (use this for line numbers) - char *textptr; - char *eof; - char *filename; - int linenum; - long *lineoffs; -} scriptfile; - -char *scriptfile_gettoken(scriptfile *sf); -int scriptfile_getnumber(scriptfile *sf, int *num); -int scriptfile_getdouble(scriptfile *sf, double *num); -int scriptfile_getstring(scriptfile *sf, char **st); -int scriptfile_getsymbol(scriptfile *sf, int *num); -int scriptfile_getlinum(scriptfile *sf, char *ptr); -int scriptfile_getbraces(scriptfile *sf, char **braceend); - -scriptfile *scriptfile_fromfile(char *fn); -scriptfile *scriptfile_fromstring(char *string); -void scriptfile_close(scriptfile *sf); -int scriptfile_eof(scriptfile *sf); - -int scriptfile_getsymbolvalue(char *name, int *val); -int scriptfile_addsymbolvalue(char *name, int val); -void scriptfile_clearsymbols(void); +typedef struct { + char *textbuf; + unsigned int textlength; + char *ltextptr; // pointer to start of the last token fetched (use this for line numbers) + char *textptr; + char *eof; + char *filename; + int linenum; + long *lineoffs; +} scriptfile; + +char *scriptfile_gettoken(scriptfile *sf); +int scriptfile_getnumber(scriptfile *sf, int *num); +int scriptfile_getdouble(scriptfile *sf, double *num); +int scriptfile_getstring(scriptfile *sf, char **st); +int scriptfile_getsymbol(scriptfile *sf, int *num); +int scriptfile_getlinum(scriptfile *sf, char *ptr); +int scriptfile_getbraces(scriptfile *sf, char **braceend); + +scriptfile *scriptfile_fromfile(char *fn); +scriptfile *scriptfile_fromstring(char *string); +void scriptfile_close(scriptfile *sf); +int scriptfile_eof(scriptfile *sf); + +int scriptfile_getsymbolvalue(char *name, int *val); +int scriptfile_addsymbolvalue(char *name, int val); +void scriptfile_clearsymbols(void);