Remove jmact/types.h in favor of standardized inttypes.h stuff

git-svn-id: https://svn.eduke32.com/eduke32@1346 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-04-26 05:57:42 +00:00
parent d419b6e0c9
commit 7c036eb073
43 changed files with 759 additions and 868 deletions

View file

@ -1,4 +1,4 @@
duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/types.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(SRC)/jaudiolib/fx_man.h $(SRC)/jaudiolib/music.h $(INC)/namesdyn.h $(INC)/funct.h $(INC)/duke3d.h duke3d_h=$(EINC)/build.h $(EINC)/polymer.h $(EINC)/pragmas.h $(EINC)/compat.h $(EINC)/cache1d.h $(EINC)/baselayer.h $(SRC)/jmact/file_lib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/control.h $(INC)/gamedefs.h $(INC)/function.h $(INC)/config.h $(INC)/sounds.h $(INC)/rts.h $(INC)/_rts.h $(INC)/soundefs.h $(SRC)/jaudiolib/fx_man.h $(SRC)/jaudiolib/music.h $(INC)/namesdyn.h $(INC)/funct.h $(INC)/duke3d.h
gamedef_h=$(SRC)/gamedef.h gamedef_h=$(SRC)/gamedef.h
$(OBJ)/game.$o: $(SRC)/game.c $(SRC)/sync.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h $(OBJ)/game.$o: $(SRC)/game.c $(SRC)/sync.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h
@ -37,14 +37,14 @@ $(OBJ)/startgtk.game.$o: $(SRC)/startgtk.game.c $(duke3d_h) $(EINC)/dynamicgtk.h
# jMACT objects # jMACT objects
$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/types.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/animlib.h $(EINC)/compat.h $(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/util_lib.h $(SRC)/jmact/animlib.h $(EINC)/compat.h
$(OBJ)/util_lib.$o: $(SRC)/jmact/util_lib.c $(SRC)/jmact/util_lib.h $(SRC)/jmact/types.h $(EINC)/compat.h $(OBJ)/util_lib.$o: $(SRC)/jmact/util_lib.c $(SRC)/jmact/util_lib.h $(EINC)/compat.h
$(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h $(SRC)/jmact/types.h $(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h
$(OBJ)/control.$o: $(SRC)/jmact/control.c $(SRC)/jmact/types.h $(SRC)/jmact/control.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/mouse.h $(EINC)/baselayer.h $(OBJ)/control.$o: $(SRC)/jmact/control.c $(SRC)/jmact/control.h $(SRC)/jmact/keyboard.h $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
$(OBJ)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/types.h $(SRC)/jmact/keyboard.h $(EINC)/compat.h $(EINC)/baselayer.h $(OBJ)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/keyboard.h $(EINC)/compat.h $(EINC)/baselayer.h
$(OBJ)/mouse.$o: $(SRC)/jmact/mouse.c $(SRC)/jmact/types.h $(SRC)/jmact/mouse.h $(EINC)/baselayer.h $(OBJ)/mouse.$o: $(SRC)/jmact/mouse.c $(SRC)/jmact/mouse.h $(EINC)/baselayer.h
$(OBJ)/mathutil.$o: $(SRC)/jmact/mathutil.c $(SRC)/jmact/types.h $(OBJ)/mathutil.$o: $(SRC)/jmact/mathutil.c
$(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/_scrplib.h $(SRC)/jmact/types.h $(EINC)/compat.h $(OBJ)/scriplib.$o: $(SRC)/jmact/scriplib.c $(SRC)/jmact/scriplib.h $(SRC)/jmact/util_lib.h $(SRC)/jmact/_scrplib.h $(EINC)/compat.h
# jAudioLib objects # jAudioLib objects
$(OBJ)/audiolib_fxstub.$o: $(SRC)/jaudiolib/audiolib_fxstub.c $(SRC)/jaudiolib/fx_man.h $(OBJ)/audiolib_fxstub.$o: $(SRC)/jaudiolib/audiolib_fxstub.c $(SRC)/jaudiolib/fx_man.h

View file

@ -25,6 +25,14 @@
# include "msvc/inttypes.h" // from http://code.google.com/p/msinttypes/ # include "msvc/inttypes.h" // from http://code.google.com/p/msinttypes/
#endif #endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
// Define this to rewrite all 'B' versions to library functions. This // Define this to rewrite all 'B' versions to library functions. This
// is for platforms which give us a standard sort of C library so we // is for platforms which give us a standard sort of C library so we
// link directly. Platforms like PalmOS which don't have a standard C // link directly. Platforms like PalmOS which don't have a standard C
@ -301,9 +309,9 @@ static inline uint64 B_SWAP64(uint64 l) { return (l>>56)|((l>>40)&0xff00)|((l>>2
struct Bdirent { struct Bdirent {
uint16_t namlen; uint16_t namlen;
char *name; char *name;
unsigned mode; uint32_t mode;
unsigned size; uint32_t size;
unsigned mtime; uint32_t mtime;
}; };
typedef void BDIR; typedef void BDIR;
@ -319,7 +327,7 @@ int32_t Bclosedir(BDIR *dir);
#else #else
typedef void BFILE; typedef void BFILE;
typedef uint32_t bsize_t; typedef uint32_t bsize_t;
typedef signed int32_t bssize_t; typedef int32_t bssize_t;
#endif #endif

View file

@ -27,7 +27,7 @@ typedef struct _mdanim_t
typedef struct _mdskinmap_t typedef struct _mdskinmap_t
{ {
unsigned char palette, filler[3]; // Build palette number uint8_t palette, filler[3]; // Build palette number
int32_t skinnum, surfnum; // Skin identifier, surface number int32_t skinnum, surfnum; // Skin identifier, surface number
char *fn; // Skin filename char *fn; // Skin filename
GLuint texid[HICEFFECTMASK+1]; // OpenGL texture numbers for effect variations GLuint texid[HICEFFECTMASK+1]; // OpenGL texture numbers for effect variations
@ -50,7 +50,7 @@ typedef struct
int32_t ofsskins, ofsuv, ofstris, ofsframes, ofsglcmds, ofseof; //ofsskins: skin names (64 bytes each) int32_t ofsskins, ofsuv, ofstris, ofsframes, ofsglcmds, ofseof; //ofsskins: skin names (64 bytes each)
} md2head_t; } md2head_t;
typedef struct { unsigned char v[3], ni; } md2vert_t; //compressed vertex coords (x,y,z) typedef struct { uint8_t v[3], ni; } md2vert_t; //compressed vertex coords (x,y,z)
typedef struct typedef struct
{ {
point3d mul, add; //scale&translation vector point3d mul, add; //scale&translation vector
@ -93,7 +93,7 @@ typedef struct
typedef struct { char nam[64]; int32_t i; } md3shader_t; //ascz path of shader, shader index typedef struct { char nam[64]; int32_t i; } md3shader_t; //ascz path of shader, shader index
typedef struct { int32_t i[3]; } md3tri_t; //indices of tri typedef struct { int32_t i[3]; } md3tri_t; //indices of tri
typedef struct { float u, v; } md3uv_t; typedef struct { float u, v; } md3uv_t;
typedef struct { int16_t x, y, z; unsigned char nlat, nlng; } md3xyzn_t; //xyz are [10:6] ints typedef struct { int16_t x, y, z; uint8_t nlat, nlng; } md3xyzn_t; //xyz are [10:6] ints
typedef struct typedef struct
{ {
@ -182,7 +182,7 @@ typedef struct
#define VOXBORDWIDTH 1 //use 0 to save memory, but has texture artifacts; 1 looks better... #define VOXBORDWIDTH 1 //use 0 to save memory, but has texture artifacts; 1 looks better...
#define VOXUSECHAR 0 #define VOXUSECHAR 0
#if (VOXUSECHAR != 0) #if (VOXUSECHAR != 0)
typedef struct { unsigned char x, y, z, u, v; } vert_t; typedef struct { uint8_t x, y, z, u, v; } vert_t;
#else #else
typedef struct { uint16_t x, y, z, u, v; } vert_t; typedef struct { uint16_t x, y, z, u, v; } vert_t;
#endif #endif

View file

@ -97,7 +97,7 @@ void initcache(intptr_t dacachestart, int32_t dacachesize)
//printf("BEFORE: cachestart = %x, cachesize = %d\n", dacachestart, dacachesize); //printf("BEFORE: cachestart = %x, cachesize = %d\n", dacachestart, dacachesize);
cachestart = ((uintptr_t)dacachestart+15)&~(uintptr_t)0xf; cachestart = ((uintptr_t)dacachestart+15)&~(uintptr_t)0xf;
cachesize = (dacachesize-((-(uintptr_t)(dacachestart))&0xf))&~(uintptr_t)0xf; cachesize = (dacachesize-(((uintptr_t)(dacachestart))&0xf))&~(uintptr_t)0xf;
//printf("AFTER : cachestart = %x, cachesize = %d\n", cachestart, cachesize); //printf("AFTER : cachestart = %x, cachesize = %d\n", cachestart, cachesize);
cac[0].leng = cachesize; cac[0].leng = cachesize;

View file

@ -768,10 +768,6 @@
RelativePath=".\source\jmact\scriplib.h" RelativePath=".\source\jmact\scriplib.h"
> >
</File> </File>
<File
RelativePath=".\source\jmact\types.h"
>
</File>
<File <File
RelativePath=".\source\jmact\util_lib.h" RelativePath=".\source\jmact\util_lib.h"
> >

View file

@ -32,20 +32,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct typedef struct
{ {
char name[8]; char name[8];
int32 handle,position,size; int32_t handle,position,size;
} lumpinfo_t; } lumpinfo_t;
typedef struct typedef struct
{ {
char identification[4]; // should be IWAD char identification[4]; // should be IWAD
int32 numlumps; int32_t numlumps;
int32 infotableofs; int32_t infotableofs;
} wadinfo_t; } wadinfo_t;
typedef struct typedef struct
{ {
int32 filepos; int32_t filepos;
int32 size; int32_t size;
char name[8]; char name[8];
} filelump_t; } filelump_t;

View file

@ -1135,7 +1135,7 @@ static void G_MoveFX(void)
{ {
j = s->lotag+((unsigned)g_globalRandom%(s->hitag+1)); j = s->lotag+((unsigned)g_globalRandom%(s->hitag+1));
S_PlaySound(j); S_PlaySound(j);
T5 = 26*40 + (g_globalRandom%(26*40)); T5 = GAMETICSPERSEC*40 + (g_globalRandom%(GAMETICSPERSEC*40));
} }
} }
} }
@ -3474,7 +3474,7 @@ static void G_MoveActors(void)
if (t[0] == 4) A_PlaySound(WAR_AMBIENCE2,i); if (t[0] == 4) A_PlaySound(WAR_AMBIENCE2,i);
if (t[0] > (26*8)) if (t[0] > (GAMETICSPERSEC*8))
{ {
S_PlaySound(RPG_EXPLODE); S_PlaySound(RPG_EXPLODE);
for (j=0; j<32; j++) RANDOMSCRAP; for (j=0; j<32; j++) RANDOMSCRAP;
@ -3732,7 +3732,7 @@ static void G_MoveActors(void)
A_Shoot(i,FIRELASER); A_Shoot(i,FIRELASER);
s->ang = a; s->ang = a;
} }
if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) if (t[2] > (GAMETICSPERSEC*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum))
{ {
t[0] = 0; t[0] = 0;
t[2] = 0; t[2] = 0;
@ -3755,7 +3755,7 @@ static void G_MoveActors(void)
else else
{ {
t[2]++; t[2]++;
if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) if (t[2] > (GAMETICSPERSEC*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum))
{ {
t[0] = 1; t[0] = 1;
t[2] = 0; t[2] = 0;
@ -3804,7 +3804,7 @@ static void G_MoveActors(void)
if (t[0] < 2) t[2]++; if (t[0] < 2) t[2]++;
if (x < 6144 && t[0] < 2 && t[2] > (26*4)) if (x < 6144 && t[0] < 2 && t[2] > (GAMETICSPERSEC*4))
{ {
t[0] = 2+(krand()&2); t[0] = 2+(krand()&2);
t[2] = 0; t[2] = 0;
@ -4777,7 +4777,7 @@ static void G_MoveMisc(void) // STATNUM 5
case BLOODSPLAT3__STATIC: case BLOODSPLAT3__STATIC:
case BLOODSPLAT4__STATIC: case BLOODSPLAT4__STATIC:
if (t[0] == 7*26) goto BOLT; if (t[0] == 7*GAMETICSPERSEC) goto BOLT;
s->z += 16+(krand()&15); s->z += 16+(krand()&15);
t[0]++; t[0]++;
if ((t[0]%9) == 0) s->yrepeat++; if ((t[0]%9) == 0) s->yrepeat++;
@ -4797,7 +4797,7 @@ static void G_MoveMisc(void) // STATNUM 5
s->picnum = NUKEBUTTON+2; s->picnum = NUKEBUTTON+2;
g_player[sprite[s->owner].yvel].ps->fist_incs = 1; g_player[sprite[s->owner].yvel].ps->fist_incs = 1;
} }
if (g_player[sprite[s->owner].yvel].ps->fist_incs == 26) if (g_player[sprite[s->owner].yvel].ps->fist_incs == GAMETICSPERSEC)
s->picnum = NUKEBUTTON+3; s->picnum = NUKEBUTTON+3;
} }
goto BOLT; goto BOLT;
@ -7444,7 +7444,7 @@ static void G_MoveEffectors(void) //STATNUM 3
{ {
if (t[0] == 1) if (t[0] == 1)
A_Shoot(i,sc->extra); A_Shoot(i,sc->extra);
else if (t[0] == 26*5) else if (t[0] == GAMETICSPERSEC*5)
t[0] = 0; t[0] = 0;
t[0]++; t[0]++;
} }

View file

@ -208,7 +208,7 @@ void G_PlayAnim(const char *fn,char t)
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
int32_t ogltexfiltermode=gltexfiltermode; int32_t ogltexfiltermode=gltexfiltermode;
#endif #endif
int32 handle=-1; int32_t handle=-1;
int32_t frametime = 0; int32_t frametime = 0;
// return; // return;

View file

@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mapster32.h" #include "mapster32.h"
#include "keys.h" #include "keys.h"
#include "types.h"
#include "keyboard.h" #include "keyboard.h"
#include "scriptfile.h" #include "scriptfile.h"
#include "crc32.h" #include "crc32.h"
@ -3517,9 +3517,9 @@ static inline void getnumber_doint16_t(int16_t *ptr, int32_t num)
*ptr = (int16_t) num; *ptr = (int16_t) num;
} }
static inline void getnumber_doint32(int32 *ptr, int32_t num) static inline void getnumber_doint32(int32_t *ptr, int32_t num)
{ {
*ptr = (int32) num; *ptr = (int32_t) num;
} }
static inline void getnumber_doint64(int64 *ptr, int32_t num) static inline void getnumber_doint64(int64 *ptr, int32_t num)
@ -3541,7 +3541,7 @@ void getnumberptr256(char *namestart, void *num, int32_t bytes, int32_t maxnumbe
danum = *(int16_t *)num; danum = *(int16_t *)num;
break; break;
case 4: case 4:
danum = *(int32 *)num; danum = *(int32_t *)num;
break; break;
case 8: case 8:
danum = *(int64 *)num; danum = *(int64 *)num;

View file

@ -53,9 +53,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
hashtable_t gamefuncH = { NUMGAMEFUNCTIONS<<1, NULL }; hashtable_t gamefuncH = { NUMGAMEFUNCTIONS<<1, NULL };
int32 CONFIG_FunctionNameToNum(char * func) int32_t CONFIG_FunctionNameToNum(char * func)
{ {
int32 i; int32_t i;
i = hash_find(&gamefuncH,func); i = hash_find(&gamefuncH,func);
@ -79,7 +79,7 @@ int32 CONFIG_FunctionNameToNum(char * func)
=================== ===================
*/ */
char * CONFIG_FunctionNumToName(int32 func) char * CONFIG_FunctionNumToName(int32_t func)
{ {
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS) if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return NULL; return NULL;
@ -95,7 +95,7 @@ char * CONFIG_FunctionNumToName(int32 func)
*/ */
int32 CONFIG_AnalogNameToNum(char * func) int32_t CONFIG_AnalogNameToNum(char * func)
{ {
if (!Bstrcasecmp(func,"analog_turning")) if (!Bstrcasecmp(func,"analog_turning"))
@ -119,7 +119,7 @@ int32 CONFIG_AnalogNameToNum(char * func)
} }
char * CONFIG_AnalogNumToName(int32 func) char * CONFIG_AnalogNumToName(int32_t func)
{ {
switch (func) switch (func)
{ {
@ -147,7 +147,7 @@ char * CONFIG_AnalogNumToName(int32 func)
void CONFIG_SetDefaultKeys(int32_t type) void CONFIG_SetDefaultKeys(int32_t type)
{ {
int32 i,f; int32_t i,f;
Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys)); Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys));
Bmemset(&KeyBindings,0,sizeof(KeyBindings)); Bmemset(&KeyBindings,0,sizeof(KeyBindings));
@ -155,7 +155,7 @@ void CONFIG_SetDefaultKeys(int32_t type)
if (type == 1) if (type == 1)
{ {
for (i=0; i < (int32)(sizeof(oldkeydefaults)/sizeof(oldkeydefaults[0])); i+=3) for (i=0; i < (int32_t)(sizeof(oldkeydefaults)/sizeof(oldkeydefaults[0])); i+=3)
{ {
f = CONFIG_FunctionNameToNum((char *)oldkeydefaults[i+0]); f = CONFIG_FunctionNameToNum((char *)oldkeydefaults[i+0]);
if (f == -1) continue; if (f == -1) continue;
@ -168,7 +168,7 @@ void CONFIG_SetDefaultKeys(int32_t type)
return; return;
} }
for (i=0; i < (int32)(sizeof(keydefaults)/sizeof(keydefaults[0])); i+=3) for (i=0; i < (int32_t)(sizeof(keydefaults)/sizeof(keydefaults[0])); i+=3)
{ {
f = CONFIG_FunctionNameToNum(keydefaults[i+0]); f = CONFIG_FunctionNameToNum(keydefaults[i+0]);
if (f == -1) continue; if (f == -1) continue;
@ -183,7 +183,7 @@ void CONFIG_SetDefaultKeys(int32_t type)
void CONFIG_SetDefaults(void) void CONFIG_SetDefaults(void)
{ {
// JBF 20031211 // JBF 20031211
int32 i; int32_t i;
ud.config.scripthandle = -1; ud.config.scripthandle = -1;
ud.config.ScreenWidth = 1024; ud.config.ScreenWidth = 1024;
@ -343,9 +343,9 @@ void CONFIG_SetDefaults(void)
void CONFIG_ReadKeys(void) void CONFIG_ReadKeys(void)
{ {
int32 i; int32_t i;
int32 numkeyentries; int32_t numkeyentries;
int32 function; int32_t function;
char keyname1[80]; char keyname1[80];
char keyname2[80]; char keyname2[80];
kb_scancode key1,key2; kb_scancode key1,key2;
@ -375,11 +375,11 @@ void CONFIG_ReadKeys(void)
key2 = 0xff; key2 = 0xff;
if (keyname1[0]) if (keyname1[0])
{ {
key1 = (byte) KB_StringToScanCode(keyname1); key1 = (uint8_t) KB_StringToScanCode(keyname1);
} }
if (keyname2[0]) if (keyname2[0])
{ {
key2 = (byte) KB_StringToScanCode(keyname2); key2 = (uint8_t) KB_StringToScanCode(keyname2);
} }
ud.config.KeyboardKeys[function][0] = key1; ud.config.KeyboardKeys[function][0] = key1;
ud.config.KeyboardKeys[function][1] = key2; ud.config.KeyboardKeys[function][1] = key2;
@ -396,7 +396,7 @@ void CONFIG_ReadKeys(void)
} }
// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup // wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup
void CONFIG_MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2) void CONFIG_MapKey(int32_t which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2)
{ {
int32_t i, j, k; int32_t i, j, k;
int32_t ii[] = { key1, key2, oldkey1, oldkey2 }; int32_t ii[] = { key1, key2, oldkey1, oldkey2 };
@ -444,10 +444,10 @@ void CONFIG_MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scanco
void CONFIG_SetupMouse(void) void CONFIG_SetupMouse(void)
{ {
int32 i; int32_t i;
char str[80]; char str[80];
char temp[80]; char temp[80];
int32 function, scale; int32_t function, scale;
if (ud.config.scripthandle < 0) return; if (ud.config.scripthandle < 0) return;
@ -519,10 +519,10 @@ void CONFIG_SetupMouse(void)
void CONFIG_SetupJoystick(void) void CONFIG_SetupJoystick(void)
{ {
int32 i; int32_t i;
char str[80]; char str[80];
char temp[80]; char temp[80];
int32 scale; int32_t scale;
if (ud.config.scripthandle < 0) return; if (ud.config.scripthandle < 0) return;
@ -605,11 +605,11 @@ extern char mod_dir[BMAX_PATH];
extern int32_t r_maxfps; extern int32_t r_maxfps;
extern int32_t g_noSetup; extern int32_t g_noSetup;
int32 CONFIG_ReadSetup(void) int32_t CONFIG_ReadSetup(void)
{ {
int32 dummy, i = 0; int32_t dummy, i = 0;
char commmacro[] = "CommbatMacro# "; char commmacro[] = "CommbatMacro# ";
extern int32 CommandWeaponChoice; extern int32_t CommandWeaponChoice;
char tempbuf[1024]; char tempbuf[1024];
CONTROL_ClearAssignments(); CONTROL_ClearAssignments();
@ -662,7 +662,7 @@ int32 CONFIG_ReadSetup(void)
#ifndef RANCID_NETWORKING #ifndef RANCID_NETWORKING
// The packetrate mechanism is specific to the eduke32 networking code // The packetrate mechanism is specific to the eduke32 networking code
SCRIPT_GetNumber(ud.config.scripthandle, "Comm Setup", "Rate",(int32 *)&packetrate); SCRIPT_GetNumber(ud.config.scripthandle, "Comm Setup", "Rate",(int32_t *)&packetrate);
packetrate = min(max(packetrate,50),1000); packetrate = min(max(packetrate,50),1000);
#endif #endif
@ -752,11 +752,11 @@ int32 CONFIG_ReadSetup(void)
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
{ {
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", (int32 *)&windowpos); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", (int32_t *)&windowpos);
windowx = -1; windowx = -1;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32 *)&windowx); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32_t *)&windowx);
windowy = -1; windowy = -1;
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32 *)&windowy); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32_t *)&windowy);
} }
#endif #endif
@ -771,7 +771,7 @@ int32 CONFIG_ReadSetup(void)
} }
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32_t*)&maxrefreshfreq);
#endif #endif
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
@ -912,7 +912,7 @@ int32 CONFIG_ReadSetup(void)
if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5; if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5;
} }
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32 *)&g_myAimMode); // (if toggle mode) gives state SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32_t *)&g_myAimMode); // (if toggle mode) gives state
{ {
SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AutoAim",&ud.config.AutoAim); // JBF 20031125 SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AutoAim",&ud.config.AutoAim); // JBF 20031125
@ -1009,7 +1009,7 @@ void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_binds.cfg
void CONFIG_WriteSetup(void) void CONFIG_WriteSetup(void)
{ {
int32 dummy; int32_t dummy;
char tempbuf[1024]; char tempbuf[1024];
if (!ud.config.setupread) return; if (!ud.config.setupread) return;
@ -1017,23 +1017,23 @@ void CONFIG_WriteSetup(void)
if (ud.config.scripthandle < 0) if (ud.config.scripthandle < 0)
ud.config.scripthandle = SCRIPT_Init(setupfilename); ud.config.scripthandle = SCRIPT_Init(setupfilename);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32_t) g_myAimMode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32_t) g_myAimMode,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AutoAim",ud.config.AutoAim,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","AutoAim",ud.config.AutoAim,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseAiming",ud.mouseaiming,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseBias",ud.config.MouseBias,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseBias",ud.config.MouseBias,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseDeadZone",ud.config.MouseDeadZone,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","MouseDeadZone",ud.config.MouseDeadZone,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","SmoothInput",ud.config.SmoothInput,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","SmoothInput",ud.config.SmoothInput,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseJoystick",ud.config.UseJoystick,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseJoystick",ud.config.UseJoystick,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseMouse",ud.config.UseMouse,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","UseMouse",ud.config.UseMouse,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AltHud",ud.althud,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AltHud",ud.althud,FALSE,FALSE);
// SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AngleInterpolation",ud.angleinterpolation,false,false); // SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AngleInterpolation",ud.angleinterpolation,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoMsg",ud.automsg,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoMsg",ud.automsg,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoVote",ud.autovote,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoVote",ud.autovote,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Color",ud.color,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Color",ud.color,FALSE,FALSE);
if (CrosshairColors.r != DefaultCrosshairColors.r || CrosshairColors.g != DefaultCrosshairColors.g if (CrosshairColors.r != DefaultCrosshairColors.r || CrosshairColors.g != DefaultCrosshairColors.g
|| CrosshairColors.b != DefaultCrosshairColors.b) || CrosshairColors.b != DefaultCrosshairColors.b)
@ -1042,95 +1042,95 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutString(ud.config.scripthandle, "Misc", "CrosshairColor",tempbuf); SCRIPT_PutString(ud.config.scripthandle, "Misc", "CrosshairColor",tempbuf);
} }
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "CrosshairScale",ud.crosshairscale,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "CrosshairScale",ud.crosshairscale,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Crosshairs",ud.crosshair,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DeathMessages",ud.obituaries,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DeathMessages",ud.obituaries,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DemoCams",ud.democams,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "DemoCams",ud.democams,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Executions",++ud.executions,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Executions",++ud.executions,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "IDPlayers",ud.idplayers,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "IDPlayers",ud.idplayers,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "MPMessageDisplayTime",ud.msgdisptime,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "RunMode",ud.config.RunMode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "RunMode",ud.config.RunMode,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowFPS",ud.tickrate,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowFPS",ud.tickrate,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowLevelStats",ud.levelstats,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowOpponentWeapons",ud.config.ShowOpponentWeapons,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowOpponentWeapons",ud.config.ShowOpponentWeapons,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ShowViewWeapon",ud.drawweapon,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarMode",ud.statusbarmode,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Team",ud.team,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Team",ud.team,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "TextScale",ud.textscale,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "TextScale",ud.textscale,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "UsePrecache",ud.config.useprecache,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "UsePrecache",ud.config.useprecache,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ViewBobbing",ud.viewbob,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ViewBobbing",ud.viewbob,FALSE,FALSE);
for (dummy=0; dummy<10; dummy++) for (dummy=0; dummy<10; dummy++)
{ {
Bsprintf(buf,"WeaponChoice%d",dummy); Bsprintf(buf,"WeaponChoice%d",dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc",buf,g_player[myconnectindex].wchoice[dummy],false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc",buf,g_player[myconnectindex].wchoice[dummy],FALSE,FALSE);
} }
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponScale",ud.weaponscale,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponScale",ud.weaponscale,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponSway",ud.weaponsway,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "WeaponSway",ud.weaponsway,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Setup","ConfigVersion",BYTEVERSION_JF,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Setup","ConfigVersion",BYTEVERSION_JF,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,FALSE,FALSE);
{ {
Bsprintf(tempbuf,"%.2f",r_ambientlight); Bsprintf(tempbuf,"%.2f",r_ambientlight);
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "AmbientLight",tempbuf); SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "AmbientLight",tempbuf);
} }
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Detail",ud.detail,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Detail",ud.detail,FALSE,FALSE);
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing",r_animsmoothing,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnimationSmoothing",r_animsmoothing,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,FALSE,FALSE);
/*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);*/ /*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDepthPeeling",r_depthpeeling,false,false);*/
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLDetailMapping", r_detailmapping,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLFullbrights", r_fullbrights,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLGlowMapping", r_glowmapping,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", r_modelocclusionchecking,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLOcclusionChecking", r_modelocclusionchecking,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyClamping",r_parallaxskyclamping,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLParallaxSkyPanning",r_parallaxskypanning,FALSE,FALSE);
/*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);*/ /*SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLPeelsCount",r_peelscount,false,false);*/
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLTextureQuality", r_downsize,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", r_vbocount,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOCount", r_vbocount,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", r_vbos,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVBOs", r_vbos,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVertexArrays", r_vertexarrays,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVSync", vsync,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLVSync", vsync,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "GLWidescreen",glwidescreen,FALSE,FALSE);
#endif #endif
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS", r_maxfps, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS", r_maxfps, FALSE, FALSE);
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,FALSE,FALSE);
#endif #endif
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Messages",ud.fta_on,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDHightile",osdhightile,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDHightile",osdhightile,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",OSD_GetTextMode(),false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "OSDTextMode",OSD_GetTextMode(),FALSE,FALSE);
if (!NAM) if (!NAM)
{ {
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Out",ud.lockout,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Out",ud.lockout,FALSE,FALSE);
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "Password",ud.pwlockout); SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "Password",ud.pwlockout);
} }
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP",ud.config.ScreenBPP,false,false); // JBF 20040523 SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP",ud.config.ScreenBPP,FALSE,FALSE); // JBF 20040523
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenHeight",ud.config.ScreenHeight,false,false); // JBF 20031206 SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenHeight",ud.config.ScreenHeight,FALSE,FALSE); // JBF 20031206
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenMode",ud.config.ScreenMode,false,false); // JBF 20031206 SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenMode",ud.config.ScreenMode,FALSE,FALSE); // JBF 20031206
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,false,false); // JBF 20031206 SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,FALSE,FALSE); // JBF 20031206
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Shadows",ud.shadows,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,FALSE,FALSE);
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseHightile",usehightile,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseHightile",usehightile,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseModels",usemodels,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseModels",usemodels,FALSE,FALSE);
#endif #endif
{ {
@ -1143,26 +1143,26 @@ void CONFIG_WriteSetup(void)
} }
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", windowpos, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPositioning", windowpos, FALSE, FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", windowx, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", windowx, FALSE, FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", windowy, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", windowy, FALSE, FALSE);
#endif #endif
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "AmbienceToggle",ud.config.AmbienceToggle,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "AmbienceToggle",ud.config.AmbienceToggle,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "FXVolume",ud.config.FXVolume,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "FXVolume",ud.config.FXVolume,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MusicToggle",ud.config.MusicToggle,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MusicToggle",ud.config.MusicToggle,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MusicVolume",ud.config.MusicVolume,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MusicVolume",ud.config.MusicVolume,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumVoices",ud.config.NumVoices,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumVoices",ud.config.NumVoices,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumChannels",ud.config.NumChannels,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumChannels",ud.config.NumChannels,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumBits",ud.config.NumBits,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "NumBits",ud.config.NumBits,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MixRate",ud.config.MixRate,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "MixRate",ud.config.MixRate,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "ReverseStereo",ud.config.ReverseStereo,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "ReverseStereo",ud.config.ReverseStereo,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",ud.config.SoundToggle,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",ud.config.SoundToggle,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",ud.config.VoiceToggle,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",ud.config.VoiceToggle,FALSE,FALSE);
#ifdef _WIN32 #ifdef _WIN32
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", ud.config.CheckForUpdates, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", ud.config.CheckForUpdates, FALSE, FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", ud.config.LastUpdateCheck, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", ud.config.LastUpdateCheck, FALSE, FALSE);
#endif #endif
// JBF 20031211 // JBF 20031211
@ -1195,10 +1195,10 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[dummy][1])); SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[dummy][1]));
Bsprintf(buf,"MouseAnalogScale%d",dummy); Bsprintf(buf,"MouseAnalogScale%d",dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.MouseAnalogueScale[dummy], false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.MouseAnalogueScale[dummy], FALSE, FALSE);
} }
dummy = CONTROL_GetMouseSensitivity(); dummy = CONTROL_GetMouseSensitivity();
SCRIPT_PutNumber(ud.config.scripthandle, "Controls","Mouse_Sensitivity",dummy,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls","Mouse_Sensitivity",dummy,FALSE,FALSE);
for (dummy=0; dummy<MAXJOYBUTTONS; dummy++) for (dummy=0; dummy<MAXJOYBUTTONS; dummy++)
{ {
@ -1220,13 +1220,13 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickDigitalFunctions[dummy][1])); SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickDigitalFunctions[dummy][1]));
Bsprintf(buf,"JoystickAnalogScale%d",dummy); Bsprintf(buf,"JoystickAnalogScale%d",dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueScale[dummy], false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueScale[dummy], FALSE, FALSE);
Bsprintf(buf,"JoystickAnalogDead%d",dummy); Bsprintf(buf,"JoystickAnalogDead%d",dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueDead[dummy], false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueDead[dummy], FALSE, FALSE);
Bsprintf(buf,"JoystickAnalogSaturate%d",dummy); Bsprintf(buf,"JoystickAnalogSaturate%d",dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueSaturate[dummy], false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueSaturate[dummy], FALSE, FALSE);
} }
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&szPlayerName[0]); SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&szPlayerName[0]);
@ -1234,7 +1234,7 @@ void CONFIG_WriteSetup(void)
#ifndef RANCID_NETWORKING #ifndef RANCID_NETWORKING
// The packetrate mechanism is specific to the eduke32 networking code // The packetrate mechanism is specific to the eduke32 networking code
SCRIPT_PutNumber(ud.config.scripthandle, "Comm Setup", "Rate", packetrate, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "Comm Setup", "Rate", packetrate, FALSE, FALSE);
#endif #endif
@ -1262,9 +1262,9 @@ void CONFIG_WriteSetup(void)
} }
int32 CONFIG_GetMapBestTime(char *mapname) int32_t CONFIG_GetMapBestTime(char *mapname)
{ {
int32 t = -1; int32_t t = -1;
char m[BMAX_PATH], *p; char m[BMAX_PATH], *p;
strcpy(m, mapname); strcpy(m, mapname);
@ -1284,7 +1284,7 @@ int32 CONFIG_GetMapBestTime(char *mapname)
return t; return t;
} }
int32 CONFIG_SetMapBestTime(char *mapname, int32 tm) int32_t CONFIG_SetMapBestTime(char *mapname, int32_t tm)
{ {
char m[BMAX_PATH], *p; char m[BMAX_PATH], *p;
@ -1301,7 +1301,7 @@ int32 CONFIG_SetMapBestTime(char *mapname, int32 tm)
if (ud.config.scripthandle < 0) ud.config.scripthandle = SCRIPT_Init(setupfilename); if (ud.config.scripthandle < 0) ud.config.scripthandle = SCRIPT_Init(setupfilename);
if (ud.config.scripthandle < 0) return -1; if (ud.config.scripthandle < 0) return -1;
SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", p, tm, false, false); SCRIPT_PutNumber(ud.config.scripthandle, "MapTimes", p, tm, FALSE, FALSE);
return 0; return 0;
} }

