6 struct GameInfo_SP game_sp;
7 struct LevelInfo_SP native_sp_level;
10 int GfxElementLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
11 int GfxGraphicLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
12 int GfxGraphic[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
13 int GfxFrame[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
16 void InitGameEngine_SP()
20 gfx.anim_random_frame = -1; // (use simple, ad-hoc random numbers)
22 game_sp.LevelSolved = FALSE;
23 game_sp.GameOver = FALSE;
25 game_sp.time_played = 0;
26 game_sp.infotrons_still_needed = native_sp_level.header.InfotronsNeeded;
27 game_sp.red_disk_count = 0;
30 menBorder.Checked = setup.sp_show_border_elements;
32 for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++)
34 for (y = 0; y < SP_MAX_PLAYFIELD_HEIGHT; y++)
36 GfxElementLast[x][y] = -1;
37 GfxGraphicLast[x][y] = -1;
38 GfxGraphic[x][y] = -1;
43 InitScrollPlayfield();
46 printf(":A: %d, %d [%d, %d]\n",
47 mScrollX, mScrollY, mScrollX_last, mScrollY_last);
57 printf(":B: %d, %d [%d, %d]\n",
58 mScrollX, mScrollY, mScrollX_last, mScrollY_last);
63 void BlitScreenToBitmap_SP(Bitmap *target_bitmap)
65 DDScrollBuffer_Blt_Ext(target_bitmap);
69 void RedrawPlayfield_SP(boolean force_redraw)
76 UpdatePlayfield(force_redraw);
81 void DrawGameDoorValues_SP()
85 game_sp.time_played = TimerVar / setup.game_frame_delay;
86 game_sp.infotrons_still_needed = InfotronsNeeded;
87 game_sp.red_disk_count = RedDiskCount;
88 game_sp.score = 0; // (currently no score in Supaplex engine)
92 int infotrons_still_needed = InfotronsNeeded;
93 int red_disks = RedDiskCount;
94 int no_score_in_supaplex = 0;
96 int level_time_played = TimerVar / setup.game_frame_delay;
98 int level_time_played = TimerVar / 35; /* !!! CHECK THIS !!! */
100 int no_keys_in_supaplex = 0;
102 DrawAllGameValues(infotrons_still_needed, red_disks, no_score_in_supaplex,
103 level_time_played, no_keys_in_supaplex);
107 void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)
109 byte single_player_action = action[0];
112 subMainGameLoop_Main(single_player_action, warp_mode);
114 RedrawPlayfield_SP(FALSE);
116 if (!warp_mode) /* do not redraw values in warp mode */
117 DrawGameDoorValues_SP();
119 for (x = DisplayMinX; x <= DisplayMaxX; x++)
120 for (y = DisplayMinY; y <= DisplayMaxY; y++)