From: Holger Schemel Date: Sun, 29 Oct 2006 19:26:55 +0000 (+0100) Subject: rnd-20061029-1-src X-Git-Tag: 3.2.3^2~19 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=44daf525cec5664a3de0ce6e7516cd6c0081cf5b;p=rocksndiamonds.git rnd-20061029-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 4490d2ae..d52d0e34 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-10-28 22:48]" +#define COMPILE_DATE_STRING "[2006-10-29 20:25]" diff --git a/src/game.c b/src/game.c index f0875a7a..61d5d6b2 100644 --- a/src/game.c +++ b/src/game.c @@ -2734,35 +2734,38 @@ void GameWon() DrawGameValue_Score(score); } - if (ExitX >= 0 && ExitY >= 0) /* local player has left the level */ + if (level.game_engine_type == GAME_ENGINE_TYPE_RND) { - /* close exit door after last player */ - if (AllPlayersGone && - (Feld[ExitX][ExitY] == EL_EXIT_OPEN || - Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN)) + if (ExitX >= 0 && ExitY >= 0) /* local player has left the level */ { - int element = Feld[ExitX][ExitY]; - - Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING : - EL_SP_EXIT_CLOSING); + /* close exit door after last player */ + if (AllPlayersGone && + (Feld[ExitX][ExitY] == EL_EXIT_OPEN || + Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN)) + { + int element = Feld[ExitX][ExitY]; - PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING); - } + Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING : + EL_SP_EXIT_CLOSING); - /* player disappears */ - DrawLevelField(ExitX, ExitY); - } + PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING); + } - for (i = 0; i < MAX_PLAYERS; i++) - { - struct PlayerInfo *player = &stored_player[i]; + /* player disappears */ + DrawLevelField(ExitX, ExitY); + } - if (player->present) + for (i = 0; i < MAX_PLAYERS; i++) { - RemovePlayer(player); + struct PlayerInfo *player = &stored_player[i]; - /* player disappears */ - DrawLevelField(player->jx, player->jy); + if (player->present) + { + RemovePlayer(player); + + /* player disappears */ + DrawLevelField(player->jx, player->jy); + } } } diff --git a/src/init.c b/src/init.c index ee3a1552..aabc7026 100644 --- a/src/init.c +++ b/src/init.c @@ -4572,7 +4572,11 @@ void InitGfx() font_height = getFontHeight(FC_RED); +#if 1 + DrawInitText(getWindowTitleString(), 20, FC_YELLOW); +#else DrawInitText(getProgramInitString(), 20, FC_YELLOW); +#endif DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 4f004494..d599d1c7 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -92,6 +92,8 @@ static int compareTreeInfoEntries(const void *, const void *); static int token_value_position = TOKEN_VALUE_POSITION_DEFAULT; static int token_comment_position = TOKEN_COMMENT_POSITION_DEFAULT; +static SetupFileHash *level_artwork_info_hash = NULL; + /* ------------------------------------------------------------------------- */ /* file functions */ @@ -1704,6 +1706,27 @@ static void *loadSetupFileData(char *filename, boolean use_hash) return setup_file_data; } +void saveSetupFileHash(SetupFileHash *hash, char *filename) +{ + FILE *file; + + if (!(file = fopen(filename, MODE_WRITE))) + { + Error(ERR_WARN, "cannot write configuration file '%s'", filename); + + return; + } + + BEGIN_HASH_ITERATION(hash, itr) + { + fprintf(file, "%s\n", getFormattedSetupEntry(HASH_ITERATION_TOKEN(itr), + HASH_ITERATION_VALUE(itr))); + } + END_HASH_ITERATION(hash, itr) + + fclose(file); +} + SetupFileList *loadSetupFileList(char *filename) { return (SetupFileList *)loadSetupFileData(filename, FALSE); @@ -2652,6 +2675,20 @@ void LoadLevelArtworkInfo() { DrawInitText("Looking for custom level artwork:", 120, FC_GREEN); +#if 0 + if (level_artwork_info_hash == NULL) + { + char *filename = getPath2(getSetupDir(), "test.conf"); + + level_artwork_info_hash = loadSetupFileHash(filename); + + if (level_artwork_info_hash == NULL) + level_artwork_info_hash = newSetupFileHash(); + + free(filename); + } +#endif + LoadArtworkInfoFromLevelInfo(&artwork.gfx_first, leveldir_first_all); LoadArtworkInfoFromLevelInfo(&artwork.snd_first, leveldir_first_all); LoadArtworkInfoFromLevelInfo(&artwork.mus_first, leveldir_first_all); diff --git a/src/screens.c b/src/screens.c index 0d297f6c..175e59fc 100644 --- a/src/screens.c +++ b/src/screens.c @@ -2561,10 +2561,17 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, /* force LEVELS font on artwork setup screen */ game_status = GAME_MODE_LEVELS; +#if 1 + /* clear tree list area, but not title or scrollbar */ + DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32, + SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset, + NUM_MENU_ENTRIES_ON_SCREEN * 32); +#else /* clear tree list area, but not title or scrollbar */ DrawBackground(mSX, mSY + MENU_SCREEN_START_YPOS * 32, SC_SCROLLBAR_XPOS + menu.scrollbar_xoffset, MAX_MENU_ENTRIES_ON_SCREEN * 32); +#endif for (i = 0; i < num_page_entries; i++) { diff --git a/src/tools.c b/src/tools.c index ddc8353b..415935a4 100644 --- a/src/tools.c +++ b/src/tools.c @@ -274,7 +274,7 @@ void BackToFront() if (redraw_mask & REDRAW_TILES && game_status == GAME_MODE_PLAYING && - border.draw_masked[game_status]) + border.draw_masked[GAME_MODE_PLAYING]) redraw_mask |= REDRAW_FIELD; if (global.fps_slowdown && game_status == GAME_MODE_PLAYING) @@ -315,7 +315,10 @@ void BackToFront() SyncDisplay(); #if 1 - DrawMaskedBorder(redraw_mask); + if (game_status != GAME_MODE_PLAYING || + redraw_mask & REDRAW_FROM_BACKBUFFER || + buffer == backbuffer) + DrawMaskedBorder(redraw_mask); #endif if (redraw_mask & REDRAW_ALL) @@ -333,9 +336,6 @@ void BackToFront() if (game_status != GAME_MODE_PLAYING || redraw_mask & REDRAW_FROM_BACKBUFFER) { -#if 0 - DrawMaskedBorder(REDRAW_FIELD); -#endif BlitBitmap(backbuffer, window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); } @@ -354,21 +354,22 @@ void BackToFront() ABS(ScreenMovPos) == ScrollStepSize || redraw_tiles > REDRAWTILES_THRESHOLD) { -#if 1 - if (border.draw_masked[GFX_SPECIAL_ARG_MAIN]) + if (border.draw_masked[GAME_MODE_PLAYING]) { - BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY); + if (buffer != backbuffer) + { + BlitBitmap(buffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY); + DrawMaskedBorder(REDRAW_FIELD); + } - DrawMaskedBorder(REDRAW_FIELD); BlitBitmap(backbuffer, window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); } else + { BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY); -#else - BlitBitmap(buffer, window, fx, fy, SXSIZE, SYSIZE, SX, SY); -#endif + } #if 0 #ifdef DEBUG @@ -392,28 +393,13 @@ void BackToFront() if (redraw_mask & REDRAW_DOORS) { if (redraw_mask & REDRAW_DOOR_1) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_1); -#endif BlitBitmap(backbuffer, window, DX, DY, DXSIZE, DYSIZE, DX, DY); - } if (redraw_mask & REDRAW_DOOR_2) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_2); -#endif BlitBitmap(backbuffer, window, VX, VY, VXSIZE, VYSIZE, VX, VY); - } if (redraw_mask & REDRAW_DOOR_3) - { -#if 0 - DrawMaskedBorder(REDRAW_DOOR_3); -#endif BlitBitmap(backbuffer, window, EX, EY, EXSIZE, EYSIZE, EX, EY); - } redraw_mask &= ~REDRAW_DOORS; }