projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved displaying FPS (debug mode only)
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index b543e6d2e14132d345e14aca528e069efdc98e54..ce4fd8cb30e033a0fb9623b99bfe8bcf4dde681a 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-1619,7
+1619,6
@@
void GetPlayerConfig()
setup.sound = (setup.sound_simple || setup.sound_loops || setup.sound_music);
SetAudioMode(setup.sound);
setup.sound = (setup.sound_simple || setup.sound_loops || setup.sound_music);
SetAudioMode(setup.sound);
- InitJoysticks();
}
int GetElementFromGroupElement(int element)
}
int GetElementFromGroupElement(int element)
@@
-2699,6
+2698,9
@@
static void InitGameEngine()
game.use_block_last_field_bug =
(game.engine_version < VERSION_IDENT(3,1,1,0));
game.use_block_last_field_bug =
(game.engine_version < VERSION_IDENT(3,1,1,0));
+ game_em.use_single_button =
+ (game.engine_version > VERSION_IDENT(4,0,0,2));
+
/* ---------------------------------------------------------------------- */
/* set maximal allowed number of custom element changes per game frame */
/* ---------------------------------------------------------------------- */
/* set maximal allowed number of custom element changes per game frame */
@@
-3222,6
+3224,8
@@
void InitGame()
player->was_snapping = FALSE;
player->was_dropping = FALSE;
player->was_snapping = FALSE;
player->was_dropping = FALSE;
+ player->force_dropping = FALSE;
+
player->frame_counter_bored = -1;
player->frame_counter_sleeping = -1;
player->frame_counter_bored = -1;
player->frame_counter_sleeping = -1;
@@
-4461,7
+4465,8
@@
void GameEnd()
SaveLevelSetup_SeriesInfo();
}
SaveLevelSetup_SeriesInfo();
}
- if (level_nr < leveldir_current->last_level)
+ if (setup.increment_levels &&
+ level_nr < leveldir_current->last_level)
raise_level = TRUE; /* advance to next level */
if ((hi_pos = NewHiScore()) >= 0)
raise_level = TRUE; /* advance to next level */
if ((hi_pos = NewHiScore()) >= 0)
@@
-10711,7
+10716,9
@@
static void CheckSingleStepMode(struct PlayerInfo *player)
{
/* as it is called "single step mode", just return to pause mode when the
player stopped moving after one tile (or never starts moving at all) */
{
/* as it is called "single step mode", just return to pause mode when the
player stopped moving after one tile (or never starts moving at all) */
- if (!player->is_moving && !player->is_pushing)
+ if (!player->is_moving &&
+ !player->is_pushing &&
+ !player->is_dropping_pressed)
{
TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
SnapField(player, 0, 0); /* stop snapping */
{
TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
SnapField(player, 0, 0); /* stop snapping */
@@
-11219,9
+11226,14
@@
void GameActionsExt()
fps_frames = 0;
fps_counter = Counter();
fps_frames = 0;
fps_counter = Counter();
+
+ /* always draw FPS to screen after FPS value was updated */
+ redraw_mask |= REDRAW_FPS;
}
}
- redraw_mask |= REDRAW_FPS;
+ /* only draw FPS if no screen areas are deactivated (invisible warp mode) */
+ if (GetDrawDeactivationMask() == REDRAW_NONE)
+ redraw_mask |= REDRAW_FPS;
}
}
}
}
@@
-11265,6
+11277,14
@@
void GameActions_SP_Main()
effective_action[i] = stored_player[i].effective_action;
GameActions_SP(effective_action, warp_mode);
effective_action[i] = stored_player[i].effective_action;
GameActions_SP(effective_action, warp_mode);
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ {
+ if (stored_player[i].force_dropping)
+ stored_player[i].action |= KEY_BUTTON_DROP;
+
+ stored_player[i].force_dropping = FALSE;
+ }
}
void GameActions_RND_Main()
}
void GameActions_RND_Main()
@@
-13976,8
+13996,6
@@
static boolean DropElement(struct PlayerInfo *player)
int drop_side = drop_direction;
int drop_element = get_next_dropped_element(player);
int drop_side = drop_direction;
int drop_element = get_next_dropped_element(player);
- player->is_dropping_pressed = TRUE;
-
/* do not drop an element on top of another element; when holding drop key
pressed without moving, dropped element must move away before the next
element can be dropped (this is especially important if the next element
/* do not drop an element on top of another element; when holding drop key
pressed without moving, dropped element must move away before the next
element can be dropped (this is especially important if the next element
@@
-14005,6
+14023,9
@@
static boolean DropElement(struct PlayerInfo *player)
if (new_element == EL_UNDEFINED)
return FALSE;
if (new_element == EL_UNDEFINED)
return FALSE;
+ /* only set if player has anything that can be dropped */
+ player->is_dropping_pressed = TRUE;
+
/* check if drop key was pressed long enough for EM style dynamite */
if (new_element == EL_EM_DYNAMITE && player->drop_pressed_delay < 40)
return FALSE;
/* check if drop key was pressed long enough for EM style dynamite */
if (new_element == EL_EM_DYNAMITE && player->drop_pressed_delay < 40)
return FALSE;