rnd-20091211-1-src
[rocksndiamonds.git] / src / game_sp / main.c
index ce409eb4551e3fe882a64f3af7ba37adbb003573..d63d32a0f2966b9c6d1f18ddfa728c604ef51ecf 100644 (file)
@@ -3,21 +3,46 @@
 #include "global.h"
 
 
+struct GameInfo_SP game_sp_info;
+struct LevelInfo_SP native_sp_level;
+
 void InitGameEngine_SP()
 {
-#if 0
+  game_sp_info.LevelSolved = FALSE;
+  game_sp_info.GameOver = FALSE;
+
+  menBorder.Checked = setup.sp_show_border_elements;
+
+  InitScrollPlayfield();
+
+#if 1
   menPlay_Click();
 #else
   menPlayDemo_Click();
 #endif
 }
 
+#if 0
 void BlitScreenToBitmap_SP(Bitmap *target_bitmap)
 {
-  BlitBitmap(screenBitmap, target_bitmap, 15 * 32, 7 * 32,
-            SCR_FIELDX * TILEX, SCR_FIELDY * TILEY, SX, SY);
+  DDScrollBuffer_Blt_Ext(target_bitmap);
+}
+#endif
+
+void RedrawPlayfield_SP(boolean force_redraw)
+{
+  // subDisplayLevel();
+
+  UpdatePlayfield();
+
+  BackToFront_SP();
 }
 
 void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)
 {
+  byte single_player_action = action[0];
+
+  subMainGameLoop_Main(single_player_action, warp_mode);
+
+  RedrawPlayfield_SP(FALSE);
 }