6 struct GameInfo_SP game_sp;
7 struct LevelInfo_SP native_sp_level;
9 int GfxElementLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
10 int GfxGraphicLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
11 int GfxGraphic[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
12 int GfxFrame[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
15 void InitGameEngine_SP()
19 gfx.anim_random_frame = -1; // (use simple, ad-hoc random numbers)
21 game_sp.LevelSolved = FALSE;
22 game_sp.GameOver = FALSE;
24 game_sp.time_played = 0;
25 game_sp.infotrons_still_needed = native_sp_level.header.InfotronsNeeded;
26 game_sp.red_disk_count = 0;
29 menBorder = setup.sp_show_border_elements;
31 game_sp.scroll_xoffset = (EVEN(SCR_FIELDX) ? TILEX / 2 : 0);
32 game_sp.scroll_yoffset = (EVEN(SCR_FIELDY) ? TILEY / 2 : 0);
34 if (native_sp_level.width <= SCR_FIELDX)
35 game_sp.scroll_xoffset = TILEX / 2;
36 if (native_sp_level.height <= SCR_FIELDY)
37 game_sp.scroll_yoffset = TILEY / 2;
39 for (x = 0; x < SP_MAX_PLAYFIELD_WIDTH; x++)
41 for (y = 0; y < SP_MAX_PLAYFIELD_HEIGHT; y++)
43 GfxElementLast[x][y] = -1;
44 GfxGraphicLast[x][y] = -1;
45 GfxGraphic[x][y] = -1;
50 InitScrollPlayfield();
55 void RedrawPlayfield_SP(boolean force_redraw)
60 UpdatePlayfield(force_redraw);
62 BlitScreenToBitmap_SP(backbuffer);
65 void UpdateGameDoorValues_SP()
67 game_sp.time_played = TimerVar / FRAMES_PER_SECOND;
68 game_sp.infotrons_still_needed = InfotronsNeeded;
69 game_sp.red_disk_count = RedDiskCount;
70 game_sp.score = 0; // (currently no score in Supaplex engine)
73 void GameActions_SP(byte action[MAX_PLAYERS], boolean warp_mode)
75 byte single_player_action = action[0];
78 UpdateEngineValues(mScrollX / TILEX, mScrollY / TILEY);
80 subMainGameLoop_Main(single_player_action, warp_mode);
82 RedrawPlayfield_SP(FALSE);
84 UpdateGameDoorValues_SP();
86 CheckSingleStepMode_SP(PlayField16[MurphyPosIndex] == fiMurphy,
87 HighByte(PlayField16[MurphyPosIndex]) == 0x2A);
89 for (x = DisplayMinX; x <= DisplayMaxX; x++)
90 for (y = DisplayMinY; y <= DisplayMaxY; y++)
94 int getRedDiskReleaseFlag_SP()
96 return RedDiskReleaseFlag;