redraw_mask |= REDRAW_FIELD;
}
-void DrawFramesPerSecond(void)
+static void DrawFramesPerSecond(void)
{
char text[100];
int font_nr = FONT_TEXT_2;
FadeExt(0, FADE_MODE_SKIP_FADE_OUT, FADE_TYPE_SKIP);
}
-Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic)
+static Bitmap *getBitmapFromGraphicOrDefault(int graphic, int default_graphic)
{
boolean redefined = getImageListEntryFromImageID(graphic)->redefined;
graphic_info[default_graphic].bitmap);
}
-Bitmap *getBackgroundBitmap(int graphic)
+static Bitmap *getBackgroundBitmap(int graphic)
{
return getBitmapFromGraphicOrDefault(graphic, IMG_BACKGROUND);
}
-Bitmap *getGlobalBorderBitmap(int graphic)
+static Bitmap *getGlobalBorderBitmap(int graphic)
{
return getBitmapFromGraphicOrDefault(graphic, IMG_GLOBAL_BORDER);
}
return (global_border_bitmap_last != global_border_bitmap);
}
-boolean CheckIfGlobalBorderRedrawIsNeeded(void)
+#define ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED 0
+
+#if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED
+static boolean CheckIfGlobalBorderRedrawIsNeeded(void)
{
// if game status has not changed, nothing has to be redrawn
if (game_status == game_status_last)
return FALSE;
}
+#endif
-void RedrawGlobalBorderFromBitmap(Bitmap *bitmap)
+static void RedrawGlobalBorderFromBitmap(Bitmap *bitmap)
{
if (bitmap)
BlitBitmap(bitmap, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
redraw_mask = REDRAW_ALL;
}
-#define ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED 0
-
static void RedrawGlobalBorderIfNeeded(void)
{
#if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED
DrawGraphicShiftedNormal(x, y, dx, dy, graphic, frame, cut_mode,mask_mode);
}
-void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, int graphic,
- int frame, int cut_mode)
+static void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy,
+ int graphic, int frame, int cut_mode)
{
DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, USE_MASKING);
}
element, tilesize, el2edimg, masked, element_bits_draw);
}
-void DrawSizedWall_MM(int dst_x, int dst_y, int element, int tilesize,
- int (*el2img_function)(int))
+static void DrawSizedWall_MM(int dst_x, int dst_y, int element, int tilesize,
+ int (*el2img_function)(int))
{
DrawSizedWallExt_MM(dst_x, dst_y, element, tilesize, el2img_function, FALSE,
0x000f);
}
-void DrawSizedElementExt(int x, int y, int element, int tilesize,
- boolean masked)
+static void DrawSizedElementExt(int x, int y, int element, int tilesize,
+ boolean masked)
{
if (IS_MM_WALL(element))
{
DrawMiniGraphic(sx, sy, el2edimg(getBorderElement(x, y)));
}
-void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty,
- int x, int y, int xsize, int ysize,
- int tile_width, int tile_height)
+static void DrawEnvelopeBackgroundTiles(int graphic, int startx, int starty,
+ int x, int y, int xsize, int ysize,
+ int tile_width, int tile_height)
{
Bitmap *src_bitmap;
int src_x, src_y;
dst_x, dst_y);
}
-void DrawEnvelopeBackground(int graphic, int startx, int starty,
- int x, int y, int xsize, int ysize, int font_nr)
+static void DrawEnvelopeBackground(int graphic, int startx, int starty,
+ int x, int y, int xsize, int ysize,
+ int font_nr)
{
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
font_width, font_height);
}
-void AnimateEnvelope(int envelope_nr, int anim_mode, int action)
+static void AnimateEnvelope(int envelope_nr, int anim_mode, int action)
{
int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr;
Bitmap *src_bitmap = graphic_info[graphic].bitmap;
setRequestPositionExt(x, y, request.width, request.height, add_border_size);
}
-void DrawEnvelopeRequest(char *text)
+static void DrawEnvelopeRequest(char *text)
{
char *text_final = text;
char *text_door_style = NULL;
free(text_door_style);
}
-void AnimateEnvelopeRequest(int anim_mode, int action)
+static void AnimateEnvelopeRequest(int anim_mode, int action)
{
int graphic = IMG_BACKGROUND_REQUEST;
boolean draw_masked = graphic_info[graphic].draw_masked;
ClearAutoRepeatKeyEvents();
}
-void ShowEnvelopeRequest(char *text, unsigned int req_state, int action)
+static void ShowEnvelopeRequest(char *text, unsigned int req_state, int action)
{
int graphic = IMG_BACKGROUND_REQUEST;
int sound_opening = SND_REQUEST_OPENING;
SetDrawtoField(DRAW_TO_FIELDBUFFER);
}
-void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize)
+static void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize)
{
if (IS_MM_WALL(element))
{
}
}
-void DrawPreviewPlayers(void)
+static void DrawPreviewPlayers(void)
{
if (game_status != GAME_MODE_MAIN)
return;
DrawText(x + xoffset_text, y + yoffset_text, player_name, font_nr);
}
-void DrawNetworkPlayersExt(boolean force)
+static void DrawNetworkPlayersExt(boolean force)
{
if (game_status != GAME_MODE_MAIN)
return;
{
switch (event.type)
{
- case EVENT_BUTTONPRESS:
+ case EVENT_BUTTONRELEASE:
case EVENT_KEYPRESS:
#if defined(TARGET_SDL2)
case SDL_CONTROLLERBUTTONDOWN:
static int RequestHandleEvents(unsigned int req_state)
{
- boolean level_solved = (game_status == GAME_MODE_PLAYING &&
- local_player->LevelSolved_GameEnd);
+ boolean game_just_ended = (game_status == GAME_MODE_PLAYING &&
+ checkGameEnded());
int width = request.width;
int height = request.height;
int sx, sy;
int result;
+ /* when showing request dialog after game ended, deactivate game panel */
+ if (game_just_ended)
+ game.panel.active = FALSE;
+
+ game.request_active = TRUE;
+
setRequestPosition(&sx, &sy, FALSE);
button_status = MB_RELEASED;
while (result < 0)
{
- if (level_solved)
+ if (game_just_ended)
{
/* the MM game engine does not use a special (scrollable) field buffer */
if (level.game_engine_type != GAME_ENGINE_TYPE_MM)
}
}
- if (level_solved)
+ if (game_just_ended)
{
if (global.use_envelope_request)
{
BackToFront();
}
+ game.request_active = FALSE;
+
return result;
}
int result;
int ty;
- if (maxWordLengthInString(text) > MAX_REQUEST_LINE_FONT1_LEN)
+ if (maxWordLengthInRequestString(text) > MAX_REQUEST_LINE_FONT1_LEN)
{
max_request_line_len = MAX_REQUEST_LINE_FONT2_LEN;
font_nr = FONT_TEXT_1;
return MoveDoor(door_state | DOOR_SET_STATE);
}
-int euclid(int a, int b)
+static int euclid(int a, int b)
{
return (b ? euclid(b, a % b) : a);
}
}
}
+#if 0
void ResetGfxAnimation_EM(int x, int y, int tile)
{
GfxFrame[x][y] = 0;
}
+#endif
void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em,
int tile, int frame_em, int x, int y)
#endif
}
-void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame,
- boolean any_player_moving,
- boolean any_player_snapping,
- boolean any_player_dropping)
+static void CheckSaveEngineSnapshot_EM(byte action[MAX_PLAYERS], int frame,
+ boolean any_player_moving,
+ boolean any_player_snapping,
+ boolean any_player_dropping)
{
if (frame == 0 && !any_player_dropping)
{
}
}
-void CheckSaveEngineSnapshot_SP(boolean murphy_is_waiting,
- boolean murphy_is_dropping)
+static void CheckSaveEngineSnapshot_SP(boolean murphy_is_waiting,
+ boolean murphy_is_dropping)
{
if (murphy_is_waiting)
{
}
}
-void CheckSaveEngineSnapshot_MM(boolean element_clicked,
- boolean button_released)
+static void CheckSaveEngineSnapshot_MM(boolean element_clicked,
+ boolean button_released)
{
if (button_released)
{
}
}
-void JoinRectangles(int *x, int *y, int *width, int *height,
- int x2, int y2, int width2, int height2)
+static void JoinRectangles(int *x, int *y, int *width, int *height,
+ int x2, int y2, int width2, int height2)
{
// do not join with "off-screen" rectangle
if (x2 == -1 || y2 == -1)