{ "door_1.part_1.step_yoffset", "1" },
{ "door_1.part_1.step_delay", "20" },
{ "door_1.part_1.start_step", "0" },
+ { "door_1.part_1.start_step_opening", "0" },
+ { "door_1.part_1.start_step_closing", "0" },
{ "door_1.part_1.draw_masked", "true" },
{ "door_1.part_1.draw_order", "3" },
{ "door_1.part_2.x", "0" },
{ "door_1.part_2.step_yoffset", "1" },
{ "door_1.part_2.step_delay", "20" },
{ "door_1.part_2.start_step", "0" },
+ { "door_1.part_2.start_step_opening", "0" },
+ { "door_1.part_2.start_step_closing", "0" },
{ "door_1.part_2.draw_masked", "true" },
{ "door_1.part_2.draw_order", "5" },
{ "door_1.part_3.x", "0" },
{ "door_1.part_3.step_yoffset", "1" },
{ "door_1.part_3.step_delay", "20" },
{ "door_1.part_3.start_step", "0" },
+ { "door_1.part_3.start_step_opening", "0" },
+ { "door_1.part_3.start_step_closing", "0" },
{ "door_1.part_3.draw_masked", "true" },
{ "door_1.part_3.draw_order", "4" },
{ "door_1.part_4.x", "0" },
{ "door_1.part_4.step_yoffset", "1" },
{ "door_1.part_4.step_delay", "20" },
{ "door_1.part_4.start_step", "0" },
+ { "door_1.part_4.start_step_opening", "0" },
+ { "door_1.part_4.start_step_closing", "0" },
{ "door_1.part_4.draw_masked", "true" },
{ "door_1.part_4.draw_order", "6" },
{ "door_1.part_5.x", "0" },
{ "door_1.part_5.step_yoffset", "-1" },
{ "door_1.part_5.step_delay", "20" },
{ "door_1.part_5.start_step", "0" },
+ { "door_1.part_5.start_step_opening", "0" },
+ { "door_1.part_5.start_step_closing", "0" },
{ "door_1.part_5.draw_masked", "true" },
{ "door_1.part_5.draw_order", "1" },
{ "door_1.part_6.x", "0" },
{ "door_1.part_6.step_yoffset", "-1" },
{ "door_1.part_6.step_delay", "20" },
{ "door_1.part_6.start_step", "0" },
+ { "door_1.part_6.start_step_opening", "0" },
+ { "door_1.part_6.start_step_closing", "0" },
{ "door_1.part_6.draw_masked", "true" },
{ "door_1.part_6.draw_order", "7" },
{ "door_1.part_7.x", "0" },
{ "door_1.part_7.step_yoffset", "-1" },
{ "door_1.part_7.step_delay", "20" },
{ "door_1.part_7.start_step", "0" },
+ { "door_1.part_7.start_step_opening", "0" },
+ { "door_1.part_7.start_step_closing", "0" },
{ "door_1.part_7.draw_masked", "true" },
{ "door_1.part_7.draw_order", "2" },
{ "door_1.part_8.x", "0" },
{ "door_1.part_8.step_yoffset", "-1" },
{ "door_1.part_8.step_delay", "20" },
{ "door_1.part_8.start_step", "0" },
+ { "door_1.part_8.start_step_opening", "0" },
+ { "door_1.part_8.start_step_closing", "0" },
{ "door_1.part_8.draw_masked", "true" },
{ "door_1.part_8.draw_order", "8" },
{ "door_2.part_1.step_yoffset", "1" },
{ "door_2.part_1.step_delay", "20" },
{ "door_2.part_1.start_step", "0" },
+ { "door_2.part_1.start_step_opening", "0" },
+ { "door_2.part_1.start_step_closing", "0" },
{ "door_2.part_1.draw_masked", "true" },
{ "door_2.part_1.draw_order", "2" },
{ "door_2.part_2.x", "0" },
{ "door_2.part_2.step_yoffset", "1" },
{ "door_2.part_2.step_delay", "20" },
{ "door_2.part_2.start_step", "0" },
+ { "door_2.part_2.start_step_opening", "0" },
+ { "door_2.part_2.start_step_closing", "0" },
{ "door_2.part_2.draw_masked", "true" },
{ "door_2.part_2.draw_order", "3" },
{ "door_2.part_3.x", "0" },
{ "door_2.part_3.step_yoffset", "-1" },
{ "door_2.part_3.step_delay", "20" },
{ "door_2.part_3.start_step", "0" },
+ { "door_2.part_3.start_step_opening", "0" },
+ { "door_2.part_3.start_step_closing", "0" },
{ "door_2.part_3.draw_masked", "true" },
{ "door_2.part_3.draw_order", "1" },
{ "door_2.part_4.x", "0" },
{ "door_2.part_4.step_yoffset", "-1" },
{ "door_2.part_4.step_delay", "20" },
{ "door_2.part_4.start_step", "0" },
+ { "door_2.part_4.start_step_opening", "0" },
+ { "door_2.part_4.start_step_closing", "0" },
{ "door_2.part_4.draw_masked", "true" },
{ "door_2.part_4.draw_order", "4" },
{ "door_2.part_5.x", "-1" },
{ "door_2.part_5.step_yoffset", "0" },
{ "door_2.part_5.step_delay", "0" },
{ "door_2.part_5.start_step", "0" },
+ { "door_2.part_5.start_step_opening", "0" },
+ { "door_2.part_5.start_step_closing", "0" },
{ "door_2.part_5.draw_masked", "true" },
{ "door_2.part_5.draw_order", "0" },
{ "door_2.part_6.x", "-1" },
{ "door_2.part_6.step_yoffset", "0" },
{ "door_2.part_6.step_delay", "0" },
{ "door_2.part_6.start_step", "0" },
+ { "door_2.part_6.start_step_opening", "0" },
+ { "door_2.part_6.start_step_closing", "0" },
{ "door_2.part_6.draw_masked", "true" },
{ "door_2.part_6.draw_order", "0" },
{ "door_2.part_7.x", "-1" },
{ "door_2.part_7.step_yoffset", "0" },
{ "door_2.part_7.step_delay", "0" },
{ "door_2.part_7.start_step", "0" },
+ { "door_2.part_7.start_step_opening", "0" },
+ { "door_2.part_7.start_step_closing", "0" },
{ "door_2.part_7.draw_masked", "true" },
{ "door_2.part_7.draw_order", "0" },
{ "door_2.part_8.x", "-1" },
{ "door_2.part_8.step_yoffset", "0" },
{ "door_2.part_8.step_delay", "0" },
{ "door_2.part_8.start_step", "0" },
+ { "door_2.part_8.start_step_opening", "0" },
+ { "door_2.part_8.start_step_closing", "0" },
{ "door_2.part_8.draw_masked", "true" },
{ "door_2.part_8.draw_order", "0" },
{ "door_1.panel.step_yoffset", "1" },
{ "door_1.panel.step_delay", "10" },
{ "door_1.panel.start_step", "212" },
+ { "door_1.panel.start_step_opening", "0" },
+ { "door_1.panel.start_step_closing", "0" },
{ "door_1.panel.draw_masked", "false" },
{ "door_1.panel.draw_order", "0" },
{ "door_2.panel.step_yoffset", "1" },
{ "door_2.panel.step_delay", "10" },
{ "door_2.panel.start_step", "32" },
+ { "door_2.panel.start_step_opening", "0" },
+ { "door_2.panel.start_step_closing", "0" },
{ "door_2.panel.draw_masked", "false" },
{ "door_2.panel.draw_order", "0" },
"door_1.part_1.start_step",
&door_1.part_1.start_step
},
+ {
+ "door_1.part_1.start_step_opening",
+ &door_1.part_1.start_step_opening
+ },
+ {
+ "door_1.part_1.start_step_closing",
+ &door_1.part_1.start_step_closing
+ },
{
"door_1.part_1.draw_masked",
&door_1.part_1.draw_masked
"door_1.part_2.start_step",
&door_1.part_2.start_step
},
+ {
+ "door_1.part_2.start_step_opening",
+ &door_1.part_2.start_step_opening
+ },
+ {
+ "door_1.part_2.start_step_closing",
+ &door_1.part_2.start_step_closing
+ },
{
"door_1.part_2.draw_masked",
&door_1.part_2.draw_masked
"door_1.part_3.start_step",
&door_1.part_3.start_step
},
+ {
+ "door_1.part_3.start_step_opening",
+ &door_1.part_3.start_step_opening
+ },
+ {
+ "door_1.part_3.start_step_closing",
+ &door_1.part_3.start_step_closing
+ },
{
"door_1.part_3.draw_masked",
&door_1.part_3.draw_masked
"door_1.part_4.start_step",
&door_1.part_4.start_step
},
+ {
+ "door_1.part_4.start_step_opening",
+ &door_1.part_4.start_step_opening
+ },
+ {
+ "door_1.part_4.start_step_closing",
+ &door_1.part_4.start_step_closing
+ },
{
"door_1.part_4.draw_masked",
&door_1.part_4.draw_masked
"door_1.part_5.start_step",
&door_1.part_5.start_step
},
+ {
+ "door_1.part_5.start_step_opening",
+ &door_1.part_5.start_step_opening
+ },
+ {
+ "door_1.part_5.start_step_closing",
+ &door_1.part_5.start_step_closing
+ },
{
"door_1.part_5.draw_masked",
&door_1.part_5.draw_masked
"door_1.part_6.start_step",
&door_1.part_6.start_step
},
+ {
+ "door_1.part_6.start_step_opening",
+ &door_1.part_6.start_step_opening
+ },
+ {
+ "door_1.part_6.start_step_closing",
+ &door_1.part_6.start_step_closing
+ },
{
"door_1.part_6.draw_masked",
&door_1.part_6.draw_masked
"door_1.part_7.start_step",
&door_1.part_7.start_step
},
+ {
+ "door_1.part_7.start_step_opening",
+ &door_1.part_7.start_step_opening
+ },
+ {
+ "door_1.part_7.start_step_closing",
+ &door_1.part_7.start_step_closing
+ },
{
"door_1.part_7.draw_masked",
&door_1.part_7.draw_masked
"door_1.part_8.start_step",
&door_1.part_8.start_step
},
+ {
+ "door_1.part_8.start_step_opening",
+ &door_1.part_8.start_step_opening
+ },
+ {
+ "door_1.part_8.start_step_closing",
+ &door_1.part_8.start_step_closing
+ },
{
"door_1.part_8.draw_masked",
&door_1.part_8.draw_masked
"door_2.part_1.start_step",
&door_2.part_1.start_step
},
+ {
+ "door_2.part_1.start_step_opening",
+ &door_2.part_1.start_step_opening
+ },
+ {
+ "door_2.part_1.start_step_closing",
+ &door_2.part_1.start_step_closing
+ },
{
"door_2.part_1.draw_masked",
&door_2.part_1.draw_masked
"door_2.part_2.start_step",
&door_2.part_2.start_step
},
+ {
+ "door_2.part_2.start_step_opening",
+ &door_2.part_2.start_step_opening
+ },
+ {
+ "door_2.part_2.start_step_closing",
+ &door_2.part_2.start_step_closing
+ },
{
"door_2.part_2.draw_masked",
&door_2.part_2.draw_masked
"door_2.part_3.start_step",
&door_2.part_3.start_step
},
+ {
+ "door_2.part_3.start_step_opening",
+ &door_2.part_3.start_step_opening
+ },
+ {
+ "door_2.part_3.start_step_closing",
+ &door_2.part_3.start_step_closing
+ },
{
"door_2.part_3.draw_masked",
&door_2.part_3.draw_masked
"door_2.part_4.start_step",
&door_2.part_4.start_step
},
+ {
+ "door_2.part_4.start_step_opening",
+ &door_2.part_4.start_step_opening
+ },
+ {
+ "door_2.part_4.start_step_closing",
+ &door_2.part_4.start_step_closing
+ },
{
"door_2.part_4.draw_masked",
&door_2.part_4.draw_masked
"door_2.part_5.start_step",
&door_2.part_5.start_step
},
+ {
+ "door_2.part_5.start_step_opening",
+ &door_2.part_5.start_step_opening
+ },
+ {
+ "door_2.part_5.start_step_closing",
+ &door_2.part_5.start_step_closing
+ },
{
"door_2.part_5.draw_masked",
&door_2.part_5.draw_masked
"door_2.part_6.start_step",
&door_2.part_6.start_step
},
+ {
+ "door_2.part_6.start_step_opening",
+ &door_2.part_6.start_step_opening
+ },
+ {
+ "door_2.part_6.start_step_closing",
+ &door_2.part_6.start_step_closing
+ },
{
"door_2.part_6.draw_masked",
&door_2.part_6.draw_masked
"door_2.part_7.start_step",
&door_2.part_7.start_step
},
+ {
+ "door_2.part_7.start_step_opening",
+ &door_2.part_7.start_step_opening
+ },
+ {
+ "door_2.part_7.start_step_closing",
+ &door_2.part_7.start_step_closing
+ },
{
"door_2.part_7.draw_masked",
&door_2.part_7.draw_masked
"door_2.part_8.start_step",
&door_2.part_8.start_step
},
+ {
+ "door_2.part_8.start_step_opening",
+ &door_2.part_8.start_step_opening
+ },
+ {
+ "door_2.part_8.start_step_closing",
+ &door_2.part_8.start_step_closing
+ },
{
"door_2.part_8.draw_masked",
&door_2.part_8.draw_masked
"door_1.panel.start_step",
&door_1.panel.start_step
},
+ {
+ "door_1.panel.start_step_opening",
+ &door_1.panel.start_step_opening
+ },
+ {
+ "door_1.panel.start_step_closing",
+ &door_1.panel.start_step_closing
+ },
{
"door_1.panel.draw_masked",
&door_1.panel.draw_masked
"door_2.panel.start_step",
&door_2.panel.start_step
},
+ {
+ "door_2.panel.start_step_opening",
+ &door_2.panel.start_step_opening
+ },
+ {
+ "door_2.panel.start_step_closing",
+ &door_2.panel.start_step_closing
+ },
{
"door_2.panel.draw_masked",
&door_2.panel.draw_masked
struct DoorPartControlInfo *dpc = &door_part_controls[i];
struct DoorPartOrderInfo *dpo = &door_part_order[i];
- /* fill structure for door part draw order */
+ /* initialize "start_step_opening" and "start_step_closing", if needed */
+ if (dpc->pos->start_step_opening == 0 &&
+ dpc->pos->start_step_closing == 0)
+ {
+ dpc->pos->start_step_opening = dpc->pos->start_step;
+ dpc->pos->start_step_closing = dpc->pos->start_step;
+ }
+
+ /* fill structure for door part draw order (sorted below) */
dpo->nr = i;
dpo->sort_priority = dpc->pos->sort_priority;
for (i = 0; i < MAX_DOOR_PARTS; i++)
{
- struct DoorPartControlInfo *dpc = &door_part_controls[i];
- struct GraphicInfo *g = &graphic_info[dpc->graphic];
+ int nr = door_part_order[i].nr;
+ struct DoorPartControlInfo *dpc = &door_part_controls[nr];
struct DoorPartPosInfo *pos = dpc->pos;
+ struct GraphicInfo *g = &graphic_info[dpc->graphic];
+ int door_token = dpc->door_nr;
+ boolean is_panel = DOOR_PART_IS_PANEL(nr);
int step_xoffset = ABS(pos->step_xoffset);
int step_yoffset = ABS(pos->step_yoffset);
int step_delay = pos->step_delay;
- int start_step = pos->start_step;
+ int current_door_state = door_state & door_token;
+ boolean door_opening = ((current_door_state & DOOR_OPEN) != 0);
+ boolean door_closing = ((current_door_state & DOOR_CLOSE) != 0);
+ boolean part_opening = (is_panel ? door_closing : door_opening);
+ int start_step = (part_opening ? pos->start_step_opening :
+ pos->start_step_closing);
float move_xsize = (step_xoffset ? g->width : 0);
float move_ysize = (step_yoffset ? g->height : 0);
int move_xsteps = (step_xoffset ? ceil(move_xsize / step_xoffset) : 0);
move_xsteps ? move_xsteps : move_ysteps) - start_step;
int move_delay = move_steps * step_delay;
- if (door_part_done[i])
+ if (door_part_done[nr])
continue;
max_move_delay = MAX(max_move_delay, move_delay);
max_step_delay = (max_step_delay == 0 ? step_delay :
euclid(max_step_delay, step_delay));
- num_steps[i] = move_steps;
+ num_steps[nr] = move_steps;
#if 0
#if 0
{
int nr = door_part_order[i].nr;
struct DoorPartControlInfo *dpc = &door_part_controls[nr];
+ struct DoorPartPosInfo *pos = dpc->pos;
+ struct GraphicInfo *g = &graphic_info[dpc->graphic];
int door_token = dpc->door_nr;
int door_index = DOOR_INDEX_FROM_TOKEN(door_token);
boolean is_panel = DOOR_PART_IS_PANEL(nr);
- struct GraphicInfo *g = &graphic_info[dpc->graphic];
- struct DoorPartPosInfo *pos = dpc->pos;
struct XY *panel_pos = &panel_pos_list[door_index];
struct Rect *door_rect = &door_rect_list[door_index];
Bitmap *bitmap = (is_panel ? bitmap_db_door : g->bitmap);
int current_door_state = door_state & door_token;
boolean door_opening = ((current_door_state & DOOR_OPEN) != 0);
boolean door_closing = ((current_door_state & DOOR_CLOSE) != 0);
- boolean mode_opening = (is_panel ? door_closing : door_opening);
- int start_step = pos->start_step;
+ boolean part_opening = (is_panel ? door_closing : door_opening);
+ int start_step = (part_opening ? pos->start_step_opening :
+ pos->start_step_closing);
int step_delay = pos->step_delay;
int step_factor = step_delay / max_step_delay;
int k1 = (step_factor ? k / step_factor + 1 : k);
- int k2 = (mode_opening ? k1 + start_step : num_steps[nr] - k1);
+ int k2 = (part_opening ? k1 + start_step : num_steps[nr] - k1);
int kk = (k2 < 0 ? 0 : k2);
int src_x, src_y, src_xx, src_yy;
int dst_x, dst_y, dst_xx, dst_yy;