From 30e9eed1b38a33471aa0b975c9475f4970946606 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 22 Oct 2019 00:05:21 +0200 Subject: [PATCH] - the next CVAR, cl_autoaim --- source/blood/src/blood.cpp | 4 +- source/blood/src/config.cpp | 2 - source/blood/src/config.h | 1 - source/blood/src/menu.cpp | 6 +- source/blood/src/network.cpp | 2 +- source/blood/src/osdcmd.cpp | 166 ------------------------------- source/build/include/baselayer.h | 1 + source/duke3d/src/config.cpp | 1 - source/duke3d/src/duke3d.h | 1 + source/duke3d/src/game.cpp | 2 +- source/duke3d/src/menus.cpp | 2 +- source/duke3d/src/network.cpp | 3 +- source/duke3d/src/savegame.cpp | 2 +- source/rr/src/config.cpp | 1 - source/rr/src/duke3d.h | 1 + source/rr/src/game.cpp | 2 +- source/rr/src/menus.cpp | 2 +- source/rr/src/net.cpp | 2 +- source/rr/src/savegame.cpp | 2 +- source/sw/src/draw.cpp | 2 +- source/sw/src/game.cpp | 6 +- source/sw/src/game.h | 1 + source/sw/src/menus.cpp | 12 +-- source/sw/src/network.cpp | 2 +- source/sw/src/swconfig.cpp | 4 +- 25 files changed, 32 insertions(+), 198 deletions(-) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 08638108b..ff6286281 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -686,7 +686,7 @@ void StartLevel(GAMEOPTIONS *gameOptions) if (numplayers == 1) { gProfile[i].skill = gSkill; - gProfile[i].nAutoAim = gAutoAim; + gProfile[i].nAutoAim = cl_autoaim; gProfile[i].nWeaponSwitch = gWeaponSwitch; } playerInit(i,0); @@ -1290,7 +1290,7 @@ void ParseOptions(void) strncpy(gNetAddress, OptArgv[0], sizeof(gNetAddress)-1); break; case 14: - gAutoAim = 0; + cl_autoaim = 0; break; case 22: bNoResend = 0; diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 0b24f1d87..ff9093728 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -81,7 +81,6 @@ char szPlayerName[MAXPLAYERNAME]; int32_t gTurnSpeed; int32_t gDetail; int32_t gMouseAim; -int32_t gAutoAim; int32_t gWeaponSwitch; int32_t gAutoRun; int32_t gViewInterpolate; @@ -401,7 +400,6 @@ void CONFIG_SetDefaults(void) gMouseAimingFlipped = 0; gMouseAim = 1; - gAutoAim = 1; gWeaponSwitch = 1; Bstrcpy(szPlayerName, "Player"); diff --git a/source/blood/src/config.h b/source/blood/src/config.h index 925e343a0..0b8b2917f 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -62,7 +62,6 @@ extern char CommbatMacro[MAXRIDECULE][MAXRIDECULELENGTH]; extern char szPlayerName[MAXPLAYERNAME]; extern int32_t gTurnSpeed; extern int32_t gDetail; -extern int32_t gAutoAim; extern int32_t gWeaponSwitch; extern int32_t gAutoRun; extern int32_t gViewInterpolate; diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index 89db896ee..0cf4e7a33 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -1122,7 +1122,7 @@ void SetupOptionsMenu(void) itemOptionsGameBoolSlopeTilting.at20 = gSlopeTilting; itemOptionsGameBoolViewBobbing.at20 = gViewVBobbing; itemOptionsGameBoolViewSwaying.at20 = gViewHBobbing; - itemOptionsGameBoolAutoAim.m_nFocus = gAutoAim; + itemOptionsGameBoolAutoAim.m_nFocus = cl_autoaim; itemOptionsGameWeaponSwitch.m_nFocus = (gWeaponSwitch&1) ? ((gWeaponSwitch&2) ? 1 : 2) : 0; /////// @@ -1469,10 +1469,10 @@ void SetTurnSpeed(CGameMenuItemSlider *pItem) void SetAutoAim(CGameMenuItemZCycle *pItem) { - gAutoAim = pItem->m_nFocus; + cl_autoaim = pItem->m_nFocus; if (!gDemo.at0 && !gDemo.at1) { - gProfile[myconnectindex].nAutoAim = gAutoAim; + gProfile[myconnectindex].nAutoAim = cl_autoaim; netBroadcastPlayerInfo(myconnectindex); } } diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index de35787ec..6213fb783 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -578,7 +578,7 @@ void netBroadcastPlayerInfo(int nPlayer) PROFILE *pProfile = &gProfile[nPlayer]; strcpy(pProfile->name, szPlayerName); pProfile->skill = gSkill; - pProfile->nAutoAim = gAutoAim; + pProfile->nAutoAim = cl_autoaim; pProfile->nWeaponSwitch = gWeaponSwitch; if (numplayers < 2) return; diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 40437b4ba..23697607f 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -906,173 +906,7 @@ static int osdcmd_cvar_set_multi(osdcmdptr_t parm) int32_t registerosdcommands(void) { char buffer[256]; - static osdcvardata_t cvars_game[] = - { - { "crosshair", "enable/disable crosshair", (void *)&gAimReticle, CVAR_BOOL, 0, 1 }, - { "cl_autoaim", "enable/disable weapon autoaim", (void *)&gAutoAim, CVAR_INT|CVAR_MULTI, 0, 2 }, -// { "cl_automsg", "enable/disable automatically sending messages to all players", (void *)&ud.automsg, CVAR_BOOL, 0, 1 }, - { "cl_autorun", "enable/disable autorun", (void *)&gAutoRun, CVAR_BOOL, 0, 1 }, -// -// { "cl_autosave", "enable/disable autosaves", (void *) &ud.autosave, CVAR_BOOL, 0, 1 }, -// { "cl_autosavedeletion", "enable/disable automatic deletion of autosaves", (void *) &ud.autosavedeletion, CVAR_BOOL, 0, 1 }, -// { "cl_maxautosaves", "number of autosaves to keep before deleting the oldest", (void *) &ud.maxautosaves, CVAR_INT, 1, 100 }, -// -// { "cl_autovote", "enable/disable automatic voting", (void *)&ud.autovote, CVAR_INT, 0, 2 }, -// -// { "cl_cheatmask", "configure what cheats show in the cheats menu", (void *)&cl_cheatmask, CVAR_UINT, 0, ~0 }, -// -// { "cl_obituaries", "enable/disable multiplayer death messages", (void *)&ud.obituaries, CVAR_BOOL, 0, 1 }, -// { "cl_democams", "enable/disable demo playback cameras", (void *)&ud.democams, CVAR_BOOL, 0, 1 }, -// -// { "cl_idplayers", "enable/disable name display when aiming at opponents", (void *)&ud.idplayers, CVAR_BOOL, 0, 1 }, -// - - { "cl_interpolate", "enable/disable view interpolation", (void *)&gViewInterpolate, CVAR_BOOL, 0, 1 }, - { "cl_viewhbob", "enable/disable view horizontal bobbing", (void *)&gViewHBobbing, CVAR_BOOL, 0, 1 }, - { "cl_viewvbob", "enable/disable view vertical bobbing", (void *)&gViewVBobbing, CVAR_BOOL, 0, 1 }, - { "cl_slopetilting", "enable/disable slope tilting", (void *)&gSlopeTilting, CVAR_BOOL, 0, 1 }, - { "cl_showweapon", "enable/disable show weapons", (void *)&gShowWeapon, CVAR_BOOL, 0, 1 }, - - { "cl_runmode", "enable/disable modernized run key operation", (void *)&gRunKeyMode, CVAR_BOOL, 0, 1 }, -// -// { "cl_showcoords", "show your position in the game world", (void *)&ud.coords, CVAR_INT, 0, -//#ifdef USE_OPENGL -// 2 -//#else -// 1 -//#endif -// }, -// -// { "cl_viewbob", "enable/disable player head bobbing", (void *)&ud.viewbob, CVAR_BOOL, 0, 1 }, -// -// { "cl_weaponsway", "enable/disable player weapon swaying", (void *)&ud.weaponsway, CVAR_BOOL, 0, 1 }, - { "cl_weaponswitch", "enable/disable auto weapon switching", (void *)&gWeaponSwitch, CVAR_INT|CVAR_MULTI, 0, 3 }, -// -// { "color", "changes player palette", (void *)&ud.color, CVAR_INT|CVAR_MULTI, 0, MAXPALOOKUPS-1 }, -// -// { "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 }, -// -// { "demorec_diffs","enable/disable diff recording in demos",(void *)&demorec_diffs_cvar, CVAR_BOOL, 0, 1 }, -// { "demorec_force","enable/disable forced demo recording",(void *)&demorec_force_cvar, CVAR_BOOL|CVAR_NOSAVE, 0, 1 }, -// { -// "demorec_difftics","sets game tic interval after which a diff is recorded", -// (void *)&demorec_difftics_cvar, CVAR_INT, 2, 60*REALGAMETICSPERSEC -// }, -// { "demorec_diffcompress","Compression method for diffs. (0: none, 1: KSLZW)",(void *)&demorec_diffcompress_cvar, CVAR_INT, 0, 1 }, -// { "demorec_synccompress","Compression method for input. (0: none, 1: KSLZW)",(void *)&demorec_synccompress_cvar, CVAR_INT, 0, 1 }, -// { "demorec_seeds","enable/disable recording of random seed for later sync checking",(void *)&demorec_seeds_cvar, CVAR_BOOL, 0, 1 }, -// { "demoplay_diffs","enable/disable application of diffs in demo playback",(void *)&demoplay_diffs, CVAR_BOOL, 0, 1 }, -// { "demoplay_showsync","enable/disable display of sync status",(void *)&demoplay_showsync, CVAR_BOOL, 0, 1 }, -// -// { "hud_althud", "enable/disable alternate mini-hud", (void *)&ud.althud, CVAR_BOOL, 0, 1 }, -// { "hud_custom", "change the custom hud", (void *)&ud.statusbarcustom, CVAR_INT, 0, ud.statusbarrange }, -// { "hud_position", "aligns the status bar to the bottom/top", (void *)&ud.hudontop, CVAR_BOOL, 0, 1 }, -// { "hud_bgstretch", "enable/disable background image stretching in wide resolutions", (void *)&ud.bgstretch, CVAR_BOOL, 0, 1 }, - { "hud_messages", "enable/disable showing messages", (void *)&gMessageState, CVAR_BOOL, 0, 1 }, -// { "hud_messagetime", "length of time to display multiplayer chat messages", (void *)&ud.msgdisptime, CVAR_INT, 0, 3600 }, -// { "hud_numbertile", "first tile in alt hud number set", (void *)&althud_numbertile, CVAR_INT, 0, MAXUSERTILES-10 }, -// { "hud_numberpal", "pal for alt hud numbers", (void *)&althud_numberpal, CVAR_INT, 0, MAXPALOOKUPS-1 }, -// { "hud_shadows", "enable/disable althud shadows", (void *)&althud_shadows, CVAR_BOOL, 0, 1 }, -// { "hud_flashing", "enable/disable althud flashing", (void *)&althud_flashing, CVAR_BOOL, 0, 1 }, -// { "hud_glowingquotes", "enable/disable \"glowing\" quote text", (void *)&hud_glowingquotes, CVAR_BOOL, 0, 1 }, -// { "hud_scale","changes the hud scale", (void *)&ud.statusbarscale, CVAR_INT|CVAR_FUNCPTR, 36, 100 }, -// { "hud_showmapname", "enable/disable map name display on load", (void *)&hud_showmapname, CVAR_BOOL, 0, 1 }, - { "hud_stats", "enable/disable level statistics display", (void *)&gLevelStats, CVAR_BOOL, 0, 1 }, - { "hud_powerupduration", "enable/disable displaying the remaining seconds for power-ups", (void *)&gPowerupDuration, CVAR_BOOL, 0, 1 }, - { "hud_showmaptitle", "enable/disable displaying the map title at the beginning of the maps", (void*)& gShowMapTitle, CVAR_BOOL, 0, 1 }, -// { "hud_textscale", "sets multiplayer chat message size", (void *)&ud.textscale, CVAR_INT, 100, 400 }, -// { "hud_weaponscale","changes the weapon scale", (void *)&ud.weaponscale, CVAR_INT, 10, 100 }, -// { "hud_statusbarmode", "change overlay mode of status bar", (void *)&ud.statusbarmode, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, -// -//#ifdef EDUKE32_TOUCH_DEVICES -// { "hud_hidestick", "hide the touch input stick", (void *)&droidinput.hideStick, CVAR_BOOL, 0, 1 }, -//#endif -// - { "horizcenter", "enable/disable centered horizon line", (void *)&gCenterHoriz, CVAR_BOOL, 0, 1 }, - { "deliriumblur", "enable/disable delirium blur effect(polymost)", (void *)&gDeliriumBlur, CVAR_BOOL, 0, 1 }, - { "fov", "change the field of view", (void *)&gFov, CVAR_INT|CVAR_FUNCPTR, 75, 120 }, - { "in_joystick","enables input from the joystick if it is present",(void *)&gSetup.usejoystick, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, - { "in_mouse","enables input from the mouse if it is present",(void *)&gSetup.usemouse, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, - - { "in_aimmode", "0:toggle, 1:hold to aim", (void *)&gMouseAiming, CVAR_BOOL, 0, 1 }, - { - "in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time", - (void *)&MouseBias, CVAR_INT, 0, 32 - }, - { "in_mousedeadzone", "amount of mouse movement to filter out", (void *)&MouseDeadZone, CVAR_INT, 0, 512 }, - { "in_mouseflip", "invert vertical mouse movement", (void *)&gMouseAimingFlipped, CVAR_BOOL, 0, 1 }, - { "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 }, - { "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&SmoothInput, CVAR_BOOL, 0, 1 }, -// - { "mus_enabled", "enables/disables music", (void *)&MusicToggle, CVAR_BOOL, 0, 1 }, - { "mus_restartonload", "restart the music when loading a saved game with the same map or not", (void *)&MusicRestartsOnLoadToggle, CVAR_BOOL, 0, 1 }, - { "mus_volume", "controls music volume", (void *)&MusicVolume, CVAR_INT, 0, 255 }, - { "mus_device", "music device", (void *)&MusicDevice, CVAR_INT, 0, 1 }, - { "mus_redbook", "enables/disables redbook audio", (void *)&CDAudioToggle, CVAR_BOOL, 0, 1 }, -// -// { "osdhightile", "enable/disable hires art replacements for console text", (void *)&osdhightile, CVAR_BOOL, 0, 1 }, -// { "osdscale", "adjust console text size", (void *)&osdscale, CVAR_FLOAT|CVAR_FUNCPTR, 1, 4 }, -// -// { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, -// { "r_drawweapon", "enable/disable weapon drawing", (void *)&ud.drawweapon, CVAR_INT, 0, 2 }, - { "r_showfps", "show the frame rate counter", (void *)&gShowFps, CVAR_INT, 0, 3 }, - { "r_showfpsperiod", "time in seconds before averaging min and max stats for r_showfps 2+", (void *)&gFramePeriod, CVAR_INT, 0, 5 }, -// { "r_shadows", "enable/disable sprite and model shadows", (void *)&ud.shadows, CVAR_BOOL, 0, 1 }, - { "r_size", "change size of viewable area", (void *)&gViewSize, CVAR_INT|CVAR_FUNCPTR, 0, 7 }, -// { "r_rotatespritenowidescreen", "pass bit 1024 to all CON rotatesprite calls", (void *)&g_rotatespriteNoWidescreen, CVAR_BOOL|CVAR_FUNCPTR, 0, 1 }, - { "r_upscalefactor", "increase performance by rendering at upscalefactor less than the screen resolution and upscale to the full resolution in the software renderer", (void *)&gUpscaleFactor, CVAR_INT|CVAR_FUNCPTR, 1, 16 }, - { "r_precache", "enable/disable the pre-level caching routine", (void *)&useprecache, CVAR_BOOL, 0, 1 }, -// - { "r_ambientlight", "sets the global map light level",(void *)&r_ambientlight, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "r_maxfps", "limit the frame rate",(void *)&r_maxfps, CVAR_INT|CVAR_FUNCPTR, 0, 1000 }, - { "r_maxfpsoffset", "menu-controlled offset for r_maxfps",(void *)&r_maxfpsoffset, CVAR_INT|CVAR_FUNCPTR, -10, 10 }, - - { "sensitivity","changes the mouse sensitivity", (void *)&CONTROL_MouseSensitivity, CVAR_FLOAT|CVAR_FUNCPTR, 0, 25 }, -// -// { "skill","changes the game skill setting", (void *)&ud.m_player_skill, CVAR_INT|CVAR_FUNCPTR|CVAR_NOSAVE/*|CVAR_NOMULTI*/, 0, 5 }, -// -// { "snd_ambience", "enables/disables ambient sounds", (void *)&ud.config.AmbienceToggle, CVAR_BOOL, 0, 1 }, - { "snd_enabled", "enables/disables sound effects", (void *)&SoundToggle, CVAR_BOOL, 0, 1 }, - { "snd_fxvolume", "controls volume for sound effects", (void *)&FXVolume, CVAR_INT, 0, 255 }, - { "snd_mixrate", "sound mixing rate", (void *)&MixRate, CVAR_INT, 0, 48000 }, - { "snd_numchannels", "the number of sound channels", (void *)&NumChannels, CVAR_INT, 0, 2 }, - { "snd_numvoices", "the number of concurrent sounds", (void *)&NumVoices, CVAR_INT, 1, 128 }, - { "snd_reversestereo", "reverses the stereo channels", (void *)&ReverseStereo, CVAR_BOOL, 0, 1 }, - { "snd_doppler", "enable/disable 3d sound", (void *)&gDoppler, CVAR_BOOL, 0, 1 }, -// { "snd_speech", "enables/disables player speech", (void *)&ud.config.VoiceToggle, CVAR_INT, 0, 5 }, -// -// { "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 }, -// -//#ifdef EDUKE32_TOUCH_DEVICES -// { "touch_sens_move_x","touch input sensitivity for moving forward/back", (void *)&droidinput.forward_sens, CVAR_FLOAT, 1, 9 }, -// { "touch_sens_move_y","touch input sensitivity for strafing", (void *)&droidinput.strafe_sens, CVAR_FLOAT, 1, 9 }, -// { "touch_sens_look_x", "touch input sensitivity for turning left/right", (void *) &droidinput.yaw_sens, CVAR_FLOAT, 1, 9 }, -// { "touch_sens_look_y", "touch input sensitivity for looking up/down", (void *) &droidinput.pitch_sens, CVAR_FLOAT, 1, 9 }, -// { "touch_invert", "invert look up/down touch input", (void *) &droidinput.invertLook, CVAR_INT, 0, 1 }, -//#endif -// - { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&g_videoGamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&g_videoContrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&g_videoBrightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, -// { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS }, - }; -// -// osdcmd_cheatsinfo_stat.cheatnum = -1; -// - for (auto & cv : cvars_game) - { - switch (cv.flags & (CVAR_FUNCPTR|CVAR_MULTI)) - { - case CVAR_FUNCPTR: - OSD_RegisterCvar(&cv, osdcmd_cvar_set_game); break; - case CVAR_MULTI: - case CVAR_FUNCPTR|CVAR_MULTI: - OSD_RegisterCvar(&cv, osdcmd_cvar_set_multi); break; - default: - OSD_RegisterCvar(&cv, osdcmd_cvar_set); break; - } - } // // if (VOLUMEONE) // OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index ccc48fe41..18b9271b1 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -245,6 +245,7 @@ struct GameInterface int32_t (*startwin_run)(void); const char* (*DefaultDefFile)(); const char* (*DefFile)(); + }; extern GameInterface* gi; diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index f2884194f..fac0a6f34 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -263,7 +263,6 @@ void CONFIG_SetDefaults(void) ud.camerasprite = -1; ud.color = 0; ud.config.AmbienceToggle = 1; - ud.config.AutoAim = 1; ud.config.CheckForUpdates = 1; ud.config.FXVolume = 255; ud.config.MouseBias = 0; diff --git a/source/duke3d/src/duke3d.h b/source/duke3d/src/duke3d.h index f0cfc9e7b..6a0ffd3cc 100644 --- a/source/duke3d/src/duke3d.h +++ b/source/duke3d/src/duke3d.h @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "keyboard.h" #include "pragmas.h" #include "polymost.h" +#include "gamecvars.h" #define HEAD2 APPNAME diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index f17786d98..71ba72989 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6143,7 +6143,7 @@ static void P_SetupMiscInputSettings(void) auto ps = g_player[myconnectindex].ps; ps->aim_mode = ud.mouseaiming; - ps->auto_aim = ud.config.AutoAim; + ps->auto_aim = cl_autoaim; ps->weaponswitch = ud.weaponswitch; } diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 1b565cd68..d628d106f 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -407,7 +407,7 @@ static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2, }; static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 ); -static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim ); +static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &cl_autoaim.Value ); static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option ); static MenuOption_t MEO_GAMESETUP_ALWAYS_RUN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.auto_run); diff --git a/source/duke3d/src/network.cpp b/source/duke3d/src/network.cpp index e08bdf303..802bcc376 100644 --- a/source/duke3d/src/network.cpp +++ b/source/duke3d/src/network.cpp @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "premap.h" #include "savegame.h" #include "input.h" +#include "gamecvars.h" #include "enet.h" #include "lz4.h" @@ -4807,7 +4808,7 @@ void Net_SendClientInfo(void) tempnetbuf[l++] = 0; tempnetbuf[l++] = g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; - tempnetbuf[l++] = g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + tempnetbuf[l++] = g_player[myconnectindex].ps->auto_aim = cl_autoaim; tempnetbuf[l++] = g_player[myconnectindex].ps->weaponswitch = ud.weaponswitch; tempnetbuf[l++] = g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; diff --git a/source/duke3d/src/savegame.cpp b/source/duke3d/src/savegame.cpp index 4b867e203..00bad1631 100644 --- a/source/duke3d/src/savegame.cpp +++ b/source/duke3d/src/savegame.cpp @@ -2207,7 +2207,7 @@ static void sv_restload() #undef CPDAT if (g_player[myconnectindex].ps) - g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + g_player[myconnectindex].ps->auto_aim = cl_autoaim; } #ifdef DEBUGGINGAIDS diff --git a/source/rr/src/config.cpp b/source/rr/src/config.cpp index 269dde6b3..397242904 100644 --- a/source/rr/src/config.cpp +++ b/source/rr/src/config.cpp @@ -213,7 +213,6 @@ void CONFIG_SetDefaults(void) #endif ud.config.useprecache = 1; ud.config.AmbienceToggle = 1; - ud.config.AutoAim = 1; ud.config.FXVolume = 255; #if defined(_WIN32) ud.config.MixRate = 44100; diff --git a/source/rr/src/duke3d.h b/source/rr/src/duke3d.h index 7d8cf5587..bd134866f 100644 --- a/source/rr/src/duke3d.h +++ b/source/rr/src/duke3d.h @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "pragmas.h" #include "polymost.h" +#include "gamecvars.h" BEGIN_RR_NS diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index c9a0871e8..3cbc58714 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7537,7 +7537,7 @@ static void P_SetupMiscInputSettings(void) DukePlayer_t *ps = g_player[myconnectindex].ps; ps->aim_mode = ud.mouseaiming; - ps->auto_aim = ud.config.AutoAim; + ps->auto_aim = cl_autoaim; ps->weaponswitch = ud.weaponswitch; } diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index 7fed9c27d..c260b3f7b 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -396,7 +396,7 @@ static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2, }; static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 ); -static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim ); +static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &cl_autoaim.Value ); static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option ); static char const *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", "By rating", }; diff --git a/source/rr/src/net.cpp b/source/rr/src/net.cpp index 3425dcf7d..8c5b50526 100644 --- a/source/rr/src/net.cpp +++ b/source/rr/src/net.cpp @@ -3468,7 +3468,7 @@ void Net_SendClientInfo(void) tempbuf[l++] = 0; tempbuf[l++] = g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; - tempbuf[l++] = g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + tempbuf[l++] = g_player[myconnectindex].ps->auto_aim = cl_autoaim; tempbuf[l++] = g_player[myconnectindex].ps->weaponswitch = ud.weaponswitch; tempbuf[l++] = g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; diff --git a/source/rr/src/savegame.cpp b/source/rr/src/savegame.cpp index 5665ea1f6..00b6c52d0 100644 --- a/source/rr/src/savegame.cpp +++ b/source/rr/src/savegame.cpp @@ -1763,7 +1763,7 @@ static void sv_restload() #undef CPDAT if (g_player[myconnectindex].ps) - g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + g_player[myconnectindex].ps->auto_aim = cl_autoaim; } #ifdef DEBUGGINGAIDS diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 28c6c684c..8f0b42108 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -1820,7 +1820,7 @@ void DrawCrosshair(PLAYERp pp) // wdx = 160; // wdy = 100; #if 0 - if (gs.AutoAim) + if (cl_autoaim) { int daz; short hit_sprite, daang; diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index b529b34cd..0762b2199 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -3050,7 +3050,7 @@ void InitPlayerGameSettings(void) } else { - if (gs.AutoAim) + if (cl_autoaim) SET(Player[myconnectindex].Flags, PF_AUTO_AIM); else RESET(Player[myconnectindex].Flags, PF_AUTO_AIM); @@ -5263,7 +5263,7 @@ getinput(SW_PACKET *loc) if (MenuButtonAutoRun) { MenuButtonAutoRun = FALSE; - if ((!!TEST(pp->Flags, PF_LOCK_RUN)) != gs.AutoRun) + if ((!!TEST(pp->Flags, PF_LOCK_RUN)) != !!gs.AutoRun) SET_LOC_KEY(loc->bits, SK_RUN_LOCK, TRUE); } @@ -5274,7 +5274,7 @@ getinput(SW_PACKET *loc) if (MenuButtonAutoAim) { MenuButtonAutoAim = FALSE; - if ((!!TEST(pp->Flags, PF_AUTO_AIM)) != gs.AutoAim) + if ((!!TEST(pp->Flags, PF_AUTO_AIM)) != !!cl_autoaim) SET_LOC_KEY(loc->bits, SK_AUTO_AIM, TRUE); } } diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 8ff2ccc49..ec0beee83 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -45,6 +45,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "sounds.h" #include "settings.h" #include "pragmas.h" +#include "gamecvars.h" BEGIN_SW_NS diff --git a/source/sw/src/menus.cpp b/source/sw/src/menus.cpp index 700a5b663..367686177 100644 --- a/source/sw/src/menus.cpp +++ b/source/sw/src/menus.cpp @@ -1976,7 +1976,7 @@ MNU_StartNetGame(void) // need to set gNet vars for self // everone else gets a packet to set them - gNet.AutoAim = gs.AutoAim; + gNet.AutoAim = cl_autoaim; gNet.SpawnMarkers = gs.NetSpawnMarkers; gNet.HurtTeammate = gs.NetHurtTeammate; gNet.Nuke = gs.NetNuke; @@ -2011,7 +2011,7 @@ MNU_StartNetGame(void) p.Level = Level; p.Skill = Skill; p.GameType = gs.NetGameType; - p.AutoAim = gs.AutoAim; + p.AutoAim = cl_autoaim; p.HurtTeammate = gs.NetHurtTeammate; p.TeamPlay = gs.NetTeamPlay; p.SpawnMarkers = gs.NetSpawnMarkers; @@ -2219,7 +2219,7 @@ MNU_InitMenus(void) } buttonsettings[btn_auto_run] = gs.AutoRun; - buttonsettings[btn_auto_aim] = gs.AutoAim; + buttonsettings[btn_auto_aim] = cl_autoaim; buttonsettings[btn_messages] = gs.Messages; buttonsettings[btn_crosshair] = gs.Crosshair; // buttonsettings[btn_bobbing] = gs.Bobbing; @@ -3397,9 +3397,9 @@ MNU_DoButton(MenuItem_p item, SWBOOL draw) gs.Crosshair = state = buttonsettings[item->button]; break; case btn_auto_aim: - last_value = gs.AutoAim; - gs.AutoAim = state = buttonsettings[item->button]; - if (gs.AutoAim != last_value) + last_value = cl_autoaim; + cl_autoaim = state = buttonsettings[item->button]; + if (cl_autoaim != last_value) MenuButtonAutoAim = TRUE; break; case btn_messages: diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index 6c1890bb2..02b43e40c 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -1532,7 +1532,7 @@ getpackets(void) //tempbuf[0] = PACKET_TYPE_DUMMY; //sendpacket(otherconnectindex, tempbuf, 1); - ////DSPRINTF(ds,"Level %d, Skill %d, AutoAim %d",Level, Skill, gs.AutoAim); + ////DSPRINTF(ds,"Level %d, Skill %d, AutoAim %d",Level, Skill, cl_autoaim); //MONO_PRINT(ds); break; diff --git a/source/sw/src/swconfig.cpp b/source/sw/src/swconfig.cpp index d840a4d21..cacd95149 100644 --- a/source/sw/src/swconfig.cpp +++ b/source/sw/src/swconfig.cpp @@ -158,7 +158,7 @@ void ReadGameSetup(int32_t scripthandle) dummy = -1; SCRIPT_GetNumber(scripthandle, "Options", "AutoAim",&dummy); - if (dummy != -1) gs.AutoAim = dummy; + if (dummy != -1) cl_autoaim = dummy; dummy = -1; SCRIPT_GetNumber(scripthandle, "Options", "Messages",&dummy); @@ -292,7 +292,7 @@ void WriteGameSetup(int32_t scripthandle) SCRIPT_PutNumber(scripthandle, "Options", "AutoRun",dummy,FALSE,FALSE); dummy = gs.Crosshair; SCRIPT_PutNumber(scripthandle, "Options", "Crosshair",dummy,FALSE,FALSE); - dummy = gs.AutoAim; + dummy = cl_autoaim; SCRIPT_PutNumber(scripthandle, "Options", "AutoAim",dummy,FALSE,FALSE); dummy = gs.Messages; SCRIPT_PutNumber(scripthandle, "Options", "Messages",dummy,FALSE,FALSE);