From 273ed881a8affb54ee8e2bd7489eb3d898e11c23 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 12 Feb 2014 02:14:46 +0100 Subject: [PATCH] rnd-20140212-1-src --- src/conf_gfx.c | 38 ++++++++++++-- src/conf_gfx.h | 4 +- src/conf_var.c | 112 +++++++++++++++++++++++++++++++++++------ src/conftime.h | 2 +- src/editor.c | 5 +- src/files.c | 104 ++++++++++++++++++++++++-------------- src/libgame/system.c | 3 ++ src/main.c | 12 +++-- src/main.h | 12 +++-- src/screens.c | 8 +++ src/tools.c | 117 ++++++++++++++++++++++++++++++++++++------- 11 files changed, 332 insertions(+), 85 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index f0c258b4..e8cc66ed 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -5316,6 +5316,16 @@ struct ConfigInfo image_config[] = { "titlescreen_4", UNDEFINED_FILENAME }, { "titlescreen_5", UNDEFINED_FILENAME }, + { "door_2.top_border_correction", "RocksDoor.png" }, + { "door_2.top_border_correction.x", "600" }, + { "door_2.top_border_correction.y", "0" }, + { "door_2.top_border_correction.width", "108" }, + { "door_2.top_border_correction.height", "8" }, + + /* the last image entry apparently gets overwritten by very last entry + of "image_config[]"; so far this bug could not be found and fixed */ + { "last_image_entry_bug", UNDEFINED_FILENAME }, + /* the following directives are not associated with an image, but probably make sense to be defined in "graphicsinfo.conf", too */ @@ -5857,14 +5867,10 @@ struct ConfigInfo image_config[] = { "preview.step_delay", "50" }, { "preview.anim_mode", "default" }, - { "door_1.width", "-1" }, - { "door_1.height", "-1" }, { "door_1.step_offset", "2" }, { "door_1.step_delay", "10" }, { "door_1.anim_mode", "default" }, - { "door_2.width", "-1" }, - { "door_2.height", "-1" }, { "door_2.step_offset", "2" }, { "door_2.step_delay", "10" }, { "door_2.anim_mode", "default" }, @@ -6785,20 +6791,44 @@ struct ConfigInfo image_config[] = { "viewport.playfield.EDITOR.border_size", ARG_DEFAULT }, { "viewport.door_1.x", "566" }, { "viewport.door_1.y", "60" }, + { "viewport.door_1.width", "100" }, + { "viewport.door_1.height", "280" }, + { "viewport.door_1.border_size", "4" }, { "viewport.door_1.MAIN.x", ARG_DEFAULT }, { "viewport.door_1.MAIN.y", ARG_DEFAULT }, + { "viewport.door_1.MAIN.width", ARG_DEFAULT }, + { "viewport.door_1.MAIN.height", ARG_DEFAULT }, + { "viewport.door_1.MAIN.border_size", ARG_DEFAULT }, { "viewport.door_1.PLAYING.x", ARG_DEFAULT }, { "viewport.door_1.PLAYING.y", ARG_DEFAULT }, + { "viewport.door_1.PLAYING.width", ARG_DEFAULT }, + { "viewport.door_1.PLAYING.height", ARG_DEFAULT }, + { "viewport.door_1.PLAYING.border_size", ARG_DEFAULT }, { "viewport.door_1.EDITOR.x", ARG_DEFAULT }, { "viewport.door_1.EDITOR.y", ARG_DEFAULT }, + { "viewport.door_1.EDITOR.width", ARG_DEFAULT }, + { "viewport.door_1.EDITOR.height", ARG_DEFAULT }, + { "viewport.door_1.EDITOR.border_size", ARG_DEFAULT }, { "viewport.door_2.x", "566" }, { "viewport.door_2.y", "400" }, + { "viewport.door_2.width", "100" }, + { "viewport.door_2.height", "100" }, + { "viewport.door_2.border_size", "4" }, { "viewport.door_2.MAIN.x", ARG_DEFAULT }, { "viewport.door_2.MAIN.y", ARG_DEFAULT }, + { "viewport.door_2.MAIN.width", ARG_DEFAULT }, + { "viewport.door_2.MAIN.height", ARG_DEFAULT }, + { "viewport.door_2.MAIN.border_size", ARG_DEFAULT }, { "viewport.door_2.PLAYING.x", ARG_DEFAULT }, { "viewport.door_2.PLAYING.y", ARG_DEFAULT }, + { "viewport.door_2.PLAYING.width", ARG_DEFAULT }, + { "viewport.door_2.PLAYING.height", ARG_DEFAULT }, + { "viewport.door_2.PLAYING.border_size", ARG_DEFAULT }, { "viewport.door_2.EDITOR.x", "566" }, { "viewport.door_2.EDITOR.y", "356" }, + { "viewport.door_2.EDITOR.width", "100" }, + { "viewport.door_2.EDITOR.height", "144" }, + { "viewport.door_2.EDITOR.border_size", "4" }, { NULL, NULL } }; diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 9935b1ad..875588a8 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1868,7 +1868,9 @@ #define IMG_TITLESCREEN_3 1847 #define IMG_TITLESCREEN_4 1848 #define IMG_TITLESCREEN_5 1849 +#define IMG_DOOR_2_TOP_BORDER_CORRECTION 1850 +#define IMG_LAST_IMAGE_ENTRY_BUG 1851 -#define NUM_IMAGE_FILES 1850 +#define NUM_IMAGE_FILES 1852 #endif /* CONF_GFX_H */ diff --git a/src/conf_var.c b/src/conf_var.c index f6a55cf1..4f65fd33 100644 --- a/src/conf_var.c +++ b/src/conf_var.c @@ -2092,14 +2092,6 @@ struct TokenIntPtrInfo image_config_vars[] = "preview.anim_mode", &preview.anim_mode }, - { - "door_1.width", - &door_1.width - }, - { - "door_1.height", - &door_1.height - }, { "door_1.step_offset", &door_1.step_offset @@ -2112,14 +2104,6 @@ struct TokenIntPtrInfo image_config_vars[] = "door_1.anim_mode", &door_1.anim_mode }, - { - "door_2.width", - &door_2.width - }, - { - "door_2.height", - &door_2.height - }, { "door_2.step_offset", &door_2.step_offset @@ -5620,6 +5604,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_1.y", &viewport.door_1[GFX_SPECIAL_ARG_DEFAULT].y }, + { + "viewport.door_1.width", + &viewport.door_1[GFX_SPECIAL_ARG_DEFAULT].width + }, + { + "viewport.door_1.height", + &viewport.door_1[GFX_SPECIAL_ARG_DEFAULT].height + }, + { + "viewport.door_1.border_size", + &viewport.door_1[GFX_SPECIAL_ARG_DEFAULT].border_size + }, { "viewport.door_1.MAIN.x", &viewport.door_1[GFX_SPECIAL_ARG_MAIN].x @@ -5628,6 +5624,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_1.MAIN.y", &viewport.door_1[GFX_SPECIAL_ARG_MAIN].y }, + { + "viewport.door_1.MAIN.width", + &viewport.door_1[GFX_SPECIAL_ARG_MAIN].width + }, + { + "viewport.door_1.MAIN.height", + &viewport.door_1[GFX_SPECIAL_ARG_MAIN].height + }, + { + "viewport.door_1.MAIN.border_size", + &viewport.door_1[GFX_SPECIAL_ARG_MAIN].border_size + }, { "viewport.door_1.PLAYING.x", &viewport.door_1[GFX_SPECIAL_ARG_PLAYING].x @@ -5636,6 +5644,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_1.PLAYING.y", &viewport.door_1[GFX_SPECIAL_ARG_PLAYING].y }, + { + "viewport.door_1.PLAYING.width", + &viewport.door_1[GFX_SPECIAL_ARG_PLAYING].width + }, + { + "viewport.door_1.PLAYING.height", + &viewport.door_1[GFX_SPECIAL_ARG_PLAYING].height + }, + { + "viewport.door_1.PLAYING.border_size", + &viewport.door_1[GFX_SPECIAL_ARG_PLAYING].border_size + }, { "viewport.door_1.EDITOR.x", &viewport.door_1[GFX_SPECIAL_ARG_EDITOR].x @@ -5644,6 +5664,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_1.EDITOR.y", &viewport.door_1[GFX_SPECIAL_ARG_EDITOR].y }, + { + "viewport.door_1.EDITOR.width", + &viewport.door_1[GFX_SPECIAL_ARG_EDITOR].width + }, + { + "viewport.door_1.EDITOR.height", + &viewport.door_1[GFX_SPECIAL_ARG_EDITOR].height + }, + { + "viewport.door_1.EDITOR.border_size", + &viewport.door_1[GFX_SPECIAL_ARG_EDITOR].border_size + }, { "viewport.door_2.x", &viewport.door_2[GFX_SPECIAL_ARG_DEFAULT].x @@ -5652,6 +5684,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_2.y", &viewport.door_2[GFX_SPECIAL_ARG_DEFAULT].y }, + { + "viewport.door_2.width", + &viewport.door_2[GFX_SPECIAL_ARG_DEFAULT].width + }, + { + "viewport.door_2.height", + &viewport.door_2[GFX_SPECIAL_ARG_DEFAULT].height + }, + { + "viewport.door_2.border_size", + &viewport.door_2[GFX_SPECIAL_ARG_DEFAULT].border_size + }, { "viewport.door_2.MAIN.x", &viewport.door_2[GFX_SPECIAL_ARG_MAIN].x @@ -5660,6 +5704,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_2.MAIN.y", &viewport.door_2[GFX_SPECIAL_ARG_MAIN].y }, + { + "viewport.door_2.MAIN.width", + &viewport.door_2[GFX_SPECIAL_ARG_MAIN].width + }, + { + "viewport.door_2.MAIN.height", + &viewport.door_2[GFX_SPECIAL_ARG_MAIN].height + }, + { + "viewport.door_2.MAIN.border_size", + &viewport.door_2[GFX_SPECIAL_ARG_MAIN].border_size + }, { "viewport.door_2.PLAYING.x", &viewport.door_2[GFX_SPECIAL_ARG_PLAYING].x @@ -5668,6 +5724,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_2.PLAYING.y", &viewport.door_2[GFX_SPECIAL_ARG_PLAYING].y }, + { + "viewport.door_2.PLAYING.width", + &viewport.door_2[GFX_SPECIAL_ARG_PLAYING].width + }, + { + "viewport.door_2.PLAYING.height", + &viewport.door_2[GFX_SPECIAL_ARG_PLAYING].height + }, + { + "viewport.door_2.PLAYING.border_size", + &viewport.door_2[GFX_SPECIAL_ARG_PLAYING].border_size + }, { "viewport.door_2.EDITOR.x", &viewport.door_2[GFX_SPECIAL_ARG_EDITOR].x @@ -5676,6 +5744,18 @@ struct TokenIntPtrInfo image_config_vars[] = "viewport.door_2.EDITOR.y", &viewport.door_2[GFX_SPECIAL_ARG_EDITOR].y }, + { + "viewport.door_2.EDITOR.width", + &viewport.door_2[GFX_SPECIAL_ARG_EDITOR].width + }, + { + "viewport.door_2.EDITOR.height", + &viewport.door_2[GFX_SPECIAL_ARG_EDITOR].height + }, + { + "viewport.door_2.EDITOR.border_size", + &viewport.door_2[GFX_SPECIAL_ARG_EDITOR].border_size + }, { NULL, NULL diff --git a/src/conftime.h b/src/conftime.h index 314aa87d..24f236ea 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-02-11 01:44" +#define COMPILE_DATE_STRING "2014-02-12 02:10" diff --git a/src/editor.c b/src/editor.c index c6d6ecfa..d939c154 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2587,12 +2587,13 @@ static struct -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 */ + -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, +#endif GD_TYPE_SCROLLBAR_VERTICAL, GADGET_ID_SCROLL_LIST_VERTICAL, "scroll element list vertically" @@ -6052,6 +6053,8 @@ static void CreateScrollbarGadgets() 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; + scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].wheel_width = DXSIZE; + scrollbar_info[ED_SCROLLBAR_ID_LIST_VERTICAL].wheel_height = DYSIZE; for (i = 0; i < ED_NUM_SCROLLBARS; i++) { diff --git a/src/files.c b/src/files.c index fb2e1d3c..f20c2155 100644 --- a/src/files.c +++ b/src/files.c @@ -12351,44 +12351,72 @@ static void LoadMenuDesignSettingsFromFilename(char *filename) /* (eg, init "viewport.door_1.MAIN.xyz" from "viewport.door_1.xyz") */ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) { - char *token_1 = "viewport.playfield.x"; - char *token_2 = "viewport.playfield.y"; - char *token_3 = "viewport.playfield.width"; - char *token_4 = "viewport.playfield.height"; - char *token_5 = "viewport.playfield.border_size"; - char *token_6 = "viewport.door_1.x"; - char *token_7 = "viewport.door_1.y"; - char *token_8 = "viewport.door_2.x"; - char *token_9 = "viewport.door_2.y"; - char *value_1 = getHashEntry(setup_file_hash, token_1); - char *value_2 = getHashEntry(setup_file_hash, token_2); - char *value_3 = getHashEntry(setup_file_hash, token_3); - char *value_4 = getHashEntry(setup_file_hash, token_4); - char *value_5 = getHashEntry(setup_file_hash, token_5); - char *value_6 = getHashEntry(setup_file_hash, token_6); - char *value_7 = getHashEntry(setup_file_hash, token_7); - char *value_8 = getHashEntry(setup_file_hash, token_8); - char *value_9 = getHashEntry(setup_file_hash, token_9); - - if (value_1 != NULL) - viewport.playfield[i].x = get_token_parameter_value(token_1, value_1); - if (value_2 != NULL) - viewport.playfield[i].y = get_token_parameter_value(token_2, value_2); - if (value_3 != NULL) - viewport.playfield[i].width = get_token_parameter_value(token_3, value_3); - if (value_4 != NULL) - viewport.playfield[i].height = get_token_parameter_value(token_4,value_4); - if (value_5 != NULL) - viewport.playfield[i].border_size = get_token_parameter_value(token_5, - value_5); - if (value_6 != NULL) - viewport.door_1[i].x = get_token_parameter_value(token_6, value_6); - if (value_7 != NULL) - viewport.door_1[i].y = get_token_parameter_value(token_7, value_7); - if (value_8 != NULL) - viewport.door_2[i].x = get_token_parameter_value(token_8, value_8); - if (value_9 != NULL) - viewport.door_2[i].y = get_token_parameter_value(token_9, value_9); + char *token_01 = "viewport.playfield.x"; + char *token_02 = "viewport.playfield.y"; + char *token_03 = "viewport.playfield.width"; + char *token_04 = "viewport.playfield.height"; + char *token_05 = "viewport.playfield.border_size"; + char *token_06 = "viewport.door_1.x"; + char *token_07 = "viewport.door_1.y"; + char *token_08 = "viewport.door_1.width"; + char *token_09 = "viewport.door_1.height"; + char *token_10 = "viewport.door_1.border_size"; + char *token_11 = "viewport.door_2.x"; + char *token_12 = "viewport.door_2.y"; + char *token_13 = "viewport.door_2.width"; + char *token_14 = "viewport.door_2.height"; + char *token_15 = "viewport.door_2.border_size"; + 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_04 = getHashEntry(setup_file_hash, token_04); + char *value_05 = getHashEntry(setup_file_hash, token_05); + char *value_06 = getHashEntry(setup_file_hash, token_06); + char *value_07 = getHashEntry(setup_file_hash, token_07); + char *value_08 = getHashEntry(setup_file_hash, token_08); + char *value_09 = getHashEntry(setup_file_hash, token_09); + char *value_10 = getHashEntry(setup_file_hash, token_10); + char *value_11 = getHashEntry(setup_file_hash, token_11); + char *value_12 = getHashEntry(setup_file_hash, token_12); + char *value_13 = getHashEntry(setup_file_hash, token_13); + char *value_14 = getHashEntry(setup_file_hash, token_14); + char *value_15 = getHashEntry(setup_file_hash, token_15); + + if (value_01 != NULL) + viewport.playfield[i].x = get_token_parameter_value(token_01, value_01); + if (value_02 != NULL) + viewport.playfield[i].y = get_token_parameter_value(token_02, value_02); + if (value_03 != NULL) + viewport.playfield[i].width = get_token_parameter_value(token_03, + value_03); + if (value_04 != NULL) + viewport.playfield[i].height = get_token_parameter_value(token_04, + value_04); + if (value_05 != NULL) + viewport.playfield[i].border_size = get_token_parameter_value(token_05, + value_05); + if (value_06 != NULL) + viewport.door_1[i].x = get_token_parameter_value(token_06, value_06); + if (value_07 != NULL) + viewport.door_1[i].y = get_token_parameter_value(token_07, value_07); + if (value_08 != NULL) + viewport.door_1[i].width = get_token_parameter_value(token_08, value_08); + if (value_09 != NULL) + viewport.door_1[i].height = get_token_parameter_value(token_09, value_09); + if (value_10 != NULL) + viewport.door_1[i].border_size = get_token_parameter_value(token_10, + value_10); + if (value_11 != NULL) + viewport.door_2[i].x = get_token_parameter_value(token_11, value_11); + if (value_12 != NULL) + viewport.door_2[i].y = get_token_parameter_value(token_12, value_12); + if (value_13 != NULL) + viewport.door_2[i].width = get_token_parameter_value(token_13, value_13); + if (value_14 != NULL) + viewport.door_2[i].height = get_token_parameter_value(token_14, value_14); + if (value_15 != NULL) + viewport.door_1[i].border_size = get_token_parameter_value(token_15, + value_15); } /* special case: initialize with default values that may be overwritten */ diff --git a/src/libgame/system.c b/src/libgame/system.c index f08c88c7..9ac05663 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -685,6 +685,9 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, int dst_x_unclipped = dst_x; int dst_y_unclipped = dst_y; + if (src_bitmap == NULL || dst_bitmap == NULL) + return; + if (DrawingDeactivated(dst_x, dst_y, width, height)) return; diff --git a/src/main.c b/src/main.c index b3453d8d..dcd5075e 100644 --- a/src/main.c +++ b/src/main.c @@ -96,16 +96,22 @@ int scroll_x, scroll_y; int WIN_XSIZE = 672, WIN_YSIZE = 560; int SCR_FIELDX = 17, SCR_FIELDY = 17; -int SX = 8, SY = 8; int REAL_SX = 6, REAL_SY = 6; +int SX = 8, SY = 8; int DX = 566, DY = 60; int VX = 566, VY = 400; int EX = 566, EY = 356; int dDX, dDY; -int SXSIZE = 17 * TILEX; /* SCR_FIELDX * TILEX */ -int SYSIZE = 17 * TILEY; /* SCR_FIELDY * TILEY */ int FULL_SXSIZE = 2 + 17 * TILEX + 2; /* 2 + SXSIZE + 2 */ int FULL_SYSIZE = 2 + 17 * TILEY + 2; /* 2 + SYSIZE + 2 */ +int SXSIZE = 17 * TILEX; /* SCR_FIELDX * TILEX */ +int SYSIZE = 17 * TILEY; /* SCR_FIELDY * TILEY */ +int DXSIZE = 100; +int DYSIZE = 280; +int VXSIZE = 100; +int VYSIZE = 100; +int EXSIZE = 100; +int EYSIZE = 144; int TILESIZE_VAR = TILESIZE; #if 1 diff --git a/src/main.h b/src/main.h index 17fec5ca..9d37e678 100644 --- a/src/main.h +++ b/src/main.h @@ -1008,12 +1008,16 @@ #define FYSIZE ((SCR_FIELDY + 2) * TILEY) #endif #endif + +#if 0 #define DXSIZE 100 #define DYSIZE 280 #define VXSIZE DXSIZE #define VYSIZE 100 #define EXSIZE DXSIZE #define EYSIZE (VYSIZE + 44) +#endif + #if 0 #define FULL_SXSIZE (2 + SXSIZE + 2) #define FULL_SYSIZE (2 + SYSIZE + 2) @@ -2296,7 +2300,6 @@ struct MenuInfo struct DoorInfo { - int width, height; int step_offset; int step_delay; int anim_mode; @@ -2947,14 +2950,17 @@ extern int scroll_x, scroll_y; extern int WIN_XSIZE, WIN_YSIZE; extern int SCR_FIELDX, SCR_FIELDY; -extern int SX, SY; extern int REAL_SX, REAL_SY; +extern int SX, SY; extern int DX, DY; extern int VX, VY; extern int EX, EY; extern int dDX, dDY; -extern int SXSIZE, SYSIZE; extern int FULL_SXSIZE, FULL_SYSIZE; +extern int SXSIZE, SYSIZE; +extern int DXSIZE, DYSIZE; +extern int VXSIZE, VYSIZE; +extern int EXSIZE, EYSIZE; extern int TILESIZE_VAR; extern int FX, FY; diff --git a/src/screens.c b/src/screens.c index e2f3f27f..4d951f5a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1387,8 +1387,11 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading) #if 1 FadeOut(fade_mask); +#if 0 /* needed if last screen was the editor screen */ UndrawSpecialEditorDoor(); +#endif + #if 0 if (fade_mask == REDRAW_FIELD) BackToFront(); @@ -1400,6 +1403,11 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading) ChangeViewportPropertiesIfNeeded(); #endif +#if 1 + /* needed if last screen was the editor screen */ + UndrawSpecialEditorDoor(); +#endif + #if defined(TARGET_SDL) SetDrawtoField(DRAW_BACKBUFFER); #endif diff --git a/src/tools.c b/src/tools.c index d7b94cb0..71e6486e 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5228,6 +5228,7 @@ unsigned int MoveDoor(unsigned int door_state) unsigned int door_delay_value; int stepsize = 1; +#if 0 if (door_1.width < 0 || door_1.width > DXSIZE) door_1.width = DXSIZE; if (door_1.height < 0 || door_1.height > DYSIZE) @@ -5236,6 +5237,7 @@ unsigned int MoveDoor(unsigned int door_state) door_2.width = VXSIZE; if (door_2.height < 0 || door_2.height > VYSIZE) door_2.height = VYSIZE; +#endif if (door_state == DOOR_GET_STATE) return (door1 | door2); @@ -5290,8 +5292,13 @@ unsigned int MoveDoor(unsigned int door_state) boolean door_2_done = (!handle_door_2); boolean door_1_vertical = (door_1.anim_mode & ANIM_VERTICAL); boolean door_2_vertical = (door_2.anim_mode & ANIM_VERTICAL); +#if 1 + int door_size_1 = (door_1_vertical ? DYSIZE : DXSIZE); + int door_size_2 = (door_2_vertical ? VYSIZE : VXSIZE); +#else int door_size_1 = (door_1_vertical ? door_1.height : door_1.width); int door_size_2 = (door_2_vertical ? door_2.height : door_2.width); +#endif int max_door_size_1 = (door_1_vertical ? DYSIZE : DXSIZE); int max_door_size_2 = (door_2_vertical ? VYSIZE : VXSIZE); int door_size = (handle_door_1 ? door_size_1 : door_size_2); @@ -5511,23 +5518,50 @@ unsigned int MoveDoor(unsigned int door_state) void DrawSpecialEditorDoor() { +#if 1 + struct GraphicInfo *gfx1 = &graphic_info[IMG_DOOR_2_TOP_BORDER_CORRECTION]; + int outer_border = viewport.door_2[GAME_MODE_EDITOR].border_size; + + /* draw bigger toolbox window */ + BlitBitmap(gfx1->bitmap, drawto, + gfx1->src_x, gfx1->src_y, gfx1->width, gfx1->height, + EX - outer_border, EY - outer_border - gfx1->height); + BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, drawto, + EX - outer_border, VY - outer_border, + EXSIZE + 2 * outer_border, EYSIZE - VYSIZE + outer_border, + EX - outer_border, EY - outer_border); +#else /* draw bigger toolbox window */ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, - DOOR_GFX_PAGEX7, 0, EXSIZE + 8, 8, - EX - 4, EY - 12); + DOOR_GFX_PAGEX7, 0, EXSIZE + 8, 8, + EX - 4, EY - 12); BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, drawto, - EX - 6, VY - 4, EXSIZE + 12, EYSIZE - VYSIZE + 4, - EX - 6, EY - 4); + EX - 6, VY - 4, EXSIZE + 12, EYSIZE - VYSIZE + 4, + EX - 6, EY - 4); +#endif redraw_mask |= REDRAW_ALL; } void UndrawSpecialEditorDoor() { +#if 1 + struct GraphicInfo *gfx1 = &graphic_info[IMG_DOOR_2_TOP_BORDER_CORRECTION]; + int outer_border = viewport.door_2[GAME_MODE_EDITOR].border_size; + int top_border = gfx1->height; + + /* draw normal tape recorder window */ + BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, drawto, + EX - outer_border, EY - outer_border - top_border, + EXSIZE + 2 * outer_border, + EYSIZE - VYSIZE + outer_border + top_border, + EX - outer_border, EY - outer_border - top_border); +#else /* draw normal tape recorder window */ BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, drawto, - EX - 6, EY - 12, EXSIZE + 12, EYSIZE - VYSIZE + 12, - EX - 6, EY - 12); + EX - 6, EY - 12, EXSIZE + 12, EYSIZE - VYSIZE + 12, + EX - 6, EY - 12); +#endif redraw_mask |= REDRAW_ALL; } @@ -10040,25 +10074,42 @@ void ToggleFullscreenOrChangeWindowScalingIfNeeded() void ChangeViewportPropertiesIfNeeded() { +#if 0 int *door_1_x = &DX; int *door_1_y = &DY; int *door_2_x = (game_status == GAME_MODE_EDITOR ? &EX : &VX); int *door_2_y = (game_status == GAME_MODE_EDITOR ? &EY : &VY); +#endif int gfx_game_mode = (game_status == GAME_MODE_PLAYING || game_status == GAME_MODE_EDITOR ? game_status : GAME_MODE_MAIN); + int gfx_game_mode2 = (game_status == GAME_MODE_EDITOR ? GAME_MODE_DEFAULT : + game_status); 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_mode]; - int border_size = vp_playfield->border_size; - int new_sx = vp_playfield->x + border_size; - int new_sy = vp_playfield->y + border_size; - int new_sxsize = vp_playfield->width - 2 * border_size; - int new_sysize = vp_playfield->height - 2 * border_size; - int new_real_sx = vp_playfield->x; - int new_real_sy = vp_playfield->y; - int new_full_sxsize = vp_playfield->width; - int new_full_sysize = vp_playfield->height; + struct RectWithBorder *vp_door_2 = &viewport.door_2[gfx_game_mode2]; + struct RectWithBorder *vp_door_3 = &viewport.door_2[GAME_MODE_EDITOR]; + int border_size = vp_playfield->border_size; + int new_sx = vp_playfield->x + border_size; + int new_sy = vp_playfield->y + border_size; + int new_sxsize = vp_playfield->width - 2 * border_size; + int new_sysize = vp_playfield->height - 2 * border_size; + int new_real_sx = vp_playfield->x; + int new_real_sy = vp_playfield->y; + int new_full_sxsize = vp_playfield->width; + int new_full_sysize = vp_playfield->height; + int new_dx = vp_door_1->x; + int new_dy = vp_door_1->y; + int new_dxsize = vp_door_1->width; + int new_dysize = vp_door_1->height; + int new_vx = vp_door_2->x; + int new_vy = vp_door_2->y; + int new_vxsize = vp_door_2->width; + int new_vysize = vp_door_2->height; + int new_ex = vp_door_3->x; + int new_ey = vp_door_3->y; + int new_exsize = vp_door_3->width; + int new_eysize = vp_door_3->height; #if NEW_TILESIZE int new_tilesize_var = TILESIZE / (setup.small_game_graphics ? 2 : 1); int tilesize = (gfx_game_mode == GAME_MODE_PLAYING ? new_tilesize_var : @@ -10132,22 +10183,50 @@ void ChangeViewportPropertiesIfNeeded() if (new_sx != SX || new_sy != SY || + new_dx != DX || + new_dy != DY || + new_vx != VX || + new_vy != VY || + new_ex != EX || + new_ey != EY || new_sxsize != SXSIZE || new_sysize != SYSIZE || + new_dxsize != DXSIZE || + new_dysize != DYSIZE || + new_vxsize != VXSIZE || + new_vysize != VYSIZE || + new_exsize != EXSIZE || + new_eysize != EYSIZE || new_real_sx != REAL_SX || new_real_sy != REAL_SY || new_full_sxsize != FULL_SXSIZE || new_full_sysize != FULL_SYSIZE || - new_tilesize_var != TILESIZE_VAR || + new_tilesize_var != TILESIZE_VAR +#if 0 + || vp_door_1->x != *door_1_x || vp_door_1->y != *door_1_y || vp_door_2->x != *door_2_x || - vp_door_2->y != *door_2_y) + vp_door_2->y != *door_2_y +#endif + ) { SX = new_sx; SY = new_sy; + DX = new_dx; + DY = new_dy; + VX = new_vx; + VY = new_vy; + EX = new_ex; + EY = new_ey; SXSIZE = new_sxsize; SYSIZE = new_sysize; + DXSIZE = new_dxsize; + DYSIZE = new_dysize; + VXSIZE = new_vxsize; + VYSIZE = new_vysize; + EXSIZE = new_exsize; + EYSIZE = new_eysize; REAL_SX = new_real_sx; REAL_SY = new_real_sy; FULL_SXSIZE = new_full_sxsize; @@ -10160,10 +10239,12 @@ void ChangeViewportPropertiesIfNeeded() setup.small_game_graphics); #endif +#if 0 *door_1_x = vp_door_1->x; *door_1_y = vp_door_1->y; *door_2_x = vp_door_2->x; *door_2_y = vp_door_2->y; +#endif #if 1 init_gfx_buffers = TRUE; -- 2.34.1