void CONFIG_WriteSetup( void ) { int32 dummy; char buf[80]; extern BOOL ClassicLighting; #if MEGAWANG extern int32 useDarts; scripthandle = SCRIPT_Init(localsetupfilename); #else if (scripthandle < 0) scripthandle = SCRIPT_Init(setupfilename); #endif SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenWidth", ScreenWidth,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenMode",ScreenMode,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,FALSE,FALSE); #if MEGAWANG SCRIPT_PutBoolean( scripthandle, "Screen Setup", "VerticalSync", vsync); SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxFPS", max_fps, FALSE, FALSE); dummy = (int32)(xfov*90.0f); SCRIPT_PutNumber( scripthandle, "Options", "FOV", dummy, FALSE, FALSE); #endif #ifdef RENDERTYPEWIN SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,FALSE,FALSE); #endif SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,FALSE,FALSE); #if MEGAWANG SCRIPT_PutBoolean(scripthandle, "Screen Setup", "ClassicLighting", ClassicLighting); SCRIPT_Save(scripthandle, localsetupfilename); SCRIPT_Free(scripthandle); scripthandle = SCRIPT_Init(setupfilename); #endif SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXDevice", FXDevice, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicDevice", MusicDevice, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumVoices", NumVoices, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumChannels", NumChannels, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumBits", NumBits, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MixRate", MixRate, FALSE, FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXVolume",gs.SoundVolume,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicVolume",gs.MusicVolume,FALSE,FALSE); dummy = gs.FlipStereo; SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",dummy,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Setup", "ForceSetup",ForceSetup,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,FALSE,FALSE); SCRIPT_PutNumber( scripthandle, "Controls","MouseSensitivity",gs.MouseSpeed,FALSE,FALSE); #if MEGAWANG SCRIPT_PutBoolean( scripthandle, "Options", "UseDarts", useDarts); #endif WriteGameSetup(scripthandle); #if MEGAWANG for (dummy = 0; dummy<NUMGAMEFUNCTIONS; dummy++) { SCRIPT_PutDoubleString( scripthandle, "KeyDefinitions", CONFIG_FunctionNumToName(dummy), (char*)dnGetKeyName(dnGetFunctionBinding(dummy, 0)), (char*)dnGetKeyName(dnGetFunctionBinding(dummy, 1))); } #else for (dummy=0;dummy<NUMGAMEFUNCTIONS;dummy++) { SCRIPT_PutDoubleString( scripthandle, "KeyDefinitions", CONFIG_FunctionNumToName(dummy), KB_ScanCodeToString(KeyboardKeys[dummy][0]), KB_ScanCodeToString(KeyboardKeys[dummy][1])); } #endif for (dummy=0;dummy<MAXMOUSEBUTTONS;dummy++) { Bsprintf(buf,"MouseButton%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( MouseFunctions[dummy][0] )); if (dummy >= (MAXMOUSEBUTTONS-2)) continue; // scroll wheel Bsprintf(buf,"MouseButtonClicked%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( MouseFunctions[dummy][1] )); } for (dummy=0;dummy<MAXMOUSEAXES;dummy++) { Bsprintf(buf,"MouseAnalogAxes%ld",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_AnalogNumToName( MouseAnalogueAxes[dummy] )); Bsprintf(buf,"MouseDigitalAxes%ld_0",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(MouseDigitalFunctions[dummy][0])); Bsprintf(buf,"MouseDigitalAxes%ld_1",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(MouseDigitalFunctions[dummy][1])); Bsprintf(buf,"MouseAnalogScale%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, MouseAnalogueScale[dummy], FALSE, FALSE); } for (dummy=0;dummy<MAXJOYBUTTONS;dummy++) { Bsprintf(buf,"JoystickButton%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( JoystickFunctions[dummy][0] )); Bsprintf(buf,"JoystickButtonClicked%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( JoystickFunctions[dummy][1] )); } for (dummy=0;dummy<MAXJOYAXES;dummy++) { Bsprintf(buf,"JoystickAnalogAxes%ld",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_AnalogNumToName( JoystickAnalogueAxes[dummy] )); Bsprintf(buf,"JoystickDigitalAxes%ld_0",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(JoystickDigitalFunctions[dummy][0])); Bsprintf(buf,"JoystickDigitalAxes%ld_1",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(JoystickDigitalFunctions[dummy][1])); Bsprintf(buf,"JoystickAnalogScale%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueScale[dummy], FALSE, FALSE); Bsprintf(buf,"JoystickAnalogDead%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueDead[dummy], FALSE, FALSE); Bsprintf(buf,"JoystickAnalogSaturate%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueSaturate[dummy], FALSE, FALSE); } SCRIPT_Save (scripthandle, setupfilename); SCRIPT_Free (scripthandle); }
void CONFIG_WriteSetup( void ) { int32 dummy; if (!setupread) return; // if (scripthandle < 0) scripthandle = SCRIPT_Init(localsetupfilename); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false); SCRIPT_PutString( scripthandle, "Screen Setup", "Password",ud.pwlockout); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Out",ud.lockout,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenWidth",ScreenWidth,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenHeight",ScreenHeight,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenMode",ScreenMode,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenBPP",ScreenBPP,false,false); SCRIPT_PutBoolean( scripthandle, "Screen Setup", "VerticalSync", (boolean)ud.vsync); SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxFPS", ud.fps_max, false, false); #ifdef RENDERTYPEWIN SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); #endif SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false); SCRIPT_Save (scripthandle, localsetupfilename); SCRIPT_Free (scripthandle); scripthandle = SCRIPT_Init(setupfilename); SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXDevice", FXDevice, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicDevice", MusicDevice, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumVoices", NumVoices, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumChannels", NumChannels, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "NumBits", NumBits, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "MixRate", MixRate, false, false); SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false); SCRIPT_PutNumber( scripthandle, "Setup", "ForceSetup",ForceSetup,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "Executions",ud.executions,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "RunMode",RunMode,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "ShowLevelStats",ud.levelstats,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "StatusBarScale",ud.statusbarscale,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "ShowOpponentWeapons",ShowOpponentWeapons,false,false); SCRIPT_PutNumber( scripthandle, "Misc", "UsePrecache",useprecache,false,false); SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false); SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false); SCRIPT_PutNumber( scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false); SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false); //SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false); SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false); SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false); SCRIPT_PutNumber( scripthandle, "Controls","AutoAim",AutoAim,false,false); SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false); // JBF 20031211 #if 0 for(dummy=0;dummy<NUMGAMEFUNCTIONS;dummy++) { SCRIPT_PutDoubleString( scripthandle, "KeyDefinitions", CONFIG_FunctionNumToName(dummy), KB_ScanCodeToString(KeyboardKeys[dummy][0]), KB_ScanCodeToString(KeyboardKeys[dummy][1])); } #else for(dummy=0;dummy<NUMGAMEFUNCTIONS;dummy++) { SCRIPT_PutDoubleString( scripthandle, "KeyDefinitions", CONFIG_FunctionNumToName(dummy), dnGetKeyName(dnGetFunctionBinding(dummy, 0)), dnGetKeyName(dnGetFunctionBinding(dummy, 1))); } #endif for(dummy=0;dummy<10;dummy++) { Bsprintf(buf,"WeaponChoice%ld",dummy); SCRIPT_PutNumber( scripthandle, "Misc",buf,ud.wchoice[myconnectindex][dummy],false,false); } for (dummy=0;dummy<MAXMOUSEBUTTONS;dummy++) { Bsprintf(buf,"MouseButton%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( MouseFunctions[dummy][0] )); if (dummy >= (MAXMOUSEBUTTONS-2)) continue; Bsprintf(buf,"MouseButtonClicked%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( MouseFunctions[dummy][1] )); } for (dummy=0;dummy<MAXMOUSEAXES;dummy++) { Bsprintf(buf,"MouseAnalogAxes%ld",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_AnalogNumToName( MouseAnalogueAxes[dummy] )); Bsprintf(buf,"MouseDigitalAxes%ld_0",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(MouseDigitalFunctions[dummy][0])); Bsprintf(buf,"MouseDigitalAxes%ld_1",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(MouseDigitalFunctions[dummy][1])); Bsprintf(buf,"MouseAnalogScale%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, MouseAnalogueScale[dummy], false, false); } #if 0 dummy = CONTROL_GetMouseSensitivity(); #else dummy = dnGetMouseSensitivity(); #endif SCRIPT_PutNumber( scripthandle, "Controls","MouseSensitivity",dummy,false,false); for (dummy=0;dummy<MAXJOYBUTTONS;dummy++) { Bsprintf(buf,"JoystickButton%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( JoystickFunctions[dummy][0] )); Bsprintf(buf,"JoystickButtonClicked%ld",dummy); SCRIPT_PutString( scripthandle,"Controls", buf, CONFIG_FunctionNumToName( JoystickFunctions[dummy][1] )); } for (dummy=0;dummy<MAXJOYAXES;dummy++) { Bsprintf(buf,"JoystickAnalogAxes%ld",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_AnalogNumToName( JoystickAnalogueAxes[dummy] )); Bsprintf(buf,"JoystickDigitalAxes%ld_0",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(JoystickDigitalFunctions[dummy][0])); Bsprintf(buf,"JoystickDigitalAxes%ld_1",dummy); SCRIPT_PutString(scripthandle, "Controls", buf, CONFIG_FunctionNumToName(JoystickDigitalFunctions[dummy][1])); Bsprintf(buf,"JoystickAnalogScale%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueScale[dummy], false, false); Bsprintf(buf,"JoystickAnalogDead%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueDead[dummy], false, false); Bsprintf(buf,"JoystickAnalogSaturate%ld",dummy); SCRIPT_PutNumber(scripthandle, "Controls", buf, JoystickAnalogueSaturate[dummy], false, false); } SCRIPT_PutString( scripthandle, "Comm Setup","PlayerName",&myname[0]); SCRIPT_Save (scripthandle, setupfilename); SCRIPT_Free (scripthandle); }