rnd-20140228-1-src
authorHolger Schemel <info@artsoft.org>
Fri, 28 Feb 2014 20:56:32 +0000 (21:56 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 09:01:04 +0000 (11:01 +0200)
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/tools.c

index 90c2585303bdb3bed39f6322396fcbc7c1de6499..3eb72e80884f9dda5dbb1b0ecdd92745a3653b6e 100644 (file)
@@ -5973,6 +5973,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_1.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_1.draw_order",                        "3"                     },
   { "door_1.part_2.x",                         "0"                     },
@@ -5980,6 +5981,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_2.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_2.draw_order",                        "5"                     },
   { "door_1.part_3.x",                         "0"                     },
@@ -5987,6 +5989,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_3.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_3.draw_order",                        "4"                     },
   { "door_1.part_4.x",                         "0"                     },
@@ -5994,6 +5997,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_4.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_4.draw_order",                        "6"                     },
   { "door_1.part_5.x",                         "0"                     },
@@ -6001,6 +6005,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_5.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_5.draw_order",                        "1"                     },
   { "door_1.part_6.x",                         "0"                     },
@@ -6008,6 +6013,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_6.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_6.draw_order",                        "7"                     },
   { "door_1.part_7.x",                         "0"                     },
@@ -6015,6 +6021,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_7.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_7.draw_order",                        "2"                     },
   { "door_1.part_8.x",                         "0"                     },
@@ -6022,6 +6029,7 @@ struct ConfigInfo image_config[] =
   { "door_1.part_8.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_1.part_8.draw_order",                        "8"                     },
 
@@ -6030,6 +6038,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_1.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_1.draw_order",                        "2"                     },
   { "door_2.part_2.x",                         "0"                     },
@@ -6037,6 +6046,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_2.step_xoffset",              "3"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_2.draw_order",                        "3"                     },
   { "door_2.part_3.x",                         "0"                     },
@@ -6044,6 +6054,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_3.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_3.draw_order",                        "1"                     },
   { "door_2.part_4.x",                         "0"                     },
@@ -6051,6 +6062,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_4.step_xoffset",              "-3"                    },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_4.draw_order",                        "4"                     },
   { "door_2.part_5.x",                         "-1"                    },
@@ -6058,6 +6070,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_5.step_xoffset",              "0"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_5.draw_order",                        "0"                     },
   { "door_2.part_6.x",                         "-1"                    },
@@ -6065,6 +6078,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_6.step_xoffset",              "0"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_6.draw_order",                        "0"                     },
   { "door_2.part_7.x",                         "-1"                    },
@@ -6072,6 +6086,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_7.step_xoffset",              "0"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_7.draw_order",                        "0"                     },
   { "door_2.part_8.x",                         "-1"                    },
@@ -6079,6 +6094,7 @@ struct ConfigInfo image_config[] =
   { "door_2.part_8.step_xoffset",              "0"                     },
   { "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.draw_masked",               "true"                  },
   { "door_2.part_8.draw_order",                        "0"                     },
 
index 7cd60d12ec2d42347ed168ef7bb868e7f2adaa17..0f7607801e205e81e0c7c1a3275a8c4a33b3308f 100644 (file)
@@ -2112,6 +2112,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_1.step_delay",
     &door_1.part_1.step_delay
   },
+  {
+    "door_1.part_1.start_step",
+    &door_1.part_1.start_step
+  },
   {
     "door_1.part_1.draw_masked",
     &door_1.part_1.draw_masked
@@ -2140,6 +2144,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_2.step_delay",
     &door_1.part_2.step_delay
   },
+  {
+    "door_1.part_2.start_step",
+    &door_1.part_2.start_step
+  },
   {
     "door_1.part_2.draw_masked",
     &door_1.part_2.draw_masked
@@ -2168,6 +2176,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_3.step_delay",
     &door_1.part_3.step_delay
   },
+  {
+    "door_1.part_3.start_step",
+    &door_1.part_3.start_step
+  },
   {
     "door_1.part_3.draw_masked",
     &door_1.part_3.draw_masked
@@ -2196,6 +2208,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_4.step_delay",
     &door_1.part_4.step_delay
   },
+  {
+    "door_1.part_4.start_step",
+    &door_1.part_4.start_step
+  },
   {
     "door_1.part_4.draw_masked",
     &door_1.part_4.draw_masked
@@ -2224,6 +2240,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_5.step_delay",
     &door_1.part_5.step_delay
   },
+  {
+    "door_1.part_5.start_step",
+    &door_1.part_5.start_step
+  },
   {
     "door_1.part_5.draw_masked",
     &door_1.part_5.draw_masked
@@ -2252,6 +2272,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_6.step_delay",
     &door_1.part_6.step_delay
   },
+  {
+    "door_1.part_6.start_step",
+    &door_1.part_6.start_step
+  },
   {
     "door_1.part_6.draw_masked",
     &door_1.part_6.draw_masked
@@ -2280,6 +2304,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_7.step_delay",
     &door_1.part_7.step_delay
   },
