-#define COMPILE_DATE_STRING "[2006-10-28 22:48]"
+#define COMPILE_DATE_STRING "[2006-10-29 20:25]"
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);
+ }
}
}
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);
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 */
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);
{
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);
/* 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++)
{
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)
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)
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);
}
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
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;
}