}
else
{
+ // when using BD game engine, cover screen before fading out
+ if (!quick_quit && level.game_engine_type == GAME_ENGINE_TYPE_BD)
+ game_bd.cover_screen = TRUE;
+
if (quick_quit)
FadeSkipNextFadeIn();
boolean LoadNativeLevel_BD(char *, int, boolean);
unsigned int InitEngineRandom_BD(int);
+void CoverScreen_BD(void);
+
+void BlitScreenToBitmap_BD(Bitmap *);
+void RedrawPlayfield_BD(boolean);
#endif // EXPORT_BD_H
void StopSound_BD(int, int);
boolean isSoundPlaying_BD(int, int);
+void BackToFront(void);
+
byte *TapePlayAction_BD(void);
byte *TapeCorrectAction_BD(byte *);
boolean TapeIsPlaying_ReplayBD(void);
return (unsigned int)seed;
}
+
+
+// ============================================================================
+// graphics functions
+// ============================================================================
+
+void CoverScreen_BD(void)
+{
+ game_bd.cover_screen = FALSE;
+
+ if (setup.bd_skip_uncovering)
+ return;
+
+ game_bd.game->state_counter = GAME_INT_COVER_START;
+
+ // play game engine (with normal speed) until cave covered
+ while (game_bd.game->state_counter < GAME_INT_COVER_ALL + 1)
+ {
+ play_game_func(game_bd.game, 0);
+
+ RedrawPlayfield_BD(TRUE);
+
+ BlitScreenToBitmap_BD(backbuffer);
+
+ BackToFront();
+ }
+
+ // stop uncovering loop sound when not using native sound engine
+ FadeSounds();
+}
+
+void BlitScreenToBitmap_BD(Bitmap *target_bitmap)
+{
+ int xsize = SXSIZE;
+ int ysize = SYSIZE;
+ int full_xsize = native_bd_level.cave->w * TILESIZE_VAR;
+ int full_ysize = native_bd_level.cave->h * TILESIZE_VAR;
+ int sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0);
+ int sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0);
+ int sxsize = (full_xsize < xsize ? full_xsize : xsize);
+ int sysize = (full_ysize < ysize ? full_ysize : ysize);
+
+ BlitBitmap(gd_screen_bitmap, target_bitmap, 0, 0, sxsize, sysize, sx, sy);
+}
+
+void RedrawPlayfield_BD(boolean force_redraw)
+{
+ gd_drawcave(gd_screen_bitmap, game_bd.game, force_redraw);
+}
if (game_status != GAME_MODE_PLAYING)
return;
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+ RedrawPlayfield_BD(TRUE);
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
RedrawPlayfield_EM(TRUE);
else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
RedrawPlayfield_SP(TRUE);
void BlitScreenToBitmap(Bitmap *target_bitmap)
{
- if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+ BlitScreenToBitmap_BD(target_bitmap);
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
BlitScreenToBitmap_EM(target_bitmap);
else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
BlitScreenToBitmap_SP(target_bitmap);
fade_type_skip != FADE_MODE_SKIP_FADE_OUT)
BackToFront();
+ // when using BD game engine, cover playfield before fading out after a game
+ if (game_bd.cover_screen)
+ CoverScreen_BD();
+
SetScreenStates_BeforeFadingOut();
SetTileCursorActive(FALSE);