void CreateLevelEditorGadgets()
{
- int old_game_status = game_status;
-
- /* setting 'game_status' is needed to get the right fonts for the editor */
- SetGameStatus(GAME_MODE_EDITOR);
+ /* force EDITOR font inside level editor */
+ SetFontStatus(GAME_MODE_EDITOR);
/* these values are not constant, but can change at runtime */
ed_fieldx = MAX_ED_FIELDX - 1;
CreateTextbuttonGadgets();
CreateDrawingAreas();
- SetGameStatus(old_game_status);
+ ResetFontStatus();
}
void FreeLevelEditorGadgets()
static void drawChooseTreeCursor(int ypos, boolean active)
{
- int last_game_status = game_status; /* save current game status */
-
drawCursorExt(0, ypos, active, -1);
-
- SetGameStatus(last_game_status); /* restore current game status */
}
void DrawHeadline()
{
char *filename = getLevelSetTitleMessageFilename(nr, initial);
struct TitleMessageInfo *tmi = getTitleMessageInfo(nr, initial);
- int last_game_status = game_status; /* save current game status */
if (filename == NULL)
return;
/* force TITLE font on title message screen */
- SetGameStatus(getTitleMessageGameMode(initial));
+ SetFontStatus(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);
- SetGameStatus(last_game_status); /* restore current game status */
+ ResetFontStatus();
}
void DrawTitleScreen()
DrawInfoScreen_NotAvailable("Title screen information:",
"No title screen for this level set.");
-
return;
}
int yoffset_setup = 16;
int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ||
ti->type == TREE_TYPE_LEVEL_NR ? yoffset_sets : yoffset_setup);
- int last_game_status = game_status; /* save current game status */
title_string = ti->infotext;
initCursor(i, IMG_MENU_BUTTON);
}
- SetGameStatus(last_game_status); /* restore current game status */
-
redraw_mask |= REDRAW_FIELD;
}
int step = (button == 1 ? 1 : button == 2 ? 5 : 10);
int num_entries = numTreeInfoInGroup(ti);
int num_page_entries;
- int last_game_status = game_status; /* save current game status */
boolean position_set_by_scrollbar = (dx == 999);
if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN)
else
num_page_entries = NUM_MENU_ENTRIES_ON_SCREEN;
- SetGameStatus(last_game_status); /* restore current game status */
-
if (button == MB_MENU_INITIALIZE)
{
int num_entries = numTreeInfoInGroup(ti);
if (mx || my) /* mouse input */
{
- int last_game_status = game_status; /* save current game status */
-
x = (mx - mSX) / 32;
y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS;
-
- SetGameStatus(last_game_status); /* restore current game status */
}
else if (dx || dy) /* keyboard or scrollbar/scrollbutton input */
{
void CreateScreenGadgets()
{
- int last_game_status = game_status; /* save current game status */
-
CreateScreenMenubuttons();
CreateScreenScrollbuttons();
CreateScreenScrollbars();
-
- SetGameStatus(last_game_status); /* restore current game status */
}
void FreeScreenGadgets()
void DrawEnvelopeRequest(char *text)
{
- int last_game_status = game_status; /* save current game status */
char *text_final = text;
char *text_door_style = NULL;
int graphic = IMG_BACKGROUND_REQUEST;
tile_size, tile_size);
/* force DOOR font inside door area */
- SetGameStatus(GAME_MODE_PSEUDO_DOOR);
+ SetFontStatus(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);
- SetGameStatus(last_game_status); /* restore current game status */
+ ResetFontStatus();
for (i = 0; i < NUM_TOOL_BUTTONS; i++)
RedrawGadget(tool_gadget[i]);
boolean show_level_border = (BorderElement != EL_EMPTY);
int level_xsize = lev_fieldx + (show_level_border ? 2 : 0);
int level_ysize = lev_fieldy + (show_level_border ? 2 : 0);
- int last_game_status = game_status; /* save current game status */
if (restart)
{
DrawTextSAligned(pos->x, pos->y, label_text, font_nr, pos->align);
}
- SetGameStatus(last_game_status); /* restore current game status */
-
return;
}
DrawPreviewLevelLabelExt(label_state);
}
-
- SetGameStatus(last_game_status); /* restore current game status */
}
void DrawPreviewLevelInitial()
static boolean RequestDoor(char *text, unsigned int req_state)
{
unsigned int old_door_state;
- int last_game_status = game_status; /* save current game status */
int max_request_line_len = MAX_REQUEST_LINE_FONT1_LEN;
int font_nr = FONT_TEXT_2;
char *text_ptr;
DrawBackground(DX, DY, DXSIZE, DYSIZE);
/* force DOOR font inside door area */
- SetGameStatus(GAME_MODE_PSEUDO_DOOR);
+ SetFontStatus(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);
}
- SetGameStatus(last_game_status); /* restore current game status */
+ ResetFontStatus();
if (req_state & REQ_ASK)
{
*height = MAX(*height, height2);
}
+void SetAnimStatus(int anim_status_new)
+{
+ global.anim_status_next = anim_status_new;
+}
+
void SetGameStatus(int game_status_new)
{
game_status = game_status_new;
- global.anim_status_next = game_status;
+ SetAnimStatus(game_status_new);
+}
+
+void SetFontStatus(int game_status_new)
+{
+ static int last_game_status = -1;
+
+ if (game_status_new != -1)
+ {
+ // set game status for font use after storing last game status
+ last_game_status = game_status;
+ game_status = game_status_new;
+ }
+ else
+ {
+ // reset game status after font use from last stored game status
+ game_status = last_game_status;
+ }
+}
+
+void ResetFontStatus()
+{
+ SetFontStatus(-1);
}
void ChangeViewportPropertiesIfNeeded()
void PlaySoundActivating();
void PlaySoundSelecting();
+void SetAnimStatus(int);
void SetGameStatus(int);
+void SetFontStatus(int);
+void ResetFontStatus();
void ToggleFullscreenOrChangeWindowScalingIfNeeded();
void ChangeViewportPropertiesIfNeeded();