rnd-20100401-1-src
authorHolger Schemel <info@artsoft.org>
Thu, 1 Apr 2010 08:33:33 +0000 (10:33 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:58:57 +0000 (10:58 +0200)
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/game.c
src/game.h
src/init.c
src/libgame/misc.c
src/libgame/setup.c

index 913a3728888f4e97ec53c0d3ad59c9a82b57403d..1282c695dfad181381f44ca742e33141b84ddc15 100644 (file)
@@ -5842,6 +5842,15 @@ struct ConfigInfo image_config[] =
   { "game.panel.time_ss.draw_masked",          "true"                  },
   { "game.panel.time_ss.draw_order",           "0"                     },
 
+  { "game.panel.frame.x",                      "-1"                    },
+  { "game.panel.frame.y",                      "-1"                    },
+  { "game.panel.frame.align",                  "left"                  },
+  { "game.panel.frame.valign",                 "top"                   },
+  { "game.panel.frame.digits",                 "-1"                    },
+  { "game.panel.frame.font",                   "font.text_2"           },
+  { "game.panel.frame.draw_masked",            "true"                  },
+  { "game.panel.frame.draw_order",             "0"                     },
+
   { "game.panel.shield_normal.x",              "-1"                    },
   { "game.panel.shield_normal.y",              "-1"                    },
   { "game.panel.shield_normal.tile_size",      "16"                    },
index 13fa8959a4335966b8088f9528924be734d605c8..3edf500b8036c03ada5952f62a8f6dec4f152dc8 100644 (file)
@@ -2936,6 +2936,38 @@ struct TokenIntPtrInfo image_config_vars[] =
     "game.panel.time_ss.draw_order",
     &game.panel.time_ss.sort_priority
   },
