#include "editor.h"
#include "files.h"
#include "tape.h"
-#include "cartoons.h"
+#include "anim.h"
#include "network.h"
#include "init.h"
#include "config.h"
{
{ STR_SPECIAL_RENDERING_OFF, "Off (May show artifacts, fast)" },
{ STR_SPECIAL_RENDERING_BITMAP, "Bitmap/Texture mode (slower)" },
+#if DEBUG
+ // this mode may work under certain conditions, but does not work on Windows
{ STR_SPECIAL_RENDERING_TARGET, "Target Texture mode (slower)" },
+#endif
{ STR_SPECIAL_RENDERING_DOUBLE, "Double Texture mode (slower)" },
{ NULL, NULL },
{
{ TOUCH_CONTROL_VIRTUAL_BUTTONS, "Virtual Buttons" },
{ TOUCH_CONTROL_WIPE_GESTURES, "Wipe Gestures" },
+ { TOUCH_CONTROL_FOLLOW_FINGER, "Follow Finger" },
{ NULL, NULL },
};
y >= rect_y && y < rect_y + rect->height);
}
+static boolean insidePreviewRect(struct PreviewInfo *preview, int x, int y)
+{
+ int rect_width = preview->xsize * preview->tile_size;
+ int rect_height = preview->ysize * preview->tile_size;
+ int rect_x = ALIGNED_XPOS(preview->x, rect_width, preview->align);
+ int rect_y = ALIGNED_YPOS(preview->y, rect_height, preview->valign);
+
+ return (x >= rect_x && x < rect_x + rect_width &&
+ y >= rect_y && y < rect_y + rect_height);
+}
+
static void AdjustScrollbar(int id, int items_max, int items_visible,
int item_position)
{
return;
}
- /* needed if different viewport properties defined for menues */
- ChangeViewportPropertiesIfNeeded();
-
if (redraw_mask & REDRAW_ALL)
fade_mask = REDRAW_ALL;
FadeOut(fade_mask);
- SetDrawtoField(DRAW_BACKBUFFER);
+ /* needed if different viewport properties defined for menues */
+ ChangeViewportPropertiesIfNeeded();
+
+ SetDrawtoField(DRAW_TO_BACKBUFFER);
/* level_nr may have been set to value over handicap with level editor */
if (setup.handicap && level_nr > leveldir_current->handicap_level)
FadeOut(REDRAW_ALL);
- /* only required to update logic for redrawing global border */
- ClearField();
-
/* title screens may have different window size */
ChangeViewportPropertiesIfNeeded();
+ /* only required to update logic for redrawing global border */
+ ClearField();
+
if (tci->is_image)
DrawTitleScreenImage(tci->local_nr, tci->initial);
else
}
}
+ /* check if level preview was clicked */
+ if (insidePreviewRect(&preview, mx - SX, my - SY))
+ pos = MAIN_CONTROL_GAME;
+
// handle pressed/unpressed state for active/inactive menu buttons
// (if pos != -1, "i" contains index position corresponding to "pos")
if (button &&
SetGameStatus(GAME_MODE_LEVELNR);
- ChangeViewportPropertiesIfNeeded();
-
DrawChooseLevelNr();
}
else if (pos >= MAIN_CONTROL_NAME && pos <= MAIN_CONTROL_QUIT)
if (setup.internal.choose_from_top_leveldir)
gotoTopLevelDir();
- ChangeViewportPropertiesIfNeeded();
-
DrawChooseLevelSet();
}
}
info_mode = INFO_MODE_MAIN;
- ChangeViewportPropertiesIfNeeded();
-
DrawInfoScreen();
}
else if (pos == MAIN_CONTROL_GAME)
setup_mode = SETUP_MODE_MAIN;
- ChangeViewportPropertiesIfNeeded();
-
DrawSetupScreen();
}
else if (pos == MAIN_CONTROL_QUIT)
FadeOut(fade_mask);
+ /* needed if different viewport properties defined for info screen */
ChangeViewportPropertiesIfNeeded();
+ SetMainBackgroundImage(IMG_BACKGROUND_INFO);
+
ClearField();
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
static void DrawInfoScreen()
{
- SetMainBackgroundImage(IMG_BACKGROUND_INFO);
-
if (info_mode == INFO_MODE_TITLE)
DrawInfoScreen_TitleScreen();
else if (info_mode == INFO_MODE_ELEMENTS)
xpos = newxpos;
-#if defined(TARGET_SDL2)
- SDL_StartTextInput();
-#endif
+ StartTextInput(startx, starty, pos->width, pos->height);
}
else if (is_valid_key_char && xpos < MAX_PLAYER_NAME_LEN)
{
DrawText(startx, starty, setup.player_name, font_nr);
-#if defined(TARGET_SDL2)
- SDL_StopTextInput();
-#endif
+ StopTextInput();
}
}
FadeOut(fade_mask);
+ /* needed if different viewport properties defined for choosing level (set) */
+ ChangeViewportPropertiesIfNeeded();
+
+ if (game_status == GAME_MODE_LEVELNR)
+ SetMainBackgroundImage(IMG_BACKGROUND_LEVELNR);
+ else if (game_status == GAME_MODE_LEVELS)
+ SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
+
ClearField();
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
{
FadeSoundsAndMusic();
- SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
-
DrawChooseTree(&leveldir_current);
PlayMenuSound();
if (level_number_current == NULL)
level_number_current = level_number;
- SetMainBackgroundImage(IMG_BACKGROUND_LEVELNR);
-
DrawChooseTree(&level_number_current);
PlayMenuSound();
{
int fade_mask = REDRAW_FIELD;
- /* needed if different viewport properties defined for scores */
- ChangeViewportPropertiesIfNeeded();
-
if (CheckIfGlobalBorderHasChanged())
fade_mask = REDRAW_ALL;
FadeOut(fade_mask);
+ /* needed if different viewport properties defined for scores */
+ ChangeViewportPropertiesIfNeeded();
+
PlayMenuSound();
PlayMenuMusic();
int font_nr2 = (active ? FONT_TEXT_2_ACTIVE : FONT_TEXT_2);
int font_nr3 = (active ? FONT_TEXT_3_ACTIVE : FONT_TEXT_3);
int font_nr4 = (active ? FONT_TEXT_4_ACTIVE : FONT_TEXT_4);
+ int dxoff = getFontDrawOffsetX(font_nr1);
int dx1 = 3 * getFontWidth(font_nr1);
int dx2 = dx1 + getFontWidth(font_nr1);
- int dx3 = SXSIZE - 2 * (mSX - SX) - 5 * getFontWidth(font_nr4);
+ int dx3 = SXSIZE - 2 * (mSX - SX + dxoff) - 5 * getFontWidth(font_nr4);
int num_dots = (dx3 - dx2) / getFontWidth(font_nr3);
int sy = mSY + 64 + i * 32;
FadeOut(fade_mask);
+ /* needed if different viewport properties defined for setup screen */
+ ChangeViewportPropertiesIfNeeded();
+
+ SetMainBackgroundImage(IMG_BACKGROUND_SETUP);
+
ClearField();
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
{
DeactivateJoystick();
- SetMainBackgroundImage(IMG_BACKGROUND_SETUP);
-
if (setup_mode == SETUP_MODE_INPUT)
DrawSetupScreen_Input();
else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED)