Skip to content

Commit

Permalink
refactor: remove unused 'VSync' option (it didn't do anything)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 authored and connorjclark committed Nov 13, 2023
1 parent 0aef538 commit 74bbc05
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 20 deletions.
6 changes: 0 additions & 6 deletions src/dialog/options.cpp
Expand Up @@ -28,7 +28,6 @@ void OptionsDialog::loadOptions()
opts[OPT_MOUSESCROLL] = MouseScroll ? 1 : 0;
opts[OPT_SAVEPATHS] = SavePaths ? 1 : 0;
opts[OPT_PALCYCLE] = CycleOn ? 1 : 0;
opts[OPT_VSYNC] = Vsync ? 1 : 0;
opts[OPT_FPS] = ShowFPS ? 1 : 0;
opts[OPT_SAVEDRAGRESIZE] = SaveDragResize ? 1 : 0;
opts[OPT_SAVEWINPOS] = SaveWinPos ? 1 : 0;
Expand Down Expand Up @@ -302,10 +301,6 @@ void OptionsDialog::saveOption(int ind)
CycleOn = v;
zc_set_config("zquest","cycle_on",v);
break;
case OPT_VSYNC:
Vsync = v;
zc_set_config("zquest","vsync",v);
break;
case OPT_FPS:
ShowFPS = v;
zc_set_config("zquest","showfps",v);
Expand Down Expand Up @@ -927,7 +922,6 @@ std::shared_ptr<GUI::Widget> OptionsDialog::view()
Rows<3>(vAlign = 0.0,
ROW_CHECK(OPT_SAVEPATHS, "Save Paths"),
ROW_CHECK(OPT_PALCYCLE, "Palette Cycle"),
ROW_CHECK(OPT_VSYNC, "VSync"),
ROW_CHECK(OPT_FPS, "Show FPS"),
ROW_CHECK(OPT_RELOAD_QUEST, "Reload Last Quest"),
ROW_CHECK(OPT_ANIM_COMBOS, "Animate Combos"),
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/options.h
Expand Up @@ -22,7 +22,7 @@ class OptionsDialog: public GUI::Dialog<OptionsDialog>
private:
enum optionVal
{
OPT_MOUSESCROLL, OPT_SAVEPATHS, OPT_PALCYCLE, OPT_VSYNC, OPT_FPS, OPT_COMB_BRUSH,
OPT_MOUSESCROLL, OPT_SAVEPATHS, OPT_PALCYCLE, OPT_FPS, OPT_COMB_BRUSH,
OPT_FLOAT_BRUSH, OPT_RELOAD_QUEST, OPT_MISALIGNS, OPT_ANIM_COMBOS, OPT_OW_PROT,
OPT_TILE_PROT, OPT_STATIC_INVAL, OPT_RULESET, OPT_TOOLTIPS,
OPT_TOOLTIP_HIGHLIGHT, OPT_PATTERNSEARCH, OPT_NEXTPREVIEW, OPT_INITSCR_WARN,
Expand Down
1 change: 0 additions & 1 deletion src/launcher/launcher_dialog.cpp
Expand Up @@ -581,7 +581,6 @@ std::shared_ptr<GUI::Widget> LauncherDialog::view()
TabRef(name = "ZC Editor", Row(framed = true,
Rows<2>(fitParent = true,
CONFIG_CHECKBOX_I("Fullscreen",App::zquest,"zquest","fullscreen",0,"Exactly stable."),
CONFIG_CHECKBOX("VSync",App::zquest,"zquest","vsync",1),
CONFIG_CHECKBOX("Show FPS",App::zquest,"zquest","showfps",0),
CONFIG_CHECKBOX("Disable Sound",App::zquest,"zquest","nosound",0),
CONFIG_CHECKBOX("Animate Combos",App::zquest,"zquest","animation_on",1),
Expand Down
12 changes: 3 additions & 9 deletions src/zc/zc_sys.cpp
Expand Up @@ -4409,12 +4409,6 @@ void syskeys()
}
}

// if(zc_readkey(KEY_F1)) Vsync=!Vsync;
/*
if(zc_readkey(KEY_F1)) set_bit(QHeader.rules4,qr4_NEWENEMYTILES,
1-((get_bit(QHeader.rules4,qr4_NEWENEMYTILES))));
*/

if(zc_read_system_key(KEY_F2))
{
ShowFPS=!ShowFPS;
Expand Down Expand Up @@ -5116,7 +5110,7 @@ int32_t onEsc() // Unused?? -L
return zc_getrawkey(KEY_ESC, true)?D_CLOSE:D_O_K;
}

int32_t onVsync()
int32_t onThrottleFPS()
{
Throttlefps = !Throttlefps;
zc_set_config(cfg_sect,"throttlefps", (int32_t)Throttlefps);
Expand Down Expand Up @@ -7435,7 +7429,7 @@ static MENU settings_menu[] =
{ "Options", NULL, options_menu, 0, NULL },
{ "", NULL, NULL, 0, NULL },
//
{ "&Cap FPS\tF1", onVsync, NULL, 0, NULL },
{ "&Cap FPS\tF1", onThrottleFPS, NULL, 0, NULL },
{ "Show &FPS\tF2", onShowFPS, NULL, 0, NULL },
{ "Click to Freeze", onClickToFreeze, NULL, 0, NULL },
{ "Cont. &Heart Beep", onHeartBeep, NULL, 0, NULL },
Expand Down Expand Up @@ -7673,7 +7667,7 @@ static DIALOG system_dlg[] =
{
/* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) */
{ jwin_menu_proc, 0, 0, 0, 0, 0, 0, 0, D_USER, 0, 0, (void *) the_player_menu, NULL, NULL },
{ d_keyboard_proc, 0, 0, 0, 0, 0, 0, 0, 0, KEY_F1, 0, (void *) onVsync, NULL, NULL },
{ d_keyboard_proc, 0, 0, 0, 0, 0, 0, 0, 0, KEY_F1, 0, (void *) onThrottleFPS, NULL, NULL },
{ d_keyboard_proc, 0, 0, 0, 0, 0, 0, 0, 0, KEY_F2, 0, (void *) onShowFPS, NULL, NULL },
{ d_keyboard_proc, 0, 0, 0, 0, 0, 0, 0, 0, KEY_F6, 0, (void *) onTryQuitMenu, NULL, NULL },
#ifndef ALLEGRO_MACOSX
Expand Down
3 changes: 1 addition & 2 deletions src/zq/zquest.cpp
Expand Up @@ -579,7 +579,7 @@ bool NoHighlightLayer0 = false;
int32_t FlashWarpSquare = -1, FlashWarpClk = 0; // flash the destination warp return when ShowSquares is active
uint8_t ViewLayer3BG = 0, ViewLayer2BG = 0;
int32_t window_width, window_height;
bool Vsync = false, ShowFPS = false, SaveDragResize = false, DragAspect = false, SaveWinPos=false;
bool ShowFPS = false, SaveDragResize = false, DragAspect = false, SaveWinPos=false;
bool allowHideMouse = false;
double aspect_ratio = LARGE_H / double(LARGE_W);
int window_min_width = 0, window_min_height = 0;
Expand Down Expand Up @@ -27803,7 +27803,6 @@ int32_t main(int32_t argc,char **argv)
SnapshotScale = zc_get_config("zquest","snapshot_scale",2);
SavePaths = zc_get_config("zquest","save_paths",1);
CycleOn = zc_get_config("zquest","cycle_on",1);
Vsync = zc_get_config("zquest","vsync",1)!=0;
ShowFPS = zc_get_config("zquest","showfps",0)!=0;
SaveDragResize = zc_get_config("zquest","save_drag_resize",0)!=0;
DragAspect = zc_get_config("zquest","drag_aspect",0)!=0;
Expand Down
2 changes: 1 addition & 1 deletion src/zq/zquest.h
Expand Up @@ -156,7 +156,7 @@ extern int32_t Flags,Flag,menutype;
extern int32_t MouseScroll, SavePaths, CycleOn, NoScreenPreview,WarnOnInitChanged,DisableLPalShortcuts,DisableCompileConsole,skipLayerWarning,numericalFlags;
extern uint8_t InvalidBG;
extern int32_t Frameskip, RequestedFPS, zqColorDepth, zqUseWin32Proc;
extern bool Vsync, ShowFPS, SaveDragResize, DragAspect, SaveWinPos;
extern bool ShowFPS, SaveDragResize, DragAspect, SaveWinPos;
extern double aspect_ratio;
extern int window_min_width, window_min_height;
extern int32_t ComboBrush; //show the brush instead of the normal mouse
Expand Down

0 comments on commit 74bbc05

Please sign in to comment.