/* ========================================================================= */
extern void SetBitmaps_EM(Bitmap **);
-extern void UpdateEngineValues(int, int);
+extern void UpdateEngineValues(int, int, int, int);
extern boolean getTeamMode_EM();
extern int getGameFrameDelay_EM(int);
SaveEngineSnapshotToListInitial();
}
-void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y)
+void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y,
+ int actual_player_x, int actual_player_y)
{
/* this is used for non-R'n'D game engines to update certain engine values */
+ if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+ {
+ actual_player_x = correctLevelPosX_EM(actual_player_x);
+ actual_player_y = correctLevelPosY_EM(actual_player_y);
+ }
+
/* needed to determine if sounds are played within the visible screen area */
scroll_x = actual_scroll_x;
scroll_y = actual_scroll_y;
+
+ /* needed to get player position for "follow finger" playing input method */
+ local_player->jx = actual_player_x;
+ local_player->jy = actual_player_y;
}
void InitMovDir(int x, int y)
void InitGameSound();
void InitGame();
-void UpdateEngineValues(int, int);
+void UpdateEngineValues(int, int, int, int);
void GameWon(void);
void GameEnd(void);
for (i = 0; i < MAX_PLAYERS; i++)
readjoy(action[i], &ply[i]);
- UpdateEngineValues(screen_x / TILEX, screen_y / TILEY);
+ UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y);
if (frame == 7)
{
byte single_player_action = action[0];
int x, y;
- UpdateEngineValues(mScrollX / TILEX, mScrollY / TILEY);
+ UpdateEngineValues(mScrollX / TILEX, mScrollY / TILEY,
+ MurphyScreenXPos / TILEX, MurphyScreenYPos / TILEY);
subMainGameLoop_Main(single_player_action, warp_mode);
return s;
}
+int correctLevelPosX_EM(int lx)
+{
+ lx -= 1;
+ lx -= (BorderElement != EL_EMPTY ? 1 : 0);
+
+ return lx;
+}
+
+int correctLevelPosY_EM(int ly)
+{
+ ly -= 1;
+ ly -= (BorderElement != EL_EMPTY ? 1 : 0);
+
+ return ly;
+}
+
static int getFieldbufferOffsetX_RND()
{
int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0);
int px = sx - SX;
int lx = LEVELX((px + dx) / TILESIZE_VAR);
- lx -= 1;
- lx -= (BorderElement != EL_EMPTY ? 1 : 0);
+ lx = correctLevelPosX_EM(lx);
return lx;
}
int py = sy - SY;
int ly = LEVELY((py + dy) / TILESIZE_VAR);
- ly -= 1;
- ly -= (BorderElement != EL_EMPTY ? 1 : 0);
+ ly = correctLevelPosY_EM(ly);
return ly;
}
printf(" GfxElement: %d\n", GfxElement[x][y]);
printf(" GfxAction: %d\n", GfxAction[x][y]);
printf(" GfxFrame: %d [%d]\n", GfxFrame[x][y], FrameCounter);
+ printf(" Player x/y: %d, %d\n", local_player->jx, local_player->jy);
printf("\n");
}
#define REQUEST_WAIT_FOR_INPUT (REQ_ASK | REQ_CONFIRM | REQ_PLAYER)
+int correctLevelPosX_EM(int);
+int correctLevelPosY_EM(int);
+
int getLevelFromScreenX(int);
int getLevelFromScreenY(int);