+2010-04-07
+ * added initial, experimental support for different viewport properties
+ (with "viewports" being menu/playfield area and doors; currently the
+ size of the menu/playfield area and door positions can be redefined)
+
2010-04-02
- * added initial, experimental support for different screen sizes
+ * added initial, experimental support for different window sizes
2010-03-27
* added support for native Sokoban solution files in pure 'udlrUDLR'
{ "[player].sleeping_delay_fixed", "2000" },
{ "[player].sleeping_delay_random", "2000" },
- { "global.screen.width", "672" },
- { "global.screen.height", "560" },
+ { "viewport.window.width", "672" },
+ { "viewport.window.height", "560" },
+ { "viewport.playfield.menu.width", "17" },
+ { "viewport.playfield.menu.height", "17" },
+ { "viewport.playfield.game.width", "17" },
+ { "viewport.playfield.game.height", "17" },
+ { "viewport.playfield.editor.width", "17" },
+ { "viewport.playfield.editor.height", "17" },
+ { "viewport.door_1.menu.x", "566" },
+ { "viewport.door_1.menu.y", "60" },
+ { "viewport.door_1.game.x", "566" },
+ { "viewport.door_1.game.y", "60" },
+ { "viewport.door_1.editor.x", "566" },
+ { "viewport.door_1.editor.y", "60" },
+ { "viewport.door_2.menu.x", "566" },
+ { "viewport.door_2.menu.y", "400" },
+ { "viewport.door_2.game.x", "566" },
+ { "viewport.door_2.game.y", "400" },
+ { "viewport.door_2.editor.x", "566" },
+ { "viewport.door_2.editor.y", "356" },
{ NULL, NULL }
};
&game.player_sleeping_delay_random
},
{
- "global.screen.width",
- &global.screen.width
+ "viewport.window.width",
+ &viewport.window.width
},
{
- "global.screen.height",
- &global.screen.height
+ "viewport.window.height",
+ &viewport.window.height
+ },
+ {
+ "viewport.playfield.menu.width",
+ &viewport.playfield.menu.width
+ },
+ {
+ "viewport.playfield.menu.height",
+ &viewport.playfield.menu.height
+ },
+ {
+ "viewport.playfield.game.width",
+ &viewport.playfield.game.width
+ },
+ {
+ "viewport.playfield.game.height",
+ &viewport.playfield.game.height
+ },
+ {
+ "viewport.playfield.editor.width",
+ &viewport.playfield.editor.width
+ },
+ {
+ "viewport.playfield.editor.height",
+ &viewport.playfield.editor.height
+ },
+ {
+ "viewport.door_1.menu.x",
+ &viewport.door_1.menu.x
+ },
+ {
+ "viewport.door_1.menu.y",
+ &viewport.door_1.menu.y
+ },
+ {
+ "viewport.door_1.game.x",
+ &viewport.door_1.game.x
+ },
+ {
+ "viewport.door_1.game.y",
+ &viewport.door_1.game.y
+ },
+ {
+ "viewport.door_1.editor.x",
+ &viewport.door_1.editor.x
+ },
+ {
+ "viewport.door_1.editor.y",
+ &viewport.door_1.editor.y
+ },
+ {
+ "viewport.door_2.menu.x",
+ &viewport.door_2.menu.x
+ },
+ {
+ "viewport.door_2.menu.y",
+ &viewport.door_2.menu.y
+ },
+ {
+ "viewport.door_2.game.x",
+ &viewport.door_2.game.x
+ },
+ {
+ "viewport.door_2.game.y",
+ &viewport.door_2.game.y
+ },
+ {
+ "viewport.door_2.editor.x",
+ &viewport.door_2.editor.x
+ },
+ {
+ "viewport.door_2.editor.y",
+ &viewport.door_2.editor.y
},
{
NULL,
-#define COMPILE_DATE_STRING "2010-04-02 22:02"
+#define COMPILE_DATE_STRING "2010-04-07 23:40"
/* ---------- current level number --------------------------------------- */
{
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
DX + 5 - SX, DY + 3 - SY,
+#endif
1, 100,
GADGET_ID_SELECT_LEVEL_DOWN, GADGET_ID_SELECT_LEVEL_UP,
GADGET_ID_SELECT_LEVEL_TEXT, GADGET_ID_NONE,
{
{
ED_SCROLLBUTTON_XPOS, ED_SCROLLBUTTON_YPOS + 0 * ED_SCROLLBUTTON_YSIZE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
ED_SCROLL_UP_XPOS, ED_SCROLL_UP_YPOS,
+#endif
GADGET_ID_SCROLL_UP,
"scroll level editing area up"
},
{
ED_SCROLLBUTTON_XPOS, ED_SCROLLBUTTON_YPOS + 1 * ED_SCROLLBUTTON_YSIZE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
ED_SCROLL_DOWN_XPOS, ED_SCROLL_DOWN_YPOS,
+#endif
GADGET_ID_SCROLL_DOWN,
"scroll level editing area down"
},
{
ED_SCROLLBUTTON_XPOS, ED_SCROLLBUTTON_YPOS + 2 * ED_SCROLLBUTTON_YSIZE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
ED_SCROLL_LEFT_XPOS, ED_SCROLL_LEFT_YPOS,
+#endif
GADGET_ID_SCROLL_LEFT,
"scroll level editing area left"
},
{
ED_SCROLLBUTTON_XPOS, ED_SCROLLBUTTON_YPOS + 3 * ED_SCROLLBUTTON_YSIZE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
ED_SCROLL_RIGHT_XPOS, ED_SCROLL_RIGHT_YPOS,
+#endif
GADGET_ID_SCROLL_RIGHT,
"scroll level editing area right"
},
{
{
ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
SX + ED_SCROLL_HORIZONTAL_XPOS, SY + ED_SCROLL_HORIZONTAL_YPOS,
ED_SCROLL_HORIZONTAL_XSIZE, ED_SCROLL_HORIZONTAL_YSIZE,
SX, SY,
SXSIZE, SYSIZE,
+#endif
GD_TYPE_SCROLLBAR_HORIZONTAL,
GADGET_ID_SCROLL_HORIZONTAL,
"scroll level editing area horizontally"
},
{
ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
SX + ED_SCROLL_VERTICAL_XPOS, SY + ED_SCROLL_VERTICAL_YPOS,
ED_SCROLL_VERTICAL_XSIZE, ED_SCROLL_VERTICAL_YSIZE,
SX, SY,
SXSIZE, SYSIZE,
+#endif
GD_TYPE_SCROLLBAR_VERTICAL,
GADGET_ID_SCROLL_VERTICAL,
"scroll level editing area vertically"
},
{
ED_SCROLLBAR2_XPOS, ED_SCROLLBAR2_YPOS,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+ ED_SCROLL2_VERTICAL_XSIZE, ED_SCROLL2_VERTICAL_YSIZE,
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
DX + ED_SCROLL2_VERTICAL_XPOS, DY + ED_SCROLL2_VERTICAL_YPOS,
ED_SCROLL2_VERTICAL_XSIZE, ED_SCROLL2_VERTICAL_YSIZE,
DX, DY,
+#endif
DXSIZE, DYSIZE,
GD_TYPE_SCROLLBAR_VERTICAL,
GADGET_ID_SCROLL_LIST_VERTICAL,
{
0, 0,
GADGET_ID_DRAWING_LEVEL, GADGET_ID_NONE,
- NULL, MAX_ED_FIELDX, MAX_ED_FIELDY,
+ NULL,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
+ MAX_ED_FIELDX, MAX_ED_FIELDY,
+#endif
NULL, NULL, NULL, NULL
},
*/
/* actual size of level editor drawing area */
+#if 1
+static int ed_fieldx, ed_fieldy;
+#else
static int ed_fieldx = MAX_ED_FIELDX - 1, ed_fieldy = MAX_ED_FIELDY - 1;
+#endif
/* actual position of level editor drawing area in level playfield */
static int level_xpos = -1, level_ypos = -1;
level_editor_gadget[id] = gi;
}
+ /* these values are not constant, but can change at runtime */
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_UP].x = ED_SCROLL_UP_XPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_UP].y = ED_SCROLL_UP_YPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_DOWN].x = ED_SCROLL_DOWN_XPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_DOWN].y = ED_SCROLL_DOWN_YPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_LEFT].x = ED_SCROLL_LEFT_XPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_LEFT].y = ED_SCROLL_LEFT_YPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_RIGHT].x = ED_SCROLL_RIGHT_XPOS;
+ scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_RIGHT].y = ED_SCROLL_RIGHT_YPOS;
+
/* create buttons for scrolling of drawing area and element list */
for (i = 0; i < ED_NUM_SCROLLBUTTONS; i++)
{
int max_infotext_len = getMaxInfoTextLength();
int i;
+ /* these values are not constant, but can change at runtime */
+ counterbutton_info[ED_COUNTER_ID_SELECT_LEVEL].x = DX + 5 - SX;
+ counterbutton_info[ED_COUNTER_ID_SELECT_LEVEL].y = DY + 3 - SY;
+
for (i = 0; i < ED_NUM_COUNTERBUTTONS; i++)
{
int j;
{
int i;
+ /* these values are not constant, but can change at runtime */
+ drawingarea_info[ED_DRAWING_ID_DRAWING_LEVEL].area_xsize = MAX_ED_FIELDX;
+ drawingarea_info[ED_DRAWING_ID_DRAWING_LEVEL].area_ysize = MAX_ED_FIELDY;
+
for (i = 0; i < ED_NUM_DRAWING_AREAS; i++)
{
struct GadgetInfo *gi;
{
int i;
+ /* these values are not constant, but can change at runtime */
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].x =
+ SX + ED_SCROLL_HORIZONTAL_XPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].y =
+ SY + ED_SCROLL_HORIZONTAL_YPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].width =
+ ED_SCROLL_HORIZONTAL_XSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].height =
+ ED_SCROLL_HORIZONTAL_YSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].wheel_x = SX;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].wheel_y = SY;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].wheel_width = SXSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_HORIZONTAL].wheel_height = SYSIZE;
+
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].x =
+ SX + ED_SCROLL_VERTICAL_XPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].y =
+ SY + ED_SCROLL_VERTICAL_YPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].width =
+ ED_SCROLL_VERTICAL_XSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].height =
+ ED_SCROLL_VERTICAL_YSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].wheel_x = SX;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].wheel_y = SY;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].wheel_width = SXSIZE;
+ scrollbar_info[ED_SCROLLBAR_ID_AREA_VERTICAL].wheel_height = SYSIZE;
+
+ scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].x =
+ DX + ED_SCROLL2_VERTICAL_XPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].y =
+ DY + ED_SCROLL2_VERTICAL_YPOS;
+ scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].wheel_x = DX;
+ scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].wheel_y = DY;
+
for (i = 0; i < ED_NUM_SCROLLBARS; i++)
{
int id = scrollbar_info[i].gadget_id;
/* setting 'game_status' is needed to get the right fonts for the editor */
game_status = GAME_MODE_EDITOR;
+ /* these values are not constant, but can change at runtime */
+ ed_fieldx = MAX_ED_FIELDX - 1;
+ ed_fieldy = MAX_ED_FIELDY - 1;
+
ReinitializeElementList();
CreateControlButtons();
redraw_mask |= REDRAW_ALL;
+#if 1
+ FreeLevelEditorGadgets();
+ CreateLevelEditorGadgets();
+#endif
+
ReinitializeElementList(); /* update dynamic level element list */
ReinitializeElementListButtons(); /* custom element may look different */
static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y,
int button, int mode)
{
+#if 1
+ static short brush_buffer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+#else
static short brush_buffer[MAX_ED_FIELDX][MAX_ED_FIELDY];
+#endif
static int brush_width, brush_height;
static int last_cursor_x = -1, last_cursor_y = -1;
static boolean delete_old_brush;
game_status = GAME_MODE_PLAYING;
+#if 1
+ /* needed if different viewport properties defined for playing */
+ ChangeViewportPropertiesIfNeeded();
+#endif
+
InitGameEngine();
InitGameControlValues();
void KeyboardAutoRepeatOffUnlessAutoplay();
void InitGfxBuffers();
+void InitGadgets();
void OpenAll(void);
void CloseAllAndExit(int);
int key_joystick_mapping = 0;
+#if 1
+boolean redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
+#else
boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+#endif
int redraw_x1 = 0, redraw_y1 = 0;
short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
int lev_fieldx, lev_fieldy;
int scroll_x, scroll_y;
-int WIN_XSIZE = 672;
-int WIN_YSIZE = 560;
+int WIN_XSIZE = 672, WIN_YSIZE = 560;
+int SCR_FIELDX = 17, SCR_FIELDY = 17;
+int DX = 566, DY = 60;
+int VX = 566, VY = 400;
+int EX = 566, EY = 356;
int FX = SX, FY = SY;
int ScrollStepSize;
int BorderElement = EL_STEELWALL;
int GameFrameDelay = GAME_FRAME_DELAY;
int FfwdFrameDelay = FFWD_FRAME_DELAY;
+#if 1
+int BX1, BY1;
+int BX2, BY2;
+#else
int BX1 = 0, BY1 = 0;
int BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1;
+#endif
int SBX_Left, SBX_Right;
int SBY_Upper, SBY_Lower;
int ZX, ZY;
struct GameInfo game;
struct GlobalInfo global;
struct BorderInfo border;
+struct ViewportInfo viewport;
struct TitleFadingInfo fading;
struct TitleFadingInfo title_initial_default;
struct TitleFadingInfo title_default;
#define DEFAULT_FULLSCREEN_MODE "800x600"
+#if 0
#define SCR_FIELDX 17
#define SCR_FIELDY 17
+#endif
#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
#define MIN_LEV_FIELDX 3
#define SY 8
#define REAL_SX (SX - 2)
#define REAL_SY (SY - 2)
+#if 0
#define DX 566
#define DY 60
#define VX DX
#define VY 400
#define EX DX
#define EY (VY - 44)
+#endif
#define TILESIZE 32
#define TILEX TILESIZE
#define TILEY TILESIZE
int fading_status;
int fading_type;
#endif
+};
+
+struct SubViewportInfo
+{
+ struct Rect menu;
+ struct Rect game;
+ struct Rect editor;
+};
- struct Rect screen;
+struct ViewportInfo
+{
+ struct Rect window;
+ struct SubViewportInfo playfield;
+ struct SubViewportInfo door_1;
+ struct SubViewportInfo door_2;
};
struct ElementChangeInfo
extern int key_joystick_mapping;
+#if 1
+extern boolean redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
+#else
extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+#endif
extern int redraw_x1, redraw_y1;
extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int scroll_x, scroll_y;
extern int WIN_XSIZE, WIN_YSIZE;
+extern int SCR_FIELDX, SCR_FIELDY;
+extern int DX, DY;
+extern int VX, VY;
+extern int EX, EY;
extern int FX, FY;
extern int ScrollStepSize;
extern struct TapeInfo tape;
extern struct GlobalInfo global;
extern struct BorderInfo border;
+extern struct ViewportInfo viewport;
extern struct TitleFadingInfo fading;
extern struct TitleFadingInfo fading_none;
extern struct TitleFadingInfo title_initial_default;
static void drawCursorExt(int xpos, int ypos, boolean active, int graphic)
{
+#if 1
+ static int cursor_array[MAX_LEV_FIELDY];
+#else
static int cursor_array[SCR_FIELDY];
+#endif
int x = mSX + TILEX * xpos;
int y = mSY + TILEY * (MENU_SCREEN_START_YPOS + ypos);
#endif
#if 1
- /* needed if newly loaded custom artwork requires a different screen mode */
- ChangeScreenModeIfNeeded();
+ /* needed if different viewport properties defined for menues */
+ ChangeViewportPropertiesIfNeeded();
#endif
#if defined(TARGET_SDL)
FadeSetEnterScreen();
+#if 1
+ /* needed if different viewport properties defined for editor */
+ ChangeViewportPropertiesIfNeeded();
+#endif
+
DrawLevelEd();
}
else if (pos == MAIN_CONTROL_INFO)
{
{
IMG_MENU_BUTTON_UP, IMG_MENU_BUTTON_UP_ACTIVE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
SC_SCROLL_UP_XPOS, SC_SCROLL_UP_YPOS,
+#endif
SCREEN_CTRL_ID_SCROLL_UP,
"scroll up"
},
{
IMG_MENU_BUTTON_DOWN, IMG_MENU_BUTTON_DOWN_ACTIVE,
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
SC_SCROLL_DOWN_XPOS, SC_SCROLL_DOWN_YPOS,
+#endif
SCREEN_CTRL_ID_SCROLL_DOWN,
"scroll down"
}
#else
IMG_MENU_SCROLLBAR, IMG_MENU_SCROLLBAR_ACTIVE,
#endif
+#if 1
+ -1, -1, /* these values are not constant, but can change at runtime */
+ -1, -1, /* these values are not constant, but can change at runtime */
+#else
SC_SCROLL_VERTICAL_XPOS, SC_SCROLL_VERTICAL_YPOS,
SC_SCROLL_VERTICAL_XSIZE, SC_SCROLL_VERTICAL_YSIZE,
+#endif
GD_TYPE_SCROLLBAR_VERTICAL,
SCREEN_CTRL_ID_SCROLL_VERTICAL,
"scroll level series vertically"
unsigned long event_mask;
int i;
+ /* these values are not constant, but can change at runtime */
+ scrollbutton_info[0].x = SC_SCROLL_UP_XPOS;
+ scrollbutton_info[0].y = SC_SCROLL_UP_YPOS;
+ scrollbutton_info[1].x = SC_SCROLL_DOWN_XPOS;
+ scrollbutton_info[1].y = SC_SCROLL_DOWN_YPOS;
+
for (i = 0; i < NUM_SCREEN_SCROLLBUTTONS; i++)
{
Bitmap *gd_bitmap_unpressed, *gd_bitmap_pressed;
{
int i;
+ /* these values are not constant, but can change at runtime */
+ scrollbar_info[0].x = SC_SCROLL_VERTICAL_XPOS;
+ scrollbar_info[0].y = SC_SCROLL_VERTICAL_YPOS;
+ scrollbar_info[0].width = SC_SCROLL_VERTICAL_XSIZE;
+ scrollbar_info[0].height = SC_SCROLL_VERTICAL_YSIZE;
+
for (i = 0; i < NUM_SCREEN_SCROLLBARS; i++)
{
Bitmap *gd_bitmap_unpressed, *gd_bitmap_pressed;
if (redraw_mask & REDRAW_FIELD)
{
+#if 0
+ printf("::: REDRAW_FIELD\n");
+#endif
+
if (game_status != GAME_MODE_PLAYING ||
redraw_mask & REDRAW_FROM_BACKBUFFER)
{
if (redraw_mask & REDRAW_TILES)
{
+#if 0
+ printf("::: REDRAW_TILES\n");
+#endif
+
for (x = 0; x < SCR_FIELDX; x++)
for (y = 0 ; y < SCR_FIELDY; y++)
if (redraw[redraw_x1 + x][redraw_y1 + y])
}
}
-void ChangeScreenModeIfNeeded()
+void ChangeViewportPropertiesIfNeeded()
{
- if (global.screen.width == WIN_XSIZE &&
- global.screen.height == WIN_YSIZE)
- return;
-
- WIN_XSIZE = global.screen.width;
- WIN_YSIZE = global.screen.height;
+ if (viewport.window.width != WIN_XSIZE ||
+ viewport.window.height != WIN_YSIZE)
+ {
+ WIN_XSIZE = viewport.window.width;
+ WIN_YSIZE = viewport.window.height;
- InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
- InitGfxBuffers();
+ InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
+ InitGfxBuffers();
#if 1
- SetDrawDeactivationMask(REDRAW_NONE);
- SetDrawBackgroundMask(REDRAW_FIELD);
+ SetDrawDeactivationMask(REDRAW_NONE);
+ SetDrawBackgroundMask(REDRAW_FIELD);
- // RedrawBackground();
+ // RedrawBackground();
#endif
+ }
+
+ if (game_status == GAME_MODE_PLAYING)
+ {
+ if (viewport.playfield.game.width != SCR_FIELDX ||
+ viewport.playfield.game.height != SCR_FIELDY ||
+ viewport.door_1.game.x != DX ||
+ viewport.door_1.game.y != DY ||
+ viewport.door_2.game.x != VX ||
+ viewport.door_2.game.y != VY)
+ {
+ SCR_FIELDX = viewport.playfield.game.width;
+ SCR_FIELDY = viewport.playfield.game.height;
+
+ DX = viewport.door_1.game.x;
+ DY = viewport.door_1.game.y;
+ VX = viewport.door_2.game.x;
+ VY = viewport.door_2.game.y;
+
+ InitGfxBuffers();
+ }
+ }
+ else if (game_status == GAME_MODE_EDITOR)
+ {
+ if (viewport.playfield.editor.width != SCR_FIELDX ||
+ viewport.playfield.editor.height != SCR_FIELDY ||
+ viewport.door_1.editor.x != DX ||
+ viewport.door_1.editor.y != DY ||
+ viewport.door_2.editor.x != EX ||
+ viewport.door_2.editor.y != EY)
+ {
+ SCR_FIELDX = viewport.playfield.editor.width;
+ SCR_FIELDY = viewport.playfield.editor.height;
+
+ DX = viewport.door_1.editor.x;
+ DY = viewport.door_1.editor.y;
+ EX = viewport.door_2.editor.x;
+ EY = viewport.door_2.editor.y;
+
+ InitGfxBuffers();
+ }
+ }
+ else /* any menu screen */
+ {
+ if (viewport.playfield.menu.width != SCR_FIELDX ||
+ viewport.playfield.menu.height != SCR_FIELDY ||
+ viewport.door_1.menu.x != DX ||
+ viewport.door_1.menu.y != DY ||
+ viewport.door_2.menu.x != VX ||
+ viewport.door_2.menu.y != VY)
+ {
+ SCR_FIELDX = viewport.playfield.menu.width;
+ SCR_FIELDY = viewport.playfield.menu.height;
+
+ DX = viewport.door_1.menu.x;
+ DY = viewport.door_1.menu.y;
+ VX = viewport.door_2.menu.x;
+ VY = viewport.door_2.menu.y;
+
+ InitGfxBuffers();
+ InitGadgets();
+ InitToons();
+ }
+ }
}
void PlaySoundSelecting();
void ToggleFullscreenIfNeeded();
-void ChangeScreenModeIfNeeded();
+void ChangeViewportPropertiesIfNeeded();
#endif /* TOOLS_H */