projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added graphics config option to support elements on non-black background
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index c1af86314e0a12c979d32a8efac9f0488d844026..4c4288750b20706592ac9dd2823c95f8f4a2a44a 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-4721,9
+4721,6
@@
void GameWon(void)
static int game_over_delay_1 = 0;
static int game_over_delay_2 = 0;
static int game_over_delay_3 = 0;
static int game_over_delay_1 = 0;
static int game_over_delay_2 = 0;
static int game_over_delay_3 = 0;
- int game_over_delay_value_1 = 50;
- int game_over_delay_value_2 = 25;
- int game_over_delay_value_3 = 50;
int time_score_base = MIN(MAX(1, level.time_score_base), 10);
float time_score = (float)level.score[SC_TIME_BONUS] / time_score_base;
int time_score_base = MIN(MAX(1, level.time_score_base), 10);
float time_score = (float)level.score[SC_TIME_BONUS] / time_score_base;
@@
-4751,9
+4748,9
@@
void GameWon(void)
TapeStop();
TapeStop();
- game_over_delay_1 =
0;
- game_over_delay_2 =
0;
- game_over_delay_3 =
game_over_delay_value_3;
+ game_over_delay_1 =
FRAMES_PER_SECOND; // delay before counting time
+ game_over_delay_2 =
FRAMES_PER_SECOND / 2; // delay before counting health
+ game_over_delay_3 =
FRAMES_PER_SECOND; // delay before ending the game
time = time_final = (game.no_time_limit ? TimePlayed : TimeLeft);
score = score_final = game.score_final;
time = time_final = (game.no_time_limit ? TimePlayed : TimeLeft);
score = score_final = game.score_final;
@@
-4778,14
+4775,10
@@
void GameWon(void)
time_count_steps = MAX(1, ABS(time_final - time) / 100);
time_count_steps = MAX(1, ABS(time_final - time) / 100);
- game_over_delay_1 = game_over_delay_value_1;
-
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
{
health_final = 0;
score_final += health * time_score;
if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
{
health_final = 0;
score_final += health * time_score;
-
- game_over_delay_2 = game_over_delay_value_2;
}
game.score_final = score_final;
}
game.score_final = score_final;
@@
-4858,15
+4851,15
@@
void GameWon(void)
if (setup.count_score_after_game)
{
if (setup.count_score_after_game)
{
- if (
game_over_delay_1 > 0
)
+ if (
time != time_final
)
{
{
- game_over_delay_1--;
+ if (game_over_delay_1 > 0)
+ {
+ game_over_delay_1--;
- return;
- }
+
return;
+
}
- if (time != time_final)
- {
int time_to_go = ABS(time_final - time);
int time_count_dir = (time < time_final ? +1 : -1);
int time_to_go = ABS(time_final - time);
int time_count_dir = (time < time_final ? +1 : -1);
@@
-4898,15
+4891,15
@@
void GameWon(void)
return;
}
return;
}
- if (
game_over_delay_2 > 0
)
+ if (
health != health_final
)
{
{
- game_over_delay_2--;
+ if (game_over_delay_2 > 0)
+ {
+ game_over_delay_2--;
- return;
- }
+
return;
+
}
- if (health != health_final)
- {
int health_count_dir = (health < health_final ? +1 : -1);
health += health_count_dir;
int health_count_dir = (health < health_final ? +1 : -1);
health += health_count_dir;
@@
-5356,13
+5349,15
@@
void DrawDynamite(int x, int y)
return;
if (Back[x][y])
return;
if (Back[x][y])
- Draw
Graphic(sx, sy, el2img(Back[x][y]), 0
);
+ Draw
LevelElement(x, y, Back[x][y]
);
else if (Store[x][y])
else if (Store[x][y])
- DrawGraphic(sx, sy, el2img(Store[x][y]), 0);
+ DrawLevelElement(x, y, Store[x][y]);
+ else if (game.use_masked_elements)
+ DrawLevelElement(x, y, EL_EMPTY);
frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
- if (Back[x][y] || Store[x][y])
+ if (Back[x][y] || Store[x][y]
|| game.use_masked_elements
)
DrawGraphicThruMask(sx, sy, graphic, frame);
else
DrawGraphic(sx, sy, graphic, frame);
DrawGraphicThruMask(sx, sy, graphic, frame);
else
DrawGraphic(sx, sy, graphic, frame);
@@
-5935,7
+5930,7
@@
static void Explode(int ex, int ey, int phase, int mode)
DrawLevelElementThruMask(x, y, Back[x][y]);
}
else if (!IS_WALKABLE_INSIDE(Back[x][y]))
DrawLevelElementThruMask(x, y, Back[x][y]);
}
else if (!IS_WALKABLE_INSIDE(Back[x][y]))
- DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ Draw
Screen
Graphic(SCREENX(x), SCREENY(y), graphic, frame);
}
}
}
}