From: Holger Schemel Date: Wed, 18 Apr 2007 17:53:09 +0000 (+0200) Subject: rnd-20070418-1-src X-Git-Tag: 3.2.4^2~31 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b33f14a8bdad5e3c9547c37b3854025daba761c7;p=rocksndiamonds.git rnd-20070418-1-src * fixed small problem with separate fading definition for game screen --- diff --git a/ChangeLog b/ChangeLog index d817ef0d..247a18ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-04-18 + * fixed small problem with separate fading definition for game screen + 2007-04-14 * added additional configuration directives for setup screen draw offset menu.draw_xoffset.SETUP[XXX] and menu.draw_yoffset.SETUP[XXX] with XXX diff --git a/src/conftime.h b/src/conftime.h index 02130fc3..d28cca62 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-04-15 00:14" +#define COMPILE_DATE_STRING "2007-04-18 19:50" diff --git a/src/game.c b/src/game.c index b18cfda3..1079966e 100644 --- a/src/game.c +++ b/src/game.c @@ -4124,8 +4124,10 @@ void InitGame() local_player->jy - MIDPOSY); } +#if 0 /* do not use PLAYING mask for fading out from main screen */ game_status = GAME_MODE_MAIN; +#endif StopAnimation(); @@ -4151,7 +4153,9 @@ void InitGame() FadeOut(REDRAW_FIELD); #endif +#if 0 game_status = GAME_MODE_PLAYING; +#endif /* !!! FIX THIS (START) !!! */ if (level.game_engine_type == GAME_ENGINE_TYPE_EM) diff --git a/src/init.c b/src/init.c index d9f258ee..d1316588 100644 --- a/src/init.c +++ b/src/init.c @@ -4460,6 +4460,10 @@ static void InitGlobal() global.frames_per_second = 0; global.fps_slowdown = FALSE; global.fps_slowdown_factor = 1; + + global.border_status = GAME_MODE_MAIN; + global.fading_status = GAME_MODE_MAIN; + global.fading_type = TYPE_ENTER_MENU; } void Execute_Command(char *command) diff --git a/src/main.h b/src/main.h index 700d7e6a..23d1b49e 100644 --- a/src/main.h +++ b/src/main.h @@ -2334,6 +2334,11 @@ struct GlobalInfo float frames_per_second; boolean fps_slowdown; int fps_slowdown_factor; + + /* global values for fading screens and masking borders */ + int border_status; + int fading_status; + int fading_type; }; struct ElementChangeInfo diff --git a/src/screens.c b/src/screens.c index 4a0110fb..4289203c 100644 --- a/src/screens.c +++ b/src/screens.c @@ -6065,6 +6065,21 @@ void HandleGameActions() AutoPlayTape(); /* continue automatically playing next tape */ } +#if 0 +void ChangeGameStatus(int new_game_status) +{ + /* for fading out last screen, use the last game status */ + global.border_status = game_status; + global.fading_status = game_status; + + /* ... */ + + /* for fading in next screen, use the new game status */ + global.border_status = new_game_status; + global.fading_status = new_game_status; +} +#endif + /* ---------- new screen button stuff -------------------------------------- */ diff --git a/src/tools.c b/src/tools.c index 3ec8d328..2ae872b4 100644 --- a/src/tools.c +++ b/src/tools.c @@ -205,16 +205,16 @@ void DrawMaskedBorder_Rect(int x, int y, int width, int height) void DrawMaskedBorder_FIELD() { - if (game_status >= GAME_MODE_TITLE && - game_status <= GAME_MODE_PLAYING && - border.draw_masked[game_status]) + if (global.border_status >= GAME_MODE_TITLE && + global.border_status <= GAME_MODE_PLAYING && + border.draw_masked[global.border_status]) DrawMaskedBorder_Rect(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); } void DrawMaskedBorder_DOOR_1() { if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] && - (game_status != GAME_MODE_EDITOR || + (global.border_status != GAME_MODE_EDITOR || border.draw_masked[GFX_SPECIAL_ARG_EDITOR])) DrawMaskedBorder_Rect(DX, DY, DXSIZE, DYSIZE); } @@ -222,7 +222,7 @@ void DrawMaskedBorder_DOOR_1() void DrawMaskedBorder_DOOR_2() { if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] && - game_status != GAME_MODE_EDITOR) + global.border_status != GAME_MODE_EDITOR) DrawMaskedBorder_Rect(VX, VY, VXSIZE, VYSIZE); } @@ -620,6 +620,29 @@ void FadeExt(int fade_mask, int fade_mode) void FadeIn(int fade_mask) { + global.border_status = game_status; + +#if 0 + global.fading_status = game_status; + + if (global.fading_type == TYPE_ENTER_MENU) + fading = menu.enter_menu; + else if (global.fading_type == TYPE_LEAVE_MENU) + fading = menu.leave_menu; + else if (global.fading_type == TYPE_ENTER_SCREEN) + fading = menu.enter_screen[global.fading_status]; + else if (global.fading_type == TYPE_LEAVE_SCREEN) + fading = menu.leave_screen[global.fading_status]; + + printf("::: FadeIn: %s [0x%08x] [%d]\n", + global.fading_type == TYPE_ENTER_MENU ? "enter_menu" : + global.fading_type == TYPE_LEAVE_MENU ? "leave_menu" : + global.fading_type == TYPE_ENTER_SCREEN ? "enter_screen" : + global.fading_type == TYPE_LEAVE_SCREEN ? "leave_screen" : "(?)", + global.fading_type, + global.fading_status); +#endif + #if 1 // printf("::: now fading in...\n"); @@ -641,6 +664,25 @@ void FadeIn(int fade_mask) void FadeOut(int fade_mask) { +#if 0 + if (global.fading_type == TYPE_ENTER_MENU) + fading = menu.enter_menu; + else if (global.fading_type == TYPE_LEAVE_MENU) + fading = menu.leave_menu; + else if (global.fading_type == TYPE_ENTER_SCREEN) + fading = menu.enter_screen[global.fading_status]; + else if (global.fading_type == TYPE_LEAVE_SCREEN) + fading = menu.leave_screen[global.fading_status]; + + printf("::: FadeOut: %s [0x%08x] [%d]\n", + global.fading_type == TYPE_ENTER_MENU ? "enter_menu" : + global.fading_type == TYPE_LEAVE_MENU ? "leave_menu" : + global.fading_type == TYPE_ENTER_SCREEN ? "enter_screen" : + global.fading_type == TYPE_LEAVE_SCREEN ? "leave_screen" : "(?)", + global.fading_type, + global.fading_status); +#endif + #if 1 // printf("::: fading.fade_mode == %d\n", fading.fade_mode); @@ -670,6 +712,32 @@ void FadeCrossSaveBackbuffer() BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); } +#if 0 +void FadeSetEnterMenu() +{ + global.fading_type = TYPE_ENTER_MENU; +} + +void FadeSetLeaveMenu() +{ + global.fading_type = TYPE_LEAVE_MENU; +} + +void FadeSetEnterScreen() +{ + global.fading_type = TYPE_ENTER_SCREEN; +} + +void FadeSetLeaveScreen() +{ + // global.fading_type = TYPE_LEAVE_SCREEN; + + global.fading_type = (global.fading_type == TYPE_ENTER_SCREEN ? + TYPE_LEAVE_SCREEN : TYPE_LEAVE_MENU); +} + +#else + static void FadeSetLeaveNext(struct TitleFadingInfo fading_leave, boolean set) { static struct TitleFadingInfo fading_leave_stored; @@ -684,6 +752,10 @@ void FadeSetEnterMenu() { fading = menu.enter_menu; +#if 0 + printf("::: storing enter_menu\n"); +#endif + FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */ } @@ -691,6 +763,10 @@ void FadeSetLeaveMenu() { fading = menu.leave_menu; +#if 0 + printf("::: storing leave_menu\n"); +#endif + FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */ } @@ -698,14 +774,32 @@ void FadeSetEnterScreen() { fading = menu.enter_screen[game_status]; +#if 0 + printf("::: storing leave_screen[%d]\n", game_status); +#endif + +#if 0 + printf("::: - %d, %d / %d, %d\n", + menu.enter_screen[game_status].fade_mode, + menu.enter_screen[game_status].fade_delay, + menu.leave_screen[game_status].fade_mode, + menu.leave_screen[game_status].fade_delay); +#endif + FadeSetLeaveNext(menu.leave_screen[game_status], TRUE); /* store */ } void FadeSetLeaveScreen() { +#if 0 + printf("::: recalling last stored value\n"); +#endif + FadeSetLeaveNext(menu.leave_screen[game_status], FALSE); /* recall */ } +#endif + void FadeSetFromType(int type) { if (type & TYPE_ENTER_SCREEN)