$var .= "[GFX_SPECIAL_ARG_DEFAULT]";
}
- if ($var =~ /^(viewport.(playfield|door_[12]))(.[a-z_]+)$/)
+ if ($var =~ /^(viewport.(window|playfield|door_[12]))(.[a-z_]+)$/)
{
$var = $1 . "[GFX_SPECIAL_ARG_DEFAULT]" . $3;
}
{ "viewport.window.width", "672" },
{ "viewport.window.height", "560" },
+ { "viewport.window.TITLE.width", ARG_DEFAULT },
+ { "viewport.window.TITLE.height", ARG_DEFAULT },
+
{ "viewport.playfield.x", "6" },
{ "viewport.playfield.y", "6" },
{ "viewport.playfield.width", "548" },
{ "viewport.playfield.PLAYING.width", ARG_DEFAULT },
{ "viewport.playfield.PLAYING.height", ARG_DEFAULT },
{ "viewport.playfield.PLAYING.border_size", ARG_DEFAULT },
+
{ "viewport.door_1.x", "566" },
{ "viewport.door_1.y", "60" },
{ "viewport.door_1.width", "100" },
{ "viewport.door_1.PLAYING.width", ARG_DEFAULT },
{ "viewport.door_1.PLAYING.height", ARG_DEFAULT },
{ "viewport.door_1.PLAYING.border_size", ARG_DEFAULT },
+
{ "viewport.door_2.x", "566" },
{ "viewport.door_2.y", "400" },
{ "viewport.door_2.width", "100" },
/* (eg, init "viewport.door_1.MAIN.xyz" from "viewport.door_1.xyz") */
for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
{
+ viewport.window[i] = viewport.window[GFX_SPECIAL_ARG_DEFAULT];
viewport.playfield[i] = viewport.playfield[GFX_SPECIAL_ARG_DEFAULT];
- viewport.door_1[i] = viewport.door_1[GFX_SPECIAL_ARG_DEFAULT];
+ viewport.door_1[i] = viewport.door_1[GFX_SPECIAL_ARG_DEFAULT];
+
if (i != GFX_SPECIAL_ARG_EDITOR) /* editor value already initialized */
viewport.door_2[i] = viewport.door_2[GFX_SPECIAL_ARG_DEFAULT];
}
/* (eg, init "viewport.door_1.MAIN.xyz" from "viewport.door_1.xyz") */
for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++)
{
+ char *token_w1 = "viewport.window.width";
+ char *token_w2 = "viewport.window.height";
char *token_01 = "viewport.playfield.x";
char *token_02 = "viewport.playfield.y";
char *token_03 = "viewport.playfield.width";
char *token_13 = "viewport.door_2.width";
char *token_14 = "viewport.door_2.height";
char *token_15 = "viewport.door_2.border_size";
+ char *value_w1 = getHashEntry(setup_file_hash, token_w1);
+ char *value_w2 = getHashEntry(setup_file_hash, token_w2);
char *value_01 = getHashEntry(setup_file_hash, token_01);
char *value_02 = getHashEntry(setup_file_hash, token_02);
char *value_03 = getHashEntry(setup_file_hash, token_03);
char *value_14 = getHashEntry(setup_file_hash, token_14);
char *value_15 = getHashEntry(setup_file_hash, token_15);
+ if (value_w1 != NULL)
+ viewport.window[i].width = get_token_parameter_value(token_w1, value_w1);
+ if (value_w2 != NULL)
+ viewport.window[i].height = get_token_parameter_value(token_w2, value_w2);
if (value_01 != NULL)
viewport.playfield[i].x = get_token_parameter_value(token_01, value_01);
if (value_02 != NULL)
struct ViewportInfo
{
- struct RectWithBorder window;
+ struct RectWithBorder window[NUM_SPECIAL_GFX_ARGS];
struct RectWithBorder playfield[NUM_SPECIAL_GFX_ARGS];
struct RectWithBorder door_1[NUM_SPECIAL_GFX_ARGS];
struct RectWithBorder door_2[NUM_SPECIAL_GFX_ARGS];
ClearField();
}
+ ChangeViewportPropertiesIfNeeded();
+
if (tci->is_image)
DrawTitleScreenImage(tci->local_nr, tci->initial);
else
FadeOut(fade_mask);
+ ChangeViewportPropertiesIfNeeded();
+
OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW);
ClearField();
int gfx_game_mode = game_status;
int gfx_game_mode2 = (game_status == GAME_MODE_EDITOR ? GAME_MODE_DEFAULT :
game_status);
+ struct RectWithBorder *vp_window = &viewport.window[gfx_game_mode];
struct RectWithBorder *vp_playfield = &viewport.playfield[gfx_game_mode];
- struct RectWithBorder *vp_door_1 = &viewport.door_1[gfx_game_mode];
- struct RectWithBorder *vp_door_2 = &viewport.door_2[gfx_game_mode2];
- struct RectWithBorder *vp_door_3 = &viewport.door_2[GAME_MODE_EDITOR];
+ struct RectWithBorder *vp_door_1 = &viewport.door_1[gfx_game_mode];
+ struct RectWithBorder *vp_door_2 = &viewport.door_2[gfx_game_mode2];
+ struct RectWithBorder *vp_door_3 = &viewport.door_2[GAME_MODE_EDITOR];
+ int new_win_xsize = vp_window->width;
+ int new_win_ysize = vp_window->height;
int border_size = vp_playfield->border_size;
int new_sx = vp_playfield->x + border_size;
int new_sy = vp_playfield->y + border_size;
boolean init_gadgets_and_toons = FALSE;
boolean init_em_graphics = FALSE;
- if (viewport.window.width != WIN_XSIZE ||
- viewport.window.height != WIN_YSIZE)
+ if (new_win_xsize != WIN_XSIZE ||
+ new_win_ysize != WIN_YSIZE)
{
- WIN_XSIZE = viewport.window.width;
- WIN_YSIZE = viewport.window.height;
+ WIN_XSIZE = new_win_xsize;
+ WIN_YSIZE = new_win_ysize;
init_video_buffer = TRUE;
init_gfx_buffers = TRUE;