Skip to content

Commit cf9942a

Browse files
committed
refactor: remove scary and now pointless warnings when toggling fullscreen
1 parent 981c6c1 commit cf9942a

File tree

4 files changed

+30
-66
lines changed

4 files changed

+30
-66
lines changed

src/zc/zc_sys.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7667,9 +7667,23 @@ int32_t onExtLetterGridEntry()
76677667
static BITMAP* oldscreen;
76687668
int32_t onFullscreenMenu()
76697669
{
7670-
onFullscreen();
7670+
PALETTE oldpal;
7671+
get_palette(oldpal);
7672+
7673+
fullscreen = !fullscreen;
7674+
all_toggle_fullscreen(fullscreen);
7675+
zc_set_config("zeldadx","fullscreen",fullscreen);
7676+
7677+
zc_set_palette(oldpal);
7678+
gui_mouse_focus=0;
7679+
extern int32_t switch_type;
7680+
switch_type = pause_in_background ? SWITCH_PAUSE : SWITCH_BACKGROUND;
7681+
set_display_switch_mode(fullscreen?SWITCH_BACKAMNESIA:switch_type);
7682+
set_display_switch_callback(SWITCH_OUT, switch_out_callback);
7683+
set_display_switch_callback(SWITCH_IN, switch_in_callback);
76717684
misc_menu.select_uid(MENUID_MISC_FULLSCREEN, isFullScreen());
76727685
misc_menu.select_uid(MENUID_MISC_VIDMODE, isFullScreen());
7686+
76737687
return D_O_K;
76747688
}
76757689

src/zc/zelda.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3995,40 +3995,6 @@ int32_t isFullScreen()
39953995
return !is_windowed_mode();
39963996
}
39973997

3998-
int32_t onFullscreen()
3999-
{
4000-
if(jwin_alert3(
4001-
(is_windowed_mode()) ? "Fullscreen Warning" : "Change to Windowed Mode",
4002-
(is_windowed_mode()) ? "Some video chipsets/drivers do not support 8-bit native fullscreen" : "Proceeding will drop from Fullscreen to Windowed Mode",
4003-
(is_windowed_mode()) ? "We strongly advise saving your game before shifting from windowed to fullscreen!": "Do you wish to shift from Fullscreen to Windowed mode?",
4004-
(is_windowed_mode()) ? "Do you wish to continue to fullscreen mode?" : NULL,
4005-
"&Yes",
4006-
"&No",
4007-
NULL,
4008-
'y',
4009-
'n',
4010-
0,
4011-
get_zc_font(font_lfont)) == 1)
4012-
{
4013-
PALETTE oldpal;
4014-
get_palette(oldpal);
4015-
4016-
fullscreen = !fullscreen;
4017-
all_toggle_fullscreen(fullscreen);
4018-
zc_set_config("zeldadx","fullscreen",fullscreen);
4019-
4020-
zc_set_palette(oldpal);
4021-
gui_mouse_focus=0;
4022-
switch_type = pause_in_background ? SWITCH_PAUSE : SWITCH_BACKGROUND;
4023-
set_display_switch_mode(fullscreen?SWITCH_BACKAMNESIA:switch_type);
4024-
set_display_switch_callback(SWITCH_OUT, switch_out_callback);
4025-
set_display_switch_callback(SWITCH_IN, switch_in_callback);
4026-
4027-
return D_REDRAW;
4028-
}
4029-
else return D_O_K;
4030-
}
4031-
40323998
static bool current_session_is_replay = false;
40333999
static void load_replay_file(ReplayMode mode, std::string replay_file, int frame)
40344000
{

src/zc/zelda.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct itemdata;
2828
struct MsgStr;
2929

3030
int32_t isFullScreen();
31-
int32_t onFullscreen();
3231
extern bool zqtesting_mode;
3332
extern bool use_testingst_start;
3433

src/zq/zquest.cpp

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,36 +1573,21 @@ int32_t onResetTransparency()
15731573

15741574
int32_t onFullScreen()
15751575
{
1576-
if(jwin_alert3(
1577-
(is_windowed_mode()) ? "Fullscreen Warning" : "Change to Windowed Mode",
1578-
(is_windowed_mode()) ? "Some video chipsets/drivers do not support 8-bit native fullscreen" : "Proceeding will drop from Fullscreen to Windowed Mode",
1579-
(is_windowed_mode()) ? "We strongly advise saving your quest before shifting from windowed to fullscreen!": "Do you wish to shift from Fullscreen to Windowed mode?",
1580-
(is_windowed_mode()) ? "Do you wish to continue to fullscreen mode?" : NULL,
1581-
"&Yes",
1582-
"&No",
1583-
NULL,
1584-
'y',
1585-
'n',
1586-
0,
1587-
get_zc_font(font_lfont)) == 1)
1588-
{
1589-
get_palette(RAMpal);
1590-
bool windowed=is_windowed_mode()!=0;
1591-
all_toggle_fullscreen(windowed);
1592-
1593-
gui_mouse_focus=0;
1594-
gui_bg_color=jwin_pal[jcBOX];
1595-
gui_fg_color=jwin_pal[jcBOXFG];
1596-
MouseSprite::set(ZQM_NORMAL);
1597-
zc_set_palette(RAMpal);
1598-
position_mouse(zq_screen_w/2,zq_screen_h/2);
1599-
set_display_switch_mode(SWITCH_BACKGROUND);
1600-
set_display_switch_callback(SWITCH_OUT, switch_out);
1601-
set_display_switch_callback(SWITCH_IN, switch_in);
1602-
zc_set_config("zquest","fullscreen", is_windowed_mode() ? 0 : 1);
1603-
return D_REDRAW;
1604-
}
1605-
else return D_O_K;
1576+
get_palette(RAMpal);
1577+
bool windowed=is_windowed_mode()!=0;
1578+
all_toggle_fullscreen(windowed);
1579+
1580+
gui_mouse_focus=0;
1581+
gui_bg_color=jwin_pal[jcBOX];
1582+
gui_fg_color=jwin_pal[jcBOXFG];
1583+
MouseSprite::set(ZQM_NORMAL);
1584+
zc_set_palette(RAMpal);
1585+
position_mouse(zq_screen_w/2,zq_screen_h/2);
1586+
set_display_switch_mode(SWITCH_BACKGROUND);
1587+
set_display_switch_callback(SWITCH_OUT, switch_out);
1588+
set_display_switch_callback(SWITCH_IN, switch_in);
1589+
zc_set_config("zquest","fullscreen", is_windowed_mode() ? 0 : 1);
1590+
return D_REDRAW;
16061591
}
16071592

16081593
int32_t onEnter()

0 commit comments

Comments
 (0)