-#define COMPILE_DATE_STRING "2013-12-10 01:00"
+#define COMPILE_DATE_STRING "2013-12-11 11:28"
#define CONFIG_TOKEN_FONT_INITIAL "font.initial"
#define CONFIG_TOKEN_GLOBAL_BUSY "global.busy"
-#define DEBUG_PRINT_INIT_TIMESTAMPS TRUE
-#define DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH 0
-
static struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS];
static struct GraphicInfo anim_initial;
};
-static void print_timestamp_ext(char *message, char *mode)
-{
-#if DEBUG
-#if DEBUG_PRINT_INIT_TIMESTAMPS
- static char *debug_message = NULL;
- static char *last_message = NULL;
- static int counter_nr = 0;
- int max_depth = DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH;
-
- checked_free(debug_message);
- debug_message = getStringCat3(mode, " ", message);
-
- if (strEqual(mode, "INIT"))
- {
- debug_print_timestamp(counter_nr, NULL);
-
- if (counter_nr + 1 < max_depth)
- debug_print_timestamp(counter_nr, debug_message);
-
- counter_nr++;
-
- debug_print_timestamp(counter_nr, NULL);
- }
- else if (strEqual(mode, "DONE"))
- {
- counter_nr--;
-
- if (counter_nr + 1 < max_depth ||
- (counter_nr == 0 && max_depth == 1))
- {
- last_message = message;
-
- if (counter_nr == 0 && max_depth == 1)
- {
- checked_free(debug_message);
- debug_message = getStringCat3("TIME", " ", message);
- }
-
- debug_print_timestamp(counter_nr, debug_message);
- }
- }
- else if (!strEqual(mode, "TIME") ||
- !strEqual(message, last_message))
- {
- if (counter_nr < max_depth)
- debug_print_timestamp(counter_nr, debug_message);
- }
-#endif
-#endif
-}
-
-static void print_timestamp_init(char *message)
-{
- print_timestamp_ext(message, "INIT");
-}
-
-static void print_timestamp_time(char *message)
-{
- print_timestamp_ext(message, "TIME");
-}
-
-static void print_timestamp_done(char *message)
-{
- print_timestamp_ext(message, "DONE");
-}
-
void DrawInitAnim()
{
struct GraphicInfo *graphic_info_last = graphic_info;
printf("::: reloading images '%s' ...\n", artwork.gfx_current_identifier);
#endif
+ print_timestamp_init("ReloadCustomImages");
+
LoadArtworkConfig(image_info);
+ print_timestamp_time("LoadArtworkConfig");
+
ReloadCustomArtworkList(image_info);
+ print_timestamp_time("ReloadCustomArtworkList");
+
+ print_timestamp_done("ReloadCustomImages");
}
void CreateImageWithSmallImages(int pos, int zoom_factor)
dir->dir_entry->is_directory =
(stat(dir->dir_entry->filename, &file_status) == 0 &&
- (file_status.st_mode & S_IFMT) != S_IFDIR);
+ (file_status.st_mode & S_IFMT) == S_IFDIR);
+
+#if 0
+ Error(ERR_INFO, "::: '%s' is directory: %d",
+ dir->dir_entry->basename,
+ dir->dir_entry->is_directory);
+#endif
return dir->dir_entry;
}
if (strEqual(file_list_entry->filename, UNDEFINED_FILENAME))
{
deleteArtworkListEntry(artwork_info, listnode);
+
return;
}
artwork_info->num_dynamic_file_list_entries;
int i;
+ print_timestamp_init("ReloadCustomArtworkList");
+
for (i = 0; i < num_file_list_entries; i++)
LoadCustomArtwork(artwork_info, &artwork_info->artwork_list[i],
&file_list[i]);
LoadCustomArtwork(artwork_info, &artwork_info->dynamic_artwork_list[i],
&dynamic_file_list[i]);
+ print_timestamp_done("ReloadCustomArtworkList");
+
#if 0
dumpList(artwork_info->content_list);
#endif
#if DEBUG
-#define DEBUG_NUM_TIMESTAMPS 5
-#define DEBUG_TIME_IN_MICROSECONDS 0
+#define DEBUG_PRINT_INIT_TIMESTAMPS TRUE
+#define DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH 10
+
+#define DEBUG_NUM_TIMESTAMPS 10
+#define DEBUG_TIME_IN_MICROSECONDS 0
#if DEBUG_TIME_IN_MICROSECONDS
static double Counter_Microseconds()
counter[counter_nr][1] = counter[counter_nr][0];
if (message)
+#if 1
+ Error(ERR_INFO, "%s%s%s %.3f %s",
+#else
printf("%s%s%s %.3f %s\n",
+#endif
debug_print_timestamp_get_padding(counter_nr * indent_size),
message,
debug_print_timestamp_get_padding(padding_size - strlen(message)),
printf("\n");
}
}
+
+void print_timestamp_ext(char *message, char *mode)
+{
+#if DEBUG_PRINT_INIT_TIMESTAMPS
+ static char *debug_message = NULL;
+ static char *last_message = NULL;
+ static int counter_nr = 0;
+ int max_depth = DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH;
+
+ checked_free(debug_message);
+ debug_message = getStringCat3(mode, " ", message);
+
+ if (strEqual(mode, "INIT"))
+ {
+ debug_print_timestamp(counter_nr, NULL);
+
+ if (counter_nr + 1 < max_depth)
+ debug_print_timestamp(counter_nr, debug_message);
+
+ counter_nr++;
+
+ debug_print_timestamp(counter_nr, NULL);
+ }
+ else if (strEqual(mode, "DONE"))
+ {
+ counter_nr--;
+
+ if (counter_nr + 1 < max_depth ||
+ (counter_nr == 0 && max_depth == 1))
+ {
+ last_message = message;
+
+ if (counter_nr == 0 && max_depth == 1)
+ {
+ checked_free(debug_message);
+ debug_message = getStringCat3("TIME", " ", message);
+ }
+
+ debug_print_timestamp(counter_nr, debug_message);
+ }
+ }
+ else if (!strEqual(mode, "TIME") ||
+ !strEqual(message, last_message))
+ {
+ if (counter_nr < max_depth)
+ debug_print_timestamp(counter_nr, debug_message);
+ }
#endif
+}
+
+void print_timestamp_init(char *message)
+{
+ print_timestamp_ext(message, "INIT");
+}
+
+void print_timestamp_time(char *message)
+{
+ print_timestamp_ext(message, "TIME");
+}
+
+void print_timestamp_done(char *message)
+{
+ print_timestamp_ext(message, "DONE");
+}
+
+#endif /* DEBUG */
void dumpErrorFile();
void NotifyUserAboutErrorFile();
+#if DEBUG
void debug_print_timestamp(int, char *);
+void print_timestamp_init(char *);
+void print_timestamp_time(char *);
+void print_timestamp_done(char *);
+#endif /* DEBUG */
+
+
#endif /* MISC_H */
Bitmap *new_bitmap = CreateBitmapStruct();
SDL_Surface *sdl_image_tmp;
+ print_timestamp_init("SDLLoadImage");
+
+ print_timestamp_time(getBaseNamePtr(filename));
+
/* load image to temporary surface */
if ((sdl_image_tmp = IMG_Load(filename)) == NULL)
{
return NULL;
}
+ print_timestamp_time("IMG_Load");
+
UPDATE_BUSY_STATE();
/* create native non-transparent surface for current image */
return NULL;
}
+ print_timestamp_time("SDL_DisplayFormat (opaque)");
+
UPDATE_BUSY_STATE();
/* create native transparent surface for current image */
return NULL;
}
+ print_timestamp_time("SDL_DisplayFormat (masked)");
+
UPDATE_BUSY_STATE();
/* free temporary surface */
new_bitmap->width = new_bitmap->surface->w;
new_bitmap->height = new_bitmap->surface->h;
+ print_timestamp_done("SDLLoadImage");
+
return new_bitmap;
}
while ((dir_entry = readDirectory(dir)) != NULL) /* loop all entries */
{
- struct stat file_status;
char *directory_name = dir_entry->basename;
char *directory_path = getPath2(level_directory, directory_name);
{
free(directory_path);
+#if 0
+ Error(ERR_INFO, "* entry '%s' is not a directory ...", directory_name);
+#endif
+
continue;
}
#else
/* find out if directory entry is itself a directory */
+ struct stat file_status;
if (stat(directory_path, &file_status) != 0 || /* cannot stat file */
(file_status.st_mode & S_IFMT) != S_IFDIR) /* not a directory */
{