View file

@ -27,16 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SETUPNAMEPARM "SETUPFILE" #define SETUPNAMEPARM "SETUPFILE"
int32 CONFIG_ReadSetup( void ); int32_t CONFIG_ReadSetup( void );
void CONFIG_GetSetupFilename( void ); void CONFIG_GetSetupFilename( void );
void CONFIG_WriteSetup( void ); void CONFIG_WriteSetup( void );
void CONFIG_SetupMouse( void ); void CONFIG_SetupMouse( void );
void CONFIG_SetupJoystick( void ); void CONFIG_SetupJoystick( void );
void CONFIG_SetDefaultKeys(int32_t type); void CONFIG_SetDefaultKeys(int32_t type);
int32 CONFIG_GetMapBestTime(char *mapname); int32_t CONFIG_GetMapBestTime(char *mapname);
int32 CONFIG_SetMapBestTime(char *mapname, int32 tm); int32_t CONFIG_SetMapBestTime(char *mapname, int32_t tm);
void CONFIG_MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2); void CONFIG_MapKey(int32_t which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2);
#endif #endif

View file

@ -94,7 +94,7 @@ extern int32_t g_scriptVersion, g_Shareware, g_gameType;
#define MAXVOLUMES 7 #define MAXVOLUMES 7
#define MAXLEVELS 32 #define MAXLEVELS 32
#include "types.h"
#include "file_lib.h" #include "file_lib.h"
#include "gamedefs.h" #include "gamedefs.h"
#include "keyboard.h" #include "keyboard.h"
@ -114,7 +114,8 @@ extern int32_t g_scriptVersion, g_Shareware, g_gameType;
#include "namesdyn.h" #include "namesdyn.h"
#define TICRATE (120) #define TICRATE (120)
#define TICSPERFRAME (TICRATE/26) #define GAMETICSPERSEC 26
#define TICSPERFRAME (TICRATE/GAMETICSPERSEC)
// #define GC (TICSPERFRAME*44) // #define GC (TICSPERFRAME*44)
@ -256,7 +257,7 @@ enum DukeWeapon_t {
void A_DeleteSprite(int32_t s); void A_DeleteSprite(int32_t s);
typedef struct { typedef struct {
uint32 bits; uint32_t bits;
int16_t fvel, svel; int16_t fvel, svel;
int8_t avel, horz; int8_t avel, horz;
char extbits; char extbits;
@ -327,7 +328,7 @@ typedef struct {
int32_t JoystickAnalogueScale[MAXJOYAXES]; int32_t JoystickAnalogueScale[MAXJOYAXES];
int32_t JoystickAnalogueDead[MAXJOYAXES]; int32_t JoystickAnalogueDead[MAXJOYAXES];
int32_t JoystickAnalogueSaturate[MAXJOYAXES]; int32_t JoystickAnalogueSaturate[MAXJOYAXES];
byte KeyboardKeys[NUMGAMEFUNCTIONS][2]; uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
// //
// Sound variables // Sound variables
@ -1027,8 +1028,8 @@ typedef struct {
DukePlayer_t *ps; DukePlayer_t *ps;
input_t *sync; input_t *sync;
int32 movefifoend, syncvalhead, myminlag; int32_t movefifoend, syncvalhead, myminlag;
int32 pcolor, pteam, frags[MAXPLAYERS], wchoice[MAX_WEAPONS]; int32_t pcolor, pteam, frags[MAXPLAYERS], wchoice[MAX_WEAPONS];
char vote, gotvote, playerreadyflag, playerquitflag; char vote, gotvote, playerreadyflag, playerquitflag;
char user_name[32]; char user_name[32];

View file

@ -81,13 +81,13 @@ extern void A_DamageObject(int32_t i,int32_t sn);
extern void allignwarpelevators(void); extern void allignwarpelevators(void);
extern void G_HandleSharedKeys(int32_t snum); extern void G_HandleSharedKeys(int32_t snum);
extern void P_CheckSectors(int32_t snum); extern void P_CheckSectors(int32_t snum);
extern int32 RTS_AddFile(const char *filename); extern int32_t RTS_AddFile(const char *filename);
extern void RTS_Init(const char *filename); extern void RTS_Init(const char *filename);
extern int32 RTS_NumSounds(void); extern int32_t RTS_NumSounds(void);
extern int32 RTS_SoundLength(int32 lump); extern int32_t RTS_SoundLength(int32_t lump);
extern const char *RTS_GetSoundName(int32 i); extern const char *RTS_GetSoundName(int32_t i);
extern void RTS_ReadLump(int32 lump,void *dest); extern void RTS_ReadLump(int32_t lump,void *dest);
extern void *RTS_GetSound(int32 lump); extern void *RTS_GetSound(int32_t lump);
extern void G_CacheMapData(void); extern void G_CacheMapData(void);
extern void xyzmirror(int32_t i,int32_t wn); extern void xyzmirror(int32_t i,int32_t wn);
extern void G_UpdateScreenArea(void); extern void G_UpdateScreenArea(void);
@ -113,7 +113,7 @@ extern void P_DropWeapon(DukePlayer_t *p);
extern void P_ProcessInput(int32_t snum); extern void P_ProcessInput(int32_t snum);
extern void ChangeToMenu(int32_t cm); extern void ChangeToMenu(int32_t cm);
// extern void savetemp(const char *fn,int32_t daptr,int32_t dasiz); // extern void savetemp(const char *fn,int32_t daptr,int32_t dasiz);
// extern int32_t G_LoadSaveHeader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr); // extern int32_t G_LoadSaveHeader(char spot,int32_t *vn,int32_t *ln,int32_t *psk,int32_t *numplr);
extern int32_t G_LoadPlayer(int32_t spot); extern int32_t G_LoadPlayer(int32_t spot);
extern int32_t G_SavePlayer(int32_t spot); extern int32_t G_SavePlayer(int32_t spot);
extern int32_t menutext_(int32_t x,int32_t y,int32_t s,int32_t p,char *t,int32_t bits); extern int32_t menutext_(int32_t x,int32_t y,int32_t s,int32_t p,char *t,int32_t bits);
@ -157,14 +157,14 @@ extern void A_SpawnCeilingGlass(int32_t i,int32_t sectnum,int32_t n);
extern void A_SpawnRandomGlass(int32_t i,int32_t wallnum,int32_t n); extern void A_SpawnRandomGlass(int32_t i,int32_t wallnum,int32_t n);
extern int32_t GetTime(void); extern int32_t GetTime(void);
extern void CONFIG_GetSetupFilename(void); extern void CONFIG_GetSetupFilename(void);
extern int32 CONFIG_FunctionNameToNum(char *func); extern int32_t CONFIG_FunctionNameToNum(char *func);
extern char *CONFIG_FunctionNumToName(int32 func); extern char *CONFIG_FunctionNumToName(int32_t func);
extern int32 CONFIG_AnalogNameToNum(char *func); extern int32_t CONFIG_AnalogNameToNum(char *func);
extern char *CONFIG_AnalogNumToName(int32 func); extern char *CONFIG_AnalogNumToName(int32_t func);
extern void CONFIG_SetDefaults(void); extern void CONFIG_SetDefaults(void);
extern void CONFIG_ReadKeys(void); extern void CONFIG_ReadKeys(void);
extern void ReadSaveGameHeaders(void); extern void ReadSaveGameHeaders(void);
extern int32 CONFIG_ReadSetup(void); extern int32_t CONFIG_ReadSetup(void);
extern void CONFIG_WriteSetup(void); extern void CONFIG_WriteSetup(void);
extern inline void G_UpdateInterpolations(void); extern inline void G_UpdateInterpolations(void);
extern void G_SetInterpolation(int32_t *posptr); extern void G_SetInterpolation(int32_t *posptr);

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
#include "types.h"
#include "scriplib.h" #include "scriplib.h"
#include "file_lib.h" #include "file_lib.h"
#include "mathutil.h" #include "mathutil.h"
@ -2812,7 +2812,7 @@ extern int32_t g_doQuickSave;
void G_GameExit(const char *t) void G_GameExit(const char *t)
{ {
if (*t != 0) g_player[myconnectindex].ps->palette = (unsigned char *) &palette[0]; if (*t != 0) g_player[myconnectindex].ps->palette = (uint8_t *) &palette[0];
if (numplayers > 1) if (numplayers > 1)
{ {
@ -3881,9 +3881,9 @@ void G_DisplayRest(int32_t smoothratio)
j = scale(2,ud.config.ScreenWidth,320); j = scale(2,ud.config.ScreenWidth,320);
Bsprintf(tempbuf,"T:^15%d:%02d.%02d", Bsprintf(tempbuf,"T:^15%d:%02d.%02d",
(g_player[myconnectindex].ps->player_par/(26*60)), (g_player[myconnectindex].ps->player_par/(GAMETICSPERSEC*60)),
(g_player[myconnectindex].ps->player_par/26)%60, (g_player[myconnectindex].ps->player_par/GAMETICSPERSEC)%60,
((g_player[myconnectindex].ps->player_par%26)*38)/10 ((g_player[myconnectindex].ps->player_par%GAMETICSPERSEC)*38)/10
); );
gametext_z(13,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-textsc(21),tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536); gametext_z(13,STARTALPHANUM, j,scale(200-i,ud.config.ScreenHeight,200)-textsc(21),tempbuf,0,10,26,0, 0, xdim-1, ydim-1, 65536);
@ -13447,19 +13447,19 @@ FRAGBONUS:
{ {
int32_t ii, ij; int32_t ii, ij;
for (ii=g_player[myconnectindex].ps->player_par/(26*60), ij=1; ii>9; ii/=10, ij++) ; for (ii=g_player[myconnectindex].ps->player_par/(GAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij); clockpad = max(clockpad,ij);
if (!(ud.volume_number == 0 && ud.last_level-1 == 7)) if (!(ud.volume_number == 0 && ud.last_level-1 == 7))
{ {
for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(26*60), ij=1; ii>9; ii/=10, ij++) ; for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(GAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij); clockpad = max(clockpad,ij);
if (!NAM) if (!NAM)
{ {
for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(26*60), ij=1; ii>9; ii/=10, ij++) ; for (ii=MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(GAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij); clockpad = max(clockpad,ij);
} }
} }
if (playerbest > 0) for (ii=playerbest/(26*60), ij=1; ii>9; ii/=10, ij++) ; if (playerbest > 0) for (ii=playerbest/(GAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ;
clockpad = max(clockpad,ij); clockpad = max(clockpad,ij);
} }
@ -13566,9 +13566,9 @@ FRAGBONUS:
} }
Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad, Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(g_player[myconnectindex].ps->player_par/(26*60)), (g_player[myconnectindex].ps->player_par/(GAMETICSPERSEC*60)),
(g_player[myconnectindex].ps->player_par/26)%60, (g_player[myconnectindex].ps->player_par/GAMETICSPERSEC)%60,
((g_player[myconnectindex].ps->player_par%26)*38)/10 ((g_player[myconnectindex].ps->player_par%GAMETICSPERSEC)*38)/10
); );
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
if (g_player[myconnectindex].ps->player_par < playerbest) if (g_player[myconnectindex].ps->player_par < playerbest)
@ -13578,16 +13578,16 @@ FRAGBONUS:
if (!(ud.volume_number == 0 && ud.last_level-1 == 7)) if (!(ud.volume_number == 0 && ud.last_level-1 == 7))
{ {
Bsprintf(tempbuf,"%0*d:%02d",clockpad, Bsprintf(tempbuf,"%0*d:%02d",clockpad,
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(26*60)), (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(GAMETICSPERSEC*60)),
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/26)%60); (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/GAMETICSPERSEC)%60);
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10; yy+=10;
if (!NAM) if (!NAM)
{ {
Bsprintf(tempbuf,"%0*d:%02d",clockpad, Bsprintf(tempbuf,"%0*d:%02d",clockpad,
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(26*60)), (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(GAMETICSPERSEC*60)),
(MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/26)%60); (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/GAMETICSPERSEC)%60);
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10; yy+=10;
} }
@ -13596,9 +13596,9 @@ FRAGBONUS:
if (playerbest > 0) if (playerbest > 0)
{ {
Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad, Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad,
(playerbest/(26*60)), (playerbest/(GAMETICSPERSEC*60)),
(playerbest/26)%60, (playerbest/GAMETICSPERSEC)%60,
((playerbest%26)*38)/10 ((playerbest%GAMETICSPERSEC)*38)/10
); );
gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16);
yy+=10; yy+=10;
@ -13864,58 +13864,58 @@ void A_SpawnRandomGlass(int32_t i,int32_t wallnum,int32_t n)
static void G_SetupGameButtons(void) static void G_SetupGameButtons(void)
{ {
CONTROL_DefineFlag(gamefunc_Move_Forward,false); CONTROL_DefineFlag(gamefunc_Move_Forward,FALSE);
CONTROL_DefineFlag(gamefunc_Move_Backward,false); CONTROL_DefineFlag(gamefunc_Move_Backward,FALSE);
CONTROL_DefineFlag(gamefunc_Turn_Left,false); CONTROL_DefineFlag(gamefunc_Turn_Left,FALSE);
CONTROL_DefineFlag(gamefunc_Turn_Right,false); CONTROL_DefineFlag(gamefunc_Turn_Right,FALSE);
CONTROL_DefineFlag(gamefunc_Strafe,false); CONTROL_DefineFlag(gamefunc_Strafe,FALSE);
CONTROL_DefineFlag(gamefunc_Fire,false); CONTROL_DefineFlag(gamefunc_Fire,FALSE);
CONTROL_DefineFlag(gamefunc_Open,false); CONTROL_DefineFlag(gamefunc_Open,FALSE);
CONTROL_DefineFlag(gamefunc_Run,false); CONTROL_DefineFlag(gamefunc_Run,FALSE);
CONTROL_DefineFlag(gamefunc_AutoRun,false); CONTROL_DefineFlag(gamefunc_AutoRun,FALSE);
CONTROL_DefineFlag(gamefunc_Jump,false); CONTROL_DefineFlag(gamefunc_Jump,FALSE);
CONTROL_DefineFlag(gamefunc_Crouch,false); CONTROL_DefineFlag(gamefunc_Crouch,FALSE);
CONTROL_DefineFlag(gamefunc_Look_Up,false); CONTROL_DefineFlag(gamefunc_Look_Up,FALSE);
CONTROL_DefineFlag(gamefunc_Look_Down,false); CONTROL_DefineFlag(gamefunc_Look_Down,FALSE);
CONTROL_DefineFlag(gamefunc_Look_Left,false); CONTROL_DefineFlag(gamefunc_Look_Left,FALSE);
CONTROL_DefineFlag(gamefunc_Look_Right,false); CONTROL_DefineFlag(gamefunc_Look_Right,FALSE);
CONTROL_DefineFlag(gamefunc_Strafe_Left,false); CONTROL_DefineFlag(gamefunc_Strafe_Left,FALSE);
CONTROL_DefineFlag(gamefunc_Strafe_Right,false); CONTROL_DefineFlag(gamefunc_Strafe_Right,FALSE);
CONTROL_DefineFlag(gamefunc_Aim_Up,false); CONTROL_DefineFlag(gamefunc_Aim_Up,FALSE);
CONTROL_DefineFlag(gamefunc_Aim_Down,false); CONTROL_DefineFlag(gamefunc_Aim_Down,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_1,false); CONTROL_DefineFlag(gamefunc_Weapon_1,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_2,false); CONTROL_DefineFlag(gamefunc_Weapon_2,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_3,false); CONTROL_DefineFlag(gamefunc_Weapon_3,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_4,false); CONTROL_DefineFlag(gamefunc_Weapon_4,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_5,false); CONTROL_DefineFlag(gamefunc_Weapon_5,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_6,false); CONTROL_DefineFlag(gamefunc_Weapon_6,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_7,false); CONTROL_DefineFlag(gamefunc_Weapon_7,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_8,false); CONTROL_DefineFlag(gamefunc_Weapon_8,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_9,false); CONTROL_DefineFlag(gamefunc_Weapon_9,FALSE);
CONTROL_DefineFlag(gamefunc_Weapon_10,false); CONTROL_DefineFlag(gamefunc_Weapon_10,FALSE);
CONTROL_DefineFlag(gamefunc_Inventory,false); CONTROL_DefineFlag(gamefunc_Inventory,FALSE);
CONTROL_DefineFlag(gamefunc_Inventory_Left,false); CONTROL_DefineFlag(gamefunc_Inventory_Left,FALSE);
CONTROL_DefineFlag(gamefunc_Inventory_Right,false); CONTROL_DefineFlag(gamefunc_Inventory_Right,FALSE);
CONTROL_DefineFlag(gamefunc_Holo_Duke,false); CONTROL_DefineFlag(gamefunc_Holo_Duke,FALSE);
CONTROL_DefineFlag(gamefunc_Jetpack,false); CONTROL_DefineFlag(gamefunc_Jetpack,FALSE);
CONTROL_DefineFlag(gamefunc_NightVision,false); CONTROL_DefineFlag(gamefunc_NightVision,FALSE);
CONTROL_DefineFlag(gamefunc_MedKit,false); CONTROL_DefineFlag(gamefunc_MedKit,FALSE);
CONTROL_DefineFlag(gamefunc_TurnAround,false); CONTROL_DefineFlag(gamefunc_TurnAround,FALSE);
CONTROL_DefineFlag(gamefunc_SendMessage,false); CONTROL_DefineFlag(gamefunc_SendMessage,FALSE);
CONTROL_DefineFlag(gamefunc_Map,false); CONTROL_DefineFlag(gamefunc_Map,FALSE);
CONTROL_DefineFlag(gamefunc_Shrink_Screen,false); CONTROL_DefineFlag(gamefunc_Shrink_Screen,FALSE);
CONTROL_DefineFlag(gamefunc_Enlarge_Screen,false); CONTROL_DefineFlag(gamefunc_Enlarge_Screen,FALSE);
CONTROL_DefineFlag(gamefunc_Center_View,false); CONTROL_DefineFlag(gamefunc_Center_View,FALSE);
CONTROL_DefineFlag(gamefunc_Holster_Weapon,false); CONTROL_DefineFlag(gamefunc_Holster_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Show_Opponents_Weapon,false); CONTROL_DefineFlag(gamefunc_Show_Opponents_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Map_Follow_Mode,false); CONTROL_DefineFlag(gamefunc_Map_Follow_Mode,FALSE);
CONTROL_DefineFlag(gamefunc_See_Coop_View,false); CONTROL_DefineFlag(gamefunc_See_Coop_View,FALSE);
CONTROL_DefineFlag(gamefunc_Mouse_Aiming,false); CONTROL_DefineFlag(gamefunc_Mouse_Aiming,FALSE);
CONTROL_DefineFlag(gamefunc_Toggle_Crosshair,false); CONTROL_DefineFlag(gamefunc_Toggle_Crosshair,FALSE);
CONTROL_DefineFlag(gamefunc_Steroids,false); CONTROL_DefineFlag(gamefunc_Steroids,FALSE);
CONTROL_DefineFlag(gamefunc_Quick_Kick,false); CONTROL_DefineFlag(gamefunc_Quick_Kick,FALSE);
CONTROL_DefineFlag(gamefunc_Next_Weapon,false); CONTROL_DefineFlag(gamefunc_Next_Weapon,FALSE);
CONTROL_DefineFlag(gamefunc_Previous_Weapon,false); CONTROL_DefineFlag(gamefunc_Previous_Weapon,FALSE);
} }
/* /*

View file

@ -5259,15 +5259,15 @@ repeatcase:
while (*textptr == ' ' || *textptr == '\t') textptr++; while (*textptr == ' ' || *textptr == '\t') textptr++;
MapInfo[j*MAXLEVELS+k].partime = MapInfo[j*MAXLEVELS+k].partime =
(((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*GAMETICSPERSEC*60)+
(((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*GAMETICSPERSEC);
textptr += 5; textptr += 5;
while (*textptr == ' ' || *textptr == '\t') textptr++; while (*textptr == ' ' || *textptr == '\t') textptr++;
MapInfo[j*MAXLEVELS+k].designertime = MapInfo[j*MAXLEVELS+k].designertime =
(((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*GAMETICSPERSEC*60)+
(((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*GAMETICSPERSEC);
textptr += 5; textptr += 5;
while (*textptr == ' ' || *textptr == '\t') textptr++; while (*textptr == ' ' || *textptr == '\t') textptr++;

View file

@ -421,7 +421,7 @@ static inline void X_AlterAng(int32_t a)
vm.g_sp->ang -= j; vm.g_sp->ang -= j;
} }
} }
else if (ticselapsed > 18 && ticselapsed < 26) // choose else if (ticselapsed > 18 && ticselapsed < GAMETICSPERSEC) // choose
{ {
if (klabs(angdif>>2) < 128) vm.g_sp->ang = goalang; if (klabs(angdif>>2) < 128) vm.g_sp->ang = goalang;
else vm.g_sp->ang += angdif>>2; else vm.g_sp->ang += angdif>>2;
@ -1060,7 +1060,7 @@ static int32_t X_DoExecute(void)
case CON_TIP: case CON_TIP:
insptr++; insptr++;
g_player[vm.g_p].ps->tipincs = 26; g_player[vm.g_p].ps->tipincs = GAMETICSPERSEC;
break; break;
case CON_FALL: case CON_FALL:
@ -2132,7 +2132,7 @@ static int32_t X_DoExecute(void)
case CON_SAVEGAMEVAR: case CON_SAVEGAMEVAR:
case CON_READGAMEVAR: case CON_READGAMEVAR:
{ {
int32 i=0; int32_t i=0;
insptr++; insptr++;
if (ud.config.scripthandle < 0) if (ud.config.scripthandle < 0)
{ {
@ -2143,7 +2143,7 @@ static int32_t X_DoExecute(void)
{ {
case CON_SAVEGAMEVAR: case CON_SAVEGAMEVAR:
i=Gv_GetVarX(*insptr); i=Gv_GetVarX(*insptr);
SCRIPT_PutNumber(ud.config.scripthandle, "Gamevars",aGameVars[*insptr++].szLabel,i,false,false); SCRIPT_PutNumber(ud.config.scripthandle, "Gamevars",aGameVars[*insptr++].szLabel,i,FALSE,FALSE);
break; break;
case CON_READGAMEVAR: case CON_READGAMEVAR:
SCRIPT_GetNumber(ud.config.scripthandle, "Gamevars",aGameVars[*insptr].szLabel,&i); SCRIPT_GetNumber(ud.config.scripthandle, "Gamevars",aGameVars[*insptr].szLabel,&i);

View file

@ -38,7 +38,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
extern "C" { extern "C" {
#endif #endif
#include "types.h"
//**************************************************************************** //****************************************************************************
// //
// DEFINES // DEFINES
@ -145,58 +145,58 @@ typedef enum
typedef struct typedef struct
{ {
int32 joyMinX; int32_t joyMinX;
int32 joyMinY; int32_t joyMinY;
int32 threshMinX; int32_t threshMinX;
int32 threshMinY; int32_t threshMinY;
int32 threshMaxX; int32_t threshMaxX;
int32 threshMaxY; int32_t threshMaxY;
int32 joyMaxX; int32_t joyMaxX;
int32 joyMaxY; int32_t joyMaxY;
int32 joyMultXL; int32_t joyMultXL;
int32 joyMultYL; int32_t joyMultYL;
int32 joyMultXH; int32_t joyMultXH;
int32 joyMultYH; int32_t joyMultYH;
} JoystickDef; } JoystickDef;
// int32 ThrottleMin; // int32_t ThrottleMin;
// int32 RudderMin; // int32_t RudderMin;
// int32 ThrottlethreshMin; // int32_t ThrottlethreshMin;
// int32 RudderthreshMin; // int32_t RudderthreshMin;
// int32 ThrottlethreshMax; // int32_t ThrottlethreshMax;
// int32 RudderthreshMax; // int32_t RudderthreshMax;
// int32 ThrottleMax; // int32_t ThrottleMax;
// int32 RudderMax; // int32_t RudderMax;
// int32 ThrottleMultL; // int32_t ThrottleMultL;
// int32 RudderMultL; // int32_t RudderMultL;
// int32 ThrottleMultH; // int32_t ThrottleMultH;
// int32 RudderMultH; // int32_t RudderMultH;
/* /*
typedef struct typedef struct
{ {
byte active : 1; uint8_t active : 1;
byte used : 1; uint8_t used : 1;
byte toggle : 1; uint8_t toggle : 1;
byte buttonheld : 1; uint8_t buttonheld : 1;
byte cleared : 1; uint8_t cleared : 1;
} controlflags; } controlflags;
typedef struct typedef struct
{ {
volatile byte active : 1; volatile uint8_t active : 1;
volatile byte used : 1; volatile uint8_t used : 1;
volatile byte toggle : 1; volatile uint8_t toggle : 1;
volatile byte buttonheld : 1; volatile uint8_t buttonheld : 1;
volatile byte cleared : 1; volatile uint8_t cleared : 1;
} controlflags; } controlflags;
*/ */
typedef struct typedef struct
{ {
byte active ; uint8_t active ;
byte used ; uint8_t used ;
byte toggle ; uint8_t toggle ;
byte buttonheld ; uint8_t buttonheld ;
int32 cleared ; int32_t cleared ;
} controlflags; } controlflags;
typedef struct typedef struct
@ -207,23 +207,23 @@ typedef struct
typedef struct typedef struct
{ {
byte singleclicked; uint8_t singleclicked;
byte doubleclicked; uint8_t doubleclicked;
word extra; uint16_t extra;
} controlbuttontype; } controlbuttontype;
typedef struct typedef struct
{ {
byte analogmap; uint8_t analogmap;
byte minmap; uint8_t minmap;
byte maxmap; uint8_t maxmap;
byte extra; uint8_t extra;
} controlaxismaptype; } controlaxismaptype;
typedef struct typedef struct
{ {
int32 analog; int32_t analog;
int32 digital; int32_t digital;
} controlaxistype; } controlaxistype;
@ -234,18 +234,18 @@ typedef struct
//*************************************************************************** //***************************************************************************
void CONTROL_GetMouseDelta( void ); void CONTROL_GetMouseDelta( void );
byte CONTROL_GetMouseButtons( void ); uint8_t CONTROL_GetMouseButtons( void );
boolean CONTROL_StartMouse( void ); int32_t CONTROL_StartMouse( void );
void CONTROL_GetJoyAbs( void ); void CONTROL_GetJoyAbs( void );
void CONTROL_GetJoyDelta( void ); void CONTROL_GetJoyDelta( void );
boolean CONTROL_StartJoy( int32 joy ); int32_t CONTROL_StartJoy( int32_t joy );
void CONTROL_ShutJoy( int32 joy ); void CONTROL_ShutJoy( int32_t joy );
void CONTROL_SetFlag( int32 which, boolean active ); void CONTROL_SetFlag( int32_t which, int32_t active );
void CONTROL_ButtonFunctionState( boolean * state ); void CONTROL_ButtonFunctionState( int32_t * state );
boolean CONTROL_KeyboardFunctionPressed( int32 whichfunction ); int32_t CONTROL_KeyboardFunctionPressed( int32_t whichfunction );
static inline boolean CONTROL_CheckRange( int32 which ); static inline int32_t CONTROL_CheckRange( int32_t which );
int32 CONTROL_GetTime( void ); int32_t CONTROL_GetTime( void );
void CONTROL_AxisFunctionState( boolean * state ); void CONTROL_AxisFunctionState( int32_t * state );
void CONTROL_GetJoyMovement( ControlInfo * info ); void CONTROL_GetJoyMovement( ControlInfo * info );
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -58,7 +58,7 @@ typedef enum
typedef struct scriptline typedef struct scriptline
{ {
int32 type; int32_t type;
void * ptr; void * ptr;
struct scriptline *nextline; struct scriptline *nextline;
struct scriptline *prevline; struct scriptline *prevline;
@ -97,7 +97,7 @@ typedef struct
============== ==============
*/ */
int32 SCRIPT_New( void ); int32_t SCRIPT_New( void );
/* /*
============== ==============
@ -106,7 +106,7 @@ int32 SCRIPT_New( void );
= =
============== ==============
*/ */
void SCRIPT_Delete( int32 scripthandle ); void SCRIPT_Delete( int32_t scripthandle );
/* /*
============== ==============
@ -124,7 +124,7 @@ void SCRIPT_FreeSection( ScriptSectionType * section );
= =
============== ==============
*/ */
void SafeWriteString (int32 handle, char * string); void SafeWriteString (int32_t handle, char * string);
/* /*
============== ==============
@ -138,7 +138,7 @@ void SafeWriteString (int32 handle, char * string);
ScriptLineType * SCRIPT_AddLine ScriptLineType * SCRIPT_AddLine
( (
ScriptLineType * root, ScriptLineType * root,
int32 type, int32_t type,
void * ptr void * ptr
); );
@ -151,7 +151,7 @@ ScriptLineType * SCRIPT_AddLine
*/ */
ScriptSectionType * SCRIPT_SectionExists ScriptSectionType * SCRIPT_SectionExists
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname char * sectionname
); );
@ -162,7 +162,7 @@ ScriptSectionType * SCRIPT_SectionExists
= =
============== ==============
*/ */
ScriptSectionType * SCRIPT_AddSection( int32 scripthandle, char * sectionname ); ScriptSectionType * SCRIPT_AddSection( int32_t scripthandle, char * sectionname );
/* /*
============== ==============
@ -186,7 +186,7 @@ ScriptEntryType * SCRIPT_EntryExists
*/ */
void SCRIPT_AddEntry void SCRIPT_AddEntry
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * entryvalue char * entryvalue
@ -200,7 +200,7 @@ void SCRIPT_AddEntry
============== ==============
*/ */
void SCRIPT_DecodeToken ( int32 scripthandle, char * str ); void SCRIPT_DecodeToken ( int32_t scripthandle, char * str );
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -26,7 +26,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "compat.h" #include "compat.h"
#include "types.h"
#include "util_lib.h" #include "util_lib.h"
#include "animlib.h" #include "animlib.h"
@ -42,7 +42,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
// //
//**************************************************************************** //****************************************************************************
static anim_t * anim=NULL; static anim_t * anim=NULL;
static boolean Anim_Started = false; static int32_t Anim_Started = FALSE;
//**************************************************************************** //****************************************************************************
// //
@ -62,9 +62,9 @@ static void CheckAnimStarted(char * funcname)
// //
//**************************************************************************** //****************************************************************************
uint16 findpage(uint16 framenumber) uint16_t findpage(uint16_t framenumber)
{ {
uint16 i; uint16_t i;
CheckAnimStarted("findpage"); CheckAnimStarted("findpage");
for (i=0; i<anim->lpheader.nLps; i++) for (i=0; i<anim->lpheader.nLps; i++)
@ -87,10 +87,10 @@ uint16 findpage(uint16 framenumber)
// //
//**************************************************************************** //****************************************************************************
void loadpage(uint16 pagenumber, uint16 *pagepointer) void loadpage(uint16_t pagenumber, uint16_t *pagepointer)
{ {
int32 size; int32_t size;
byte * buffer; uint8_t * buffer;
CheckAnimStarted("loadpage"); CheckAnimStarted("loadpage");
buffer = anim->buffer; buffer = anim->buffer;
@ -109,7 +109,7 @@ void loadpage(uint16 pagenumber, uint16 *pagepointer)
*/ */
Bmemcpy(&anim->curlp, &anim->LpArray[pagenumber], size); Bmemcpy(&anim->curlp, &anim->LpArray[pagenumber], size);
buffer += size + sizeof(uint16); buffer += size + sizeof(uint16_t);
Bmemcpy(pagepointer,buffer,anim->curlp.nBytes+(anim->curlp.nRecords*2)); Bmemcpy(pagepointer,buffer,anim->curlp.nBytes+(anim->curlp.nRecords*2));
} }
} }
@ -125,8 +125,8 @@ void loadpage(uint16 pagenumber, uint16 *pagepointer)
void CPlayRunSkipDump(uint8_t *srcP, uint8_t *dstP) void CPlayRunSkipDump(uint8_t *srcP, uint8_t *dstP)
{ {
int8_t cnt; int8_t cnt;
uint16 wordCnt; uint16_t wordCnt;
byte pixel; uint8_t pixel;
nextOp: nextOp:
@ -149,7 +149,7 @@ dump:
while (--cnt); while (--cnt);
goto nextOp; goto nextOp;
run: run:
wordCnt = (byte)*srcP++; /* 8-bit unsigned count */ wordCnt = (uint8_t)*srcP++; /* 8-bit unsigned count */
pixel = *srcP++; pixel = *srcP++;
do do
{ {
@ -159,9 +159,9 @@ run:
goto nextOp; goto nextOp;
longOp: longOp:
wordCnt = B_LITTLE16(*((uint16 *)srcP)); wordCnt = B_LITTLE16(*((uint16_t *)srcP));
srcP += sizeof(uint16); srcP += sizeof(uint16_t);
if ((int16)wordCnt <= 0) if ((int16_t)wordCnt <= 0)
goto notLongSkip; /* Do SIGNED test. */ goto notLongSkip; /* Do SIGNED test. */
/* longSkip. */ /* longSkip. */
@ -206,12 +206,12 @@ stop: /* all done */
// //
//**************************************************************************** //****************************************************************************
void renderframe(uint16 framenumber, uint16 *pagepointer) void renderframe(uint16_t framenumber, uint16_t *pagepointer)
{ {
uint16 offset=0; uint16_t offset=0;
uint16 i; uint16_t i;
uint16 destframe; uint16_t destframe;
byte *ppointer; uint8_t *ppointer;
CheckAnimStarted("renderframe"); CheckAnimStarted("renderframe");
destframe = framenumber - anim->curlp.baseRecord; destframe = framenumber - anim->curlp.baseRecord;
@ -220,12 +220,12 @@ void renderframe(uint16 framenumber, uint16 *pagepointer)
{ {
offset += B_LITTLE16(pagepointer[i]); offset += B_LITTLE16(pagepointer[i]);
} }
ppointer = (byte *)pagepointer; ppointer = (uint8_t *)pagepointer;
ppointer+=anim->curlp.nRecords*2+offset; ppointer+=anim->curlp.nRecords*2+offset;
if (ppointer[1]) if (ppointer[1])
{ {
ppointer += (4 + B_LITTLE16(((uint16 *)ppointer)[1]) + (B_LITTLE16(((uint16 *)ppointer)[1]) & 1)); ppointer += (4 + B_LITTLE16(((uint16_t *)ppointer)[1]) + (B_LITTLE16(((uint16_t *)ppointer)[1]) & 1));
} }
else else
{ {
@ -243,7 +243,7 @@ void renderframe(uint16 framenumber, uint16 *pagepointer)
// //
//**************************************************************************** //****************************************************************************
void drawframe(uint16 framenumber) void drawframe(uint16_t framenumber)
{ {
CheckAnimStarted("drawframe"); CheckAnimStarted("drawframe");
loadpage(findpage(framenumber), anim->thepage); loadpage(findpage(framenumber), anim->thepage);
@ -259,13 +259,13 @@ void drawframe(uint16 framenumber)
void ANIM_LoadAnim(char * buffer) void ANIM_LoadAnim(char * buffer)
{ {
uint16 i; uint16_t i;
int32 size; int32_t size;
if (!Anim_Started) if (!Anim_Started)
{ {
anim = SafeMalloc(sizeof(anim_t)); anim = SafeMalloc(sizeof(anim_t));
Anim_Started = true; Anim_Started = TRUE;
} }
anim->buffer = (uint8_t *)buffer; anim->buffer = (uint8_t *)buffer;
@ -318,7 +318,7 @@ void ANIM_FreeAnim(void)
if (Anim_Started) if (Anim_Started)
{ {
SafeFree(anim); SafeFree(anim);
Anim_Started = false; Anim_Started = FALSE;
} }
} }
@ -328,7 +328,7 @@ void ANIM_FreeAnim(void)
// //
//**************************************************************************** //****************************************************************************
int32 ANIM_NumFrames(void) int32_t ANIM_NumFrames(void)
{ {
CheckAnimStarted("NumFrames"); CheckAnimStarted("NumFrames");
return anim->lpheader.nRecords; return anim->lpheader.nRecords;
@ -340,9 +340,9 @@ int32 ANIM_NumFrames(void)
// //
//**************************************************************************** //****************************************************************************
byte * ANIM_DrawFrame(int32 framenumber) uint8_t * ANIM_DrawFrame(int32_t framenumber)
{ {
int32 cnt; int32_t cnt;
CheckAnimStarted("DrawFrame"); CheckAnimStarted("DrawFrame");
if ((anim->currentframe != -1) && (anim->currentframe<=framenumber)) if ((anim->currentframe != -1) && (anim->currentframe<=framenumber))
@ -365,7 +365,7 @@ byte * ANIM_DrawFrame(int32 framenumber)
// //
//**************************************************************************** //****************************************************************************
byte * ANIM_GetPalette(void) uint8_t * ANIM_GetPalette(void)
{ {
CheckAnimStarted("GetPalette"); CheckAnimStarted("GetPalette");
return anim->pal; return anim->pal;

View file

@ -55,47 +55,47 @@ extern "C" {
typedef struct PACKED typedef struct PACKED
{ {
uint32 id; // 4 character ID == "LPF " */ uint32_t id; // 4 character ID == "LPF " */
uint16 maxLps; // max # largePages allowed. 256 FOR NOW. */ uint16_t maxLps; // max # largePages allowed. 256 FOR NOW. */
uint16 nLps; // # largePages in this file. */ uint16_t nLps; // # largePages in this file. */
uint32 nRecords; // # records in this file. 65534 is current limit plus */ uint32_t nRecords; // # records in this file. 65534 is current limit plus */
// one for last-to-first delta for looping the animation */ // one for last-to-first delta for looping the animation */
uint16 maxRecsPerLp; // # records permitted in an lp. 256 FOR NOW. */ uint16_t maxRecsPerLp; // # records permitted in an lp. 256 FOR NOW. */
uint16 lpfTableOffset; // Absolute Seek position of lpfTable. 1280 FOR NOW. uint16_t lpfTableOffset; // Absolute Seek position of lpfTable. 1280 FOR NOW.
// The lpf Table is an array of 256 large page structures // The lpf Table is an array of 256 large page structures
// that is used to facilitate finding records in an anim // that is used to facilitate finding records in an anim
// file without having to seek through all of the Large // file without having to seek through all of the Large
// Pages to find which one a specific record lives in. */ // Pages to find which one a specific record lives in. */
uint32 contentType; // 4 character ID == "ANIM" */ uint32_t contentType; // 4 character ID == "ANIM" */
uint16 width; // Width of screen in pixels. */ uint16_t width; // Width of screen in pixels. */
uint16 height; // Height of screen in pixels. */ uint16_t height; // Height of screen in pixels. */
byte variant; // 0==ANIM. */ uint8_t variant; // 0==ANIM. */
byte version; // 0==frame rate is multiple of 18 cycles/sec. uint8_t version; // 0==frame rate is multiple of 18 cycles/sec.
// 1==frame rate is multiple of 70 cycles/sec. */ // 1==frame rate is multiple of 70 cycles/sec. */
byte hasLastDelta; // 1==Last record is a delta from last-to-first frame. */ uint8_t hasLastDelta; // 1==Last record is a delta from last-to-first frame. */
byte lastDeltaValid; // 0==The last-to-first delta (if present) hasn't been uint8_t lastDeltaValid; // 0==The last-to-first delta (if present) hasn't been
// updated to match the current first&last frames, so it // updated to match the current first&last frames, so it
// should be ignored. */ // should be ignored. */
byte pixelType; // /* 0==256 color. */ uint8_t pixelType; // /* 0==256 color. */
byte CompressionType;// /* 1==(RunSkipDump) Only one used FOR NOW. */ uint8_t CompressionType;// /* 1==(RunSkipDump) Only one used FOR NOW. */
byte otherRecsPerFrm;// /* 0 FOR NOW. */ uint8_t otherRecsPerFrm;// /* 0 FOR NOW. */
byte bitmaptype; // /* 1==320x200, 256-color. Only one implemented so far. */ uint8_t bitmaptype; // /* 1==320x200, 256-color. Only one implemented so far. */
byte recordTypes[32];// /* Not yet implemented. */ uint8_t recordTypes[32];// /* Not yet implemented. */
uint32 nFrames; // /* In case future version adds other records at end of uint32_t nFrames; // /* In case future version adds other records at end of
// file, we still know how many actual frames. // file, we still know how many actual frames.
// NOTE: DOES include last-to-first delta when present. */ // NOTE: DOES include last-to-first delta when present. */
uint16 framesPerSecond; // Number of frames to play per second. */ uint16_t framesPerSecond; // Number of frames to play per second. */
uint16 pad2[29]; // 58 bytes of filler to round up to 128 bytes total. */ uint16_t pad2[29]; // 58 bytes of filler to round up to 128 bytes total. */
} lpfileheader; } lpfileheader;
// this is the format of a large page structure // this is the format of a large page structure
typedef struct PACKED typedef struct PACKED
{ {
uint16 baseRecord; // Number of first record in this large page. uint16_t baseRecord; // Number of first record in this large page.
uint16 nRecords; // Number of records in lp. uint16_t nRecords; // Number of records in lp.
// bit 15 of "nRecords" == "has continuation from previous lp". // bit 15 of "nRecords" == "has continuation from previous lp".
// bit 14 of "nRecords" == "final record continues on next lp". // bit 14 of "nRecords" == "final record continues on next lp".
uint16 nBytes; // Total number of bytes of contents, excluding header. uint16_t nBytes; // Total number of bytes of contents, excluding header.
} lp_descriptor; } lp_descriptor;
#undef PACKED #undef PACKED
@ -108,16 +108,16 @@ typedef struct PACKED
typedef struct typedef struct
{ {
uint16 framecount; // current frame of anim uint16_t framecount; // current frame of anim
lpfileheader lpheader; // file header will be loaded into this structure lpfileheader lpheader; // file header will be loaded into this structure
lp_descriptor LpArray[256]; // arrays of large page structs used to find frames lp_descriptor LpArray[256]; // arrays of large page structs used to find frames
uint16 curlpnum; // initialize to an invalid Large page number uint16_t curlpnum; // initialize to an invalid Large page number
lp_descriptor curlp; // header of large page currently in memory lp_descriptor curlp; // header of large page currently in memory
uint16 thepage[0x8000]; // buffer where current large page is loaded uint16_t thepage[0x8000]; // buffer where current large page is loaded
byte imagebuffer[0x10000]; // buffer where anim frame is decoded uint8_t imagebuffer[0x10000]; // buffer where anim frame is decoded
byte * buffer; uint8_t * buffer;
byte pal[768]; uint8_t pal[768];
int32 currentframe; int32_t currentframe;
} anim_t; } anim_t;
//**************************************************************************** //****************************************************************************
@ -148,7 +148,7 @@ void ANIM_FreeAnim ( void );
// //
//**************************************************************************** //****************************************************************************
int32 ANIM_NumFrames ( void ); int32_t ANIM_NumFrames ( void );
//**************************************************************************** //****************************************************************************
// //
@ -158,7 +158,7 @@ int32 ANIM_NumFrames ( void );
// //
//**************************************************************************** //****************************************************************************
byte * ANIM_DrawFrame (int32 framenumber); uint8_t * ANIM_DrawFrame (int32_t framenumber);
//**************************************************************************** //****************************************************************************
// //
@ -167,7 +167,7 @@ byte * ANIM_DrawFrame (int32 framenumber);
// return the palette of the anim // return the palette of the anim
//**************************************************************************** //****************************************************************************
byte * ANIM_GetPalette ( void ); uint8_t * ANIM_GetPalette ( void );
#ifdef __cplusplus #ifdef __cplusplus
}; };

View file

@ -7,7 +7,7 @@
*/ */
#include "compat.h" #include "compat.h"
#include "types.h"
#include "keyboard.h" #include "keyboard.h"
#include "mouse.h" #include "mouse.h"
#include "control.h" #include "control.h"
@ -19,19 +19,19 @@
#include "pragmas.h" #include "pragmas.h"
boolean CONTROL_JoyPresent = false; int32_t CONTROL_JoyPresent = FALSE;
boolean CONTROL_JoystickEnabled = false; int32_t CONTROL_JoystickEnabled = FALSE;
boolean CONTROL_MousePresent = false; int32_t CONTROL_MousePresent = FALSE;
boolean CONTROL_MouseEnabled = false; int32_t CONTROL_MouseEnabled = FALSE;
uint64 CONTROL_ButtonState = 0; uint64 CONTROL_ButtonState = 0;
uint64 CONTROL_ButtonHeldState = 0; uint64 CONTROL_ButtonHeldState = 0;
// static int32 CONTROL_UserInputDelay = -1; // static int32_t CONTROL_UserInputDelay = -1;
static int32 CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY; static int32_t CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY;
static int32 CONTROL_NumMouseButtons = 0; static int32_t CONTROL_NumMouseButtons = 0;
static int32 CONTROL_NumMouseAxes = 0; static int32_t CONTROL_NumMouseAxes = 0;
static int32 CONTROL_NumJoyButtons = 0; static int32_t CONTROL_NumJoyButtons = 0;
static int32 CONTROL_NumJoyAxes = 0; static int32_t CONTROL_NumJoyAxes = 0;
static controlflags CONTROL_Flags[CONTROL_NUM_FLAGS]; static controlflags CONTROL_Flags[CONTROL_NUM_FLAGS];
static controlbuttontype CONTROL_MouseButtonMapping[MAXMOUSEBUTTONS], static controlbuttontype CONTROL_MouseButtonMapping[MAXMOUSEBUTTONS],
CONTROL_JoyButtonMapping[MAXJOYBUTTONS]; CONTROL_JoyButtonMapping[MAXJOYBUTTONS];
@ -42,17 +42,17 @@ static controlaxistype CONTROL_MouseAxes[MAXMOUSEAXES], // physical axes
CONTROL_JoyAxes[MAXJOYAXES]; CONTROL_JoyAxes[MAXJOYAXES];
static controlaxistype CONTROL_LastMouseAxes[MAXMOUSEAXES], static controlaxistype CONTROL_LastMouseAxes[MAXMOUSEAXES],
CONTROL_LastJoyAxes[MAXJOYAXES]; CONTROL_LastJoyAxes[MAXJOYAXES];
static int32 CONTROL_MouseAxesScale[MAXMOUSEAXES], CONTROL_JoyAxesScale[MAXJOYAXES]; static int32_t CONTROL_MouseAxesScale[MAXMOUSEAXES], CONTROL_JoyAxesScale[MAXJOYAXES];
static int32 CONTROL_MouseButtonState[MAXMOUSEBUTTONS], CONTROL_JoyButtonState[MAXJOYBUTTONS]; static int32_t CONTROL_MouseButtonState[MAXMOUSEBUTTONS], CONTROL_JoyButtonState[MAXJOYBUTTONS];
static int32 CONTROL_MouseButtonClickedTime[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedTime[MAXJOYBUTTONS]; static int32_t CONTROL_MouseButtonClickedTime[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedTime[MAXJOYBUTTONS];
static boolean CONTROL_MouseButtonClickedState[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedState[MAXJOYBUTTONS]; static int32_t CONTROL_MouseButtonClickedState[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedState[MAXJOYBUTTONS];
static boolean CONTROL_MouseButtonClicked[MAXMOUSEBUTTONS], CONTROL_JoyButtonClicked[MAXJOYBUTTONS]; static int32_t CONTROL_MouseButtonClicked[MAXMOUSEBUTTONS], CONTROL_JoyButtonClicked[MAXJOYBUTTONS];
static byte CONTROL_MouseButtonClickedCount[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedCount[MAXJOYBUTTONS]; static uint8_t CONTROL_MouseButtonClickedCount[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedCount[MAXJOYBUTTONS];
static boolean CONTROL_UserInputCleared[3]; static int32_t CONTROL_UserInputCleared[3];
static int32(*GetTime)(void); static int32_t(*GetTime)(void);
static boolean CONTROL_Started = false; static int32_t CONTROL_Started = FALSE;
static int32 ticrate; static int32_t ticrate;
static int32 CONTROL_DoubleClickSpeed; static int32_t CONTROL_DoubleClickSpeed;
int32_t extinput[CONTROL_NUM_FLAGS]; int32_t extinput[CONTROL_NUM_FLAGS];
keybind KeyBindings[MAXBOUNDKEYS], MouseBindings[MAXMOUSEBUTTONS]; keybind KeyBindings[MAXBOUNDKEYS], MouseBindings[MAXMOUSEBUTTONS];
@ -61,13 +61,13 @@ int32_t control_smoothmouse = 0;
void CONTROL_GetMouseDelta(void) void CONTROL_GetMouseDelta(void)
{ {
int32 x,y; int32_t x,y;
MOUSE_GetDelta(&x, &y); MOUSE_GetDelta(&x, &y);
if (control_smoothmouse) if (control_smoothmouse)
{ {
static int32 lastx = 0, lasty = 0; static int32_t lastx = 0, lasty = 0;
CONTROL_MouseAxes[0].analog = (((x + lastx) / 2) * (CONTROL_MouseSensitivity<<1)); CONTROL_MouseAxes[0].analog = (((x + lastx) / 2) * (CONTROL_MouseSensitivity<<1));
CONTROL_MouseAxes[1].analog = (((y + lasty) / 2) * (CONTROL_MouseSensitivity<<1))<<1; CONTROL_MouseAxes[1].analog = (((y + lasty) / 2) * (CONTROL_MouseSensitivity<<1))<<1;
@ -80,17 +80,17 @@ void CONTROL_GetMouseDelta(void)
CONTROL_MouseAxes[1].analog = (y * (CONTROL_MouseSensitivity<<1))<<1; CONTROL_MouseAxes[1].analog = (y * (CONTROL_MouseSensitivity<<1))<<1;
} }
int32 CONTROL_GetMouseSensitivity(void) int32_t CONTROL_GetMouseSensitivity(void)
{ {
return (CONTROL_MouseSensitivity); return (CONTROL_MouseSensitivity);
} }
void CONTROL_SetMouseSensitivity(int32 newsensitivity) void CONTROL_SetMouseSensitivity(int32_t newsensitivity)
{ {
CONTROL_MouseSensitivity = newsensitivity; CONTROL_MouseSensitivity = newsensitivity;
} }
boolean CONTROL_StartMouse(void) int32_t CONTROL_StartMouse(void)
{ {
CONTROL_NumMouseButtons = MAXMOUSEBUTTONS; CONTROL_NumMouseButtons = MAXMOUSEBUTTONS;
return MOUSE_Init(); return MOUSE_Init();
@ -106,40 +106,40 @@ void CONTROL_FilterJoyDelta(void)
void CONTROL_GetJoyDelta(void) void CONTROL_GetJoyDelta(void)
{ {
int32 i; int32_t i;
for (i=0; i<joynumaxes; i++) for (i=0; i<joynumaxes; i++)
CONTROL_JoyAxes[i].analog = joyaxis[i] >> 5; CONTROL_JoyAxes[i].analog = joyaxis[i] >> 5;
} }
boolean CONTROL_StartJoy(int32 joy) int32_t CONTROL_StartJoy(int32_t joy)
{ {
UNREFERENCED_PARAMETER(joy); UNREFERENCED_PARAMETER(joy);
return (inputdevices & 4) == 4; return (inputdevices & 4) == 4;
} }
void CONTROL_ShutJoy(int32 joy) void CONTROL_ShutJoy(int32_t joy)
{ {
UNREFERENCED_PARAMETER(joy); UNREFERENCED_PARAMETER(joy);
CONTROL_JoyPresent = false; CONTROL_JoyPresent = FALSE;
} }
int32 CONTROL_GetTime(void) int32_t CONTROL_GetTime(void)
{ {
static int32 t = 0; static int32_t t = 0;
t += 5; t += 5;
return t; return t;
} }
static inline boolean CONTROL_CheckRange(int32 which) static inline int32_t CONTROL_CheckRange(int32_t which)
{ {
if ((uint32)which >= (uint32)CONTROL_NUM_FLAGS) return true; if ((uint32_t)which >= (uint32_t)CONTROL_NUM_FLAGS) return TRUE;
//Error("CONTROL_CheckRange: Index %d out of valid range for %d control flags.", //Error("CONTROL_CheckRange: Index %d out of valid range for %d control flags.",
// which, CONTROL_NUM_FLAGS); // which, CONTROL_NUM_FLAGS);
return false; return FALSE;
} }
void CONTROL_SetFlag(int32 which, boolean active) void CONTROL_SetFlag(int32_t which, int32_t active)
{ {
if (CONTROL_CheckRange(which)) return; if (CONTROL_CheckRange(which)) return;
@ -150,33 +150,33 @@ void CONTROL_SetFlag(int32 which, boolean active)
} }
if (active) if (active)
{ {
CONTROL_Flags[which].buttonheld = false; CONTROL_Flags[which].buttonheld = FALSE;
} }
else if (CONTROL_Flags[which].buttonheld == false) else if (CONTROL_Flags[which].buttonheld == FALSE)
{ {
CONTROL_Flags[which].buttonheld = true; CONTROL_Flags[which].buttonheld = TRUE;
CONTROL_Flags[which].active = (CONTROL_Flags[which].active ? false : true); CONTROL_Flags[which].active = (CONTROL_Flags[which].active ? FALSE : TRUE);
} }
} }
boolean CONTROL_KeyboardFunctionPressed(int32 which) int32_t CONTROL_KeyboardFunctionPressed(int32_t which)
{ {
boolean key1 = 0, key2 = 0; int32_t key1 = 0, key2 = 0;
if (CONTROL_CheckRange(which)) return false; if (CONTROL_CheckRange(which)) return FALSE;
if (!CONTROL_Flags[which].used) return false; if (!CONTROL_Flags[which].used) return FALSE;
if (CONTROL_KeyMapping[which].key1 != KEYUNDEFINED && !KeyBindings[CONTROL_KeyMapping[which].key1].cmd[0]) if (CONTROL_KeyMapping[which].key1 != KEYUNDEFINED && !KeyBindings[CONTROL_KeyMapping[which].key1].cmd[0])
key1 = KB_KeyDown[ CONTROL_KeyMapping[which].key1 ] ? true : false; key1 = KB_KeyDown[ CONTROL_KeyMapping[which].key1 ] ? TRUE : FALSE;
if (CONTROL_KeyMapping[which].key2 != KEYUNDEFINED && !KeyBindings[CONTROL_KeyMapping[which].key2].cmd[0]) if (CONTROL_KeyMapping[which].key2 != KEYUNDEFINED && !KeyBindings[CONTROL_KeyMapping[which].key2].cmd[0])
key2 = KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] ? true : false; key2 = KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] ? TRUE : FALSE;
return (key1 | key2); return (key1 | key2);
} }
void CONTROL_ClearKeyboardFunction(int32 which) void CONTROL_ClearKeyboardFunction(int32_t which)
{ {
if (CONTROL_CheckRange(which)) return; if (CONTROL_CheckRange(which)) return;
@ -189,25 +189,25 @@ void CONTROL_ClearKeyboardFunction(int32 which)
KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] = 0; KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] = 0;
} }
void CONTROL_DefineFlag(int32 which, boolean toggle) void CONTROL_DefineFlag(int32_t which, int32_t toggle)
{ {
if (CONTROL_CheckRange(which)) return; if (CONTROL_CheckRange(which)) return;
CONTROL_Flags[which].active = false; CONTROL_Flags[which].active = FALSE;
CONTROL_Flags[which].used = true; CONTROL_Flags[which].used = TRUE;
CONTROL_Flags[which].toggle = toggle; CONTROL_Flags[which].toggle = toggle;
CONTROL_Flags[which].buttonheld = false; CONTROL_Flags[which].buttonheld = FALSE;
CONTROL_Flags[which].cleared = 0; CONTROL_Flags[which].cleared = 0;
} }
boolean CONTROL_FlagActive(int32 which) int32_t CONTROL_FlagActive(int32_t which)
{ {
if (CONTROL_CheckRange(which)) return false; if (CONTROL_CheckRange(which)) return FALSE;
return CONTROL_Flags[which].used; return CONTROL_Flags[which].used;
} }
void CONTROL_MapKey(int32 which, kb_scancode key1, kb_scancode key2) void CONTROL_MapKey(int32_t which, kb_scancode key1, kb_scancode key2)
{ {
if (CONTROL_CheckRange(which)) return; if (CONTROL_CheckRange(which)) return;
@ -217,7 +217,7 @@ void CONTROL_MapKey(int32 which, kb_scancode key1, kb_scancode key2)
void CONTROL_PrintKeyMap(void) void CONTROL_PrintKeyMap(void)
{ {
int32 i; int32_t i;
for (i=0; i<CONTROL_NUM_FLAGS; i++) for (i=0; i<CONTROL_NUM_FLAGS; i++)
{ {
@ -226,7 +226,7 @@ void CONTROL_PrintKeyMap(void)
} }
} }
void CONTROL_PrintControlFlag(int32 which) void CONTROL_PrintControlFlag(int32_t which)
{ {
initprintf("function %2ld active=%d used=%d toggle=%d buttonheld=%d cleared=%d\n", initprintf("function %2ld active=%d used=%d toggle=%d buttonheld=%d cleared=%d\n",
which, CONTROL_Flags[which].active, CONTROL_Flags[which].used, which, CONTROL_Flags[which].active, CONTROL_Flags[which].used,
@ -236,7 +236,7 @@ void CONTROL_PrintControlFlag(int32 which)
void CONTROL_PrintAxes(void) void CONTROL_PrintAxes(void)
{ {
int32 i; int32_t i;
initprintf("nummouseaxes=%d\n", CONTROL_NumMouseAxes); initprintf("nummouseaxes=%d\n", CONTROL_NumMouseAxes);
for (i=0; i<CONTROL_NumMouseAxes; i++) for (i=0; i<CONTROL_NumMouseAxes; i++)
@ -255,7 +255,7 @@ void CONTROL_PrintAxes(void)
} }
} }
void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doubleclicked, controldevice device) void CONTROL_MapButton(int32_t whichfunction, int32_t whichbutton, int32_t doubleclicked, controldevice device)
{ {
controlbuttontype *set; controlbuttontype *set;
@ -264,7 +264,7 @@ void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doublecli
switch (device) switch (device)
{ {
case controldevice_mouse: case controldevice_mouse:
if ((uint32)whichbutton >= (uint32)MAXMOUSEBUTTONS) if ((uint32_t)whichbutton >= (uint32_t)MAXMOUSEBUTTONS)
{ {
//Error("CONTROL_MapButton: button %d out of valid range for %d mouse buttons.", //Error("CONTROL_MapButton: button %d out of valid range for %d mouse buttons.",
// whichbutton, CONTROL_NumMouseButtons); // whichbutton, CONTROL_NumMouseButtons);
@ -274,7 +274,7 @@ void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doublecli
break; break;
case controldevice_joystick: case controldevice_joystick:
if ((uint32)whichbutton >= (uint32)MAXJOYBUTTONS) if ((uint32_t)whichbutton >= (uint32_t)MAXJOYBUTTONS)
{ {
//Error("CONTROL_MapButton: button %d out of valid range for %d joystick buttons.", //Error("CONTROL_MapButton: button %d out of valid range for %d joystick buttons.",
// whichbutton, CONTROL_NumJoyButtons); // whichbutton, CONTROL_NumJoyButtons);
@ -294,11 +294,11 @@ void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doublecli
set[whichbutton].singleclicked = whichfunction; set[whichbutton].singleclicked = whichfunction;
} }
void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice device) void CONTROL_MapAnalogAxis(int32_t whichaxis, int32_t whichanalog, controldevice device)
{ {
controlaxismaptype *set; controlaxismaptype *set;
if ((uint32)whichanalog >= (uint32)analog_maxtype) if ((uint32_t)whichanalog >= (uint32_t)analog_maxtype)
{ {
//Error("CONTROL_MapAnalogAxis: analog function %d out of valid range for %d analog functions.", //Error("CONTROL_MapAnalogAxis: analog function %d out of valid range for %d analog functions.",
// whichanalog, analog_maxtype); // whichanalog, analog_maxtype);
@ -308,7 +308,7 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev
switch (device) switch (device)
{ {
case controldevice_mouse: case controldevice_mouse:
if ((uint32)whichaxis >= (uint32)MAXMOUSEAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXMOUSEAXES)
{ {
//Error("CONTROL_MapAnalogAxis: axis %d out of valid range for %d mouse axes.", //Error("CONTROL_MapAnalogAxis: axis %d out of valid range for %d mouse axes.",
// whichaxis, MAXMOUSEAXES); // whichaxis, MAXMOUSEAXES);
@ -319,7 +319,7 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev
break; break;
case controldevice_joystick: case controldevice_joystick:
if ((uint32)whichaxis >= (uint32)MAXJOYAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXJOYAXES)
{ {
//Error("CONTROL_MapAnalogAxis: axis %d out of valid range for %d joystick axes.", //Error("CONTROL_MapAnalogAxis: axis %d out of valid range for %d joystick axes.",
// whichaxis, MAXJOYAXES); // whichaxis, MAXJOYAXES);
@ -337,14 +337,14 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev
set[whichaxis].analogmap = whichanalog; set[whichaxis].analogmap = whichanalog;
} }
void CONTROL_SetAnalogAxisScale(int32 whichaxis, int32 axisscale, controldevice device) void CONTROL_SetAnalogAxisScale(int32_t whichaxis, int32_t axisscale, controldevice device)
{ {
int32 *set; int32_t *set;
switch (device) switch (device)
{ {
case controldevice_mouse: case controldevice_mouse:
if ((uint32)whichaxis >= (uint32)MAXMOUSEAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXMOUSEAXES)
{ {
//Error("CONTROL_SetAnalogAxisScale: axis %d out of valid range for %d mouse axes.", //Error("CONTROL_SetAnalogAxisScale: axis %d out of valid range for %d mouse axes.",
// whichaxis, MAXMOUSEAXES); // whichaxis, MAXMOUSEAXES);
@ -355,7 +355,7 @@ void CONTROL_SetAnalogAxisScale(int32 whichaxis, int32 axisscale, controldevice
break; break;
case controldevice_joystick: case controldevice_joystick:
if ((uint32)whichaxis >= (uint32)MAXJOYAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXJOYAXES)
{ {
//Error("CONTROL_SetAnalogAxisScale: axis %d out of valid range for %d joystick axes.", //Error("CONTROL_SetAnalogAxisScale: axis %d out of valid range for %d joystick axes.",
// whichaxis, MAXJOYAXES); // whichaxis, MAXJOYAXES);
@ -373,7 +373,7 @@ void CONTROL_SetAnalogAxisScale(int32 whichaxis, int32 axisscale, controldevice
set[whichaxis] = axisscale; set[whichaxis] = axisscale;
} }
void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 direction, controldevice device) void CONTROL_MapDigitalAxis(int32_t whichaxis, int32_t whichfunction, int32_t direction, controldevice device)
{ {
controlaxismaptype *set; controlaxismaptype *set;
@ -382,7 +382,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio
switch (device) switch (device)
{ {
case controldevice_mouse: case controldevice_mouse:
if ((uint32)whichaxis >= (uint32)MAXMOUSEAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXMOUSEAXES)
{ {
//Error("CONTROL_MapDigitalAxis: axis %d out of valid range for %d mouse axes.", //Error("CONTROL_MapDigitalAxis: axis %d out of valid range for %d mouse axes.",
// whichaxis, MAXMOUSEAXES); // whichaxis, MAXMOUSEAXES);
@ -393,7 +393,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio
break; break;
case controldevice_joystick: case controldevice_joystick:
if ((uint32)whichaxis >= (uint32)MAXJOYAXES) if ((uint32_t)whichaxis >= (uint32_t)MAXJOYAXES)
{ {
//Error("CONTROL_MapDigitalAxis: axis %d out of valid range for %d joystick axes.", //Error("CONTROL_MapDigitalAxis: axis %d out of valid range for %d joystick axes.",
// whichaxis, MAXJOYAXES); // whichaxis, MAXJOYAXES);
@ -425,7 +425,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio
void CONTROL_ClearAssignments(void) void CONTROL_ClearAssignments(void)
{ {
int32 i; int32_t i;
memset(CONTROL_MouseButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_MouseButtonMapping)); memset(CONTROL_MouseButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_MouseButtonMapping));
memset(CONTROL_JoyButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_JoyButtonMapping)); memset(CONTROL_JoyButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_JoyButtonMapping));
@ -443,29 +443,29 @@ void CONTROL_ClearAssignments(void)
} }
static void DoGetDeviceButtons( static void DoGetDeviceButtons(
int32 buttons, int32 tm, int32_t buttons, int32_t tm,
int32 NumButtons, int32_t NumButtons,
int32 *DeviceButtonState, int32_t *DeviceButtonState,
int32 *ButtonClickedTime, int32_t *ButtonClickedTime,
boolean *ButtonClickedState, int32_t *ButtonClickedState,
boolean *ButtonClicked, int32_t *ButtonClicked,
byte *ButtonClickedCount uint8_t *ButtonClickedCount
) )
{ {
int32 i=NumButtons-1, bs; int32_t i=NumButtons-1, bs;
for (; i>=0; i--) for (; i>=0; i--)
{ {
bs = (buttons >> i) & 1; bs = (buttons >> i) & 1;
DeviceButtonState[i] = bs; DeviceButtonState[i] = bs;
ButtonClickedState[i] = false; ButtonClickedState[i] = FALSE;
if (bs) if (bs)
{ {
if (ButtonClicked[i] == false) if (ButtonClicked[i] == FALSE)
{ {
ButtonClicked[i] = true; ButtonClicked[i] = TRUE;
if (ButtonClickedCount[i] == 0 || tm > ButtonClickedTime[i]) if (ButtonClickedCount[i] == 0 || tm > ButtonClickedTime[i])
{ {
@ -474,27 +474,27 @@ static void DoGetDeviceButtons(
} }
else if (tm < ButtonClickedTime[i]) else if (tm < ButtonClickedTime[i])
{ {
ButtonClickedState[i] = true; ButtonClickedState[i] = TRUE;
ButtonClickedTime[i] = 0; ButtonClickedTime[i] = 0;
ButtonClickedCount[i] = 2; ButtonClickedCount[i] = 2;
} }
} }
else if (ButtonClickedCount[i] == 2) else if (ButtonClickedCount[i] == 2)
{ {
ButtonClickedState[i] = true; ButtonClickedState[i] = TRUE;
} }
continue; continue;
} }
if (ButtonClickedCount[i] == 2) if (ButtonClickedCount[i] == 2)
ButtonClickedCount[i] = 0; ButtonClickedCount[i] = 0;
ButtonClicked[i] = false; ButtonClicked[i] = FALSE;
} }
} }
void CONTROL_GetDeviceButtons(void) void CONTROL_GetDeviceButtons(void)
{ {
int32 t; int32_t t;
t = GetTime(); t = GetTime();
@ -513,10 +513,10 @@ void CONTROL_GetDeviceButtons(void)
if (CONTROL_JoystickEnabled) if (CONTROL_JoystickEnabled)
{ {
int32 buttons = joyb; int32_t buttons = joyb;
if (joynumhats > 0 && joyhat[0] != -1) if (joynumhats > 0 && joyhat[0] != -1)
{ {
static int32 hatstate[] = { 1, 1|2, 2, 2|4, 4, 4|8, 8, 8|1 }; static int32_t hatstate[] = { 1, 1|2, 2, 2|4, 4, 4|8, 8, 8|1 };
int32_t val; int32_t val;
// thanks SDL for this much more sensible method // thanks SDL for this much more sensible method
@ -536,7 +536,7 @@ void CONTROL_GetDeviceButtons(void)
} }
} }
void CONTROL_DigitizeAxis(int32 axis, controldevice device) void CONTROL_DigitizeAxis(int32_t axis, controldevice device)
{ {
controlaxistype *set, *lastset; controlaxistype *set, *lastset;
@ -567,10 +567,10 @@ void CONTROL_DigitizeAxis(int32 axis, controldevice device)
} }
} }
void CONTROL_ScaleAxis(int32 axis, controldevice device) void CONTROL_ScaleAxis(int32_t axis, controldevice device)
{ {
controlaxistype *set; controlaxistype *set;
int32 *scale; int32_t *scale;
switch (device) switch (device)
{ {
@ -590,7 +590,7 @@ void CONTROL_ScaleAxis(int32 axis, controldevice device)
set[axis].analog = mulscale16(set[axis].analog, scale[axis]); set[axis].analog = mulscale16(set[axis].analog, scale[axis]);
} }
void CONTROL_ApplyAxis(int32 axis, ControlInfo *info, controldevice device) void CONTROL_ApplyAxis(int32_t axis, ControlInfo *info, controldevice device)
{ {
controlaxistype *set; controlaxistype *set;
controlaxismaptype *map; controlaxismaptype *map;
@ -633,7 +633,7 @@ void CONTROL_PollDevices(ControlInfo *info)
if (CONTROL_MouseEnabled) if (CONTROL_MouseEnabled)
{ {
int32 i = MAXMOUSEAXES-1; int32_t i = MAXMOUSEAXES-1;
CONTROL_GetMouseDelta(); CONTROL_GetMouseDelta();
do do
@ -653,7 +653,7 @@ void CONTROL_PollDevices(ControlInfo *info)
if (CONTROL_JoystickEnabled) if (CONTROL_JoystickEnabled)
{ {
int32 i = MAXJOYAXES-1; int32_t i = MAXJOYAXES-1;
CONTROL_GetJoyDelta(); CONTROL_GetJoyDelta();
do do
@ -674,11 +674,11 @@ void CONTROL_PollDevices(ControlInfo *info)
CONTROL_GetDeviceButtons(); CONTROL_GetDeviceButtons();
} }
void CONTROL_AxisFunctionState(int32 *p1) void CONTROL_AxisFunctionState(int32_t *p1)
{ {
if (CONTROL_NumMouseAxes) if (CONTROL_NumMouseAxes)
{ {
int32 j, i = CONTROL_NumMouseAxes-1; int32_t j, i = CONTROL_NumMouseAxes-1;
do do
{ {
@ -697,7 +697,7 @@ void CONTROL_AxisFunctionState(int32 *p1)
if (CONTROL_NumJoyAxes) if (CONTROL_NumJoyAxes)
{ {
int32 j, i = CONTROL_NumJoyAxes-1; int32_t j, i = CONTROL_NumJoyAxes-1;
do do
{ {
@ -715,11 +715,11 @@ void CONTROL_AxisFunctionState(int32 *p1)
} }
} }
void CONTROL_ButtonFunctionState(int32 *p1) void CONTROL_ButtonFunctionState(int32_t *p1)
{ {
if (CONTROL_NumMouseButtons) if (CONTROL_NumMouseButtons)
{ {
int32 i = CONTROL_NumMouseButtons-1, j; int32_t i = CONTROL_NumMouseButtons-1, j;
do do
{ {
@ -749,7 +749,7 @@ void CONTROL_ButtonFunctionState(int32 *p1)
if (CONTROL_NumJoyButtons) if (CONTROL_NumJoyButtons)
{ {
int32 i=CONTROL_NumJoyButtons-1, j; int32_t i=CONTROL_NumJoyButtons-1, j;
do do
{ {
@ -851,11 +851,11 @@ void CONTROL_ClearUserInput( UserInput *info )
if (info->button1) CONTROL_UserInputCleared[2] = true; if (info->button1) CONTROL_UserInputCleared[2] = true;
} }
*/ */
void CONTROL_ClearButton(int32 whichbutton) void CONTROL_ClearButton(int32_t whichbutton)
{ {
if (CONTROL_CheckRange(whichbutton)) return; if (CONTROL_CheckRange(whichbutton)) return;
BUTTONCLEAR(whichbutton); BUTTONCLEAR(whichbutton);
CONTROL_Flags[whichbutton].cleared = true; CONTROL_Flags[whichbutton].cleared = TRUE;
} }
void CONTROL_ProcessBinds(void) void CONTROL_ProcessBinds(void)
@ -888,7 +888,7 @@ void CONTROL_ProcessBinds(void)
void CONTROL_GetInput(ControlInfo *info) void CONTROL_GetInput(ControlInfo *info)
{ {
int32 periphs[CONTROL_NUM_FLAGS]; int32_t periphs[CONTROL_NUM_FLAGS];
CONTROL_PollDevices(info); CONTROL_PollDevices(info);
@ -902,20 +902,20 @@ void CONTROL_GetInput(ControlInfo *info)
CONTROL_ProcessBinds(); CONTROL_ProcessBinds();
{ {
int32 i = CONTROL_NUM_FLAGS-1; int32_t i = CONTROL_NUM_FLAGS-1;
do do
{ {
CONTROL_SetFlag(i, CONTROL_KeyboardFunctionPressed(i) | periphs[i] | extinput[i]); CONTROL_SetFlag(i, CONTROL_KeyboardFunctionPressed(i) | periphs[i] | extinput[i]);
if (CONTROL_Flags[i].cleared == false) BUTTONSET(i, CONTROL_Flags[i].active); if (CONTROL_Flags[i].cleared == FALSE) BUTTONSET(i, CONTROL_Flags[i].active);
else if (CONTROL_Flags[i].active == false) CONTROL_Flags[i].cleared = 0; else if (CONTROL_Flags[i].active == FALSE) CONTROL_Flags[i].cleared = 0;
} }
while (--i); while (--i);
CONTROL_SetFlag(0, CONTROL_KeyboardFunctionPressed(0) | periphs[0] | extinput[0]); CONTROL_SetFlag(0, CONTROL_KeyboardFunctionPressed(0) | periphs[0] | extinput[0]);
if (CONTROL_Flags[0].cleared == false) BUTTONSET(0, CONTROL_Flags[0].active); if (CONTROL_Flags[0].cleared == FALSE) BUTTONSET(0, CONTROL_Flags[0].active);
else if (CONTROL_Flags[0].active == false) CONTROL_Flags[0].cleared = 0; else if (CONTROL_Flags[0].active == FALSE) CONTROL_Flags[0].cleared = 0;
} }
memset(extinput, 0, sizeof(extinput)); memset(extinput, 0, sizeof(extinput));
@ -929,13 +929,13 @@ void CONTROL_Ack(void)
{ {
} }
boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 ticspersecond) int32_t CONTROL_Startup(controltype which, int32_t(*TimeFunction)(void), int32_t ticspersecond)
{ {
int32 i; int32_t i;
UNREFERENCED_PARAMETER(which); UNREFERENCED_PARAMETER(which);
if (CONTROL_Started) return false; if (CONTROL_Started) return FALSE;
if (TimeFunction) GetTime = TimeFunction; if (TimeFunction) GetTime = TimeFunction;
else GetTime = CONTROL_GetTime; else GetTime = CONTROL_GetTime;
@ -946,10 +946,10 @@ boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 tic
if (CONTROL_DoubleClickSpeed <= 0) if (CONTROL_DoubleClickSpeed <= 0)
CONTROL_DoubleClickSpeed = 1; CONTROL_DoubleClickSpeed = 1;
if (initinput()) return true; if (initinput()) return TRUE;
CONTROL_MousePresent = CONTROL_MouseEnabled = false; CONTROL_MousePresent = CONTROL_MouseEnabled = FALSE;
CONTROL_JoyPresent = CONTROL_JoystickEnabled = false; CONTROL_JoyPresent = CONTROL_JoystickEnabled = FALSE;
CONTROL_NumMouseButtons = CONTROL_NumJoyButtons = 0; CONTROL_NumMouseButtons = CONTROL_NumJoyButtons = 0;
CONTROL_NumMouseAxes = CONTROL_NumJoyAxes = 0; CONTROL_NumMouseAxes = CONTROL_NumJoyAxes = 0;
KB_Startup(); KB_Startup();
@ -986,22 +986,22 @@ boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 tic
memset(CONTROL_UserInputCleared, 0, sizeof(CONTROL_UserInputCleared)); memset(CONTROL_UserInputCleared, 0, sizeof(CONTROL_UserInputCleared));
for (i=0; i<CONTROL_NUM_FLAGS; i++) for (i=0; i<CONTROL_NUM_FLAGS; i++)
CONTROL_Flags[i].used = false; CONTROL_Flags[i].used = FALSE;
CONTROL_Started = true; CONTROL_Started = TRUE;
return false; return FALSE;
} }
void CONTROL_Shutdown(void) void CONTROL_Shutdown(void)
{ {
if (!CONTROL_Started) return; if (!CONTROL_Started) return;
CONTROL_JoyPresent = false; CONTROL_JoyPresent = FALSE;
MOUSE_Shutdown(); MOUSE_Shutdown();
uninitinput(); uninitinput();
CONTROL_Started = false; CONTROL_Started = FALSE;
} }

View file

@ -96,19 +96,19 @@ typedef enum
typedef struct typedef struct
{ {
boolean button0; int32_t button0;
boolean button1; int32_t button1;
direction dir; direction dir;
} UserInput; } UserInput;
typedef struct typedef struct
{ {
fixed dx; int32_t dx;
fixed dy; int32_t dy;
fixed dz; int32_t dz;
fixed dyaw; int32_t dyaw;
fixed dpitch; int32_t dpitch;
fixed droll; int32_t droll;
} ControlInfo; } ControlInfo;
typedef enum typedef enum
@ -132,10 +132,10 @@ typedef enum
// //
//*************************************************************************** //***************************************************************************
extern boolean CONTROL_MousePresent; extern int32_t CONTROL_MousePresent;
extern boolean CONTROL_JoyPresent; extern int32_t CONTROL_JoyPresent;
extern boolean CONTROL_MouseEnabled; extern int32_t CONTROL_MouseEnabled;
extern boolean CONTROL_JoystickEnabled; extern int32_t CONTROL_JoystickEnabled;
extern uint64 CONTROL_ButtonState; extern uint64 CONTROL_ButtonState;
extern uint64 CONTROL_ButtonHeldState; extern uint64 CONTROL_ButtonHeldState;
@ -146,59 +146,59 @@ extern uint64 CONTROL_ButtonHeldState;
// //
//*************************************************************************** //***************************************************************************
void CONTROL_MapKey( int32 which, kb_scancode key1, kb_scancode key2 ); void CONTROL_MapKey( int32_t which, kb_scancode key1, kb_scancode key2 );
void CONTROL_MapButton void CONTROL_MapButton
( (
int32 whichfunction, int32_t whichfunction,
int32 whichbutton, int32_t whichbutton,
boolean doubleclicked, int32_t doubleclicked,
controldevice device controldevice device
); );
void CONTROL_DefineFlag( int32 which, boolean toggle ); void CONTROL_DefineFlag( int32_t which, int32_t toggle );
boolean CONTROL_FlagActive( int32 which ); int32_t CONTROL_FlagActive( int32_t which );
void CONTROL_ClearAssignments( void ); void CONTROL_ClearAssignments( void );
void CONTROL_GetUserInput( UserInput *info ); void CONTROL_GetUserInput( UserInput *info );
void CONTROL_GetInput( ControlInfo *info ); void CONTROL_GetInput( ControlInfo *info );
void CONTROL_ClearButton( int32 whichbutton ); void CONTROL_ClearButton( int32_t whichbutton );
void CONTROL_ClearUserInput( UserInput *info ); void CONTROL_ClearUserInput( UserInput *info );
void CONTROL_WaitRelease( void ); void CONTROL_WaitRelease( void );
void CONTROL_Ack( void ); void CONTROL_Ack( void );
int32 CONTROL_GetMouseSensitivity( void ); int32_t CONTROL_GetMouseSensitivity( void );
void CONTROL_SetMouseSensitivity( int32 newsensitivity ); void CONTROL_SetMouseSensitivity( int32_t newsensitivity );
boolean CONTROL_Startup int32_t CONTROL_Startup
( (
controltype which, controltype which,
int32 ( *TimeFunction )( void ), int32_t ( *TimeFunction )( void ),
int32 ticspersecond int32_t ticspersecond
); );
void CONTROL_Shutdown( void ); void CONTROL_Shutdown( void );
void CONTROL_SetDoubleClickDelay(int32 delay); void CONTROL_SetDoubleClickDelay(int32_t delay);
int32 CONTROL_GetDoubleClickDelay(void); int32_t CONTROL_GetDoubleClickDelay(void);
void CONTROL_MapAnalogAxis void CONTROL_MapAnalogAxis
( (
int32 whichaxis, int32_t whichaxis,
int32 whichanalog, int32_t whichanalog,
controldevice device controldevice device
); );
void CONTROL_MapDigitalAxis void CONTROL_MapDigitalAxis
( (
int32 whichaxis, int32_t whichaxis,
int32 whichfunction, int32_t whichfunction,
int32 direction, int32_t direction,
controldevice device controldevice device
); );
void CONTROL_SetAnalogAxisScale void CONTROL_SetAnalogAxisScale
( (
int32 whichaxis, int32_t whichaxis,
int32 axisscale, int32_t axisscale,
controldevice device controldevice device
); );
void CONTROL_PrintKeyMap(void); void CONTROL_PrintKeyMap(void);
void CONTROL_PrintControlFlag(int32 which); void CONTROL_PrintControlFlag(int32_t which);
void CONTROL_PrintAxes( void ); void CONTROL_PrintAxes( void );
#define MAXBINDSTRINGLENGTH 128 #define MAXBINDSTRINGLENGTH 128

View file

@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "compat.h" #include "compat.h"
#include "types.h"
#include "file_lib.h" #include "file_lib.h"
#include "util_lib.h" #include "util_lib.h"
#include "cache1d.h" #include "cache1d.h"
@ -56,9 +56,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MaxFiles 20 #define MaxFiles 20
static char *FileNames[MaxFiles]; static char *FileNames[MaxFiles];
int32 SafeOpen(const char *filename, int32 mode, int32 sharemode) int32_t SafeOpen(const char *filename, int32_t mode, int32_t sharemode)
{ {
int32 h; int32_t h;
h = openfrompath(filename, mode, sharemode); h = openfrompath(filename, mode, sharemode);
if (h < 0) Error("Error opening %s: %s", filename, strerror(errno)); if (h < 0) Error("Error opening %s: %s", filename, strerror(errno));
@ -73,7 +73,7 @@ int32 SafeOpen(const char *filename, int32 mode, int32 sharemode)
return h; return h;
} }
int32 SafeOpenRead(const char *filename, int32 filetype) int32_t SafeOpenRead(const char *filename, int32_t filetype)
{ {
switch (filetype) switch (filetype)
{ {
@ -87,7 +87,7 @@ int32 SafeOpenRead(const char *filename, int32 filetype)
} }
} }
void SafeClose(int32 handle) void SafeClose(int32_t handle)
{ {
if (handle < 0) return; if (handle < 0) return;
if (close(handle) < 0) if (close(handle) < 0)
@ -105,21 +105,21 @@ void SafeClose(int32 handle)
} }
} }
boolean SafeFileExists(const char *filename) int32_t SafeFileExists(const char *filename)
{ {
if (!access(filename, F_OK)) return true; if (!access(filename, F_OK)) return TRUE;
return false; return FALSE;
} }
int32 SafeFileLength(int32 handle) int32_t SafeFileLength(int32_t handle)
{ {
if (handle < 0) return -1; if (handle < 0) return -1;
return Bfilelength(handle); return Bfilelength(handle);
} }
void SafeRead(int32 handle, void *buffer, int32 count) void SafeRead(int32_t handle, void *buffer, int32_t count)
{ {
int32 b; int32_t b;
b = read(handle, buffer, count); b = read(handle, buffer, count);
if (b != count) if (b != count)

View file

@ -48,42 +48,42 @@ enum
// SafeOpenWrite - Opens a file for writing, returns handle // SafeOpenWrite - Opens a file for writing, returns handle
// //
//========================================================================== //==========================================================================
int32 SafeOpenWrite ( const char * filename, int32 filetype ); int32_t SafeOpenWrite ( const char * filename, int32_t filetype );
//========================================================================== //==========================================================================
// //
// SafeOpenRead - Opens a file for reading, returns handle // SafeOpenRead - Opens a file for reading, returns handle
// //
//========================================================================== //==========================================================================
int32 SafeOpenRead ( const char * filename, int32 filetype ); int32_t SafeOpenRead ( const char * filename, int32_t filetype );
//========================================================================== //==========================================================================
// //
// SafeOpenAppend - Opens a file for appending, returns handle // SafeOpenAppend - Opens a file for appending, returns handle
// //
//========================================================================== //==========================================================================
int32 SafeOpenAppend ( const char * filename, int32 filetype ); int32_t SafeOpenAppend ( const char * filename, int32_t filetype );
//========================================================================== //==========================================================================
// //
// SafeClose - Close a file denoted by the file handle // SafeClose - Close a file denoted by the file handle
// //
//========================================================================== //==========================================================================
void SafeClose ( int32 handle ); void SafeClose ( int32_t handle );
//========================================================================== //==========================================================================
// //
// SafeFileExists - Checks for existence of file // SafeFileExists - Checks for existence of file
// //
//========================================================================== //==========================================================================
boolean SafeFileExists ( const char * filename ); int32_t SafeFileExists ( const char * filename );
//========================================================================== //==========================================================================
// //
// SafeFileLength - Get length of a file pointed to by handle // SafeFileLength - Get length of a file pointed to by handle
// //
//========================================================================== //==========================================================================
int32 SafeFileLength ( int32 handle ); int32_t SafeFileLength ( int32_t handle );
//========================================================================== //==========================================================================
// //
@ -96,7 +96,7 @@ int32 SafeFileLength ( int32 handle );
// count - number of bytes to read // count - number of bytes to read
// //
//========================================================================== //==========================================================================
void SafeRead (int32 handle, void *buffer, int32 count); void SafeRead (int32_t handle, void *buffer, int32_t count);
//========================================================================== //==========================================================================
// //
@ -109,7 +109,7 @@ void SafeRead (int32 handle, void *buffer, int32 count);
// count - number of bytes to write // count - number of bytes to write
// //
//========================================================================== //==========================================================================
void SafeWrite (int32 handle, void *buffer, int32 count); void SafeWrite (int32_t handle, void *buffer, int32_t count);
//========================================================================== //==========================================================================
// //
@ -122,7 +122,7 @@ void SafeWrite (int32 handle, void *buffer, int32 count);
// returns number of bytes read // returns number of bytes read
// //
//========================================================================== //==========================================================================
int32 LoadFile ( const char * filename, void ** bufferptr ); int32_t LoadFile ( const char * filename, void ** bufferptr );
//========================================================================== //==========================================================================
// //
@ -135,7 +135,7 @@ int32 LoadFile ( const char * filename, void ** bufferptr );
// count - number of bytes to write // count - number of bytes to write
// //
//========================================================================== //==========================================================================
void SaveFile ( const char * filename, void * bufferptr, int32 count ); void SaveFile ( const char * filename, void * bufferptr, int32_t count );
//========================================================================== //==========================================================================
// //
@ -191,7 +191,7 @@ void ExtractFileBase (char *path, char *dest);
// returns false otherwise // returns false otherwise
// //
//========================================================================== //==========================================================================
boolean GetExtension( char *filename, char *extension ); int32_t GetExtension( char *filename, char *extension );
//========================================================================== //==========================================================================
// //
@ -233,7 +233,7 @@ char * GetPath (char * path, char *dir);
// FALSE - If unsuccessful. // FALSE - If unsuccessful.
// //
//****************************************************************************** //******************************************************************************
boolean ChangeDirectory (char * path); int32_t ChangeDirectory (char * path);
//****************************************************************************** //******************************************************************************
// //
@ -250,7 +250,7 @@ boolean ChangeDirectory (char * path);
// FALSE - If drive change unsuccessful. // FALSE - If drive change unsuccessful.
// //
//****************************************************************************** //******************************************************************************
boolean ChangeDrive (char *drive); int32_t ChangeDrive (char *drive);
#endif #endif

View file

@ -33,14 +33,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "compat.h" #include "compat.h"
#include "types.h"
#include "keyboard.h" #include "keyboard.h"
#include "control.h" #include "control.h"
kb_scancode KB_LastScan; kb_scancode KB_LastScan;
static boolean numpad = 0; static int32_t numpad = 0;
// translation table for taking key names to scancodes and back again // translation table for taking key names to scancodes and back again
static struct static struct
@ -196,7 +196,7 @@ static char sctoasc[2][256] = {
}; };
*/ */
boolean KB_KeyWaiting(void) int32_t KB_KeyWaiting(void)
{ {
return bkbhit(); return bkbhit();
// return (keyfifoplc != keyfifoend); // return (keyfifoplc != keyfifoend);
@ -263,7 +263,7 @@ void KB_TurnKeypadOff(void)
numpad = 0; numpad = 0;
} }
boolean KB_KeypadActive(void) int32_t KB_KeypadActive(void)
{ {
return numpad; return numpad;
} }

View file

@ -41,7 +41,7 @@ extern "C" {
============================================================================= =============================================================================
*/ */
typedef uint8 kb_scancode; typedef uint8_t kb_scancode;
#define sc_None 0 #define sc_None 0
#define sc_Bad 0xff #define sc_Bad 0xff
@ -209,7 +209,7 @@ extern kb_scancode KB_LastScan;
============================================================================= =============================================================================
*/ */
boolean KB_KeyWaiting( void ); // Checks if a character is waiting in the keyboard queue int32_t KB_KeyWaiting( void ); // Checks if a character is waiting in the keyboard queue
char KB_Getch( void ); // Gets the next keypress char KB_Getch( void ); // Gets the next keypress
void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters. void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters.
void KB_ClearKeysDown( void ); // Clears all keys down flags. void KB_ClearKeysDown( void ); // Clears all keys down flags.
@ -217,7 +217,7 @@ char * KB_ScanCodeToString( kb_scancode scancode ); // convert scancode into a
kb_scancode KB_StringToScanCode( char * string ); // convert a string into a scancode kb_scancode KB_StringToScanCode( char * string ); // convert a string into a scancode
void KB_TurnKeypadOn( void ); // turn the keypad on void KB_TurnKeypadOn( void ); // turn the keypad on
void KB_TurnKeypadOff( void ); // turn the keypad off void KB_TurnKeypadOff( void ); // turn the keypad off
boolean KB_KeypadActive( void ); // check whether keypad is active int32_t KB_KeypadActive( void ); // check whether keypad is active
void KB_Startup( void ); void KB_Startup( void );
void KB_Shutdown( void ); void KB_Shutdown( void );

View file

@ -27,8 +27,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
extern int32 FindDistance2D(int32_t dx, int32_t dy); extern int32_t FindDistance2D(int32_t dx, int32_t dy);
extern int32 FindDistance3D(int32_t dx, int32_t dy, int32_t dz); extern int32_t FindDistance3D(int32_t dx, int32_t dy, int32_t dz);
extern int32 FindDistance3D_HP(int32 dx, int32 dy, int32 dz); extern int32_t FindDistance3D_HP(int32_t dx, int32_t dy, int32_t dz);
extern int32 ArcTangentAppx(int32 dx, int32 dy); extern int32_t ArcTangentAppx(int32_t dx, int32_t dy);

View file

@ -33,12 +33,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "compat.h" #include "compat.h"
#include "types.h"
#include "mouse.h" #include "mouse.h"
#include "baselayer.h" #include "baselayer.h"
boolean MOUSE_Init(void) int32_t MOUSE_Init(void)
{ {
initmouse(); initmouse();
return ((inputdevices & 2) == 2); return ((inputdevices & 2) == 2);
@ -61,21 +61,21 @@ void MOUSE_HideCursor(void)
} }
int32 MOUSE_GetButtons(void) int32_t MOUSE_GetButtons(void)
{ {
int32 buttons; int32_t buttons;
readmousebstatus(&buttons); readmousebstatus(&buttons);
return buttons; return buttons;
} }
int32 MOUSE_ClearButton(int32 b) int32_t MOUSE_ClearButton(int32_t b)
{ {
return (mouseb &= ~b); return (mouseb &= ~b);
} }
void MOUSE_GetDelta(int32*x, int32*y) void MOUSE_GetDelta(int32_t*x, int32_t*y)
{ {
readmousexy(x,y); readmousexy(x,y);
} }

View file

@ -41,13 +41,13 @@ extern "C" {
#define RIGHT_MOUSE_PRESSED( button ) ( ( ( button ) & RIGHT_MOUSE ) != 0 ) #define RIGHT_MOUSE_PRESSED( button ) ( ( ( button ) & RIGHT_MOUSE ) != 0 )
#define MIDDLE_MOUSE_PRESSED( button ) ( ( ( button ) & MIDDLE_MOUSE ) != 0 ) #define MIDDLE_MOUSE_PRESSED( button ) ( ( ( button ) & MIDDLE_MOUSE ) != 0 )
boolean MOUSE_Init( void ); int32_t MOUSE_Init( void );
void MOUSE_Shutdown( void ); void MOUSE_Shutdown( void );
void MOUSE_ShowCursor( void ); void MOUSE_ShowCursor( void );
void MOUSE_HideCursor( void ); void MOUSE_HideCursor( void );
int32 MOUSE_GetButtons( void ); int32_t MOUSE_GetButtons( void );
int32 MOUSE_ClearButton( int32 b ); int32_t MOUSE_ClearButton( int32_t b );
void MOUSE_GetDelta( int32*x, int32*y ); void MOUSE_GetDelta( int32_t*x, int32_t*y );
#ifdef __cplusplus #ifdef __cplusplus
}; };

View file

@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "compat.h" #include "compat.h"
#include "types.h"
#include "scriplib.h" #include "scriplib.h"
#include "util_lib.h" #include "util_lib.h"
#include "file_lib.h" #include "file_lib.h"
@ -54,9 +54,9 @@ static script_t *scriptfiles[MAXSCRIPTFILES];
#define SC(s) scriptfiles[s] #define SC(s) scriptfiles[s]
int32 SCRIPT_New(void) int32_t SCRIPT_New(void)
{ {
int32 i; int32_t i;
for (i=0; i<MAXSCRIPTFILES; i++) for (i=0; i<MAXSCRIPTFILES; i++)
{ {
@ -72,7 +72,7 @@ int32 SCRIPT_New(void)
return -1; return -1;
} }
void SCRIPT_Delete(int32 scripthandle) void SCRIPT_Delete(int32_t scripthandle)
{ {
ScriptSectionType *s; ScriptSectionType *s;
@ -133,7 +133,7 @@ void SCRIPT_FreeSection(ScriptSectionType * section)
(e)->preventry = (e); \ (e)->preventry = (e); \
} }
ScriptSectionType * SCRIPT_SectionExists(int32 scripthandle, char * sectionname) ScriptSectionType * SCRIPT_SectionExists(int32_t scripthandle, char * sectionname)
{ {
ScriptSectionType *s, *ls=NULL; ScriptSectionType *s, *ls=NULL;
@ -148,7 +148,7 @@ ScriptSectionType * SCRIPT_SectionExists(int32 scripthandle, char * sectionname)
return NULL; return NULL;
} }
ScriptSectionType * SCRIPT_AddSection(int32 scripthandle, char * sectionname) ScriptSectionType * SCRIPT_AddSection(int32_t scripthandle, char * sectionname)
{ {
ScriptSectionType *s,*s2; ScriptSectionType *s,*s2;
@ -190,7 +190,7 @@ ScriptEntryType * SCRIPT_EntryExists(ScriptSectionType * section, char * entryna
return NULL; return NULL;
} }
void SCRIPT_AddEntry(int32 scripthandle, char * sectionname, char * entryname, char * entryvalue) void SCRIPT_AddEntry(int32_t scripthandle, char * sectionname, char * entryname, char * entryvalue)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e,*e2; ScriptEntryType *e,*e2;
@ -228,7 +228,7 @@ void SCRIPT_AddEntry(int32 scripthandle, char * sectionname, char * entryname, c
} }
int32 SCRIPT_ParseBuffer(int32 scripthandle, char *data, int32 length) int32_t SCRIPT_ParseBuffer(int32_t scripthandle, char *data, int32_t length)
{ {
char *fence = data + length; char *fence = data + length;
char *dp, *sp, ch=0, lastch=0; char *dp, *sp, ch=0, lastch=0;
@ -425,23 +425,23 @@ int32 SCRIPT_ParseBuffer(int32 scripthandle, char *data, int32 length)
//--- //---
int32 SCRIPT_Init(char * name) int32_t SCRIPT_Init(char * name)
{ {
int32 h = SCRIPT_New(); int32_t h = SCRIPT_New();
if (h >= 0) Bstrncpy(SCRIPT(h,scriptfilename), name, 127); if (h >= 0) Bstrncpy(SCRIPT(h,scriptfilename), name, 127);
return h; return h;
} }
void SCRIPT_Free(int32 scripthandle) void SCRIPT_Free(int32_t scripthandle)
{ {
SCRIPT_Delete(scripthandle); SCRIPT_Delete(scripthandle);
} }
int32 SCRIPT_Load(char * filename) int32_t SCRIPT_Load(char * filename)
{ {
int32 s,h,l; int32_t s,h,l;
char *b; char *b;
h = SafeOpenRead(filename, filetype_binary); h = SafeOpenRead(filename, filetype_binary);
@ -465,7 +465,7 @@ int32 SCRIPT_Load(char * filename)
return s; return s;
} }
void SCRIPT_Save(int32 scripthandle, char * filename) void SCRIPT_Save(int32_t scripthandle, char * filename)
{ {
char *section, *entry, *value; char *section, *entry, *value;
int32_t sec, ent, numsect, nument; int32_t sec, ent, numsect, nument;
@ -499,9 +499,9 @@ void SCRIPT_Save(int32 scripthandle, char * filename)
fclose(fp); fclose(fp);
} }
int32 SCRIPT_NumberSections(int32 scripthandle) int32_t SCRIPT_NumberSections(int32_t scripthandle)
{ {
int32 c=0; int32_t c=0;
ScriptSectionType *s,*ls=NULL; ScriptSectionType *s,*ls=NULL;
if (!SC(scripthandle)) return 0; if (!SC(scripthandle)) return 0;
@ -512,7 +512,7 @@ int32 SCRIPT_NumberSections(int32 scripthandle)
return c; return c;
} }
char * SCRIPT_Section(int32 scripthandle, int32 which) char * SCRIPT_Section(int32_t scripthandle, int32_t which)
{ {
ScriptSectionType *s,*ls=NULL; ScriptSectionType *s,*ls=NULL;
@ -524,11 +524,11 @@ char * SCRIPT_Section(int32 scripthandle, int32 which)
return s->name; return s->name;
} }
int32 SCRIPT_NumberEntries(int32 scripthandle, char * sectionname) int32_t SCRIPT_NumberEntries(int32_t scripthandle, char * sectionname)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e,*le=NULL; ScriptEntryType *e,*le=NULL;
int32 c=0; int32_t c=0;
if (!SC(scripthandle)) return 0; if (!SC(scripthandle)) return 0;
if (!SCRIPT(scripthandle,script)) return 0; if (!SCRIPT(scripthandle,script)) return 0;
@ -540,7 +540,7 @@ int32 SCRIPT_NumberEntries(int32 scripthandle, char * sectionname)
return c; return c;
} }
char * SCRIPT_Entry(int32 scripthandle, char * sectionname, int32 which) char * SCRIPT_Entry(int32_t scripthandle, char * sectionname, int32_t which)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e,*le=NULL; ScriptEntryType *e,*le=NULL;
@ -555,7 +555,7 @@ char * SCRIPT_Entry(int32 scripthandle, char * sectionname, int32 which)
return e->name; return e->name;
} }
char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname) char * SCRIPT_GetRaw(int32_t scripthandle, char * sectionname, char * entryname)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e; ScriptEntryType *e;
@ -570,7 +570,7 @@ char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname)
return e->value; return e->value;
} }
boolean SCRIPT_GetString(int32 scripthandle, char * sectionname, char * entryname, char * dest) int32_t SCRIPT_GetString(int32_t scripthandle, char * sectionname, char * entryname, char * dest)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e; ScriptEntryType *e;
@ -629,7 +629,7 @@ boolean SCRIPT_GetString(int32 scripthandle, char * sectionname, char * entrynam
return 0; return 0;
} }
boolean SCRIPT_GetDoubleString(int32 scripthandle, char * sectionname, char * entryname, char * dest1, char * dest2) int32_t SCRIPT_GetDoubleString(int32_t scripthandle, char * sectionname, char * entryname, char * dest1, char * dest2)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e; ScriptEntryType *e;
@ -733,7 +733,7 @@ breakme:
return 0; return 0;
} }
boolean SCRIPT_GetNumber(int32 scripthandle, char * sectionname, char * entryname, int32 * number) int32_t SCRIPT_GetNumber(int32_t scripthandle, char * sectionname, char * entryname, int32_t * number)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e; ScriptEntryType *e;
@ -765,7 +765,7 @@ boolean SCRIPT_GetNumber(int32 scripthandle, char * sectionname, char * entrynam
return 0; return 0;
} }
boolean SCRIPT_GetBoolean(int32 scripthandle, char * sectionname, char * entryname, boolean * boole) int32_t SCRIPT_GetBoolean(int32_t scripthandle, char * sectionname, char * entryname, int32_t * boole)
{ {
ScriptSectionType *s; ScriptSectionType *s;
ScriptEntryType *e; ScriptEntryType *e;
@ -788,14 +788,14 @@ boolean SCRIPT_GetBoolean(int32 scripthandle, char * sectionname, char * entryna
return 0; return 0;
} }
void SCRIPT_PutSection(int32 scripthandle, char * sectionname) void SCRIPT_PutSection(int32_t scripthandle, char * sectionname)
{ {
SCRIPT_AddSection(scripthandle, sectionname); SCRIPT_AddSection(scripthandle, sectionname);
} }
void SCRIPT_PutRaw void SCRIPT_PutRaw
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * raw char * raw
@ -806,7 +806,7 @@ void SCRIPT_PutRaw
void SCRIPT_PutString void SCRIPT_PutString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * string char * string
@ -840,7 +840,7 @@ void SCRIPT_PutString
void SCRIPT_PutDoubleString void SCRIPT_PutDoubleString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * string1, char * string1,
@ -892,12 +892,12 @@ void SCRIPT_PutDoubleString
void SCRIPT_PutNumber void SCRIPT_PutNumber
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
int32 number, int32_t number,
boolean hexadecimal, int32_t hexadecimal,
boolean defaultvalue int32_t defaultvalue
) )
{ {
char raw[64]; char raw[64];
@ -911,10 +911,10 @@ void SCRIPT_PutNumber
void SCRIPT_PutBoolean void SCRIPT_PutBoolean
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
boolean boole int32_t boole
) )
{ {
char raw[2] = "0"; char raw[2] = "0";
@ -926,11 +926,11 @@ void SCRIPT_PutBoolean
void SCRIPT_PutDouble void SCRIPT_PutDouble
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
double number, double number,
boolean defaultvalue int32_t defaultvalue
) )
{ {
char raw[64]; char raw[64];

View file

@ -39,7 +39,7 @@ extern "C" {
= =
============== ==============
*/ */
int32 SCRIPT_Init( char * name ); int32_t SCRIPT_Init( char * name );
/* /*
@ -49,7 +49,7 @@ int32 SCRIPT_Init( char * name );
= =
============== ==============
*/ */
void SCRIPT_Free( int32 scripthandle ); void SCRIPT_Free( int32_t scripthandle );
/* /*
============== ==============
@ -59,7 +59,7 @@ void SCRIPT_Free( int32 scripthandle );
============== ==============
*/ */
int32 SCRIPT_Load ( char * filename ); int32_t SCRIPT_Load ( char * filename );
/* /*
============== ==============
@ -68,7 +68,7 @@ int32 SCRIPT_Load ( char * filename );
= =
============== ==============
*/ */
void SCRIPT_Save (int32 scripthandle, char * filename); void SCRIPT_Save (int32_t scripthandle, char * filename);
/* /*
@ -79,7 +79,7 @@ void SCRIPT_Save (int32 scripthandle, char * filename);
============== ==============
*/ */
int32 SCRIPT_NumberSections( int32 scripthandle ); int32_t SCRIPT_NumberSections( int32_t scripthandle );
/* /*
============== ==============
@ -89,7 +89,7 @@ int32 SCRIPT_NumberSections( int32 scripthandle );
============== ==============
*/ */
char * SCRIPT_Section( int32 scripthandle, int32 which ); char * SCRIPT_Section( int32_t scripthandle, int32_t which );
/* /*
============== ==============
@ -99,7 +99,7 @@ char * SCRIPT_Section( int32 scripthandle, int32 which );
============== ==============
*/ */
int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname ); int32_t SCRIPT_NumberEntries( int32_t scripthandle, char * sectionname );
/* /*
============== ==============
@ -109,7 +109,7 @@ int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname );
============== ==============
*/ */
char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which ); char * SCRIPT_Entry( int32_t scripthandle, char * sectionname, int32_t which );
/* /*
@ -119,7 +119,7 @@ char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which );
= =
============== ==============
*/ */
char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname); char * SCRIPT_GetRaw(int32_t scripthandle, char * sectionname, char * entryname);
/* /*
============== ==============
@ -128,9 +128,9 @@ char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname);
= =
============== ==============
*/ */
boolean SCRIPT_GetString int32_t SCRIPT_GetString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * dest char * dest
@ -143,9 +143,9 @@ boolean SCRIPT_GetString
= =
============== ==============
*/ */
boolean SCRIPT_GetDoubleString int32_t SCRIPT_GetDoubleString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * dest1, char * dest1,
@ -159,12 +159,12 @@ boolean SCRIPT_GetDoubleString
= =
============== ==============
*/ */
boolean SCRIPT_GetNumber int32_t SCRIPT_GetNumber
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
int32 * number int32_t * number
); );
/* /*
@ -174,12 +174,12 @@ boolean SCRIPT_GetNumber
= =
============== ==============
*/ */
boolean SCRIPT_GetBoolean int32_t SCRIPT_GetBoolean
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
boolean * boole int32_t * boole
); );
/* /*
@ -189,7 +189,7 @@ boolean SCRIPT_GetBoolean
= =
============== ==============
*/ */
void SCRIPT_PutSection( int32 scripthandle, char * sectionname ); void SCRIPT_PutSection( int32_t scripthandle, char * sectionname );
/* /*
============== ==============
@ -200,7 +200,7 @@ void SCRIPT_PutSection( int32 scripthandle, char * sectionname );
*/ */
void SCRIPT_PutRaw void SCRIPT_PutRaw
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * raw char * raw
@ -215,7 +215,7 @@ void SCRIPT_PutRaw
*/ */
void SCRIPT_PutString void SCRIPT_PutString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * string char * string
@ -230,7 +230,7 @@ void SCRIPT_PutString
*/ */
void SCRIPT_PutDoubleString void SCRIPT_PutDoubleString
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
char * string1, char * string1,
@ -246,12 +246,12 @@ void SCRIPT_PutDoubleString
*/ */
void SCRIPT_PutNumber void SCRIPT_PutNumber
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
int32 number, int32_t number,
boolean hexadecimal, int32_t hexadecimal,
boolean defaultvalue int32_t defaultvalue
); );
/* /*
@ -263,10 +263,10 @@ void SCRIPT_PutNumber
*/ */
void SCRIPT_PutBoolean void SCRIPT_PutBoolean
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
boolean boole int32_t boole
); );
/* /*
@ -279,11 +279,11 @@ void SCRIPT_PutBoolean
void SCRIPT_PutDouble void SCRIPT_PutDouble
( (
int32 scripthandle, int32_t scripthandle,
char * sectionname, char * sectionname,
char * entryname, char * entryname,
double number, double number,
boolean defaultvalue int32_t defaultvalue
); );

View file

@ -1,114 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
*/
//-------------------------------------------------------------------------
#ifndef _types_public
#define _types_public
#ifdef __cplusplus
extern "C" {
#endif
//***************************************************************************
//
// Global Data Types (For portability)
//
//***************************************************************************
typedef unsigned char uint8;
typedef uint8 byte;
typedef signed char int8;
typedef unsigned short int uint16;
typedef uint16 word;
typedef short int int16;
typedef unsigned int uint32;
typedef int int32;
typedef uint32 dword;
typedef int32 fixed;
typedef int32 boolean;
typedef float float32;
typedef double float64;
//typedef int double float128;
typedef float64 appfloat;
#ifndef _MSC_VER
#define MAXINT32 0x7fffffff
#define MININT32 -0x80000000
#define MAXUINT32 0xffffffff
#define MINUINT32 0
#define MAXINT16 0x7fff
#define MININT16 -0x8000
#define MAXUINT16 0xffff
#define MINUINT16 0
#endif
//***************************************************************************
//
// boolean values
//
//***************************************************************************
#define true ( 1 == 1 )
#define false ( ! true )
#ifndef TRUE
#define TRUE ( 1 == 1 )
#define FALSE ( !TRUE )
#endif
//***************************************************************************
//
// BYTE ACCESS MACROS
//
//***************************************************************************
// WORD macros
#define Int16_HighByte( x ) ( (uint8) ((x)>>8) )
#define Int16_LowByte( x ) ( (uint8) ((x)&0xff) )
// DWORD macros
#define Int32_4Byte( x ) ( (uint8) ((x)>>24)&0xff )
#define Int32_3Byte( x ) ( (uint8) (((x)>>16)&0xff) )
#define Int32_2Byte( x ) ( (uint8) (((x)>>8)&0xff) )
#define Int32_1Byte( x ) ( (uint8) ((x)&0xff) )
#ifdef __WATCOMC__
# ifndef strcasecmp
# define strcasecmp stricmp
# endif
# ifndef strncasecmp
# define strncasecmp strnicmp
# endif
#endif
#ifdef __cplusplus
};
#endif
#endif

View file

@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "compat.h" #include "compat.h"
#include "types.h"
#include "util_lib.h" #include "util_lib.h"
#include "baselayer.h" #include "baselayer.h"
@ -79,7 +79,7 @@ char CheckParm(char *check)
return 0; return 0;
} }
void *SafeMalloc(int32 size) void *SafeMalloc(int32_t size)
{ {
void *p; void *p;
@ -95,7 +95,7 @@ void SafeFree(void * ptr)
free(ptr); free(ptr);
} }
void SafeRealloc(void ** ptr, int32 newsize) void SafeRealloc(void ** ptr, int32_t newsize)
{ {
void *p; void *p;
@ -105,17 +105,17 @@ void SafeRealloc(void ** ptr, int32 newsize)
*ptr = p; *ptr = p;
} }
int32 ParseHex(char *hex) int32_t ParseHex(char *hex)
{ {
return strtol(hex, NULL, 16); return strtol(hex, NULL, 16);
} }
int32 ParseNum(char *str) int32_t ParseNum(char *str)
{ {
return strtol(str, NULL, 10); return strtol(str, NULL, 10);
} }
int16 MotoShort(int16 l) int16_t MotoShort(int16_t l)
{ {
#if B_LITTLE_ENDIAN != 0 #if B_LITTLE_ENDIAN != 0
return l; return l;
@ -124,7 +124,7 @@ int16 MotoShort(int16 l)
#endif #endif
} }
int16 IntelShort(int16 l) int16_t IntelShort(int16_t l)
{ {
#if B_BIG_ENDIAN != 0 #if B_BIG_ENDIAN != 0
return ((l & 0x00ff) << 8) | ((l & 0xff00) >> 8); return ((l & 0x00ff) << 8) | ((l & 0xff00) >> 8);
@ -133,20 +133,20 @@ int16 IntelShort(int16 l)
#endif #endif
} }
int32 MotoLong(int32 l) int32_t MotoLong(int32_t l)
{ {
#if B_LITTLE_ENDIAN != 0 #if B_LITTLE_ENDIAN != 0
return l; return l;
#else #else
int32 t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8); int32_t t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8);
return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16); return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16);
#endif #endif
} }
int32 IntelLong(int32 l) int32_t IntelLong(int32_t l)
{ {
#if B_BIG_ENDIAN != 0 #if B_BIG_ENDIAN != 0
int32 t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8); int32_t t = ((l & 0x00ff00ffl) << 8) | ((l & 0xff00ff00l) >> 8);
return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16); return ((t & 0x0000ffffl) << 16) | ((t & 0xffff0000l) >> 16);
#else #else
return l; return l;

View file

@ -46,18 +46,18 @@ void Error (char *error, ...);
char CheckParm (char *check); char CheckParm (char *check);
void *SafeMalloc (int32 size); void *SafeMalloc (int32_t size);
int32 SafeMallocSize (void * ptr); int32_t SafeMallocSize (void * ptr);
void SafeFree (void * ptr); void SafeFree (void * ptr);
void SafeRealloc (void ** ptr, int32 newsize); void SafeRealloc (void ** ptr, int32_t newsize);
int32 ParseHex (char *hex); int32_t ParseHex (char *hex);
int32 ParseNum (char *str); int32_t ParseNum (char *str);
int16 MotoShort (int16 l); int16_t MotoShort (int16_t l);
int16 IntelShort (int16 l); int16_t IntelShort (int16_t l);
int32 MotoLong (int32 l); int32_t MotoLong (int32_t l);
int32 IntelLong (int32 l); int32_t IntelLong (int32_t l);
void HeapSort(char * base, int32 nel, int32 width, int32 (*compare)(), void (*switcher)()); void HeapSort(char * base, int32_t nel, int32_t width, int32_t (*compare)(), void (*switcher)());
#ifdef __cplusplus #ifdef __cplusplus
}; };

View file

@ -473,7 +473,7 @@ static void modval(int32_t min, int32_t max,int32_t *p,int32_t dainc,int32_t dam
extern int32_t G_LoadSaveHeader(char spot,struct savehead *saveh); extern int32_t G_LoadSaveHeader(char spot,struct savehead *saveh);
static struct savehead savehead; static struct savehead savehead;
//static int32 volnum,levnum,plrskl,numplr; //static int32_t volnum,levnum,plrskl,numplr;
//static char brdfn[BMAX_PATH]; //static char brdfn[BMAX_PATH];
int32_t g_lastSaveSlot = -1; int32_t g_lastSaveSlot = -1;
@ -3582,7 +3582,7 @@ cheat_for_port_credits:
case 210: case 210:
{ {
int32 sc; int32_t sc;
rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
menutext(320>>1,24,0,0,"KEYBOARD SETUP"); menutext(320>>1,24,0,0,"KEYBOARD SETUP");
@ -4245,7 +4245,7 @@ cheat_for_port_credits:
ud.config.JoystickAnalogueAxes[thispage*2+(x==7)] = l; ud.config.JoystickAnalogueAxes[thispage*2+(x==7)] = l;
CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick); CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick);
{ {
extern int32 mouseyaxismode; // player.c extern int32_t mouseyaxismode; // player.c
mouseyaxismode = -1; mouseyaxismode = -1;
} }
break; break;

View file

@ -37,8 +37,8 @@ int32_t g_kb;
int32_t g_looking_angSR1; int32_t g_looking_angSR1;
int32_t g_weapon_xoffset; int32_t g_weapon_xoffset;
int32 turnheldtime; //MED int32_t turnheldtime; //MED
int32 lastcontroltime; //MED int32_t lastcontroltime; //MED
extern int32_t g_levelTextTime; extern int32_t g_levelTextTime;
@ -2998,18 +2998,18 @@ void P_DisplayWeapon(int32_t snum)
#define MAXHORIZ 127 #define MAXHORIZ 127
int32_t g_myAimMode = 0, g_myAimStat = 0, g_oldAimStat = 0; int32_t g_myAimMode = 0, g_myAimStat = 0, g_oldAimStat = 0;
int32 mouseyaxismode = -1; int32_t mouseyaxismode = -1;
int32_t jump_input = 0; int32_t jump_input = 0;
void getinput(int32_t snum) void getinput(int32_t snum)
{ {
int32_t j, daang; int32_t j, daang;
static ControlInfo info[2]; static ControlInfo info[2];
int32 tics; int32_t tics;
boolean running; int32_t running;
int32 turnamount; int32_t turnamount;
int32 keymove; int32_t keymove;
int32 momx = 0,momy = 0; int32_t momx = 0,momy = 0;
DukePlayer_t *p = g_player[snum].ps; DukePlayer_t *p = g_player[snum].ps;
if ((p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) || (numplayers > 1 && totalclock < 10)) if ((p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) || (numplayers > 1 && totalclock < 10))
@ -3042,7 +3042,7 @@ void getinput(int32_t snum)
} }
{ {
int32 i; int32_t i;
if (g_myAimMode) i = analog_lookingupanddown; if (g_myAimMode) i = analog_lookingupanddown;
else i = ud.config.MouseAnalogueAxes[1]; else i = ud.config.MouseAnalogueAxes[1];
@ -3320,14 +3320,14 @@ static int32_t P_DoCounters(DukePlayer_t *p)
{ {
p->last_pissed_time--; p->last_pissed_time--;
if (p->last_pissed_time == (26*219)) if (p->last_pissed_time == (GAMETICSPERSEC*219))
{ {
A_PlaySound(FLUSH_TOILET,p->i); A_PlaySound(FLUSH_TOILET,p->i);
if (snum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND)) if (snum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND))
A_PlaySound(DUKE_PISSRELIEF,p->i); A_PlaySound(DUKE_PISSRELIEF,p->i);
} }
if (p->last_pissed_time == (26*218)) if (p->last_pissed_time == (GAMETICSPERSEC*218))
{ {
p->holster_weapon = 0; p->holster_weapon = 0;
p->weapon_pos = 10; p->weapon_pos = 10;
@ -3742,7 +3742,7 @@ void P_CheckTouchDamage(DukePlayer_t *p,int32_t j)
break; break;
case BIGFORCE__STATIC: case BIGFORCE__STATIC:
p->hurt_delay = 26; p->hurt_delay = GAMETICSPERSEC;
{ {
vec3_t davect; vec3_t davect;
@ -3951,7 +3951,7 @@ void P_ProcessInput(int32_t snum)
if (p->timebeforeexit > 1 && p->last_extra > 0) if (p->timebeforeexit > 1 && p->last_extra > 0)
{ {
p->timebeforeexit--; p->timebeforeexit--;
if (p->timebeforeexit == 26*5) if (p->timebeforeexit == GAMETICSPERSEC*5)
{ {
FX_StopAllSounds(); FX_StopAllSounds();
S_ClearSoundLocks(); S_ClearSoundLocks();
@ -4416,8 +4416,8 @@ void P_ProcessInput(int32_t snum)
} }
else if (psectlotag != 2) else if (psectlotag != 2)
{ {
if (p->airleft != 15*26) if (p->airleft != 15*GAMETICSPERSEC)
p->airleft = 15*26; //Aprox twenty seconds. p->airleft = 15*GAMETICSPERSEC; //Aprox twenty seconds.
if (p->scuba_on == 1) if (p->scuba_on == 1)
p->scuba_on = 0; p->scuba_on = 0;
@ -5202,7 +5202,7 @@ SHOOTINCODE:
if (p->holster_weapon == 1) if (p->holster_weapon == 1)
{ {
if (p->last_pissed_time <= (26*218) && p->weapon_pos == -9) if (p->last_pissed_time <= (GAMETICSPERSEC*218) && p->weapon_pos == -9)
{ {
p->holster_weapon = 0; p->holster_weapon = 0;
p->weapon_pos = 10; p->weapon_pos = 10;

View file

@ -663,7 +663,7 @@ static void P_ResetStatus(int32_t snum)
p->on_ground = 0; p->on_ground = 0;
p->player_par = 0; p->player_par = 0;
p->return_to_center = 9; p->return_to_center = 9;
p->airleft = 15*26; p->airleft = 15*GAMETICSPERSEC;
p->rapid_fire_hold = 0; p->rapid_fire_hold = 0;
p->toggle_key_flag = 0; p->toggle_key_flag = 0;
p->access_spritenum = -1; p->access_spritenum = -1;
@ -1244,7 +1244,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk)
FX_StopAllSounds(); FX_StopAllSounds();
} }
g_showShareware = 26*34; g_showShareware = GAMETICSPERSEC*34;
ud.level_number = ln; ud.level_number = ln;
ud.volume_number = vn; ud.volume_number = vn;

View file

@ -28,10 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// STATICS // STATICS
//============= //=============
int32 numlumps; int32_t numlumps;
static void **lumpcache; static void **lumpcache;
static lumpinfo_t *lumpinfo; // location of each lump on disk static lumpinfo_t *lumpinfo; // location of each lump on disk
static boolean RTS_Started = false; static int32_t RTS_Started = FALSE;
char lumplockbyte[11]; char lumplockbyte[11];
@ -55,13 +55,13 @@ char lumplockbyte[11];
==================== ====================
*/ */
int32 RTS_AddFile(const char *filename) int32_t RTS_AddFile(const char *filename)
{ {
wadinfo_t header; wadinfo_t header;
lumpinfo_t *lump_p; lumpinfo_t *lump_p;
uint32 i; uint32_t i;
int32 handle, length; int32_t handle, length;
int32 startlump; int32_t startlump;
filelump_t *fileinfo, *fileinfoo; filelump_t *fileinfo, *fileinfoo;
// //
@ -114,7 +114,7 @@ int32 RTS_AddFile(const char *filename)
lump_p = &lumpinfo[startlump]; lump_p = &lumpinfo[startlump];
for (i=startlump ; i<(uint32)numlumps ; i++,lump_p++, fileinfo++) for (i=startlump ; i<(uint32_t)numlumps ; i++,lump_p++, fileinfo++)
{ {
lump_p->handle = handle; lump_p->handle = handle;
lump_p->position = IntelLong(fileinfo->filepos); lump_p->position = IntelLong(fileinfo->filepos);
@ -139,7 +139,7 @@ int32 RTS_AddFile(const char *filename)
void RTS_Init(const char *filename) void RTS_Init(const char *filename)
{ {
int32 length; int32_t length;
// //
// open all the files, load headers, and count lumps // open all the files, load headers, and count lumps
// //
@ -157,7 +157,7 @@ void RTS_Init(const char *filename)
length = (numlumps) * sizeof(*lumpcache); length = (numlumps) * sizeof(*lumpcache);
lumpcache = SafeMalloc(length); lumpcache = SafeMalloc(length);
memset(lumpcache,0,length); memset(lumpcache,0,length);
RTS_Started = true; RTS_Started = TRUE;
} }
@ -169,7 +169,7 @@ void RTS_Init(const char *filename)
==================== ====================
*/ */
int32 RTS_NumSounds(void) int32_t RTS_NumSounds(void)
{ {
return numlumps-1; return numlumps-1;
} }
@ -184,7 +184,7 @@ int32 RTS_NumSounds(void)
==================== ====================
*/ */
int32 RTS_SoundLength(int32 lump) int32_t RTS_SoundLength(int32_t lump)
{ {
lump++; lump++;
if (lump >= numlumps) if (lump >= numlumps)
@ -200,7 +200,7 @@ int32 RTS_SoundLength(int32 lump)
==================== ====================
*/ */
const char * RTS_GetSoundName(int32 i) const char * RTS_GetSoundName(int32_t i)
{ {
i++; i++;
if (i>=numlumps) if (i>=numlumps)
@ -217,7 +217,7 @@ const char * RTS_GetSoundName(int32 i)
= =
==================== ====================
*/ */
void RTS_ReadLump(int32 lump, void *dest) void RTS_ReadLump(int32_t lump, void *dest)
{ {
lumpinfo_t *l; lumpinfo_t *l;
@ -237,10 +237,10 @@ void RTS_ReadLump(int32 lump, void *dest)
= =
==================== ====================
*/ */
void *RTS_GetSound(int32 lump) void *RTS_GetSound(int32_t lump)
{ {
lump++; lump++;
if ((uint32)lump >= (uint32)numlumps) if ((uint32_t)lump >= (uint32_t)numlumps)
Error("RTS_GetSound: %i >= %i\n",lump,numlumps); Error("RTS_GetSound: %i >= %i\n",lump,numlumps);
if (lumpcache[lump] == NULL) if (lumpcache[lump] == NULL)

View file

@ -50,7 +50,7 @@ void RTS_Init (const char *filename);
==================== ====================
*/ */
int32 RTS_NumSounds (void); int32_t RTS_NumSounds (void);
/* /*
==================== ====================
= =
@ -61,7 +61,7 @@ int32 RTS_NumSounds (void);
==================== ====================
*/ */
int32 RTS_SoundLength (int32 lump); int32_t RTS_SoundLength (int32_t lump);
/* /*
==================== ====================
= =
@ -70,7 +70,7 @@ int32 RTS_SoundLength (int32 lump);
==================== ====================
*/ */
const char * RTS_GetSoundName (int32 i); const char * RTS_GetSoundName (int32_t i);
/* /*
==================== ====================
= =
@ -78,5 +78,5 @@ const char * RTS_GetSoundName (int32 i);
= =
==================== ====================
*/ */
void *RTS_GetSound (int32 lump); void *RTS_GetSound (int32_t lump);
#endif #endif

View file

@ -100,12 +100,12 @@ int32_t G_LoadSaveHeader(char spot,struct savehead *saveh)
return 1; return 1;
}*/ }*/
if (kdfread(&saveh->numplr,sizeof(int32),1,fil) != 1) goto corrupt; if (kdfread(&saveh->numplr,sizeof(int32_t),1,fil) != 1) goto corrupt;
if (kdfread(saveh->name,19,1,fil) != 1) goto corrupt; if (kdfread(saveh->name,19,1,fil) != 1) goto corrupt;
if (kdfread(&saveh->volnum,sizeof(int32),1,fil) != 1) goto corrupt; if (kdfread(&saveh->volnum,sizeof(int32_t),1,fil) != 1) goto corrupt;
if (kdfread(&saveh->levnum,sizeof(int32),1,fil) != 1) goto corrupt; if (kdfread(&saveh->levnum,sizeof(int32_t),1,fil) != 1) goto corrupt;
if (kdfread(&saveh->plrskl,sizeof(int32),1,fil) != 1) goto corrupt; if (kdfread(&saveh->plrskl,sizeof(int32_t),1,fil) != 1) goto corrupt;
if (kdfread(saveh->boardfn,BMAX_PATH,1,fil) != 1) goto corrupt; if (kdfread(saveh->boardfn,BMAX_PATH,1,fil) != 1) goto corrupt;
if (waloff[TILE_LOADSHOT] == 0) allocache(&waloff[TILE_LOADSHOT],320*200,&walock[TILE_LOADSHOT]); if (waloff[TILE_LOADSHOT] == 0) allocache(&waloff[TILE_LOADSHOT],320*200,&walock[TILE_LOADSHOT]);
@ -130,7 +130,7 @@ int32_t G_LoadPlayer(int32_t spot)
char *fnptr, *scriptptrs; char *fnptr, *scriptptrs;
int32_t fil, bv, i, x; int32_t fil, bv, i, x;
intptr_t j; intptr_t j;
int32 nump; int32_t nump;
strcpy(fn, "egam0.sav"); strcpy(fn, "egam0.sav");
strcpy(mpfn, "egamA_00.sav"); strcpy(mpfn, "egamA_00.sav");

View file

@ -2599,7 +2599,7 @@ void G_HandleSharedKeys(int32_t snum)
if (p->newowner == -1) if (p->newowner == -1)
if (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT) || TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT)) if (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT) || TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT))
{ {
p->invdisptime = 26*2; p->invdisptime = GAMETICSPERSEC*2;
if (TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT)) k = 1; if (TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT)) k = 1;
else k = 0; else k = 0;
@ -2760,7 +2760,7 @@ CHECKINV1:
p->wantweaponfire = j; p->wantweaponfire = j;
p->kickback_pic = 0; p->kickback_pic = 0;
} }
if (p->last_pissed_time <= (26*218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0) if (p->last_pissed_time <= (GAMETICSPERSEC*218) && p->show_empty_weapon == 0 && p->kickback_pic == 0 && p->quick_kick == 0 && sprite[p->i].xrepeat > 32 && p->access_incs == 0 && p->knee_incs == 0)
{ {
// if( ( p->weapon_pos == 0 || ( p->holster_weapon && p->weapon_pos == -9 ) )) // if( ( p->weapon_pos == 0 || ( p->holster_weapon && p->weapon_pos == -9 ) ))
{ {
@ -3174,7 +3174,7 @@ void P_CheckSectors(int32_t snum)
return; return;
case -2: case -2:
sector[p->cursectnum].lotag = 0; sector[p->cursectnum].lotag = 0;
p->timebeforeexit = 26*8; p->timebeforeexit = GAMETICSPERSEC*8;
p->customexitsound = sector[p->cursectnum].hitag; p->customexitsound = sector[p->cursectnum].hitag;
return; return;
default: default:
@ -3315,7 +3315,7 @@ void P_CheckSectors(int32_t snum)
{ {
if (ud.lockout == 0) A_PlaySound(DUKE_URINATE,p->i); if (ud.lockout == 0) A_PlaySound(DUKE_URINATE,p->i);
p->last_pissed_time = 26*220; p->last_pissed_time = GAMETICSPERSEC*220;
p->transporter_hold = 29*2; p->transporter_hold = 29*2;
if (p->holster_weapon == 0) if (p->holster_weapon == 0)
{ {

View file

@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#include <conio.h> //#include <conio.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "types.h"
#include "fx_man.h" #include "fx_man.h"
#include "music.h" #include "music.h"
#include "duke3d.h" #include "duke3d.h"
@ -310,7 +310,7 @@ int32_t S_PlaySoundXYZ(int32_t num, int32_t i, const vec3_t *pos)
ud.config.SoundToggle == 0 || ud.config.SoundToggle == 0 ||
g_sounds[num].num > 3 || g_sounds[num].num > 3 ||
FX_VoiceAvailable(g_sounds[num].pr) == 0 || FX_VoiceAvailable(g_sounds[num].pr) == 0 ||
(g_player[myconnectindex].ps->timebeforeexit > 0 && g_player[myconnectindex].ps->timebeforeexit <= 26*3) || (g_player[myconnectindex].ps->timebeforeexit > 0 && g_player[myconnectindex].ps->timebeforeexit <= GAMETICSPERSEC*3) ||
g_player[myconnectindex].ps->gm&MODE_MENU) return -1; g_player[myconnectindex].ps->gm&MODE_MENU) return -1;
if (g_sounds[num].m&128) if (g_sounds[num].m&128)

View file

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#include <conio.h> //#include <conio.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "types.h"
#include "fx_man.h" #include "fx_man.h"
//#include "music.h" //#include "music.h"
//#include "duke3d.h" //#include "duke3d.h"