projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20140315-1-src
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 21728e5a081efa7910da8dbcb3bfdf0f07c39c22..ac20e3c144e5b3567019de53c3ad60344ab517c5 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1017,11
+1017,28
@@
static void FadeExt(int fade_mask, int fade_mode, int fade_type)
ClearRectangle(backbuffer, x, y, width, height);
#endif
ClearRectangle(backbuffer, x, y, width, height);
#endif
+#if 1
+
+#if 1
+ BlitBitmap(backbuffer, window, x, y, width, height, x, y);
+
+ redraw_mask &= ~fade_mask;
+#else
+ /* always redraw area that was explicitly marked to fade */
+ redraw_mask |= fade_mask;
+
+ BackToFront();
+#endif
+
+#else
+
#if 1
BlitBitmap(backbuffer, window, x, y, width, height, x, y);
redraw_mask = REDRAW_NONE;
#if 1
BlitBitmap(backbuffer, window, x, y, width, height, x, y);
redraw_mask = REDRAW_NONE;
+ // (^^^ WRONG; should be "redraw_mask &= ~fade_mask" if done this way)
#else
BackToFront();
#else
BackToFront();
+#endif
#endif
return;
#endif
return;
@@
-2972,7
+2989,7
@@
void AnimateEnvelopeRequest(int anim_mode, int action)
dst_x + xsize_size_left, dst_y + ysize_size_top);
#endif
dst_x + xsize_size_left, dst_y + ysize_size_top);
#endif
-#if
1
+#if
0
redraw_mask = REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
// redraw_mask |= REDRAW_ALL | REDRAW_FROM_BACKBUFFER;
#else
redraw_mask = REDRAW_FIELD | REDRAW_FROM_BACKBUFFER;
// redraw_mask |= REDRAW_ALL | REDRAW_FROM_BACKBUFFER;
#else
@@
-5702,6
+5719,7
@@
unsigned int MoveDoor(unsigned int door_state)
if (door_state & DOOR_ACTION)
{
boolean door_panel_drawn[NUM_DOORS];
if (door_state & DOOR_ACTION)
{
boolean door_panel_drawn[NUM_DOORS];
+ boolean panel_has_doors[NUM_DOORS];
boolean door_part_skip[MAX_DOOR_PARTS];
boolean door_part_done[MAX_DOOR_PARTS];
boolean door_part_done_all;
boolean door_part_skip[MAX_DOOR_PARTS];
boolean door_part_done[MAX_DOOR_PARTS];
boolean door_part_done_all;
@@
-5712,6
+5730,9
@@
unsigned int MoveDoor(unsigned int door_state)
int current_move_delay = 0;
int k;
int current_move_delay = 0;
int k;
+ for (i = 0; i < NUM_DOORS; i++)
+ panel_has_doors[i] = FALSE;
+
for (i = 0; i < MAX_DOOR_PARTS; i++)
{
struct DoorPartControlInfo *dpc = &door_part_controls[i];
for (i = 0; i < MAX_DOOR_PARTS; i++)
{
struct DoorPartControlInfo *dpc = &door_part_controls[i];
@@
-5742,6
+5763,7
@@
unsigned int MoveDoor(unsigned int door_state)
struct DoorPartPosInfo *pos = dpc->pos;
struct GraphicInfo *g = &graphic_info[dpc->graphic];
int door_token = dpc->door_token;
struct DoorPartPosInfo *pos = dpc->pos;
struct GraphicInfo *g = &graphic_info[dpc->graphic];
int door_token = dpc->door_token;
+ int door_index = DOOR_INDEX_FROM_TOKEN(door_token);
boolean is_panel = DOOR_PART_IS_PANEL(nr);
int step_xoffset = ABS(pos->step_xoffset);
int step_yoffset = ABS(pos->step_yoffset);
boolean is_panel = DOOR_PART_IS_PANEL(nr);
int step_xoffset = ABS(pos->step_xoffset);
int step_yoffset = ABS(pos->step_yoffset);
@@
-5764,6
+5786,9
@@
unsigned int MoveDoor(unsigned int door_state)
if (door_part_skip[nr])
continue;
if (door_part_skip[nr])
continue;
+ if (!is_panel)
+ panel_has_doors[door_index] = TRUE;
+
max_move_delay = MAX(max_move_delay, move_delay);
max_step_delay = (max_step_delay == 0 ? step_delay :
euclid(max_step_delay, step_delay));
max_move_delay = MAX(max_move_delay, move_delay);
max_step_delay = (max_step_delay == 0 ? step_delay :
euclid(max_step_delay, step_delay));
@@
-6009,9
+6034,16
@@
unsigned int MoveDoor(unsigned int door_state)
door_part_done[nr] = TRUE;
#endif
door_part_done[nr] = TRUE;
#endif
+#if 1
+ // continue door part animations, but not panel after door has closed
+ if (!door_part_done[nr] &&
+ !(is_panel && door_closing && panel_has_doors[door_index]))
+ door_part_done_all = FALSE;
+#else
// continue door part animations, but not panel after door has closed
if (!door_part_done[nr] && !(is_panel && door_closing))
door_part_done_all = FALSE;
// continue door part animations, but not panel after door has closed
if (!door_part_done[nr] && !(is_panel && door_closing))
door_part_done_all = FALSE;
+#endif
#if 0
if (!door_part_done[nr])
#if 0
if (!door_part_done[nr])
@@
-11271,9
+11303,13
@@
void ChangeViewportPropertiesIfNeeded()
int *door_2_x = (game_status == GAME_MODE_EDITOR ? &EX : &VX);
int *door_2_y = (game_status == GAME_MODE_EDITOR ? &EY : &VY);
#endif
int *door_2_x = (game_status == GAME_MODE_EDITOR ? &EX : &VX);
int *door_2_y = (game_status == GAME_MODE_EDITOR ? &EY : &VY);
#endif
+#if 1
+ int gfx_game_mode = game_status;
+#else
int gfx_game_mode = (game_status == GAME_MODE_PLAYING ||
game_status == GAME_MODE_EDITOR ? game_status :
GAME_MODE_MAIN);
int gfx_game_mode = (game_status == GAME_MODE_PLAYING ||
game_status == GAME_MODE_EDITOR ? game_status :
GAME_MODE_MAIN);
+#endif
int gfx_game_mode2 = (game_status == GAME_MODE_EDITOR ? GAME_MODE_DEFAULT :
game_status);
struct RectWithBorder *vp_playfield = &viewport.playfield[gfx_game_mode];
int gfx_game_mode2 = (game_status == GAME_MODE_EDITOR ? GAME_MODE_DEFAULT :
game_status);
struct RectWithBorder *vp_playfield = &viewport.playfield[gfx_game_mode];