+  {
+    "game.panel.frame.x",
+    &game.panel.frame.x
+  },
+  {
+    "game.panel.frame.y",
+    &game.panel.frame.y
+  },
+  {
+    "game.panel.frame.align",
+    &game.panel.frame.align
+  },
+  {
+    "game.panel.frame.valign",
+    &game.panel.frame.valign
+  },
+  {
+    "game.panel.frame.digits",
+    &game.panel.frame.size
+  },
+  {
+    "game.panel.frame.font",
+    &game.panel.frame.font
+  },
+  {
+    "game.panel.frame.draw_masked",
+    &game.panel.frame.draw_masked
+  },
+  {
+    "game.panel.frame.draw_order",
+    &game.panel.frame.sort_priority
+  },
   {
     "game.panel.shield_normal.x",
     &game.panel.shield_normal.x
index dc3844eee5b1cb1b665420256a364ddf0d4d9b3f..4b951c0d25db7a8395a75c72c3396065caa810aa 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2010-03-27 20:44"
+#define COMPILE_DATE_STRING "2010-03-31 10:44"
index d486b15fd19db7435a87ae285b2a9a96e66b1094..556c22b29aa87abd23b7a6975809761c739c2389 100644 (file)
 #define GAME_PANEL_TIME_HH                     32
 #define GAME_PANEL_TIME_MM                     33
 #define GAME_PANEL_TIME_SS                     34
-#define GAME_PANEL_SHIELD_NORMAL               35
-#define GAME_PANEL_SHIELD_NORMAL_TIME          36
-#define GAME_PANEL_SHIELD_DEADLY               37
-#define GAME_PANEL_SHIELD_DEADLY_TIME          38
-#define GAME_PANEL_EXIT                                39
-#define GAME_PANEL_EMC_MAGIC_BALL              40
-#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH       41
-#define GAME_PANEL_LIGHT_SWITCH                        42
-#define GAME_PANEL_LIGHT_SWITCH_TIME           43
-#define GAME_PANEL_TIMEGATE_SWITCH             44
-#define GAME_PANEL_TIMEGATE_SWITCH_TIME                45
-#define GAME_PANEL_SWITCHGATE_SWITCH           46
-#define GAME_PANEL_EMC_LENSES                  47
-#define GAME_PANEL_EMC_LENSES_TIME             48
-#define GAME_PANEL_EMC_MAGNIFIER               49
-#define GAME_PANEL_EMC_MAGNIFIER_TIME          50
-#define GAME_PANEL_BALLOON_SWITCH              51
-#define GAME_PANEL_DYNABOMB_NUMBER             52
-#define GAME_PANEL_DYNABOMB_SIZE               53
-#define GAME_PANEL_DYNABOMB_POWER              54
-#define GAME_PANEL_PENGUINS                    55
-#define GAME_PANEL_SOKOBAN_OBJECTS             56
-#define GAME_PANEL_SOKOBAN_FIELDS              57
-#define GAME_PANEL_ROBOT_WHEEL                 58
-#define GAME_PANEL_CONVEYOR_BELT_1             59
-#define GAME_PANEL_CONVEYOR_BELT_2             60
-#define GAME_PANEL_CONVEYOR_BELT_3             61
-#define GAME_PANEL_CONVEYOR_BELT_4             62
-#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH      63
-#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH      64
-#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH      65
-#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH      66
-#define GAME_PANEL_MAGIC_WALL                  67
-#define GAME_PANEL_MAGIC_WALL_TIME             68
-#define GAME_PANEL_GRAVITY_STATE               69
-#define GAME_PANEL_GRAPHIC_1                   70
-#define GAME_PANEL_GRAPHIC_2                   71
-#define GAME_PANEL_GRAPHIC_3                   72
-#define GAME_PANEL_GRAPHIC_4                   73
-#define GAME_PANEL_GRAPHIC_5                   74
-#define GAME_PANEL_GRAPHIC_6                   75
-#define GAME_PANEL_GRAPHIC_7                   76
-#define GAME_PANEL_GRAPHIC_8                   77
-#define GAME_PANEL_ELEMENT_1                   78
-#define GAME_PANEL_ELEMENT_2                   79
-#define GAME_PANEL_ELEMENT_3                   80
-#define GAME_PANEL_ELEMENT_4                   81
-#define GAME_PANEL_ELEMENT_5                   82
-#define GAME_PANEL_ELEMENT_6                   83
-#define GAME_PANEL_ELEMENT_7                   84
-#define GAME_PANEL_ELEMENT_8                   85
-#define GAME_PANEL_ELEMENT_COUNT_1             86
-#define GAME_PANEL_ELEMENT_COUNT_2             87
-#define GAME_PANEL_ELEMENT_COUNT_3             88
-#define GAME_PANEL_ELEMENT_COUNT_4             89
-#define GAME_PANEL_ELEMENT_COUNT_5             90
-#define GAME_PANEL_ELEMENT_COUNT_6             91
-#define GAME_PANEL_ELEMENT_COUNT_7             92
-#define GAME_PANEL_ELEMENT_COUNT_8             93
-#define GAME_PANEL_CE_SCORE_1                  94
-#define GAME_PANEL_CE_SCORE_2                  95
-#define GAME_PANEL_CE_SCORE_3                  96
-#define GAME_PANEL_CE_SCORE_4                  97
-#define GAME_PANEL_CE_SCORE_5                  98
-#define GAME_PANEL_CE_SCORE_6                  99
-#define GAME_PANEL_CE_SCORE_7                  100
-#define GAME_PANEL_CE_SCORE_8                  101
-#define GAME_PANEL_CE_SCORE_1_ELEMENT          102
-#define GAME_PANEL_CE_SCORE_2_ELEMENT          103
-#define GAME_PANEL_CE_SCORE_3_ELEMENT          104
-#define GAME_PANEL_CE_SCORE_4_ELEMENT          105
-#define GAME_PANEL_CE_SCORE_5_ELEMENT          106
-#define GAME_PANEL_CE_SCORE_6_ELEMENT          107
-#define GAME_PANEL_CE_SCORE_7_ELEMENT          108
-#define GAME_PANEL_CE_SCORE_8_ELEMENT          109
-#define GAME_PANEL_PLAYER_NAME                 110
-#define GAME_PANEL_LEVEL_NAME                  111
-#define GAME_PANEL_LEVEL_AUTHOR                        112
-
-#define NUM_GAME_PANEL_CONTROLS                        113
+#define GAME_PANEL_FRAME                       35
+#define GAME_PANEL_SHIELD_NORMAL               36
+#define GAME_PANEL_SHIELD_NORMAL_TIME          37
+#define GAME_PANEL_SHIELD_DEADLY               38
+#define GAME_PANEL_SHIELD_DEADLY_TIME          39
+#define GAME_PANEL_EXIT                                40
+#define GAME_PANEL_EMC_MAGIC_BALL              41
+#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH       42
+#define GAME_PANEL_LIGHT_SWITCH                        43
+#define GAME_PANEL_LIGHT_SWITCH_TIME           44
+#define GAME_PANEL_TIMEGATE_SWITCH             45
+#define GAME_PANEL_TIMEGATE_SWITCH_TIME                46
+#define GAME_PANEL_SWITCHGATE_SWITCH           47
+#define GAME_PANEL_EMC_LENSES                  48
+#define GAME_PANEL_EMC_LENSES_TIME             49
+#define GAME_PANEL_EMC_MAGNIFIER               50
+#define GAME_PANEL_EMC_MAGNIFIER_TIME          51
+#define GAME_PANEL_BALLOON_SWITCH              52
+#define GAME_PANEL_DYNABOMB_NUMBER             53
+#define GAME_PANEL_DYNABOMB_SIZE               54
+#define GAME_PANEL_DYNABOMB_POWER              55
+#define GAME_PANEL_PENGUINS                    56
+#define GAME_PANEL_SOKOBAN_OBJECTS             57
+#define GAME_PANEL_SOKOBAN_FIELDS              58
+#define GAME_PANEL_ROBOT_WHEEL                 59
+#define GAME_PANEL_CONVEYOR_BELT_1             60
+#define GAME_PANEL_CONVEYOR_BELT_2             61
+#define GAME_PANEL_CONVEYOR_BELT_3             62
+#define GAME_PANEL_CONVEYOR_BELT_4             63
+#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH      64
+#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH      65
+#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH      66
+#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH      67
+#define GAME_PANEL_MAGIC_WALL                  68
+#define GAME_PANEL_MAGIC_WALL_TIME             69
+#define GAME_PANEL_GRAVITY_STATE               70
+#define GAME_PANEL_GRAPHIC_1                   71
+#define GAME_PANEL_GRAPHIC_2                   72
+#define GAME_PANEL_GRAPHIC_3                   73
+#define GAME_PANEL_GRAPHIC_4                   74
+#define GAME_PANEL_GRAPHIC_5                   75
+#define GAME_PANEL_GRAPHIC_6                   76
+#define GAME_PANEL_GRAPHIC_7                   77
+#define GAME_PANEL_GRAPHIC_8                   78
+#define GAME_PANEL_ELEMENT_1                   79
+#define GAME_PANEL_ELEMENT_2                   80
+#define GAME_PANEL_ELEMENT_3                   81
+#define GAME_PANEL_ELEMENT_4                   82
+#define GAME_PANEL_ELEMENT_5                   83
+#define GAME_PANEL_ELEMENT_6                   84
+#define GAME_PANEL_ELEMENT_7                   85
+#define GAME_PANEL_ELEMENT_8                   86
+#define GAME_PANEL_ELEMENT_COUNT_1             87
+#define GAME_PANEL_ELEMENT_COUNT_2             88
+#define GAME_PANEL_ELEMENT_COUNT_3             89
+#define GAME_PANEL_ELEMENT_COUNT_4             90
+#define GAME_PANEL_ELEMENT_COUNT_5             91
+#define GAME_PANEL_ELEMENT_COUNT_6             92
+#define GAME_PANEL_ELEMENT_COUNT_7             93
+#define GAME_PANEL_ELEMENT_COUNT_8             94
+#define GAME_PANEL_CE_SCORE_1                  95
+#define GAME_PANEL_CE_SCORE_2                  96
+#define GAME_PANEL_CE_SCORE_3                  97
+#define GAME_PANEL_CE_SCORE_4                  98
+#define GAME_PANEL_CE_SCORE_5                  99
+#define GAME_PANEL_CE_SCORE_6                  100
+#define GAME_PANEL_CE_SCORE_7                  101
+#define GAME_PANEL_CE_SCORE_8                  102
+#define GAME_PANEL_CE_SCORE_1_ELEMENT          103
+#define GAME_PANEL_CE_SCORE_2_ELEMENT          104
+#define GAME_PANEL_CE_SCORE_3_ELEMENT          105
+#define GAME_PANEL_CE_SCORE_4_ELEMENT          106
+#define GAME_PANEL_CE_SCORE_5_ELEMENT          107
+#define GAME_PANEL_CE_SCORE_6_ELEMENT          108
+#define GAME_PANEL_CE_SCORE_7_ELEMENT          109
+#define GAME_PANEL_CE_SCORE_8_ELEMENT          110
+#define GAME_PANEL_PLAYER_NAME                 111
+#define GAME_PANEL_LEVEL_NAME                  112
+#define GAME_PANEL_LEVEL_AUTHOR                        113
+
+#define NUM_GAME_PANEL_CONTROLS                        114
 
 struct GamePanelOrderInfo
 {
@@ -473,6 +474,11 @@ static struct GamePanelControlInfo game_panel_controls[] =
     &game.panel.time_ss,
     TYPE_INTEGER,
   },
+  {
+    GAME_PANEL_FRAME,
+    &game.panel.frame,
+    TYPE_INTEGER,
+  },
   {
     GAME_PANEL_SHIELD_NORMAL,
     &game.panel.shield_normal,
@@ -2347,6 +2353,8 @@ void UpdateGameControlValues()
   game_panel_controls[GAME_PANEL_TIME_MM].value = (time / 60) % 60;
   game_panel_controls[GAME_PANEL_TIME_SS].value = time % 60;
 
+  game_panel_controls[GAME_PANEL_FRAME].value = FrameCounter;
+
   game_panel_controls[GAME_PANEL_SHIELD_NORMAL].value =
     (local_player->shield_normal_time_left > 0 ? EL_SHIELD_NORMAL_ACTIVE :
      EL_EMPTY);
index f5bf7bbf37fdb9ca2d0ab635fdc54c3d3c47736e..c764e1d39163d18cf7dd56f5e54215fc7143906b 100644 (file)
@@ -47,6 +47,7 @@ struct GamePanelInfo
   struct TextPosInfo time_hh;
   struct TextPosInfo time_mm;
   struct TextPosInfo time_ss;
+  struct TextPosInfo frame;
   struct TextPosInfo shield_normal;
   struct TextPosInfo shield_normal_time;
   struct TextPosInfo shield_deadly;
index 4596e8395d4772a6b2bd282680435f20fa948b2e..6d0b9501bb136d832991a1902ec20fd07ddc0e78 100644 (file)
@@ -39,7 +39,7 @@
 #define CONFIG_TOKEN_GLOBAL_BUSY               "global.busy"
 
 #define DEBUG_PRINT_INIT_TIMESTAMPS            TRUE
-#define DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH      1
+#define DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH      10
 
 
 static struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS];
@@ -6171,8 +6171,14 @@ void OpenAll()
 
   game_status = GAME_MODE_LOADING;
 
+#if 1
+  InitCounter();
+#endif
+
   InitGlobal();                        /* initialize some global variables */
 
+  print_timestamp_time("[init global stuff]");
+
   if (options.execute_command)
     Execute_Command(options.execute_command);
 
@@ -6195,25 +6201,29 @@ void OpenAll()
   InitArtworkConfig();         /* needed before forking sound child process */
   InitMixer();
 
+#if 0
   InitCounter();
+#endif
 
   InitRND(NEW_RANDOMIZE);
   InitSimpleRandom(NEW_RANDOMIZE);
 
   InitJoysticks();
 
-  print_timestamp_time("[pre-video]");
+  print_timestamp_time("[init setup/config stuff]");
 
   InitVideoDisplay();
   InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
 
   InitEventFilter(FilterMouseMotionEvents);
 
+  print_timestamp_time("[init video stuff]");
+
   InitElementPropertiesStatic();
   InitElementPropertiesEngine(GAME_VERSION_ACTUAL);
   InitElementPropertiesGfxElement();
 
-  print_timestamp_time("[post-video]");
+  print_timestamp_time("[init element properties stuff]");
 
   InitGfx();
 
index 1535b69cd04d7d1c5dd92d6d6b7c6f3f5c3887b4..d21815b29b48db5dc91e27de15558b5f50984880 100644 (file)
@@ -182,6 +182,46 @@ END_OF_FUNCTION(increment_counter);
 /* maximal allowed length of a command line option */
 #define MAX_OPTION_LEN         256
 
+#if 1
+
+#ifdef TARGET_SDL
+static unsigned long getCurrentMS()
+{
+  return SDL_GetTicks();
+}
+
+#else /* !TARGET_SDL */
+
+#if defined(PLATFORM_UNIX)
+static unsigned long getCurrentMS()
+{
+  struct timeval current_time;
+
+  gettimeofday(&current_time, NULL);
+
+  return current_time.tv_sec * 1000 + current_time.tv_usec / 1000;
+}
+#endif /* PLATFORM_UNIX */
+#endif /* !TARGET_SDL */
+
+static unsigned long mainCounter(int mode)
+{
+  static unsigned long base_ms = 0;
+  unsigned long current_ms;
+
+  /* get current system milliseconds */
+  current_ms = getCurrentMS();
+
+  /* reset base timestamp in case of counter reset or wrap-around */
+  if (mode == INIT_COUNTER || current_ms < base_ms)
+    base_ms = current_ms;
+
+  /* return milliseconds since last counter reset */
+  return current_ms - base_ms;
+}
+
+#else
+
 #ifdef TARGET_SDL
 static unsigned long mainCounter(int mode)
 {
@@ -223,6 +263,8 @@ static unsigned long mainCounter(int mode)
 #endif /* PLATFORM_UNIX */
 #endif /* !TARGET_SDL */
 
+#endif
+
 void InitCounter()             /* set counter back to zero */
 {
 #if !defined(PLATFORM_MSDOS)
index 3ccc53524dcb5d49e88f0501750965570215e10c..b7e34adf1b3d2ab8267102e7cb48731f9d9be03d 100644 (file)
@@ -2603,7 +2603,11 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent)
     ti->last_level = 0;
     ti->level_group = FALSE;
     ti->handicap_level = 0;
+#if 1
+    ti->readonly = parent->readonly;
+#else
     ti->readonly = TRUE;
+#endif
     ti->handicap = TRUE;
     ti->skip_levels = FALSE;
   }
@@ -3137,6 +3141,12 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first,
   leveldir_new->in_user_dir =
     (!strEqual(leveldir_new->basepath, options.level_directory));
 
+#if 0
+  printf("::: '%s' -> %d\n",
+        leveldir_new->identifier,
+        leveldir_new->in_user_dir);
+#endif
+
   /* adjust some settings if user's private level directory was detected */
   if (leveldir_new->sort_priority == LEVELCLASS_UNDEFINED &&
       leveldir_new->in_user_dir &&