diff --git a/polymer/eduke32/Makefile.deps b/polymer/eduke32/Makefile.deps index 13de80fa7..f89746402 100644 --- a/polymer/eduke32/Makefile.deps +++ b/polymer/eduke32/Makefile.deps @@ -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 $(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 -$(OBJ)/animlib.$o: $(SRC)/jmact/animlib.c $(SRC)/jmact/types.h $(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)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.h $(SRC)/jmact/types.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)/keyboard.$o: $(SRC)/jmact/keyboard.c $(SRC)/jmact/types.h $(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)/mathutil.$o: $(SRC)/jmact/mathutil.c $(SRC)/jmact/types.h -$(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)/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 $(EINC)/compat.h +$(OBJ)/file_lib.$o: $(SRC)/jmact/file_lib.c $(SRC)/jmact/file_lib.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/keyboard.h $(EINC)/compat.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 +$(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 $(OBJ)/audiolib_fxstub.$o: $(SRC)/jaudiolib/audiolib_fxstub.c $(SRC)/jaudiolib/fx_man.h diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index d3bec7072..fe1587acc 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -25,6 +25,14 @@ # include "msvc/inttypes.h" // from http://code.google.com/p/msinttypes/ #endif +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + // 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 // 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 { uint16_t namlen; char *name; - unsigned mode; - unsigned size; - unsigned mtime; + uint32_t mode; + uint32_t size; + uint32_t mtime; }; typedef void BDIR; @@ -319,7 +327,7 @@ int32_t Bclosedir(BDIR *dir); #else typedef void BFILE; typedef uint32_t bsize_t; - typedef signed int32_t bssize_t; + typedef int32_t bssize_t; #endif diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index 1c9950d1b..629e79c02 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -27,7 +27,7 @@ typedef struct _mdanim_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 char *fn; // Skin filename 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) } 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 { 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 { int32_t i[3]; } md3tri_t; //indices of tri 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 { @@ -182,7 +182,7 @@ typedef struct #define VOXBORDWIDTH 1 //use 0 to save memory, but has texture artifacts; 1 looks better... #define 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 typedef struct { uint16_t x, y, z, u, v; } vert_t; #endif diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index f8a370878..7bd0b5321 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -97,7 +97,7 @@ void initcache(intptr_t dacachestart, int32_t dacachesize) //printf("BEFORE: cachestart = %x, cachesize = %d\n", dacachestart, dacachesize); 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); cac[0].leng = cachesize; diff --git a/polymer/eduke32/eduke32.vcproj b/polymer/eduke32/eduke32.vcproj index 95b173c3f..69b5952ee 100644 --- a/polymer/eduke32/eduke32.vcproj +++ b/polymer/eduke32/eduke32.vcproj @@ -768,10 +768,6 @@ RelativePath=".\source\jmact\scriplib.h" > - - diff --git a/polymer/eduke32/source/_rts.h b/polymer/eduke32/source/_rts.h index 98c81a20a..61a97c632 100644 --- a/polymer/eduke32/source/_rts.h +++ b/polymer/eduke32/source/_rts.h @@ -32,20 +32,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct { char name[8]; - int32 handle,position,size; + int32_t handle,position,size; } lumpinfo_t; typedef struct { char identification[4]; // should be IWAD - int32 numlumps; - int32 infotableofs; + int32_t numlumps; + int32_t infotableofs; } wadinfo_t; typedef struct { - int32 filepos; - int32 size; + int32_t filepos; + int32_t size; char name[8]; } filelump_t; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index f3de67d2f..17672b4ea 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -1135,7 +1135,7 @@ static void G_MoveFX(void) { j = s->lotag+((unsigned)g_globalRandom%(s->hitag+1)); 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] > (26*8)) + if (t[0] > (GAMETICSPERSEC*8)) { S_PlaySound(RPG_EXPLODE); for (j=0; j<32; j++) RANDOMSCRAP; @@ -3732,7 +3732,7 @@ static void G_MoveActors(void) A_Shoot(i,FIRELASER); 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[2] = 0; @@ -3755,7 +3755,7 @@ static void G_MoveActors(void) else { 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[2] = 0; @@ -3804,7 +3804,7 @@ static void G_MoveActors(void) 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[2] = 0; @@ -4777,7 +4777,7 @@ static void G_MoveMisc(void) // STATNUM 5 case BLOODSPLAT3__STATIC: case BLOODSPLAT4__STATIC: - if (t[0] == 7*26) goto BOLT; + if (t[0] == 7*GAMETICSPERSEC) goto BOLT; s->z += 16+(krand()&15); t[0]++; if ((t[0]%9) == 0) s->yrepeat++; @@ -4797,7 +4797,7 @@ static void G_MoveMisc(void) // STATNUM 5 s->picnum = NUKEBUTTON+2; 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; } goto BOLT; @@ -7444,7 +7444,7 @@ static void G_MoveEffectors(void) //STATNUM 3 { if (t[0] == 1) A_Shoot(i,sc->extra); - else if (t[0] == 26*5) + else if (t[0] == GAMETICSPERSEC*5) t[0] = 0; t[0]++; } diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 646a20848..e720baaa8 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -208,7 +208,7 @@ void G_PlayAnim(const char *fn,char t) #if defined(POLYMOST) && defined(USE_OPENGL) int32_t ogltexfiltermode=gltexfiltermode; #endif - int32 handle=-1; + int32_t handle=-1; int32_t frametime = 0; // return; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index bfab87b7f..059fe7b3a 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mapster32.h" #include "keys.h" -#include "types.h" + #include "keyboard.h" #include "scriptfile.h" #include "crc32.h" @@ -3517,9 +3517,9 @@ static inline void getnumber_doint16_t(int16_t *ptr, int32_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) @@ -3541,7 +3541,7 @@ void getnumberptr256(char *namestart, void *num, int32_t bytes, int32_t maxnumbe danum = *(int16_t *)num; break; case 4: - danum = *(int32 *)num; + danum = *(int32_t *)num; break; case 8: danum = *(int64 *)num; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index e64a81ae6..e65c7d1b7 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -53,9 +53,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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); @@ -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) 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")) @@ -119,7 +119,7 @@ int32 CONFIG_AnalogNameToNum(char * func) } -char * CONFIG_AnalogNumToName(int32 func) +char * CONFIG_AnalogNumToName(int32_t func) { switch (func) { @@ -147,7 +147,7 @@ char * CONFIG_AnalogNumToName(int32 func) void CONFIG_SetDefaultKeys(int32_t type) { - int32 i,f; + int32_t i,f; Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys)); Bmemset(&KeyBindings,0,sizeof(KeyBindings)); @@ -155,7 +155,7 @@ void CONFIG_SetDefaultKeys(int32_t type) 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]); if (f == -1) continue; @@ -168,7 +168,7 @@ void CONFIG_SetDefaultKeys(int32_t type) 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]); if (f == -1) continue; @@ -183,7 +183,7 @@ void CONFIG_SetDefaultKeys(int32_t type) void CONFIG_SetDefaults(void) { // JBF 20031211 - int32 i; + int32_t i; ud.config.scripthandle = -1; ud.config.ScreenWidth = 1024; @@ -343,9 +343,9 @@ void CONFIG_SetDefaults(void) void CONFIG_ReadKeys(void) { - int32 i; - int32 numkeyentries; - int32 function; + int32_t i; + int32_t numkeyentries; + int32_t function; char keyname1[80]; char keyname2[80]; kb_scancode key1,key2; @@ -375,11 +375,11 @@ void CONFIG_ReadKeys(void) key2 = 0xff; if (keyname1[0]) { - key1 = (byte) KB_StringToScanCode(keyname1); + key1 = (uint8_t) KB_StringToScanCode(keyname1); } if (keyname2[0]) { - key2 = (byte) KB_StringToScanCode(keyname2); + key2 = (uint8_t) KB_StringToScanCode(keyname2); } ud.config.KeyboardKeys[function][0] = key1; 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 -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 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) { - int32 i; + int32_t i; char str[80]; char temp[80]; - int32 function, scale; + int32_t function, scale; if (ud.config.scripthandle < 0) return; @@ -519,10 +519,10 @@ void CONFIG_SetupMouse(void) void CONFIG_SetupJoystick(void) { - int32 i; + int32_t i; char str[80]; char temp[80]; - int32 scale; + int32_t scale; if (ud.config.scripthandle < 0) return; @@ -605,11 +605,11 @@ extern char mod_dir[BMAX_PATH]; extern int32_t r_maxfps; 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# "; - extern int32 CommandWeaponChoice; + extern int32_t CommandWeaponChoice; char tempbuf[1024]; CONTROL_ClearAssignments(); @@ -662,7 +662,7 @@ int32 CONFIG_ReadSetup(void) #ifndef RANCID_NETWORKING // 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); #endif @@ -752,11 +752,11 @@ int32 CONFIG_ReadSetup(void) #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; - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32 *)&windowx); + SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosX", (int32_t *)&windowx); windowy = -1; - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32 *)&windowy); + SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "WindowPosY", (int32_t *)&windowy); } #endif @@ -771,7 +771,7 @@ int32 CONFIG_ReadSetup(void) } #ifdef RENDERTYPEWIN - SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq); + SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", (int32_t*)&maxrefreshfreq); #endif #if defined(POLYMOST) && defined(USE_OPENGL) @@ -912,7 +912,7 @@ int32 CONFIG_ReadSetup(void) 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 @@ -1009,7 +1009,7 @@ void CONFIG_WriteBinds(void) // save binds and aliases to _binds.cfg void CONFIG_WriteSetup(void) { - int32 dummy; + int32_t dummy; char tempbuf[1024]; if (!ud.config.setupread) return; @@ -1017,23 +1017,23 @@ void CONFIG_WriteSetup(void) if (ud.config.scripthandle < 0) 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","AutoAim",ud.config.AutoAim,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","MouseBias",ud.config.MouseBias,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","SmoothInput",ud.config.SmoothInput,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","WeaponSwitchMode",ud.weaponswitch,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","MouseAimingFlipped",ud.mouseflip,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","MouseDeadZone",ud.config.MouseDeadZone,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","UseJoystick",ud.config.UseJoystick,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, "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", "AutoMsg",ud.automsg,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", "AutoMsg",ud.automsg,FALSE,FALSE); + SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "AutoVote",ud.autovote,FALSE,FALSE); + SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "Color",ud.color,FALSE,FALSE); if (CrosshairColors.r != DefaultCrosshairColors.r || CrosshairColors.g != DefaultCrosshairColors.g || CrosshairColors.b != DefaultCrosshairColors.b) @@ -1042,95 +1042,95 @@ void CONFIG_WriteSetup(void) 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", "Crosshairs",ud.crosshair,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", "Executions",++ud.executions,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", "RunMode",ud.config.RunMode,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", "ShowOpponentWeapons",ud.config.ShowOpponentWeapons,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", "StatusBarScale",ud.statusbarscale,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", "UsePrecache",ud.config.useprecache,false,false); - SCRIPT_PutNumber(ud.config.scripthandle, "Misc", "ViewBobbing",ud.viewbob,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", "DeathMessages",ud.obituaries,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", "IDPlayers",ud.idplayers,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", "ShowFPS",ud.tickrate,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", "ShowViewWeapon",ud.drawweapon,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", "Team",ud.team,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", "ViewBobbing",ud.viewbob,FALSE,FALSE); for (dummy=0; dummy<10; 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", "WeaponSway",ud.weaponsway,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, "Setup","ConfigVersion",BYTEVERSION_JF,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","ConfigVersion",BYTEVERSION_JF,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); { Bsprintf(tempbuf,"%.2f",r_ambientlight); 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) - 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", "GLAnimationSmoothing",r_animsmoothing,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", "GLDetailMapping", r_detailmapping,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", "GLOcclusionChecking", r_modelocclusionchecking,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", "GLDetailMapping", r_detailmapping,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", "GLOcclusionChecking", r_modelocclusionchecking,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", "GLPeelsCount",r_peelscount,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", "GLTextureMode",gltexfiltermode,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", "GLUseTextureCacheCompression", glusetexcachecompression,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", "GLVBOs", r_vbos,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", "GLWidescreen",glwidescreen,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", "GLTextureMode",gltexfiltermode,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", "GLUseTextureCacheCompression", glusetexcachecompression,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", "GLVBOs", r_vbos,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", "GLWidescreen",glwidescreen,FALSE,FALSE); #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 - SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); + SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,FALSE,FALSE); #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", "OSDTextMode",OSD_GetTextMode(),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); 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_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", "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", "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", "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", "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", "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", "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", "Shadows",ud.shadows,FALSE,FALSE); + SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,FALSE,FALSE); #if defined(POLYMOST) && defined(USE_OPENGL) - 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", "UseHightile",usehightile,FALSE,FALSE); + SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "UseModels",usemodels,FALSE,FALSE); #endif { @@ -1143,26 +1143,26 @@ void CONFIG_WriteSetup(void) } #ifdef RENDERTYPEWIN - 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", "WindowPosY", windowy, 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", "WindowPosY", windowy, FALSE, FALSE); #endif - 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", "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", "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", "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", "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", "VoiceToggle",ud.config.VoiceToggle,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", "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", "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", "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", "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", "VoiceToggle",ud.config.VoiceToggle,FALSE,FALSE); #ifdef _WIN32 - 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", "CheckForUpdates", ud.config.CheckForUpdates, FALSE, FALSE); + SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", ud.config.LastUpdateCheck, FALSE, FALSE); #endif // JBF 20031211 @@ -1195,10 +1195,10 @@ void CONFIG_WriteSetup(void) SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[dummy][1])); 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(); - 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; dummypalette = (unsigned char *) &palette[0]; + if (*t != 0) g_player[myconnectindex].ps->palette = (uint8_t *) &palette[0]; if (numplayers > 1) { @@ -3881,9 +3881,9 @@ void G_DisplayRest(int32_t smoothratio) j = scale(2,ud.config.ScreenWidth,320); Bsprintf(tempbuf,"T:^15%d:%02d.%02d", - (g_player[myconnectindex].ps->player_par/(26*60)), - (g_player[myconnectindex].ps->player_par/26)%60, - ((g_player[myconnectindex].ps->player_par%26)*38)/10 + (g_player[myconnectindex].ps->player_par/(GAMETICSPERSEC*60)), + (g_player[myconnectindex].ps->player_par/GAMETICSPERSEC)%60, + ((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); @@ -13447,19 +13447,19 @@ FRAGBONUS: { 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); 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); 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); } } - 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); } @@ -13566,9 +13566,9 @@ FRAGBONUS: } Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad, - (g_player[myconnectindex].ps->player_par/(26*60)), - (g_player[myconnectindex].ps->player_par/26)%60, - ((g_player[myconnectindex].ps->player_par%26)*38)/10 + (g_player[myconnectindex].ps->player_par/(GAMETICSPERSEC*60)), + (g_player[myconnectindex].ps->player_par/GAMETICSPERSEC)%60, + ((g_player[myconnectindex].ps->player_par%GAMETICSPERSEC)*38)/10 ); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); if (g_player[myconnectindex].ps->player_par < playerbest) @@ -13578,16 +13578,16 @@ FRAGBONUS: if (!(ud.volume_number == 0 && ud.last_level-1 == 7)) { 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/26)%60); + (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/(GAMETICSPERSEC*60)), + (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].partime/GAMETICSPERSEC)%60); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); yy+=10; if (!NAM) { 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/26)%60); + (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/(GAMETICSPERSEC*60)), + (MapInfo[ud.volume_number*MAXLEVELS+ud.last_level-1].designertime/GAMETICSPERSEC)%60); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); yy+=10; } @@ -13596,9 +13596,9 @@ FRAGBONUS: if (playerbest > 0) { Bsprintf(tempbuf,"%0*d:%02d.%02d",clockpad, - (playerbest/(26*60)), - (playerbest/26)%60, - ((playerbest%26)*38)/10 + (playerbest/(GAMETICSPERSEC*60)), + (playerbest/GAMETICSPERSEC)%60, + ((playerbest%GAMETICSPERSEC)*38)/10 ); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); yy+=10; @@ -13864,58 +13864,58 @@ void A_SpawnRandomGlass(int32_t i,int32_t wallnum,int32_t n) static void G_SetupGameButtons(void) { - CONTROL_DefineFlag(gamefunc_Move_Forward,false); - CONTROL_DefineFlag(gamefunc_Move_Backward,false); - CONTROL_DefineFlag(gamefunc_Turn_Left,false); - CONTROL_DefineFlag(gamefunc_Turn_Right,false); - CONTROL_DefineFlag(gamefunc_Strafe,false); - CONTROL_DefineFlag(gamefunc_Fire,false); - CONTROL_DefineFlag(gamefunc_Open,false); - CONTROL_DefineFlag(gamefunc_Run,false); - CONTROL_DefineFlag(gamefunc_AutoRun,false); - CONTROL_DefineFlag(gamefunc_Jump,false); - CONTROL_DefineFlag(gamefunc_Crouch,false); - CONTROL_DefineFlag(gamefunc_Look_Up,false); - CONTROL_DefineFlag(gamefunc_Look_Down,false); - CONTROL_DefineFlag(gamefunc_Look_Left,false); - CONTROL_DefineFlag(gamefunc_Look_Right,false); - CONTROL_DefineFlag(gamefunc_Strafe_Left,false); - CONTROL_DefineFlag(gamefunc_Strafe_Right,false); - CONTROL_DefineFlag(gamefunc_Aim_Up,false); - CONTROL_DefineFlag(gamefunc_Aim_Down,false); - CONTROL_DefineFlag(gamefunc_Weapon_1,false); - CONTROL_DefineFlag(gamefunc_Weapon_2,false); - CONTROL_DefineFlag(gamefunc_Weapon_3,false); - CONTROL_DefineFlag(gamefunc_Weapon_4,false); - CONTROL_DefineFlag(gamefunc_Weapon_5,false); - CONTROL_DefineFlag(gamefunc_Weapon_6,false); - CONTROL_DefineFlag(gamefunc_Weapon_7,false); - CONTROL_DefineFlag(gamefunc_Weapon_8,false); - CONTROL_DefineFlag(gamefunc_Weapon_9,false); - CONTROL_DefineFlag(gamefunc_Weapon_10,false); - CONTROL_DefineFlag(gamefunc_Inventory,false); - CONTROL_DefineFlag(gamefunc_Inventory_Left,false); - CONTROL_DefineFlag(gamefunc_Inventory_Right,false); - CONTROL_DefineFlag(gamefunc_Holo_Duke,false); - CONTROL_DefineFlag(gamefunc_Jetpack,false); - CONTROL_DefineFlag(gamefunc_NightVision,false); - CONTROL_DefineFlag(gamefunc_MedKit,false); - CONTROL_DefineFlag(gamefunc_TurnAround,false); - CONTROL_DefineFlag(gamefunc_SendMessage,false); - CONTROL_DefineFlag(gamefunc_Map,false); - CONTROL_DefineFlag(gamefunc_Shrink_Screen,false); - CONTROL_DefineFlag(gamefunc_Enlarge_Screen,false); - CONTROL_DefineFlag(gamefunc_Center_View,false); - CONTROL_DefineFlag(gamefunc_Holster_Weapon,false); - CONTROL_DefineFlag(gamefunc_Show_Opponents_Weapon,false); - CONTROL_DefineFlag(gamefunc_Map_Follow_Mode,false); - CONTROL_DefineFlag(gamefunc_See_Coop_View,false); - CONTROL_DefineFlag(gamefunc_Mouse_Aiming,false); - CONTROL_DefineFlag(gamefunc_Toggle_Crosshair,false); - CONTROL_DefineFlag(gamefunc_Steroids,false); - CONTROL_DefineFlag(gamefunc_Quick_Kick,false); - CONTROL_DefineFlag(gamefunc_Next_Weapon,false); - CONTROL_DefineFlag(gamefunc_Previous_Weapon,false); + CONTROL_DefineFlag(gamefunc_Move_Forward,FALSE); + CONTROL_DefineFlag(gamefunc_Move_Backward,FALSE); + CONTROL_DefineFlag(gamefunc_Turn_Left,FALSE); + CONTROL_DefineFlag(gamefunc_Turn_Right,FALSE); + CONTROL_DefineFlag(gamefunc_Strafe,FALSE); + CONTROL_DefineFlag(gamefunc_Fire,FALSE); + CONTROL_DefineFlag(gamefunc_Open,FALSE); + CONTROL_DefineFlag(gamefunc_Run,FALSE); + CONTROL_DefineFlag(gamefunc_AutoRun,FALSE); + CONTROL_DefineFlag(gamefunc_Jump,FALSE); + CONTROL_DefineFlag(gamefunc_Crouch,FALSE); + CONTROL_DefineFlag(gamefunc_Look_Up,FALSE); + CONTROL_DefineFlag(gamefunc_Look_Down,FALSE); + CONTROL_DefineFlag(gamefunc_Look_Left,FALSE); + CONTROL_DefineFlag(gamefunc_Look_Right,FALSE); + CONTROL_DefineFlag(gamefunc_Strafe_Left,FALSE); + CONTROL_DefineFlag(gamefunc_Strafe_Right,FALSE); + CONTROL_DefineFlag(gamefunc_Aim_Up,FALSE); + CONTROL_DefineFlag(gamefunc_Aim_Down,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_1,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_2,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_3,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_4,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_5,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_6,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_7,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_8,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_9,FALSE); + CONTROL_DefineFlag(gamefunc_Weapon_10,FALSE); + CONTROL_DefineFlag(gamefunc_Inventory,FALSE); + CONTROL_DefineFlag(gamefunc_Inventory_Left,FALSE); + CONTROL_DefineFlag(gamefunc_Inventory_Right,FALSE); + CONTROL_DefineFlag(gamefunc_Holo_Duke,FALSE); + CONTROL_DefineFlag(gamefunc_Jetpack,FALSE); + CONTROL_DefineFlag(gamefunc_NightVision,FALSE); + CONTROL_DefineFlag(gamefunc_MedKit,FALSE); + CONTROL_DefineFlag(gamefunc_TurnAround,FALSE); + CONTROL_DefineFlag(gamefunc_SendMessage,FALSE); + CONTROL_DefineFlag(gamefunc_Map,FALSE); + CONTROL_DefineFlag(gamefunc_Shrink_Screen,FALSE); + CONTROL_DefineFlag(gamefunc_Enlarge_Screen,FALSE); + CONTROL_DefineFlag(gamefunc_Center_View,FALSE); + CONTROL_DefineFlag(gamefunc_Holster_Weapon,FALSE); + CONTROL_DefineFlag(gamefunc_Show_Opponents_Weapon,FALSE); + CONTROL_DefineFlag(gamefunc_Map_Follow_Mode,FALSE); + CONTROL_DefineFlag(gamefunc_See_Coop_View,FALSE); + CONTROL_DefineFlag(gamefunc_Mouse_Aiming,FALSE); + CONTROL_DefineFlag(gamefunc_Toggle_Crosshair,FALSE); + CONTROL_DefineFlag(gamefunc_Steroids,FALSE); + CONTROL_DefineFlag(gamefunc_Quick_Kick,FALSE); + CONTROL_DefineFlag(gamefunc_Next_Weapon,FALSE); + CONTROL_DefineFlag(gamefunc_Previous_Weapon,FALSE); } /* diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 3765e376a..d979df639 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5259,15 +5259,15 @@ repeatcase: while (*textptr == ' ' || *textptr == '\t') textptr++; MapInfo[j*MAXLEVELS+k].partime = - (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ - (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); + (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*GAMETICSPERSEC*60)+ + (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*GAMETICSPERSEC); textptr += 5; while (*textptr == ' ' || *textptr == '\t') textptr++; MapInfo[j*MAXLEVELS+k].designertime = - (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*26*60)+ - (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*26); + (((*(textptr+0)-'0')*10+(*(textptr+1)-'0'))*GAMETICSPERSEC*60)+ + (((*(textptr+3)-'0')*10+(*(textptr+4)-'0'))*GAMETICSPERSEC); textptr += 5; while (*textptr == ' ' || *textptr == '\t') textptr++; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index e45b53707..94de5930a 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -421,7 +421,7 @@ static inline void X_AlterAng(int32_t a) 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; else vm.g_sp->ang += angdif>>2; @@ -1060,7 +1060,7 @@ static int32_t X_DoExecute(void) case CON_TIP: insptr++; - g_player[vm.g_p].ps->tipincs = 26; + g_player[vm.g_p].ps->tipincs = GAMETICSPERSEC; break; case CON_FALL: @@ -2132,7 +2132,7 @@ static int32_t X_DoExecute(void) case CON_SAVEGAMEVAR: case CON_READGAMEVAR: { - int32 i=0; + int32_t i=0; insptr++; if (ud.config.scripthandle < 0) { @@ -2143,7 +2143,7 @@ static int32_t X_DoExecute(void) { case CON_SAVEGAMEVAR: 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; case CON_READGAMEVAR: SCRIPT_GetNumber(ud.config.scripthandle, "Gamevars",aGameVars[*insptr].szLabel,&i); diff --git a/polymer/eduke32/source/jmact/_control.h b/polymer/eduke32/source/jmact/_control.h index b24813289..bed7b2393 100644 --- a/polymer/eduke32/source/jmact/_control.h +++ b/polymer/eduke32/source/jmact/_control.h @@ -38,7 +38,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms extern "C" { #endif -#include "types.h" + //**************************************************************************** // // DEFINES @@ -145,58 +145,58 @@ typedef enum typedef struct { - int32 joyMinX; - int32 joyMinY; - int32 threshMinX; - int32 threshMinY; - int32 threshMaxX; - int32 threshMaxY; - int32 joyMaxX; - int32 joyMaxY; - int32 joyMultXL; - int32 joyMultYL; - int32 joyMultXH; - int32 joyMultYH; + int32_t joyMinX; + int32_t joyMinY; + int32_t threshMinX; + int32_t threshMinY; + int32_t threshMaxX; + int32_t threshMaxY; + int32_t joyMaxX; + int32_t joyMaxY; + int32_t joyMultXL; + int32_t joyMultYL; + int32_t joyMultXH; + int32_t joyMultYH; } JoystickDef; -// int32 ThrottleMin; -// int32 RudderMin; -// int32 ThrottlethreshMin; -// int32 RudderthreshMin; -// int32 ThrottlethreshMax; -// int32 RudderthreshMax; -// int32 ThrottleMax; -// int32 RudderMax; -// int32 ThrottleMultL; -// int32 RudderMultL; -// int32 ThrottleMultH; -// int32 RudderMultH; +// int32_t ThrottleMin; +// int32_t RudderMin; +// int32_t ThrottlethreshMin; +// int32_t RudderthreshMin; +// int32_t ThrottlethreshMax; +// int32_t RudderthreshMax; +// int32_t ThrottleMax; +// int32_t RudderMax; +// int32_t ThrottleMultL; +// int32_t RudderMultL; +// int32_t ThrottleMultH; +// int32_t RudderMultH; /* typedef struct { - byte active : 1; - byte used : 1; - byte toggle : 1; - byte buttonheld : 1; - byte cleared : 1; + uint8_t active : 1; + uint8_t used : 1; + uint8_t toggle : 1; + uint8_t buttonheld : 1; + uint8_t cleared : 1; } controlflags; typedef struct { - volatile byte active : 1; - volatile byte used : 1; - volatile byte toggle : 1; - volatile byte buttonheld : 1; - volatile byte cleared : 1; + volatile uint8_t active : 1; + volatile uint8_t used : 1; + volatile uint8_t toggle : 1; + volatile uint8_t buttonheld : 1; + volatile uint8_t cleared : 1; } controlflags; */ typedef struct { - byte active ; - byte used ; - byte toggle ; - byte buttonheld ; - int32 cleared ; + uint8_t active ; + uint8_t used ; + uint8_t toggle ; + uint8_t buttonheld ; + int32_t cleared ; } controlflags; typedef struct @@ -207,23 +207,23 @@ typedef struct typedef struct { - byte singleclicked; - byte doubleclicked; - word extra; + uint8_t singleclicked; + uint8_t doubleclicked; + uint16_t extra; } controlbuttontype; typedef struct { - byte analogmap; - byte minmap; - byte maxmap; - byte extra; + uint8_t analogmap; + uint8_t minmap; + uint8_t maxmap; + uint8_t extra; } controlaxismaptype; typedef struct { - int32 analog; - int32 digital; + int32_t analog; + int32_t digital; } controlaxistype; @@ -234,18 +234,18 @@ typedef struct //*************************************************************************** void CONTROL_GetMouseDelta( void ); -byte CONTROL_GetMouseButtons( void ); -boolean CONTROL_StartMouse( void ); +uint8_t CONTROL_GetMouseButtons( void ); +int32_t CONTROL_StartMouse( void ); void CONTROL_GetJoyAbs( void ); void CONTROL_GetJoyDelta( void ); -boolean CONTROL_StartJoy( int32 joy ); -void CONTROL_ShutJoy( int32 joy ); -void CONTROL_SetFlag( int32 which, boolean active ); -void CONTROL_ButtonFunctionState( boolean * state ); -boolean CONTROL_KeyboardFunctionPressed( int32 whichfunction ); -static inline boolean CONTROL_CheckRange( int32 which ); -int32 CONTROL_GetTime( void ); -void CONTROL_AxisFunctionState( boolean * state ); +int32_t CONTROL_StartJoy( int32_t joy ); +void CONTROL_ShutJoy( int32_t joy ); +void CONTROL_SetFlag( int32_t which, int32_t active ); +void CONTROL_ButtonFunctionState( int32_t * state ); +int32_t CONTROL_KeyboardFunctionPressed( int32_t whichfunction ); +static inline int32_t CONTROL_CheckRange( int32_t which ); +int32_t CONTROL_GetTime( void ); +void CONTROL_AxisFunctionState( int32_t * state ); void CONTROL_GetJoyMovement( ControlInfo * info ); #ifdef __cplusplus diff --git a/polymer/eduke32/source/jmact/_scrplib.h b/polymer/eduke32/source/jmact/_scrplib.h index b27db8045..22a250e81 100644 --- a/polymer/eduke32/source/jmact/_scrplib.h +++ b/polymer/eduke32/source/jmact/_scrplib.h @@ -58,7 +58,7 @@ typedef enum typedef struct scriptline { - int32 type; + int32_t type; void * ptr; struct scriptline *nextline; 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 * root, - int32 type, + int32_t type, void * ptr ); @@ -151,7 +151,7 @@ ScriptLineType * SCRIPT_AddLine */ ScriptSectionType * SCRIPT_SectionExists ( - int32 scripthandle, + int32_t scripthandle, 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 ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, 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 diff --git a/polymer/eduke32/source/jmact/animlib.c b/polymer/eduke32/source/jmact/animlib.c index 09f086cb6..261bc764b 100644 --- a/polymer/eduke32/source/jmact/animlib.c +++ b/polymer/eduke32/source/jmact/animlib.c @@ -26,7 +26,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com) //------------------------------------------------------------------------- #include "compat.h" -#include "types.h" + #include "util_lib.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 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"); for (i=0; ilpheader.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; - byte * buffer; + int32_t size; + uint8_t * buffer; CheckAnimStarted("loadpage"); buffer = anim->buffer; @@ -109,7 +109,7 @@ void loadpage(uint16 pagenumber, uint16 *pagepointer) */ 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)); } } @@ -125,8 +125,8 @@ void loadpage(uint16 pagenumber, uint16 *pagepointer) void CPlayRunSkipDump(uint8_t *srcP, uint8_t *dstP) { int8_t cnt; - uint16 wordCnt; - byte pixel; + uint16_t wordCnt; + uint8_t pixel; nextOp: @@ -149,7 +149,7 @@ dump: while (--cnt); goto nextOp; run: - wordCnt = (byte)*srcP++; /* 8-bit unsigned count */ + wordCnt = (uint8_t)*srcP++; /* 8-bit unsigned count */ pixel = *srcP++; do { @@ -159,9 +159,9 @@ run: goto nextOp; longOp: - wordCnt = B_LITTLE16(*((uint16 *)srcP)); - srcP += sizeof(uint16); - if ((int16)wordCnt <= 0) + wordCnt = B_LITTLE16(*((uint16_t *)srcP)); + srcP += sizeof(uint16_t); + if ((int16_t)wordCnt <= 0) goto notLongSkip; /* Do SIGNED test. */ /* 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 i; - uint16 destframe; - byte *ppointer; + uint16_t offset=0; + uint16_t i; + uint16_t destframe; + uint8_t *ppointer; CheckAnimStarted("renderframe"); destframe = framenumber - anim->curlp.baseRecord; @@ -220,12 +220,12 @@ void renderframe(uint16 framenumber, uint16 *pagepointer) { offset += B_LITTLE16(pagepointer[i]); } - ppointer = (byte *)pagepointer; + ppointer = (uint8_t *)pagepointer; ppointer+=anim->curlp.nRecords*2+offset; 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 { @@ -243,7 +243,7 @@ void renderframe(uint16 framenumber, uint16 *pagepointer) // //**************************************************************************** -void drawframe(uint16 framenumber) +void drawframe(uint16_t framenumber) { CheckAnimStarted("drawframe"); loadpage(findpage(framenumber), anim->thepage); @@ -259,13 +259,13 @@ void drawframe(uint16 framenumber) void ANIM_LoadAnim(char * buffer) { - uint16 i; - int32 size; + uint16_t i; + int32_t size; if (!Anim_Started) { anim = SafeMalloc(sizeof(anim_t)); - Anim_Started = true; + Anim_Started = TRUE; } anim->buffer = (uint8_t *)buffer; @@ -318,7 +318,7 @@ void ANIM_FreeAnim(void) if (Anim_Started) { 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"); 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"); 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"); return anim->pal; diff --git a/polymer/eduke32/source/jmact/animlib.h b/polymer/eduke32/source/jmact/animlib.h index bc2239b2c..9ec530d83 100644 --- a/polymer/eduke32/source/jmact/animlib.h +++ b/polymer/eduke32/source/jmact/animlib.h @@ -55,47 +55,47 @@ extern "C" { typedef struct PACKED { - uint32 id; // 4 character ID == "LPF " */ - uint16 maxLps; // max # largePages allowed. 256 FOR NOW. */ - uint16 nLps; // # largePages in this file. */ - uint32 nRecords; // # records in this file. 65534 is current limit plus */ + uint32_t id; // 4 character ID == "LPF " */ + uint16_t maxLps; // max # largePages allowed. 256 FOR NOW. */ + uint16_t nLps; // # largePages in this file. */ + uint32_t nRecords; // # records in this file. 65534 is current limit plus */ // one for last-to-first delta for looping the animation */ - uint16 maxRecsPerLp; // # records permitted in an lp. 256 FOR NOW. */ - uint16 lpfTableOffset; // Absolute Seek position of lpfTable. 1280 FOR NOW. + uint16_t maxRecsPerLp; // # records permitted in an lp. 256 FOR NOW. */ + uint16_t lpfTableOffset; // Absolute Seek position of lpfTable. 1280 FOR NOW. // The lpf Table is an array of 256 large page structures // that is used to facilitate finding records in an anim // file without having to seek through all of the Large // Pages to find which one a specific record lives in. */ - uint32 contentType; // 4 character ID == "ANIM" */ - uint16 width; // Width of screen in pixels. */ - uint16 height; // Height of screen in pixels. */ - byte variant; // 0==ANIM. */ - byte version; // 0==frame rate is multiple of 18 cycles/sec. + uint32_t contentType; // 4 character ID == "ANIM" */ + uint16_t width; // Width of screen in pixels. */ + uint16_t height; // Height of screen in pixels. */ + uint8_t variant; // 0==ANIM. */ + uint8_t version; // 0==frame rate is multiple of 18 cycles/sec. // 1==frame rate is multiple of 70 cycles/sec. */ - byte 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 hasLastDelta; // 1==Last record is a delta from last-to-first frame. */ + uint8_t lastDeltaValid; // 0==The last-to-first delta (if present) hasn't been // updated to match the current first&last frames, so it // should be ignored. */ - byte pixelType; // /* 0==256 color. */ - byte CompressionType;// /* 1==(RunSkipDump) Only one used FOR NOW. */ - byte otherRecsPerFrm;// /* 0 FOR NOW. */ - byte bitmaptype; // /* 1==320x200, 256-color. Only one implemented so far. */ - byte recordTypes[32];// /* Not yet implemented. */ - uint32 nFrames; // /* In case future version adds other records at end of + uint8_t pixelType; // /* 0==256 color. */ + uint8_t CompressionType;// /* 1==(RunSkipDump) Only one used FOR NOW. */ + uint8_t otherRecsPerFrm;// /* 0 FOR NOW. */ + uint8_t bitmaptype; // /* 1==320x200, 256-color. Only one implemented so far. */ + uint8_t recordTypes[32];// /* Not yet implemented. */ + uint32_t nFrames; // /* In case future version adds other records at end of // file, we still know how many actual frames. // NOTE: DOES include last-to-first delta when present. */ - uint16 framesPerSecond; // Number of frames to play per second. */ - uint16 pad2[29]; // 58 bytes of filler to round up to 128 bytes total. */ + uint16_t framesPerSecond; // Number of frames to play per second. */ + uint16_t pad2[29]; // 58 bytes of filler to round up to 128 bytes total. */ } lpfileheader; // this is the format of a large page structure typedef struct PACKED { - uint16 baseRecord; // Number of first record in this large page. - uint16 nRecords; // Number of records in lp. + uint16_t baseRecord; // Number of first record in this large page. + uint16_t nRecords; // Number of records in lp. // bit 15 of "nRecords" == "has continuation from previous 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; #undef PACKED @@ -108,16 +108,16 @@ typedef struct PACKED 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 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 - uint16 thepage[0x8000]; // buffer where current large page is loaded - byte imagebuffer[0x10000]; // buffer where anim frame is decoded - byte * buffer; - byte pal[768]; - int32 currentframe; + uint16_t thepage[0x8000]; // buffer where current large page is loaded + uint8_t imagebuffer[0x10000]; // buffer where anim frame is decoded + uint8_t * buffer; + uint8_t pal[768]; + int32_t currentframe; } 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 //**************************************************************************** -byte * ANIM_GetPalette ( void ); +uint8_t * ANIM_GetPalette ( void ); #ifdef __cplusplus }; diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index d65611a99..edf046195 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -7,7 +7,7 @@ */ #include "compat.h" -#include "types.h" + #include "keyboard.h" #include "mouse.h" #include "control.h" @@ -19,19 +19,19 @@ #include "pragmas.h" -boolean CONTROL_JoyPresent = false; -boolean CONTROL_JoystickEnabled = false; -boolean CONTROL_MousePresent = false; -boolean CONTROL_MouseEnabled = false; +int32_t CONTROL_JoyPresent = FALSE; +int32_t CONTROL_JoystickEnabled = FALSE; +int32_t CONTROL_MousePresent = FALSE; +int32_t CONTROL_MouseEnabled = FALSE; uint64 CONTROL_ButtonState = 0; uint64 CONTROL_ButtonHeldState = 0; -// static int32 CONTROL_UserInputDelay = -1; -static int32 CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY; -static int32 CONTROL_NumMouseButtons = 0; -static int32 CONTROL_NumMouseAxes = 0; -static int32 CONTROL_NumJoyButtons = 0; -static int32 CONTROL_NumJoyAxes = 0; +// static int32_t CONTROL_UserInputDelay = -1; +static int32_t CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY; +static int32_t CONTROL_NumMouseButtons = 0; +static int32_t CONTROL_NumMouseAxes = 0; +static int32_t CONTROL_NumJoyButtons = 0; +static int32_t CONTROL_NumJoyAxes = 0; static controlflags CONTROL_Flags[CONTROL_NUM_FLAGS]; static controlbuttontype CONTROL_MouseButtonMapping[MAXMOUSEBUTTONS], CONTROL_JoyButtonMapping[MAXJOYBUTTONS]; @@ -42,17 +42,17 @@ static controlaxistype CONTROL_MouseAxes[MAXMOUSEAXES], // physical axes CONTROL_JoyAxes[MAXJOYAXES]; static controlaxistype CONTROL_LastMouseAxes[MAXMOUSEAXES], CONTROL_LastJoyAxes[MAXJOYAXES]; -static int32 CONTROL_MouseAxesScale[MAXMOUSEAXES], CONTROL_JoyAxesScale[MAXJOYAXES]; -static int32 CONTROL_MouseButtonState[MAXMOUSEBUTTONS], CONTROL_JoyButtonState[MAXJOYBUTTONS]; -static int32 CONTROL_MouseButtonClickedTime[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedTime[MAXJOYBUTTONS]; -static boolean CONTROL_MouseButtonClickedState[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedState[MAXJOYBUTTONS]; -static boolean CONTROL_MouseButtonClicked[MAXMOUSEBUTTONS], CONTROL_JoyButtonClicked[MAXJOYBUTTONS]; -static byte CONTROL_MouseButtonClickedCount[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedCount[MAXJOYBUTTONS]; -static boolean CONTROL_UserInputCleared[3]; -static int32(*GetTime)(void); -static boolean CONTROL_Started = false; -static int32 ticrate; -static int32 CONTROL_DoubleClickSpeed; +static int32_t CONTROL_MouseAxesScale[MAXMOUSEAXES], CONTROL_JoyAxesScale[MAXJOYAXES]; +static int32_t CONTROL_MouseButtonState[MAXMOUSEBUTTONS], CONTROL_JoyButtonState[MAXJOYBUTTONS]; +static int32_t CONTROL_MouseButtonClickedTime[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedTime[MAXJOYBUTTONS]; +static int32_t CONTROL_MouseButtonClickedState[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedState[MAXJOYBUTTONS]; +static int32_t CONTROL_MouseButtonClicked[MAXMOUSEBUTTONS], CONTROL_JoyButtonClicked[MAXJOYBUTTONS]; +static uint8_t CONTROL_MouseButtonClickedCount[MAXMOUSEBUTTONS], CONTROL_JoyButtonClickedCount[MAXJOYBUTTONS]; +static int32_t CONTROL_UserInputCleared[3]; +static int32_t(*GetTime)(void); +static int32_t CONTROL_Started = FALSE; +static int32_t ticrate; +static int32_t CONTROL_DoubleClickSpeed; int32_t extinput[CONTROL_NUM_FLAGS]; keybind KeyBindings[MAXBOUNDKEYS], MouseBindings[MAXMOUSEBUTTONS]; @@ -61,13 +61,13 @@ int32_t control_smoothmouse = 0; void CONTROL_GetMouseDelta(void) { - int32 x,y; + int32_t x,y; MOUSE_GetDelta(&x, &y); 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[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; } -int32 CONTROL_GetMouseSensitivity(void) +int32_t CONTROL_GetMouseSensitivity(void) { return (CONTROL_MouseSensitivity); } -void CONTROL_SetMouseSensitivity(int32 newsensitivity) +void CONTROL_SetMouseSensitivity(int32_t newsensitivity) { CONTROL_MouseSensitivity = newsensitivity; } -boolean CONTROL_StartMouse(void) +int32_t CONTROL_StartMouse(void) { CONTROL_NumMouseButtons = MAXMOUSEBUTTONS; return MOUSE_Init(); @@ -106,40 +106,40 @@ void CONTROL_FilterJoyDelta(void) void CONTROL_GetJoyDelta(void) { - int32 i; + int32_t i; for (i=0; i> 5; } -boolean CONTROL_StartJoy(int32 joy) +int32_t CONTROL_StartJoy(int32_t joy) { UNREFERENCED_PARAMETER(joy); return (inputdevices & 4) == 4; } -void CONTROL_ShutJoy(int32 joy) +void CONTROL_ShutJoy(int32_t 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; 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.", // 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; @@ -150,33 +150,33 @@ void CONTROL_SetFlag(int32 which, boolean 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].active = (CONTROL_Flags[which].active ? false : true); + CONTROL_Flags[which].buttonheld = 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]) - 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]) - key2 = KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] ? true : false; + key2 = KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] ? TRUE : FALSE; return (key1 | key2); } -void CONTROL_ClearKeyboardFunction(int32 which) +void CONTROL_ClearKeyboardFunction(int32_t which) { if (CONTROL_CheckRange(which)) return; @@ -189,25 +189,25 @@ void CONTROL_ClearKeyboardFunction(int32 which) 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; - CONTROL_Flags[which].active = false; - CONTROL_Flags[which].used = true; + CONTROL_Flags[which].active = FALSE; + CONTROL_Flags[which].used = TRUE; CONTROL_Flags[which].toggle = toggle; - CONTROL_Flags[which].buttonheld = false; + CONTROL_Flags[which].buttonheld = FALSE; 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; } -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; @@ -217,16 +217,16 @@ void CONTROL_MapKey(int32 which, kb_scancode key1, kb_scancode key2) void CONTROL_PrintKeyMap(void) { - int32 i; + int32_t i; - for (i=0;i= (uint32)MAXMOUSEBUTTONS) + if ((uint32_t)whichbutton >= (uint32_t)MAXMOUSEBUTTONS) { //Error("CONTROL_MapButton: button %d out of valid range for %d mouse buttons.", // whichbutton, CONTROL_NumMouseButtons); @@ -274,7 +274,7 @@ void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doublecli break; 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.", // whichbutton, CONTROL_NumJoyButtons); @@ -294,11 +294,11 @@ void CONTROL_MapButton(int32 whichfunction, int32 whichbutton, boolean doublecli 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; - 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.", // whichanalog, analog_maxtype); @@ -308,7 +308,7 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev switch (device) { 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.", // whichaxis, MAXMOUSEAXES); @@ -319,7 +319,7 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev break; 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.", // whichaxis, MAXJOYAXES); @@ -337,14 +337,14 @@ void CONTROL_MapAnalogAxis(int32 whichaxis, int32 whichanalog, controldevice dev 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) { 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.", // whichaxis, MAXMOUSEAXES); @@ -355,7 +355,7 @@ void CONTROL_SetAnalogAxisScale(int32 whichaxis, int32 axisscale, controldevice break; 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.", // whichaxis, MAXJOYAXES); @@ -373,7 +373,7 @@ void CONTROL_SetAnalogAxisScale(int32 whichaxis, int32 axisscale, controldevice 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; @@ -382,7 +382,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio switch (device) { 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.", // whichaxis, MAXMOUSEAXES); @@ -393,7 +393,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio break; 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.", // whichaxis, MAXJOYAXES); @@ -425,7 +425,7 @@ void CONTROL_MapDigitalAxis(int32 whichaxis, int32 whichfunction, int32 directio void CONTROL_ClearAssignments(void) { - int32 i; + int32_t i; memset(CONTROL_MouseButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_MouseButtonMapping)); memset(CONTROL_JoyButtonMapping, BUTTONUNDEFINED, sizeof(CONTROL_JoyButtonMapping)); @@ -436,36 +436,36 @@ void CONTROL_ClearAssignments(void) memset(CONTROL_JoyAxes, 0, sizeof(CONTROL_JoyAxes)); memset(CONTROL_LastMouseAxes, 0, sizeof(CONTROL_LastMouseAxes)); memset(CONTROL_LastJoyAxes, 0, sizeof(CONTROL_LastJoyAxes)); - for (i=0;i=0;i--) + for (; i>=0; i--) { bs = (buttons >> i) & 1; DeviceButtonState[i] = bs; - ButtonClickedState[i] = false; + ButtonClickedState[i] = FALSE; if (bs) { - if (ButtonClicked[i] == false) + if (ButtonClicked[i] == FALSE) { - ButtonClicked[i] = true; + ButtonClicked[i] = TRUE; if (ButtonClickedCount[i] == 0 || tm > ButtonClickedTime[i]) { @@ -474,27 +474,27 @@ static void DoGetDeviceButtons( } else if (tm < ButtonClickedTime[i]) { - ButtonClickedState[i] = true; + ButtonClickedState[i] = TRUE; ButtonClickedTime[i] = 0; ButtonClickedCount[i] = 2; } } else if (ButtonClickedCount[i] == 2) { - ButtonClickedState[i] = true; + ButtonClickedState[i] = TRUE; } continue; } if (ButtonClickedCount[i] == 2) ButtonClickedCount[i] = 0; - ButtonClicked[i] = false; + ButtonClicked[i] = FALSE; } } void CONTROL_GetDeviceButtons(void) { - int32 t; + int32_t t; t = GetTime(); @@ -513,10 +513,10 @@ void CONTROL_GetDeviceButtons(void) if (CONTROL_JoystickEnabled) { - int32 buttons = joyb; + int32_t buttons = joyb; 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; // 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; @@ -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; - int32 *scale; + int32_t *scale; switch (device) { @@ -590,7 +590,7 @@ void CONTROL_ScaleAxis(int32 axis, controldevice device) 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; controlaxismaptype *map; @@ -633,7 +633,7 @@ void CONTROL_PollDevices(ControlInfo *info) if (CONTROL_MouseEnabled) { - int32 i = MAXMOUSEAXES-1; + int32_t i = MAXMOUSEAXES-1; CONTROL_GetMouseDelta(); do @@ -653,7 +653,7 @@ void CONTROL_PollDevices(ControlInfo *info) if (CONTROL_JoystickEnabled) { - int32 i = MAXJOYAXES-1; + int32_t i = MAXJOYAXES-1; CONTROL_GetJoyDelta(); do @@ -674,11 +674,11 @@ void CONTROL_PollDevices(ControlInfo *info) CONTROL_GetDeviceButtons(); } -void CONTROL_AxisFunctionState(int32 *p1) +void CONTROL_AxisFunctionState(int32_t *p1) { if (CONTROL_NumMouseAxes) { - int32 j, i = CONTROL_NumMouseAxes-1; + int32_t j, i = CONTROL_NumMouseAxes-1; do { @@ -697,7 +697,7 @@ void CONTROL_AxisFunctionState(int32 *p1) if (CONTROL_NumJoyAxes) { - int32 j, i = CONTROL_NumJoyAxes-1; + int32_t j, i = CONTROL_NumJoyAxes-1; do { @@ -715,11 +715,11 @@ void CONTROL_AxisFunctionState(int32 *p1) } } -void CONTROL_ButtonFunctionState(int32 *p1) +void CONTROL_ButtonFunctionState(int32_t *p1) { if (CONTROL_NumMouseButtons) { - int32 i = CONTROL_NumMouseButtons-1, j; + int32_t i = CONTROL_NumMouseButtons-1, j; do { @@ -749,7 +749,7 @@ void CONTROL_ButtonFunctionState(int32 *p1) if (CONTROL_NumJoyButtons) { - int32 i=CONTROL_NumJoyButtons-1, j; + int32_t i=CONTROL_NumJoyButtons-1, j; do { @@ -851,11 +851,11 @@ void CONTROL_ClearUserInput( UserInput *info ) if (info->button1) CONTROL_UserInputCleared[2] = true; } */ -void CONTROL_ClearButton(int32 whichbutton) +void CONTROL_ClearButton(int32_t whichbutton) { if (CONTROL_CheckRange(whichbutton)) return; BUTTONCLEAR(whichbutton); - CONTROL_Flags[whichbutton].cleared = true; + CONTROL_Flags[whichbutton].cleared = TRUE; } void CONTROL_ProcessBinds(void) @@ -888,7 +888,7 @@ void CONTROL_ProcessBinds(void) void CONTROL_GetInput(ControlInfo *info) { - int32 periphs[CONTROL_NUM_FLAGS]; + int32_t periphs[CONTROL_NUM_FLAGS]; CONTROL_PollDevices(info); @@ -902,20 +902,20 @@ void CONTROL_GetInput(ControlInfo *info) CONTROL_ProcessBinds(); { - int32 i = CONTROL_NUM_FLAGS-1; + int32_t i = CONTROL_NUM_FLAGS-1; do { CONTROL_SetFlag(i, CONTROL_KeyboardFunctionPressed(i) | periphs[i] | extinput[i]); - if (CONTROL_Flags[i].cleared == false) BUTTONSET(i, CONTROL_Flags[i].active); - else if (CONTROL_Flags[i].active == false) CONTROL_Flags[i].cleared = 0; + if (CONTROL_Flags[i].cleared == FALSE) BUTTONSET(i, CONTROL_Flags[i].active); + else if (CONTROL_Flags[i].active == FALSE) CONTROL_Flags[i].cleared = 0; } while (--i); CONTROL_SetFlag(0, CONTROL_KeyboardFunctionPressed(0) | periphs[0] | extinput[0]); - if (CONTROL_Flags[0].cleared == false) BUTTONSET(0, CONTROL_Flags[0].active); - else if (CONTROL_Flags[0].active == false) CONTROL_Flags[0].cleared = 0; + if (CONTROL_Flags[0].cleared == FALSE) BUTTONSET(0, CONTROL_Flags[0].active); + else if (CONTROL_Flags[0].active == FALSE) CONTROL_Flags[0].cleared = 0; } 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); - if (CONTROL_Started) return false; + if (CONTROL_Started) return FALSE; if (TimeFunction) GetTime = TimeFunction; else GetTime = CONTROL_GetTime; @@ -946,10 +946,10 @@ boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 tic if (CONTROL_DoubleClickSpeed <= 0) CONTROL_DoubleClickSpeed = 1; - if (initinput()) return true; + if (initinput()) return TRUE; - CONTROL_MousePresent = CONTROL_MouseEnabled = false; - CONTROL_JoyPresent = CONTROL_JoystickEnabled = false; + CONTROL_MousePresent = CONTROL_MouseEnabled = FALSE; + CONTROL_JoyPresent = CONTROL_JoystickEnabled = FALSE; CONTROL_NumMouseButtons = CONTROL_NumJoyButtons = 0; CONTROL_NumMouseAxes = CONTROL_NumJoyAxes = 0; KB_Startup(); @@ -986,22 +986,22 @@ boolean CONTROL_Startup(controltype which, int32(*TimeFunction)(void), int32 tic memset(CONTROL_UserInputCleared, 0, sizeof(CONTROL_UserInputCleared)); for (i=0; i #include #include "compat.h" -#include "types.h" + #include "file_lib.h" #include "util_lib.h" #include "cache1d.h" @@ -56,9 +56,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MaxFiles 20 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); 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; } -int32 SafeOpenRead(const char *filename, int32 filetype) +int32_t SafeOpenRead(const char *filename, int32_t 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 (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; - return false; + if (!access(filename, F_OK)) return TRUE; + return FALSE; } -int32 SafeFileLength(int32 handle) +int32_t SafeFileLength(int32_t handle) { if (handle < 0) return -1; 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); if (b != count) diff --git a/polymer/eduke32/source/jmact/file_lib.h b/polymer/eduke32/source/jmact/file_lib.h index f5a2ee04d..1cc34375b 100644 --- a/polymer/eduke32/source/jmact/file_lib.h +++ b/polymer/eduke32/source/jmact/file_lib.h @@ -48,42 +48,42 @@ enum // 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 // //========================================================================== -int32 SafeOpenRead ( const char * filename, int32 filetype ); +int32_t SafeOpenRead ( const char * filename, int32_t filetype ); //========================================================================== // // 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 // //========================================================================== -void SafeClose ( int32 handle ); +void SafeClose ( int32_t handle ); //========================================================================== // // 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 // //========================================================================== -int32 SafeFileLength ( int32 handle ); +int32_t SafeFileLength ( int32_t handle ); //========================================================================== // @@ -96,7 +96,7 @@ int32 SafeFileLength ( int32 handle ); // 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 // //========================================================================== -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 // //========================================================================== -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 // //========================================================================== -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 // //========================================================================== -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. // //****************************************************************************** -boolean ChangeDirectory (char * path); +int32_t ChangeDirectory (char * path); //****************************************************************************** // @@ -250,7 +250,7 @@ boolean ChangeDirectory (char * path); // FALSE - If drive change unsuccessful. // //****************************************************************************** -boolean ChangeDrive (char *drive); +int32_t ChangeDrive (char *drive); #endif diff --git a/polymer/eduke32/source/jmact/keyboard.c b/polymer/eduke32/source/jmact/keyboard.c index e2aadae96..6a2377ebf 100644 --- a/polymer/eduke32/source/jmact/keyboard.c +++ b/polymer/eduke32/source/jmact/keyboard.c @@ -33,14 +33,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "compat.h" -#include "types.h" + #include "keyboard.h" #include "control.h" kb_scancode KB_LastScan; -static boolean numpad = 0; +static int32_t numpad = 0; // translation table for taking key names to scancodes and back again static struct @@ -196,7 +196,7 @@ static char sctoasc[2][256] = { }; */ -boolean KB_KeyWaiting(void) +int32_t KB_KeyWaiting(void) { return bkbhit(); // return (keyfifoplc != keyfifoend); @@ -263,7 +263,7 @@ void KB_TurnKeypadOff(void) numpad = 0; } -boolean KB_KeypadActive(void) +int32_t KB_KeypadActive(void) { return numpad; } diff --git a/polymer/eduke32/source/jmact/keyboard.h b/polymer/eduke32/source/jmact/keyboard.h index 8d2759268..ab4c5265a 100644 --- a/polymer/eduke32/source/jmact/keyboard.h +++ b/polymer/eduke32/source/jmact/keyboard.h @@ -41,7 +41,7 @@ extern "C" { ============================================================================= */ -typedef uint8 kb_scancode; +typedef uint8_t kb_scancode; #define sc_None 0 #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 void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters. 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 void KB_TurnKeypadOn( void ); // turn the keypad on 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_Shutdown( void ); diff --git a/polymer/eduke32/source/jmact/mathutil.h b/polymer/eduke32/source/jmact/mathutil.h index 9f386ef60..21386c76f 100644 --- a/polymer/eduke32/source/jmact/mathutil.h +++ b/polymer/eduke32/source/jmact/mathutil.h @@ -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 FindDistance3D(int32_t dx, int32_t dy, int32_t dz); -extern int32 FindDistance3D_HP(int32 dx, int32 dy, int32 dz); -extern int32 ArcTangentAppx(int32 dx, int32 dy); +extern int32_t FindDistance2D(int32_t dx, int32_t dy); +extern int32_t FindDistance3D(int32_t dx, int32_t dy, int32_t dz); +extern int32_t FindDistance3D_HP(int32_t dx, int32_t dy, int32_t dz); +extern int32_t ArcTangentAppx(int32_t dx, int32_t dy); diff --git a/polymer/eduke32/source/jmact/mouse.c b/polymer/eduke32/source/jmact/mouse.c index 01a7f438d..d8c95410c 100644 --- a/polymer/eduke32/source/jmact/mouse.c +++ b/polymer/eduke32/source/jmact/mouse.c @@ -33,12 +33,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "compat.h" -#include "types.h" + #include "mouse.h" #include "baselayer.h" -boolean MOUSE_Init(void) +int32_t MOUSE_Init(void) { initmouse(); 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); return buttons; } -int32 MOUSE_ClearButton(int32 b) +int32_t MOUSE_ClearButton(int32_t b) { return (mouseb &= ~b); } -void MOUSE_GetDelta(int32*x, int32*y) +void MOUSE_GetDelta(int32_t*x, int32_t*y) { readmousexy(x,y); } diff --git a/polymer/eduke32/source/jmact/mouse.h b/polymer/eduke32/source/jmact/mouse.h index 4f981c3f3..4ea7ec4dc 100644 --- a/polymer/eduke32/source/jmact/mouse.h +++ b/polymer/eduke32/source/jmact/mouse.h @@ -41,13 +41,13 @@ extern "C" { #define RIGHT_MOUSE_PRESSED( button ) ( ( ( button ) & RIGHT_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_ShowCursor( void ); void MOUSE_HideCursor( void ); -int32 MOUSE_GetButtons( void ); -int32 MOUSE_ClearButton( int32 b ); -void MOUSE_GetDelta( int32*x, int32*y ); +int32_t MOUSE_GetButtons( void ); +int32_t MOUSE_ClearButton( int32_t b ); +void MOUSE_GetDelta( int32_t*x, int32_t*y ); #ifdef __cplusplus }; diff --git a/polymer/eduke32/source/jmact/scriplib.c b/polymer/eduke32/source/jmact/scriplib.c index 8ca34ed2c..d5f471dc4 100644 --- a/polymer/eduke32/source/jmact/scriplib.c +++ b/polymer/eduke32/source/jmact/scriplib.c @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "compat.h" -#include "types.h" + #include "scriplib.h" #include "util_lib.h" #include "file_lib.h" @@ -54,9 +54,9 @@ static script_t *scriptfiles[MAXSCRIPTFILES]; #define SC(s) scriptfiles[s] -int32 SCRIPT_New(void) +int32_t SCRIPT_New(void) { - int32 i; + int32_t i; for (i=0; ipreventry = (e); \ } -ScriptSectionType * SCRIPT_SectionExists(int32 scripthandle, char * sectionname) +ScriptSectionType * SCRIPT_SectionExists(int32_t scripthandle, char * sectionname) { ScriptSectionType *s, *ls=NULL; @@ -148,7 +148,7 @@ ScriptSectionType * SCRIPT_SectionExists(int32 scripthandle, char * sectionname) return NULL; } -ScriptSectionType * SCRIPT_AddSection(int32 scripthandle, char * sectionname) +ScriptSectionType * SCRIPT_AddSection(int32_t scripthandle, char * sectionname) { ScriptSectionType *s,*s2; @@ -190,7 +190,7 @@ ScriptEntryType * SCRIPT_EntryExists(ScriptSectionType * section, char * entryna 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; 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 *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); return h; } -void SCRIPT_Free(int32 scripthandle) +void SCRIPT_Free(int32_t 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; h = SafeOpenRead(filename, filetype_binary); @@ -465,7 +465,7 @@ int32 SCRIPT_Load(char * filename) return s; } -void SCRIPT_Save(int32 scripthandle, char * filename) +void SCRIPT_Save(int32_t scripthandle, char * filename) { char *section, *entry, *value; int32_t sec, ent, numsect, nument; @@ -499,9 +499,9 @@ void SCRIPT_Save(int32 scripthandle, char * filename) 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; if (!SC(scripthandle)) return 0; @@ -512,7 +512,7 @@ int32 SCRIPT_NumberSections(int32 scripthandle) return c; } -char * SCRIPT_Section(int32 scripthandle, int32 which) +char * SCRIPT_Section(int32_t scripthandle, int32_t which) { ScriptSectionType *s,*ls=NULL; @@ -524,11 +524,11 @@ char * SCRIPT_Section(int32 scripthandle, int32 which) return s->name; } -int32 SCRIPT_NumberEntries(int32 scripthandle, char * sectionname) +int32_t SCRIPT_NumberEntries(int32_t scripthandle, char * sectionname) { ScriptSectionType *s; ScriptEntryType *e,*le=NULL; - int32 c=0; + int32_t c=0; if (!SC(scripthandle)) return 0; if (!SCRIPT(scripthandle,script)) return 0; @@ -540,7 +540,7 @@ int32 SCRIPT_NumberEntries(int32 scripthandle, char * sectionname) return c; } -char * SCRIPT_Entry(int32 scripthandle, char * sectionname, int32 which) +char * SCRIPT_Entry(int32_t scripthandle, char * sectionname, int32_t which) { ScriptSectionType *s; ScriptEntryType *e,*le=NULL; @@ -555,7 +555,7 @@ char * SCRIPT_Entry(int32 scripthandle, char * sectionname, int32 which) return e->name; } -char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname) +char * SCRIPT_GetRaw(int32_t scripthandle, char * sectionname, char * entryname) { ScriptSectionType *s; ScriptEntryType *e; @@ -570,7 +570,7 @@ char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname) 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; ScriptEntryType *e; @@ -629,7 +629,7 @@ boolean SCRIPT_GetString(int32 scripthandle, char * sectionname, char * entrynam 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; ScriptEntryType *e; @@ -733,7 +733,7 @@ breakme: 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; ScriptEntryType *e; @@ -765,7 +765,7 @@ boolean SCRIPT_GetNumber(int32 scripthandle, char * sectionname, char * entrynam 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; ScriptEntryType *e; @@ -788,14 +788,14 @@ boolean SCRIPT_GetBoolean(int32 scripthandle, char * sectionname, char * entryna return 0; } -void SCRIPT_PutSection(int32 scripthandle, char * sectionname) +void SCRIPT_PutSection(int32_t scripthandle, char * sectionname) { SCRIPT_AddSection(scripthandle, sectionname); } void SCRIPT_PutRaw ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * raw @@ -806,7 +806,7 @@ void SCRIPT_PutRaw void SCRIPT_PutString ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * string @@ -840,7 +840,7 @@ void SCRIPT_PutString void SCRIPT_PutDoubleString ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * string1, @@ -892,12 +892,12 @@ void SCRIPT_PutDoubleString void SCRIPT_PutNumber ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, - int32 number, - boolean hexadecimal, - boolean defaultvalue + int32_t number, + int32_t hexadecimal, + int32_t defaultvalue ) { char raw[64]; @@ -911,10 +911,10 @@ void SCRIPT_PutNumber void SCRIPT_PutBoolean ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, - boolean boole + int32_t boole ) { char raw[2] = "0"; @@ -926,11 +926,11 @@ void SCRIPT_PutBoolean void SCRIPT_PutDouble ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, double number, - boolean defaultvalue + int32_t defaultvalue ) { char raw[64]; diff --git a/polymer/eduke32/source/jmact/scriplib.h b/polymer/eduke32/source/jmact/scriplib.h index 072f90547..a5d0033b7 100644 --- a/polymer/eduke32/source/jmact/scriplib.h +++ b/polymer/eduke32/source/jmact/scriplib.h @@ -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 * entryname, char * dest @@ -143,9 +143,9 @@ boolean SCRIPT_GetString = ============== */ -boolean SCRIPT_GetDoubleString +int32_t SCRIPT_GetDoubleString ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * dest1, @@ -159,12 +159,12 @@ boolean SCRIPT_GetDoubleString = ============== */ -boolean SCRIPT_GetNumber +int32_t SCRIPT_GetNumber ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, 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 * 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 ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * raw @@ -215,7 +215,7 @@ void SCRIPT_PutRaw */ void SCRIPT_PutString ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * string @@ -230,7 +230,7 @@ void SCRIPT_PutString */ void SCRIPT_PutDoubleString ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, char * string1, @@ -246,12 +246,12 @@ void SCRIPT_PutDoubleString */ void SCRIPT_PutNumber ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, - int32 number, - boolean hexadecimal, - boolean defaultvalue + int32_t number, + int32_t hexadecimal, + int32_t defaultvalue ); /* @@ -263,10 +263,10 @@ void SCRIPT_PutNumber */ void SCRIPT_PutBoolean ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, - boolean boole + int32_t boole ); /* @@ -279,11 +279,11 @@ void SCRIPT_PutBoolean void SCRIPT_PutDouble ( - int32 scripthandle, + int32_t scripthandle, char * sectionname, char * entryname, double number, - boolean defaultvalue + int32_t defaultvalue ); diff --git a/polymer/eduke32/source/jmact/types.h b/polymer/eduke32/source/jmact/types.h deleted file mode 100644 index a006c33d6..000000000 --- a/polymer/eduke32/source/jmact/types.h +++ /dev/null @@ -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 diff --git a/polymer/eduke32/source/jmact/util_lib.c b/polymer/eduke32/source/jmact/util_lib.c index 4f99200e7..fda26ffd6 100644 --- a/polymer/eduke32/source/jmact/util_lib.c +++ b/polymer/eduke32/source/jmact/util_lib.c @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "compat.h" -#include "types.h" + #include "util_lib.h" #include "baselayer.h" @@ -70,7 +70,7 @@ char CheckParm(char *check) { int32_t c; - for (c=1;c<_buildargc;c++) + for (c=1; c<_buildargc; c++) { if (_buildargv[c][0] == '/' || _buildargv[c][0] == '-') if (!Bstrcasecmp(&_buildargv[c][1], check)) return c; @@ -79,7 +79,7 @@ char CheckParm(char *check) return 0; } -void *SafeMalloc(int32 size) +void *SafeMalloc(int32_t size) { void *p; @@ -95,7 +95,7 @@ void SafeFree(void * ptr) free(ptr); } -void SafeRealloc(void ** ptr, int32 newsize) +void SafeRealloc(void ** ptr, int32_t newsize) { void *p; @@ -105,17 +105,17 @@ void SafeRealloc(void ** ptr, int32 newsize) *ptr = p; } -int32 ParseHex(char *hex) +int32_t ParseHex(char *hex) { return strtol(hex, NULL, 16); } -int32 ParseNum(char *str) +int32_t ParseNum(char *str) { return strtol(str, NULL, 10); } -int16 MotoShort(int16 l) +int16_t MotoShort(int16_t l) { #if B_LITTLE_ENDIAN != 0 return l; @@ -124,7 +124,7 @@ int16 MotoShort(int16 l) #endif } -int16 IntelShort(int16 l) +int16_t IntelShort(int16_t l) { #if B_BIG_ENDIAN != 0 return ((l & 0x00ff) << 8) | ((l & 0xff00) >> 8); @@ -133,20 +133,20 @@ int16 IntelShort(int16 l) #endif } -int32 MotoLong(int32 l) +int32_t MotoLong(int32_t l) { #if B_LITTLE_ENDIAN != 0 return l; #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); #endif } -int32 IntelLong(int32 l) +int32_t IntelLong(int32_t l) { #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); #else return l; diff --git a/polymer/eduke32/source/jmact/util_lib.h b/polymer/eduke32/source/jmact/util_lib.h index 499921d41..345db431d 100644 --- a/polymer/eduke32/source/jmact/util_lib.h +++ b/polymer/eduke32/source/jmact/util_lib.h @@ -46,18 +46,18 @@ void Error (char *error, ...); char CheckParm (char *check); -void *SafeMalloc (int32 size); -int32 SafeMallocSize (void * ptr); +void *SafeMalloc (int32_t size); +int32_t SafeMallocSize (void * ptr); void SafeFree (void * ptr); -void SafeRealloc (void ** ptr, int32 newsize); -int32 ParseHex (char *hex); -int32 ParseNum (char *str); -int16 MotoShort (int16 l); -int16 IntelShort (int16 l); -int32 MotoLong (int32 l); -int32 IntelLong (int32 l); +void SafeRealloc (void ** ptr, int32_t newsize); +int32_t ParseHex (char *hex); +int32_t ParseNum (char *str); +int16_t MotoShort (int16_t l); +int16_t IntelShort (int16_t l); +int32_t MotoLong (int32_t 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 }; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 7fa27c483..3cd95706c 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -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); static struct savehead savehead; -//static int32 volnum,levnum,plrskl,numplr; +//static int32_t volnum,levnum,plrskl,numplr; //static char brdfn[BMAX_PATH]; int32_t g_lastSaveSlot = -1; @@ -3582,7 +3582,7 @@ cheat_for_port_credits: case 210: { - int32 sc; + int32_t sc; 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"); @@ -4245,7 +4245,7 @@ cheat_for_port_credits: ud.config.JoystickAnalogueAxes[thispage*2+(x==7)] = l; CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick); { - extern int32 mouseyaxismode; // player.c + extern int32_t mouseyaxismode; // player.c mouseyaxismode = -1; } break; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index ca69fdc68..f7e1c1641 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -37,8 +37,8 @@ int32_t g_kb; int32_t g_looking_angSR1; int32_t g_weapon_xoffset; -int32 turnheldtime; //MED -int32 lastcontroltime; //MED +int32_t turnheldtime; //MED +int32_t lastcontroltime; //MED extern int32_t g_levelTextTime; @@ -2998,18 +2998,18 @@ void P_DisplayWeapon(int32_t snum) #define MAXHORIZ 127 int32_t g_myAimMode = 0, g_myAimStat = 0, g_oldAimStat = 0; -int32 mouseyaxismode = -1; +int32_t mouseyaxismode = -1; int32_t jump_input = 0; void getinput(int32_t snum) { int32_t j, daang; static ControlInfo info[2]; - int32 tics; - boolean running; - int32 turnamount; - int32 keymove; - int32 momx = 0,momy = 0; + int32_t tics; + int32_t running; + int32_t turnamount; + int32_t keymove; + int32_t momx = 0,momy = 0; 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)) @@ -3042,7 +3042,7 @@ void getinput(int32_t snum) } { - int32 i; + int32_t i; if (g_myAimMode) i = analog_lookingupanddown; else i = ud.config.MouseAnalogueAxes[1]; @@ -3320,14 +3320,14 @@ static int32_t P_DoCounters(DukePlayer_t *p) { p->last_pissed_time--; - if (p->last_pissed_time == (26*219)) + if (p->last_pissed_time == (GAMETICSPERSEC*219)) { A_PlaySound(FLUSH_TOILET,p->i); if (snum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND)) 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->weapon_pos = 10; @@ -3742,7 +3742,7 @@ void P_CheckTouchDamage(DukePlayer_t *p,int32_t j) break; case BIGFORCE__STATIC: - p->hurt_delay = 26; + p->hurt_delay = GAMETICSPERSEC; { vec3_t davect; @@ -3951,7 +3951,7 @@ void P_ProcessInput(int32_t snum) if (p->timebeforeexit > 1 && p->last_extra > 0) { p->timebeforeexit--; - if (p->timebeforeexit == 26*5) + if (p->timebeforeexit == GAMETICSPERSEC*5) { FX_StopAllSounds(); S_ClearSoundLocks(); @@ -4416,8 +4416,8 @@ void P_ProcessInput(int32_t snum) } else if (psectlotag != 2) { - if (p->airleft != 15*26) - p->airleft = 15*26; //Aprox twenty seconds. + if (p->airleft != 15*GAMETICSPERSEC) + p->airleft = 15*GAMETICSPERSEC; //Aprox twenty seconds. if (p->scuba_on == 1) p->scuba_on = 0; @@ -5202,7 +5202,7 @@ SHOOTINCODE: 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->weapon_pos = 10; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 19b55277e..33c6add03 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -663,7 +663,7 @@ static void P_ResetStatus(int32_t snum) p->on_ground = 0; p->player_par = 0; p->return_to_center = 9; - p->airleft = 15*26; + p->airleft = 15*GAMETICSPERSEC; p->rapid_fire_hold = 0; p->toggle_key_flag = 0; p->access_spritenum = -1; @@ -1244,7 +1244,7 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk) FX_StopAllSounds(); } - g_showShareware = 26*34; + g_showShareware = GAMETICSPERSEC*34; ud.level_number = ln; ud.volume_number = vn; diff --git a/polymer/eduke32/source/rts.c b/polymer/eduke32/source/rts.c index b8a6dfa2a..f471d4da2 100644 --- a/polymer/eduke32/source/rts.c +++ b/polymer/eduke32/source/rts.c @@ -28,10 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // STATICS //============= -int32 numlumps; +int32_t numlumps; static void **lumpcache; static lumpinfo_t *lumpinfo; // location of each lump on disk -static boolean RTS_Started = false; +static int32_t RTS_Started = FALSE; 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; lumpinfo_t *lump_p; - uint32 i; - int32 handle, length; - int32 startlump; + uint32_t i; + int32_t handle, length; + int32_t startlump; filelump_t *fileinfo, *fileinfoo; // @@ -114,7 +114,7 @@ int32 RTS_AddFile(const char *filename) 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->position = IntelLong(fileinfo->filepos); @@ -139,7 +139,7 @@ int32 RTS_AddFile(const char *filename) void RTS_Init(const char *filename) { - int32 length; + int32_t length; // // open all the files, load headers, and count lumps // @@ -157,7 +157,7 @@ void RTS_Init(const char *filename) length = (numlumps) * sizeof(*lumpcache); lumpcache = SafeMalloc(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; } @@ -184,7 +184,7 @@ int32 RTS_NumSounds(void) ==================== */ -int32 RTS_SoundLength(int32 lump) +int32_t RTS_SoundLength(int32_t lump) { lump++; 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++; 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; @@ -237,10 +237,10 @@ void RTS_ReadLump(int32 lump, void *dest) = ==================== */ -void *RTS_GetSound(int32 lump) +void *RTS_GetSound(int32_t lump) { lump++; - if ((uint32)lump >= (uint32)numlumps) + if ((uint32_t)lump >= (uint32_t)numlumps) Error("RTS_GetSound: %i >= %i\n",lump,numlumps); if (lumpcache[lump] == NULL) diff --git a/polymer/eduke32/source/rts.h b/polymer/eduke32/source/rts.h index 7f320f0b4..f9d09d18e 100644 --- a/polymer/eduke32/source/rts.h +++ b/polymer/eduke32/source/rts.h @@ -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 diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 5916942c7..0c724bcc2 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -100,12 +100,12 @@ int32_t G_LoadSaveHeader(char spot,struct savehead *saveh) 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->volnum,sizeof(int32),1,fil) != 1) goto corrupt; - if (kdfread(&saveh->levnum,sizeof(int32),1,fil) != 1) goto corrupt; - if (kdfread(&saveh->plrskl,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_t),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 (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; int32_t fil, bv, i, x; intptr_t j; - int32 nump; + int32_t nump; strcpy(fn, "egam0.sav"); strcpy(mpfn, "egamA_00.sav"); diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 83735d8a7..baa6742c2 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2599,7 +2599,7 @@ void G_HandleSharedKeys(int32_t snum) if (p->newowner == -1) 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; else k = 0; @@ -2760,7 +2760,7 @@ CHECKINV1: p->wantweaponfire = j; 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 ) )) { @@ -3174,7 +3174,7 @@ void P_CheckSectors(int32_t snum) return; case -2: sector[p->cursectnum].lotag = 0; - p->timebeforeexit = 26*8; + p->timebeforeexit = GAMETICSPERSEC*8; p->customexitsound = sector[p->cursectnum].hitag; return; default: @@ -3315,7 +3315,7 @@ void P_CheckSectors(int32_t snum) { 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; if (p->holster_weapon == 0) { diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 094206839..ef18270db 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //#include #include #include -#include "types.h" + #include "fx_man.h" #include "music.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 || g_sounds[num].num > 3 || 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; if (g_sounds[num].m&128) diff --git a/polymer/eduke32/source/sounds_mapster32.c b/polymer/eduke32/source/sounds_mapster32.c index 35451c06b..745eddfd1 100644 --- a/polymer/eduke32/source/sounds_mapster32.c +++ b/polymer/eduke32/source/sounds_mapster32.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //#include #include #include -#include "types.h" + #include "fx_man.h" //#include "music.h" //#include "duke3d.h"