+  {
+    "door_1.part_7.start_step",
+    &door_1.part_7.start_step
+  },
   {
     "door_1.part_7.draw_masked",
     &door_1.part_7.draw_masked
@@ -2308,6 +2336,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_1.part_8.step_delay",
     &door_1.part_8.step_delay
   },
+  {
+    "door_1.part_8.start_step",
+    &door_1.part_8.start_step
+  },
   {
     "door_1.part_8.draw_masked",
     &door_1.part_8.draw_masked
@@ -2336,6 +2368,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_1.step_delay",
     &door_2.part_1.step_delay
   },
+  {
+    "door_2.part_1.start_step",
+    &door_2.part_1.start_step
+  },
   {
     "door_2.part_1.draw_masked",
     &door_2.part_1.draw_masked
@@ -2364,6 +2400,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_2.step_delay",
     &door_2.part_2.step_delay
   },
+  {
+    "door_2.part_2.start_step",
+    &door_2.part_2.start_step
+  },
   {
     "door_2.part_2.draw_masked",
     &door_2.part_2.draw_masked
@@ -2392,6 +2432,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_3.step_delay",
     &door_2.part_3.step_delay
   },
+  {
+    "door_2.part_3.start_step",
+    &door_2.part_3.start_step
+  },
   {
     "door_2.part_3.draw_masked",
     &door_2.part_3.draw_masked
@@ -2420,6 +2464,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_4.step_delay",
     &door_2.part_4.step_delay
   },
+  {
+    "door_2.part_4.start_step",
+    &door_2.part_4.start_step
+  },
   {
     "door_2.part_4.draw_masked",
     &door_2.part_4.draw_masked
@@ -2448,6 +2496,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_5.step_delay",
     &door_2.part_5.step_delay
   },
+  {
+    "door_2.part_5.start_step",
+    &door_2.part_5.start_step
+  },
   {
     "door_2.part_5.draw_masked",
     &door_2.part_5.draw_masked
@@ -2476,6 +2528,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_6.step_delay",
     &door_2.part_6.step_delay
   },
+  {
+    "door_2.part_6.start_step",
+    &door_2.part_6.start_step
+  },
   {
     "door_2.part_6.draw_masked",
     &door_2.part_6.draw_masked
@@ -2504,6 +2560,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_7.step_delay",
     &door_2.part_7.step_delay
   },
+  {
+    "door_2.part_7.start_step",
+    &door_2.part_7.start_step
+  },
   {
     "door_2.part_7.draw_masked",
     &door_2.part_7.draw_masked
@@ -2532,6 +2592,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "door_2.part_8.step_delay",
     &door_2.part_8.step_delay
   },
+  {
+    "door_2.part_8.start_step",
+    &door_2.part_8.start_step
+  },
   {
     "door_2.part_8.draw_masked",
     &door_2.part_8.draw_masked
index e9184eb71df85d212b0cf5e0e3322098117cbcce..7e43d7b5fd3d9d24dca6ff95b06b230d88126883 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-02-27 02:26"
+#define COMPILE_DATE_STRING "2014-02-28 21:40"
index 5b32c1c2cc83eff3b40b65ebaa1266f18ab34ed0..0348f112c4f07abe7a21c31f2eb9b2178bb20afe 100644 (file)
@@ -5528,8 +5528,8 @@ unsigned int MoveDoor(unsigned int door_state)
       struct DoorPartPosInfo *pos = dpc->pos;
       int step_xoffset = ABS(pos->step_xoffset);
       int step_yoffset = ABS(pos->step_yoffset);
-      int start_step = pos->start_step;
       int step_delay = pos->step_delay;
+      int start_step = pos->start_step;
       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);
@@ -5592,10 +5592,11 @@ unsigned int MoveDoor(unsigned int door_state)
        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;
        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 : num_steps[nr] - k1);
+       int k2 = (mode_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;
@@ -5613,7 +5614,7 @@ unsigned int MoveDoor(unsigned int door_state)
 
 #if 0
        // !!! TEST !!! 
-       if (nr != 0)
+       if (nr != 16 && nr != 0)
          continue;
 #endif
 
@@ -5713,6 +5714,14 @@ unsigned int MoveDoor(unsigned int door_state)
        dst_x = door_rect->x + dst_xx;
        dst_y = door_rect->y + dst_yy;
 
+#if 0
+       if (DOOR_PART_IS_PANEL(nr))
+       {
+         printf("::: width == %d, height == %d [%d, %d] [%d, %d]\n",
+                width, height, g->width, g->height, src_x, src_y);
+       }
+#endif
+
        if (width  >= 0 && width  <= g->width &&
            height >= 0 && height <= g->height)
        {
@@ -5767,8 +5776,10 @@ unsigned int MoveDoor(unsigned int door_state)
        if (!door_part_done[i])
          door_part_done_all = FALSE;
 
+#if 0
       if (door_part_done_all)
        break;
+#endif
     }
   }