projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20060818-1-src
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 5051780e432522e57eb42094db5ca5b5550f4179..05219bf91a4003a6c88af470db545ec3cc6df62c 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-414,48
+414,63
@@
void FadeToFront()
BackToFront();
}
BackToFront();
}
-void Fade
In(int fade_delay
)
+void Fade
Ext(int fade_mask, int fade_mode
)
{
{
- if (fade_delay == 0)
- {
- BackToFront();
+ Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL);
+ int fade_delay = menu.fade_delay;
+ int post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0);
+ int x, y, width, height;
- return;
+ if (fade_mask & REDRAW_ALL)
+ {
+ x = 0;
+ y = 0;
+ width = WIN_XSIZE;
+ height = WIN_YSIZE;
+ }
+ else if (fade_mask & REDRAW_FIELD)
+ {
+ x = REAL_SX;
+ y = REAL_SY;
+ width = FULL_SXSIZE;
+ height = FULL_SYSIZE;
}
}
- FadeScreen(NULL, FADE_MODE_FADE_IN, fade_delay, 0);
-
- redraw_mask = REDRAW_NONE;
-}
+ redraw_mask |= fade_mask;
-void FadeOut(int fade_delay, int post_delay)
-{
- if (fade_delay == 0)
+ if (!setup.fading || fade_delay == 0)
{
{
- ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE);
+ if (fade_mode == FADE_MODE_FADE_OUT)
+ ClearRectangle(backbuffer, x, y, width, height);
+
BackToFront();
return;
}
BackToFront();
return;
}
- Fade
Screen(NULL, FADE_MODE_FADE_OUT
, fade_delay, post_delay);
+ Fade
Rectangle(bitmap, x, y, width, height, fade_mode
, fade_delay, post_delay);
- redraw_mask
= REDRAW_NONE
;
+ redraw_mask
&= ~fade_mask
;
}
}
-void Fade
Cross(int fade_delay
)
+void Fade
In(int fade_mask
)
{
{
- if (fade_delay == 0)
- {
- BlitBitmap(bitmap_db_title, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
- BackToFront();
+ FadeExt(fade_mask, FADE_MODE_FADE_IN);
+}
- return;
- }
+void FadeOut(int fade_mask)
+{
+ FadeExt(fade_mask, FADE_MODE_FADE_OUT);
+}
- FadeScreen(bitmap_db_title, FADE_MODE_CROSSFADE, fade_delay, 0);
+void FadeCross(int fade_mask)
+{
+ FadeExt(fade_mask, FADE_MODE_CROSSFADE);
+}
- redraw_mask = REDRAW_NONE;
+void FadeCrossSaveBackbuffer()
+{
+ BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
}
void SetMainBackgroundImageIfDefined(int graphic)
}
void SetMainBackgroundImageIfDefined(int graphic)
@@
-490,7
+505,11
@@
void SetPanelBackground()
void DrawBackground(int dst_x, int dst_y, int width, int height)
{
void DrawBackground(int dst_x, int dst_y, int width, int height)
{
+#if 1
+ ClearRectangleOnBackground(drawto, dst_x, dst_y, width, height);
+#else
ClearRectangleOnBackground(backbuffer, dst_x, dst_y, width, height);
ClearRectangleOnBackground(backbuffer, dst_x, dst_y, width, height);
+#endif
redraw_mask |= REDRAW_FIELD;
}
redraw_mask |= REDRAW_FIELD;
}
@@
-2057,8
+2076,15
@@
void DrawPlayer(struct PlayerInfo *player)
GfxElement[jx][jy] = EL_UNDEFINED;
/* make sure that pushed elements are drawn with correct frame rate */
GfxElement[jx][jy] = EL_UNDEFINED;
/* make sure that pushed elements are drawn with correct frame rate */
+#if 1
+ graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
+
+ if (player->is_pushing && player->is_moving && !IS_ANIM_MODE_CE(graphic))
+ GfxFrame[jx][jy] = player->StepFrame;
+#else
if (player->is_pushing && player->is_moving)
GfxFrame[jx][jy] = player->StepFrame;
if (player->is_pushing && player->is_moving)
GfxFrame[jx][jy] = player->StepFrame;
+#endif
DrawLevelField(jx, jy);
}
DrawLevelField(jx, jy);
}
@@
-2118,15
+2144,26
@@
void DrawPlayer(struct PlayerInfo *player)
int px = SCREENX(jx), py = SCREENY(jy);
int pxx = (TILEX - ABS(sxx)) * dx;
int pyy = (TILEY - ABS(syy)) * dy;
int px = SCREENX(jx), py = SCREENY(jy);
int pxx = (TILEX - ABS(sxx)) * dx;
int pyy = (TILEY - ABS(syy)) * dy;
+ int gfx_frame = GfxFrame[jx][jy];
int graphic;
int graphic;
+ int sync_frame;
int frame;
if (!IS_MOVING(jx, jy)) /* push movement already finished */
int frame;
if (!IS_MOVING(jx, jy)) /* push movement already finished */
+ {
element = Feld[next_jx][next_jy];
element = Feld[next_jx][next_jy];
+ gfx_frame = GfxFrame[next_jx][next_jy];
+ }
graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
+
+#if 1
+ sync_frame = (IS_ANIM_MODE_CE(graphic) ? gfx_frame : player->StepFrame);
+ frame = getGraphicAnimationFrame(graphic, sync_frame);
+#else
frame = getGraphicAnimationFrame(graphic, player->StepFrame);
frame = getGraphicAnimationFrame(graphic, player->StepFrame);
+#endif
/* draw background element under pushed element (like the Sokoban field) */
if (Back[next_jx][next_jy])
/* draw background element under pushed element (like the Sokoban field) */
if (Back[next_jx][next_jy])