From b461a474a18f36ff4bd5f1805ea01de11dd5a5fc Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 7 Jan 2003 02:41:48 +0100 Subject: [PATCH] rnd-20030107-1-src --- src/conf_gfx.c | 7 +++++++ src/conf_gfx.h | 19 +++++++++++++------ src/conftime.h | 2 +- src/editor.c | 6 +++--- src/init.c | 6 ++---- src/libgame/system.c | 3 +-- src/libgame/text.c | 5 ++--- src/main.h | 1 + src/screens.c | 13 ++++++++++++- src/tools.c | 23 ++++++++++++++++++----- src/tools.h | 2 ++ 11 files changed, 62 insertions(+), 25 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 43d45e48..fbfeae93 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -2595,6 +2595,13 @@ struct ConfigInfo image_config[] = { "background.default", UNDEFINED_FILENAME }, { "background.door", UNDEFINED_FILENAME }, + { "background.main", UNDEFINED_FILENAME }, + { "background.level_series", UNDEFINED_FILENAME }, + { "background.hall_of_fame", UNDEFINED_FILENAME }, + { "background.editor_settings_level", UNDEFINED_FILENAME }, + { "background.editor_settings_element", UNDEFINED_FILENAME }, + { "background.info", UNDEFINED_FILENAME }, + { "background.setup", UNDEFINED_FILENAME }, { "info.font_em_1", "RocksFontEM.pcx" }, { "info.font_em_1.xpos", "0" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 52668704..e439c05e 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -763,12 +763,19 @@ #define IMG_FONT_EM 742 #define IMG_BACKGROUND_DEFAULT 743 #define IMG_BACKGROUND_DOOR 744 -#define IMG_INFO_FONT_EM_1 745 -#define IMG_INFO_FONT_EM_2 746 -#define IMG_INFO_FONT_EM_3 747 -#define IMG_INFO_FONT_EM_4 748 -#define IMG_INFO_FONT_EM_5 749 +#define IMG_BACKGROUND_MAIN 745 +#define IMG_BACKGROUND_LEVEL_SERIES 746 +#define IMG_BACKGROUND_HALL_OF_FAME 747 +#define IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL 748 +#define IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT 749 +#define IMG_BACKGROUND_INFO 750 +#define IMG_BACKGROUND_SETUP 751 +#define IMG_INFO_FONT_EM_1 752 +#define IMG_INFO_FONT_EM_2 753 +#define IMG_INFO_FONT_EM_3 754 +#define IMG_INFO_FONT_EM_4 755 +#define IMG_INFO_FONT_EM_5 756 -#define NUM_IMAGE_FILES 750 +#define NUM_IMAGE_FILES 757 #endif /* CONF_GFX_H */ diff --git a/src/conftime.h b/src/conftime.h index 1aa23861..d8042ce7 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-01-06 03:26]" +#define COMPILE_DATE_STRING "[2003-01-07 02:39]" diff --git a/src/editor.c b/src/editor.c index cd81ccbd..3682bbd0 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2650,7 +2650,7 @@ static void PickDrawingElement(int button, int element) static void DrawDrawingWindow() { - SetMainBackgroundBitmap(NULL); + SetMainBackgroundImage(IMG_NONE); ClearWindow(); UnmapLevelEditorWindowGadgets(); @@ -2710,7 +2710,7 @@ static void DrawLevelInfoWindow() int font_color = FC_GREEN; int i, x, y; - SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + SetMainBackgroundImage(IMG_BACKGROUND_EDITOR_SETTINGS_LEVEL); ClearWindow(); UnmapLevelEditorWindowGadgets(); @@ -2943,7 +2943,7 @@ static void DrawPropertiesWindow() { -1, NULL, NULL } }; - SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + SetMainBackgroundImage(IMG_BACKGROUND_EDITOR_SETTINGS_ELEMENT); ClearWindow(); UnmapLevelEditorWindowGadgets(); diff --git a/src/init.c b/src/init.c index a10e8e6b..f497ec24 100644 --- a/src/init.c +++ b/src/init.c @@ -220,10 +220,8 @@ static void ReinitializeGraphics() new_graphic_info[IMG_FONT_SMALL].bitmap, new_graphic_info[IMG_FONT_EM].bitmap); - SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); - SetDoorBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DOOR].bitmap ? - new_graphic_info[IMG_BACKGROUND_DOOR].bitmap : - new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + SetMainBackgroundImage(IMG_BACKGROUND_DEFAULT); + SetDoorBackgroundImage(IMG_BACKGROUND_DOOR); InitGadgets(); InitToons(); diff --git a/src/libgame/system.c b/src/libgame/system.c index ff7d8e54..3c4613fb 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -510,8 +510,7 @@ inline void ClearRectangleOnBackground(Bitmap *bitmap, int x, int y, int width, int height) { if (DrawingOnBackground(x, y)) - BlitBitmap(gfx.background_bitmap, bitmap, - x - gfx.real_sx, y - gfx.real_sy, width, height, x, y); + BlitBitmap(gfx.background_bitmap, bitmap, x, y, width, height, x, y); else ClearRectangle(bitmap, x, y, width, height); } diff --git a/src/libgame/text.c b/src/libgame/text.c index 5328f18b..48974eb7 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -292,9 +292,8 @@ void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text, else if (mask_mode == FONT_MASKED) { /* clear font character background */ - BlitBitmap(gfx.background_bitmap, bitmap, - dest_x - gfx.real_sx, dest_y - gfx.real_sy, - font_width, font_height, dest_x, dest_y); + ClearRectangleOnBackground(bitmap, dest_x, dest_y, + font_width, font_height); #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) /* use special font tile clipmasks, if available */ diff --git a/src/main.h b/src/main.h index 513faf15..ca6c12f2 100644 --- a/src/main.h +++ b/src/main.h @@ -30,6 +30,7 @@ #include "conf_gfx.h" #include "conf_snd.h" +#define IMG_NONE (-1) #define IMG_EMPTY IMG_EMPTY_SPACE #define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE #define IMG_CHAR_START IMG_CHAR_SPACE diff --git a/src/screens.c b/src/screens.c index 6b827227..e86a4f12 100644 --- a/src/screens.c +++ b/src/screens.c @@ -201,7 +201,7 @@ void DrawMainMenu() GetPlayerConfig(); LoadLevel(level_nr); - SetMainBackgroundBitmap(new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); + SetMainBackgroundImage(IMG_BACKGROUND_MAIN); ClearWindow(); DrawHeadline(); @@ -1008,6 +1008,7 @@ void DrawHelpScreenElText(int start) int xstart = SX + 56, ystart = SY + 65 + 2 * 32, ystep = TILEY + 4; int ybottom = SYSIZE - 20; + SetMainBackgroundImage(IMG_BACKGROUND_INFO); ClearWindow(); DrawHeadline(); @@ -1131,6 +1132,7 @@ void DrawHelpScreen() helpscreen_step[i] = helpscreen_frame[i] = 0; helpscreen_musicpos = 0; helpscreen_state = 0; + DrawHelpScreenElText(0); DrawHelpScreenElAction(0); @@ -1262,6 +1264,7 @@ static void DrawChooseTree(TreeInfo **ti_ptr) CloseDoor(DOOR_CLOSE_2); ClearWindow(); + HandleChooseTree(0,0, 0,0, MB_MENU_INITIALIZE, ti_ptr); MapChooseTreeGadgets(*ti_ptr); @@ -1576,6 +1579,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, void DrawChooseLevel() { + SetMainBackgroundImage(IMG_BACKGROUND_LEVEL_SERIES); + DrawChooseTree(&leveldir_current); } @@ -1603,7 +1608,9 @@ static void drawHallOfFameList(int first_entry, int highlight_position) { int i; + SetMainBackgroundImage(IMG_BACKGROUND_HALL_OF_FAME); ClearWindow(); + DrawText(SX + 80, SY + 8, "Hall Of Fame", FS_BIG, FC_YELLOW); DrawTextFCentered(46, FC_RED, "HighScores of Level %d", level_nr); @@ -2008,6 +2015,7 @@ static void DrawSetupScreen_Generic() UnmapAllGadgets(); CloseDoor(DOOR_CLOSE_2); + ClearWindow(); if (setup_mode == SETUP_MODE_MAIN) @@ -2184,6 +2192,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) void DrawSetupScreen_Input() { ClearWindow(); + DrawText(SX+16, SY+16, "Setup Input", FS_BIG, FC_YELLOW); initCursor(0, IMG_BALL_BLUE); @@ -2753,6 +2762,8 @@ void DrawSetupScreen() { DeactivateJoystick(); + SetMainBackgroundImage(IMG_BACKGROUND_SETUP); + if (setup_mode == SETUP_MODE_INPUT) DrawSetupScreen_Input(); else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS) diff --git a/src/tools.c b/src/tools.c index 2f3ce540..16cb3984 100644 --- a/src/tools.c +++ b/src/tools.c @@ -362,13 +362,25 @@ void FadeToFront() BackToFront(); } +void SetMainBackgroundImage(int graphic) +{ + SetMainBackgroundBitmap(graphic == IMG_NONE ? NULL : + new_graphic_info[graphic].bitmap ? + new_graphic_info[graphic].bitmap : + new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); +} + +void SetDoorBackgroundImage(int graphic) +{ + SetDoorBackgroundBitmap(graphic == IMG_NONE ? NULL : + new_graphic_info[graphic].bitmap ? + new_graphic_info[graphic].bitmap : + new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap); +} + void DrawBackground(int dest_x, int dest_y, int width, int height) { - if (DrawingOnBackground(dest_x, dest_y) && game_status != PLAYING) - BlitBitmap(gfx.background_bitmap, backbuffer, dest_x, dest_y, - width, height, dest_x, dest_y); - else - ClearRectangle(backbuffer, dest_x, dest_y, width, height); + ClearRectangleOnBackground(backbuffer, dest_x, dest_y, width, height); redraw_mask |= REDRAW_FIELD; } @@ -1754,6 +1766,7 @@ void DrawLevel() { int x,y; + SetDrawBackgroundMask(REDRAW_NONE); ClearWindow(); for(x=BX1; x<=BX2; x++) diff --git a/src/tools.h b/src/tools.h index b6931dae..7b328f21 100644 --- a/src/tools.h +++ b/src/tools.h @@ -63,6 +63,8 @@ void RedrawPlayfield(boolean, int, int, int, int); void BackToFront(); void FadeToFront(); void ClearWindow(); +void SetMainBackgroundImage(int); +void SetDoorBackgroundImage(int); void DrawBackground(int, int, int, int); void MarkTileDirty(int, int); -- 2.34.1