From: Holger Schemel Date: Tue, 4 Mar 2003 17:25:49 +0000 (+0100) Subject: rnd-20030304-2-src X-Git-Tag: 3.0.0^2~130 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a95264fc39b6eae2473bfd6521c7bf3eef5af804;p=rocksndiamonds.git rnd-20030304-2-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index b20c7784..afa0ffba 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -3092,6 +3092,10 @@ struct ConfigInfo image_config[] = { "global.border", "RocksScreen.pcx" }, { "global.door", "RocksDoor.pcx" }, + { "editor.element_border", "RocksElements.pcx" }, + { "editor.element_border.xpos", "0" }, + { "editor.element_border.ypos", "0" }, + { "background", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, @@ -3132,7 +3136,5 @@ struct ConfigInfo image_config[] = { "global.num_toons", "20" }, - { "menu.main.hide_static_text", "false" }, - { NULL, NULL } }; diff --git a/src/conf_gfx.h b/src/conf_gfx.h index c8a12e1f..09418f34 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -843,20 +843,21 @@ #define IMG_FONT_TAPE_RECORDER 822 #define IMG_GLOBAL_BORDER 823 #define IMG_GLOBAL_DOOR 824 -#define IMG_BACKGROUND 825 -#define IMG_BACKGROUND_MAIN 826 -#define IMG_BACKGROUND_LEVELS 827 -#define IMG_BACKGROUND_SCORES 828 -#define IMG_BACKGROUND_EDITOR 829 -#define IMG_BACKGROUND_INFO 830 -#define IMG_BACKGROUND_SETUP 831 -#define IMG_BACKGROUND_DOOR 832 -#define IMG_INFO_FONT_EM_1 833 -#define IMG_INFO_FONT_EM_2 834 -#define IMG_INFO_FONT_EM_3 835 -#define IMG_INFO_FONT_EM_4 836 -#define IMG_INFO_FONT_EM_5 837 +#define IMG_EDITOR_ELEMENT_BORDER 825 +#define IMG_BACKGROUND 826 +#define IMG_BACKGROUND_MAIN 827 +#define IMG_BACKGROUND_LEVELS 828 +#define IMG_BACKGROUND_SCORES 829 +#define IMG_BACKGROUND_EDITOR 830 +#define IMG_BACKGROUND_INFO 831 +#define IMG_BACKGROUND_SETUP 832 +#define IMG_BACKGROUND_DOOR 833 +#define IMG_INFO_FONT_EM_1 834 +#define IMG_INFO_FONT_EM_2 835 +#define IMG_INFO_FONT_EM_3 836 +#define IMG_INFO_FONT_EM_4 837 +#define IMG_INFO_FONT_EM_5 838 -#define NUM_IMAGE_FILES 838 +#define NUM_IMAGE_FILES 839 #endif /* CONF_GFX_H */ diff --git a/src/conftime.h b/src/conftime.h index fab0507b..d0b39e1b 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-03-04 02:56]" +#define COMPILE_DATE_STRING "[2003-03-04 17:59]" diff --git a/src/editor.c b/src/editor.c index 42926f06..075bed04 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2791,7 +2791,7 @@ static void DrawDrawingWindow() static void DrawElementBorder(int dest_x, int dest_y, int width, int height) { - int border_graphic = IMG_SAND; + int border_graphic = IMG_EDITOR_ELEMENT_BORDER; Bitmap *src_bitmap; int src_x, src_y; int num_mini_tilex = width / MINI_TILEX + 1; diff --git a/src/files.c b/src/files.c index a0e20357..0c2a98d1 100644 --- a/src/files.c +++ b/src/files.c @@ -1702,16 +1702,11 @@ void LoadSpecialMenuDesignSettings() char *value; /* !!! CHANGE THIS !!! (redundant initialization) !!! */ - gfx.menu_main_hide_static_text = FALSE; global.num_toons = 20; if ((setup_file_list = loadSetupFileList(filename)) == NULL) return; - value = getTokenValue(setup_file_list, "menu.main.hide_static_text"); - if (value != NULL) - gfx.menu_main_hide_static_text = get_boolean_from_string(value); - value = getTokenValue(setup_file_list, "global.num_toons"); if (value != NULL) global.num_toons = get_integer_from_string(value); diff --git a/src/game.c b/src/game.c index c95f398b..6a62ab77 100644 --- a/src/game.c +++ b/src/game.c @@ -3724,6 +3724,7 @@ void AmoebeAbleger(int ax, int ay) { int i; int element = Feld[ax][ay]; + int graphic = el2img(element); int newax = ax, neway = ay; static int xy[4][2] = { @@ -3740,6 +3741,9 @@ void AmoebeAbleger(int ax, int ay) return; } + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(ax, ay, graphic); + if (!MovDelay[ax][ay]) /* start making new amoeba field */ MovDelay[ax][ay] = RND(FRAMES_PER_SECOND * 25 / (1 + level.amoeba_speed)); @@ -3871,8 +3875,12 @@ void Life(int ax, int ay) static int life[4] = { 2, 3, 3, 3 }; /* parameters for "game of life" */ int life_time = 40; int element = Feld[ax][ay]; + int graphic = el2img(element); boolean changed = FALSE; + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(ax, ay, graphic); + if (Stop[ax][ay]) return; @@ -3969,7 +3977,15 @@ void CheckExit(int x, int y) if (local_player->gems_still_needed > 0 || local_player->sokobanfields_still_needed > 0 || local_player->lights_still_needed > 0) + { + int element = Feld[x][y]; + int graphic = el2img(element); + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + return; + } Feld[x][y] = EL_EXIT_OPENING; @@ -3979,7 +3995,15 @@ void CheckExit(int x, int y) void CheckExitSP(int x, int y) { if (local_player->gems_still_needed > 0) + { + int element = Feld[x][y]; + int graphic = el2img(element); + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + return; + } Feld[x][y] = EL_SP_EXIT_OPEN; @@ -4100,12 +4124,16 @@ void MauerWaechst(int x, int y) void MauerAbleger(int ax, int ay) { int element = Feld[ax][ay]; + int graphic = el2img(element); boolean oben_frei = FALSE, unten_frei = FALSE; boolean links_frei = FALSE, rechts_frei = FALSE; boolean oben_massiv = FALSE, unten_massiv = FALSE; boolean links_massiv = FALSE, rechts_massiv = FALSE; boolean new_wall = FALSE; + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(ax, ay, graphic); + if (!MovDelay[ax][ay]) /* start building new wall */ MovDelay[ax][ay] = 6; @@ -4529,10 +4557,8 @@ void GameActions() element = Feld[x][y]; graphic = el2img(element); -#if 1 if (graphic_info[graphic].anim_global_sync) GfxFrame[x][y] = FrameCounter; -#endif if (ANIM_MODE(graphic) == ANIM_RANDOM && IS_NEXT_FRAME(GfxFrame[x][y], graphic)) @@ -4542,11 +4568,8 @@ void GameActions() if (IS_INACTIVE(element)) { - -#if 1 if (IS_ANIMATED(graphic)) DrawLevelGraphicAnimationIfNeeded(x, y, graphic); -#endif continue; } @@ -4563,8 +4586,6 @@ void GameActions() if (IS_GEM(element) || element == EL_SP_INFOTRON) EdelsteinFunkeln(x, y); } - -#if 1 else if ((element == EL_ACID || element == EL_EXIT_OPEN || element == EL_SP_EXIT_OPEN || @@ -4575,8 +4596,6 @@ void GameActions() element == EL_SHIELD_DEADLY) && IS_ANIMATED(graphic)) DrawLevelGraphicAnimationIfNeeded(x, y, graphic); -#endif - else if (IS_MOVING(x, y)) ContinueMoving(x, y); else if (IS_ACTIVE_BOMB(element)) @@ -4589,39 +4608,16 @@ void GameActions() AmoebeWaechst(x, y); else if (element == EL_AMOEBA_SHRINKING) AmoebaDisappearing(x, y); - #if !USE_NEW_AMOEBA_CODE else if (IS_AMOEBALIVE(element)) AmoebeAbleger(x, y); #endif - else if (element == EL_GAMEOFLIFE || element == EL_BIOMAZE) Life(x, y); -#if 0 - else if (element == EL_ROBOT_WHEEL_ACTIVE) - RobotWheel(x, y); - else if (element == EL_TIMEGATE_SWITCH_ACTIVE) - TimegateWheel(x, y); -#endif -#if 0 - else if (element == EL_ACID_SPLASH_LEFT || - element == EL_ACID_SPLASH_RIGHT) - SplashAcid(x, y); -#endif -#if 0 - else if (element == EL_NUT_CRACKING) - NussKnacken(x, y); - else if (element == EL_PEARL_BREAKING) - BreakingPearl(x, y); -#endif else if (element == EL_EXIT_CLOSED) CheckExit(x, y); else if (element == EL_SP_EXIT_CLOSED) CheckExitSP(x, y); -#if 0 - else if (element == EL_EXIT_OPENING) - AusgangstuerOeffnen(x, y); -#endif else if (element == EL_WALL_GROWING_ACTIVE) MauerWaechst(x, y); else if (element == EL_WALL_GROWING || @@ -4631,35 +4627,12 @@ void GameActions() MauerAbleger(x, y); else if (element == EL_FLAMES) CheckForDragon(x, y); -#if 0 - else if (element == EL_SP_BUGGY_BASE || - element == EL_SP_BUGGY_BASE_ACTIVATING || - element == EL_SP_BUGGY_BASE_ACTIVE) - CheckBuggyBase(x, y); - else if (element == EL_TRAP || - element == EL_TRAP_ACTIVE) - CheckTrap(x, y); - else if (IS_BELT_ACTIVE(element)) - DrawBeltAnimation(x, y, element); - else if (element == EL_SWITCHGATE_OPENING) - OpenSwitchgate(x, y); - else if (element == EL_SWITCHGATE_CLOSING) - CloseSwitchgate(x, y); - else if (element == EL_TIMEGATE_OPENING) - OpenTimegate(x, y); - else if (element == EL_TIMEGATE_CLOSING) - CloseTimegate(x, y); -#endif - else if (IS_AUTO_CHANGING(element)) ChangeElement(x, y); - -#if 1 else if (element == EL_EXPLOSION) ; /* drawing of correct explosion animation is handled separately */ else if (IS_ANIMATED(graphic)) DrawLevelGraphicAnimationIfNeeded(x, y, graphic); -#endif if (IS_BELT_ACTIVE(element)) PlaySoundLevelAction(x, y, ACTION_ACTIVE); diff --git a/src/init.c b/src/init.c index b24944ee..5f05b082 100644 --- a/src/init.c +++ b/src/init.c @@ -176,7 +176,6 @@ static void InitArtworkConfig() { "name", "sort_priority", - "menu.main.hide_static_text", "global.num_toons", NULL }; diff --git a/src/libgame/image.c b/src/libgame/image.c index a1cc3865..c841ffed 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -837,7 +837,7 @@ void InitImageList(struct ConfigInfo *config_list, int num_file_list_entries, image_info->num_dynamic_file_list_entries = 0; image_info->file_list = - getFileListFromConfigList(config_list, config_suffix_list, + getFileListFromConfigList(config_list, config_suffix_list, ignore_tokens, num_file_list_entries); image_info->dynamic_file_list = NULL; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index b6ec4fda..2bc5444c 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1591,6 +1591,7 @@ static void FreeCustomArtworkList(struct ArtworkListInfo *, struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, struct ConfigInfo *suffix_list, + char **ignore_tokens, int num_file_list_entries) { struct FileInfo *file_list; @@ -1651,9 +1652,9 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, } /* the following tokens are no file definitions, but other config tokens */ - if (strcmp(config_list[i].token, "global.num_toons") == 0 || - strcmp(config_list[i].token, "menu.main.hide_static_text") == 0) - is_file_entry = FALSE; + for (j=0; ignore_tokens[j] != NULL; j++) + if (strcmp(config_list[i].token, ignore_tokens[j]) == 0) + is_file_entry = FALSE; if (is_file_entry) { diff --git a/src/libgame/misc.h b/src/libgame/misc.h index a93b2baa..18565c72 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -140,7 +140,7 @@ boolean FileIsArtworkType(char *, int); int get_parameter_value(char *, char *, int); struct FileInfo *getFileListFromConfigList(struct ConfigInfo *, - struct ConfigInfo *, int); + struct ConfigInfo *, char **, int); void LoadArtworkConfig(struct ArtworkListInfo *); void ReloadCustomArtworkList(struct ArtworkListInfo *); void FreeCustomArtworkLists(struct ArtworkListInfo *); diff --git a/src/libgame/sound.c b/src/libgame/sound.c index d5bd45b4..7ded74fb 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -1834,7 +1834,7 @@ void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries, sound_info->num_dynamic_file_list_entries = 0; sound_info->file_list = - getFileListFromConfigList(config_list, config_suffix_list, + getFileListFromConfigList(config_list, config_suffix_list, ignore_tokens, num_file_list_entries); sound_info->dynamic_file_list = NULL; diff --git a/src/libgame/system.h b/src/libgame/system.h index 672a9d1d..9b914a8a 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -331,8 +331,6 @@ struct GfxInfo Bitmap *background_bitmap; int background_bitmap_mask; - boolean menu_main_hide_static_text; - int num_fonts; struct FontBitmapInfo *font_bitmap_info; int (*select_font_function)(int); diff --git a/src/screens.c b/src/screens.c index cc5ecf0b..88f69875 100644 --- a/src/screens.c +++ b/src/screens.c @@ -129,14 +129,6 @@ static void PlaySound_Menu_Continue(int sound) PlaySoundLoop(sound); } -void DrawTextStatic(int x, int y, char *text, int font_nr) -{ - if (game_status == MAINMENU && gfx.menu_main_hide_static_text) - return; - - DrawText(x, y, text, font_nr); -} - void DrawHeadline() { int font1_xsize = getFontWidth(FONT_TITLE_1); @@ -144,8 +136,8 @@ void DrawHeadline() int x1 = SX + (SXSIZE - strlen(PROGRAM_TITLE_STRING) * font1_xsize) / 2; int x2 = SX + (SXSIZE - strlen(WINDOW_SUBTITLE_STRING) * font2_xsize) / 2; - DrawTextStatic(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1); - DrawTextStatic(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT_TITLE_2); + DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1); + DrawText(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT_TITLE_2); } static void ToggleFullscreenIfNeeded() @@ -233,16 +225,16 @@ void DrawMainMenu() DrawHeadline(); - DrawTextStatic(SX + 32, SY + 2*32, name_text, FONT_MENU_1); + DrawText(SX + 32, SY + 2*32, name_text, FONT_MENU_1); DrawText(SX + 32 + name_width, SY + 2*32, setup.player_name, FONT_INPUT); - DrawTextStatic(SX + 32, SY + 3*32, "Level:", FONT_MENU_1); + DrawText(SX + 32, SY + 3*32, "Level:", FONT_MENU_1); DrawText(SX + 11 * 32, SY + 3*32, int2str(level_nr,3), FONT_VALUE_1); - DrawTextStatic(SX + 32, SY + 4*32, "Hall Of Fame", FONT_MENU_1); - DrawTextStatic(SX + 32, SY + 5*32, "Level Creator", FONT_MENU_1); - DrawTextStatic(SY + 32, SY + 6*32, "Info Screen", FONT_MENU_1); - DrawTextStatic(SX + 32, SY + 7*32, "Start Game", FONT_MENU_1); - DrawTextStatic(SX + 32, SY + 8*32, "Setup", FONT_MENU_1); - DrawTextStatic(SX + 32, SY + 9*32, "Quit", FONT_MENU_1); + DrawText(SX + 32, SY + 4*32, "Hall Of Fame", FONT_MENU_1); + DrawText(SX + 32, SY + 5*32, "Level Creator", FONT_MENU_1); + DrawText(SY + 32, SY + 6*32, "Info Screen", FONT_MENU_1); + DrawText(SX + 32, SY + 7*32, "Start Game", FONT_MENU_1); + DrawText(SX + 32, SY + 8*32, "Setup", FONT_MENU_1); + DrawText(SX + 32, SY + 9*32, "Quit", FONT_MENU_1); DrawMicroLevel(MICROLEV_XPOS, MICROLEV_YPOS, TRUE); @@ -267,8 +259,7 @@ void DrawMainMenu() drawCursorXY(14, 1, IMG_MENU_BUTTON_RIGHT); #endif - DrawTextStatic(SX + 56, SY + 326, "A Game by Artsoft Entertainment", - FONT_TEXT_3); + DrawText(SX + 56, SY + 326, "A Game by Artsoft Entertainment", FONT_TITLE_2); FadeToFront(); InitAnimation(); @@ -1197,8 +1188,9 @@ void HandleHelpScreen(int button) else { FadeSounds(); - DrawMainMenu(); + game_status = MAINMENU; + DrawMainMenu(); } } else