/* redraw game control buttons */
RedrawGameButtons();
- game_status = GAME_MODE_PSEUDO_PANEL;
+ SetGameStatus(GAME_MODE_PSEUDO_PANEL);
for (i = 0; i < NUM_GAME_PANEL_CONTROLS; i++)
{
redraw_mask |= REDRAW_DOOR_1;
}
- game_status = GAME_MODE_PLAYING;
+ SetGameStatus(GAME_MODE_PLAYING);
}
void UpdateAndDisplayGameControlValues()
// required here to update video display before fading (FIX THIS)
DrawMaskedBorder(REDRAW_DOOR_2);
- game_status = GAME_MODE_PLAYING;
+ SetGameStatus(GAME_MODE_PLAYING);
if (!game.restart_level)
CloseDoor(DOOR_CLOSE_1);
if (level_editor_test_game)
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
if (!local_player->LevelSolved_SaveScore)
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
if ((hi_pos = NewHiScore()) >= 0)
{
- game_status = GAME_MODE_SCORES;
+ SetGameStatus(GAME_MODE_SCORES);
DrawHallOfFame(hi_pos);
}
else
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
if (raise_level)
{
if (quick_quit)
FadeSkipNextFadeIn();
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
drawCursorExt(0, ypos, active, -1);
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
void DrawHeadline()
return;
/* force TITLE font on title message screen */
- game_status = getTitleMessageGameMode(initial);
+ SetGameStatus(getTitleMessageGameMode(initial));
/* if chars *and* width set to "-1", automatically determine width */
if (tmi->chars == -1 && tmi->width == -1)
filename, tmi->font, tmi->chars, -1, tmi->lines, 0, -1,
tmi->autowrap, tmi->centered, tmi->parse_comments);
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
void DrawTitleScreen()
/* needed if last screen was the playing screen, invoked from level editor */
if (level_editor_test_game)
{
- game_status = GAME_MODE_EDITOR;
+ SetGameStatus(GAME_MODE_EDITOR);
+
DrawLevelEd();
return;
if (CheckTitleScreen(levelset_has_changed))
{
game_status_last_screen = GAME_MODE_MAIN;
- game_status = GAME_MODE_TITLE;
+
+ SetGameStatus(GAME_MODE_TITLE);
DrawTitleScreen();
if (num_title_screens == 0)
{
/* switch game mode from title screen mode back to info screen mode */
- game_status = GAME_MODE_INFO;
+ SetGameStatus(GAME_MODE_INFO);
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
{
if (game_status_last_screen == GAME_MODE_INFO && num_title_screens == 0)
{
- game_status = GAME_MODE_INFO;
+ SetGameStatus(GAME_MODE_INFO);
+
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
if (game_status_last_screen == GAME_MODE_INFO)
{
- game_status = GAME_MODE_INFO;
+ SetGameStatus(GAME_MODE_INFO);
+
info_mode = INFO_MODE_MAIN;
DrawInfoScreen();
}
else /* default: return to main menu */
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_LEVELNR;
+ SetGameStatus(GAME_MODE_LEVELNR);
ChangeViewportPropertiesIfNeeded();
if (pos == MAIN_CONTROL_NAME)
{
- game_status = GAME_MODE_PSEUDO_TYPENAME;
+ SetGameStatus(GAME_MODE_PSEUDO_TYPENAME);
HandleTypeName(strlen(setup.player_name), 0);
}
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_LEVELS;
+ SetGameStatus(GAME_MODE_LEVELS);
SaveLevelSetup_LastSeries();
SaveLevelSetup_SeriesInfo();
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_SCORES;
+ SetGameStatus(GAME_MODE_SCORES);
DrawHallOfFame(-1);
}
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_EDITOR;
+ SetGameStatus(GAME_MODE_EDITOR);
FadeSetEnterScreen();
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_INFO;
+ SetGameStatus(GAME_MODE_INFO);
+
info_mode = INFO_MODE_MAIN;
ChangeViewportPropertiesIfNeeded();
CloseDoor(DOOR_CLOSE_2);
- game_status = GAME_MODE_SETUP;
+ SetGameStatus(GAME_MODE_SETUP);
+
setup_mode = SETUP_MODE_MAIN;
ChangeViewportPropertiesIfNeeded();
SaveLevelSetup_SeriesInfo();
if (Request("Do you really want to quit?", REQ_ASK | REQ_STAY_CLOSED))
- game_status = GAME_MODE_QUIT;
+ SetGameStatus(GAME_MODE_QUIT);
}
}
}
static void execExitInfo()
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
void DrawInfoScreen_TitleScreen()
{
game_status_last_screen = GAME_MODE_INFO;
- game_status = GAME_MODE_TITLE;
+
+ SetGameStatus(GAME_MODE_TITLE);
DrawTitleScreen();
}
is_active = FALSE;
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
}
else if (key == KSYM_Escape)
{
is_active = FALSE;
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
}
if (is_active)
if (strEqual((*ti_ptr)->subdir, STRING_TOP_DIRECTORY))
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
initCursor(i, IMG_MENU_BUTTON);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
redraw_mask |= REDRAW_FIELD;
}
else
num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
if (button == MB_MENU_INITIALIZE)
{
HandleMainMenu_SelectLevel(0, 0, new_level_nr);
}
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
x = (mx - mSX) / 32;
y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
HandleMainMenu_SelectLevel(0, 0, new_level_nr);
}
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
FadeSound(SND_BACKGROUND_SCORES);
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
FadeSound(SND_BACKGROUND_SCORES);
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
static void execExitSetup()
{
- game_status = GAME_MODE_MAIN;
+ SetGameStatus(GAME_MODE_MAIN);
DrawMainMenu();
}
CreateScreenScrollbuttons();
CreateScreenScrollbars();
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
void FreeScreenGadgets()
tile_size, tile_size);
/* force DOOR font inside door area */
- game_status = GAME_MODE_PSEUDO_DOOR;
+ SetGameStatus(GAME_MODE_PSEUDO_DOOR);
DrawTextBuffer(sx + sx_offset, sy + sy_offset, text_final, font_nr,
line_length, -1, max_lines, line_spacing, mask_mode,
request.autowrap, request.centered, FALSE);
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
RedrawGadget(tool_gadget[i]);
DrawTextSAligned(pos->x, pos->y, label_text, font_nr, pos->align);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
return;
}
DrawPreviewLevelLabelExt(label_state);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
}
void DrawPreviewLevelInitial()
DrawBackground(DX, DY, DXSIZE, DYSIZE);
/* force DOOR font inside door area */
- game_status = GAME_MODE_PSEUDO_DOOR;
+ SetGameStatus(GAME_MODE_PSEUDO_DOOR);
/* write text for request */
for (text_ptr = text, ty = 0; ty < MAX_REQUEST_LINES; ty++)
// text_ptr += tl + (tc == ' ' || tc == '?' || tc == '!' ? 1 : 0);
}
- game_status = last_game_status; /* restore current game status */
+ SetGameStatus(last_game_status); /* restore current game status */
if (req_state & REQ_ASK)
{
*height = MAX(*height, height2);
}
+void SetGameStatus(int game_status_new)
+{
+ game_status = game_status_new;
+}
+
void ChangeViewportPropertiesIfNeeded()
{
int gfx_game_mode = game_status;