[Tux4kids-commits] r1328 - branches/commonification/tux4kids-common/trunk/src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Sun Aug 2 13:51:32 UTC 2009


Author: bolekk-guest
Date: 2009-08-02 13:51:32 +0000 (Sun, 02 Aug 2009)
New Revision: 1328

Modified:
   branches/commonification/tux4kids-common/trunk/src/t4k-globals.h
   branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
   branches/commonification/tux4kids-common/trunk/src/t4k-main.c
   branches/commonification/tux4kids-common/trunk/src/t4k-menu.c
   branches/commonification/tux4kids-common/trunk/src/t4k-sdl.c
   branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h
Log:
changed debug_* globals' names into original ones

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-globals.h
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-globals.h	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-globals.h	2009-08-02 13:51:32 UTC (rev 1328)
@@ -21,18 +21,12 @@
 #define PATH_MAX 1024
 #define FONT_NAME_LENGTH 64
 
-extern int dbg_status;
+extern int debug_status;
 
-extern const int dbg_loaders;
-extern const int dbg_menu;
-extern const int dbg_menu_parser;
-extern const int dbg_sdl;
-extern const int dbg_all;
-
 extern SDL_Color red, yellow, white, black;
 /* debug macros */
-#define DEBUGCODE(mask) if((mask) & dbg_status)
-#define DEBUGMSG(mask, ...) if((mask) & dbg_status){ fprintf(stderr, __VA_ARGS__); fflush(stderr); }
+#define DEBUGCODE(mask) if((mask) & debug_status)
+#define DEBUGMSG(mask, ...) if((mask) & debug_status){ fprintf(stderr, __VA_ARGS__); fflush(stderr); }
 
 void putpixel8(SDL_Surface * surface, int x, int y, Uint32 pixel);
 void putpixel16(SDL_Surface * surface, int x, int y, Uint32 pixel);

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-08-02 13:51:32 UTC (rev 1328)
@@ -53,21 +53,21 @@
 
   if (!file)
   {
-    DEBUGMSG(dbg_loaders, "check_file(): invalid char* argument!\n");
+    DEBUGMSG(debug_loaders, "check_file(): invalid char* argument!\n");
     return 0;
   }
 
-  DEBUGMSG(dbg_loaders, "check_file(): checking: %s\n", file);
+  DEBUGMSG(debug_loaders, "check_file(): checking: %s\n", file);
 
   fp = fopen(file, "r");
   if (fp)
   {
-    DEBUGMSG(dbg_loaders, "check_file(): Opened successfully as FILE\n");
+    DEBUGMSG(debug_loaders, "check_file(): Opened successfully as FILE\n");
     fclose(fp);
     return 1;
   }
 
-  DEBUGMSG(dbg_loaders, "check_file(): Unable to open '%s' as either FILE or DIR\n", file);
+  DEBUGMSG(debug_loaders, "check_file(): Unable to open '%s' as either FILE or DIR\n", file);
   return 0;
 }
 
@@ -85,14 +85,14 @@
   SDL_Surface* dest;
   RsvgHandle* file_handle;
 
-  DEBUGMSG(dbg_loaders, "load_svg(): loading %s\n", file_name);
+  DEBUGMSG(debug_loaders, "load_svg(): loading %s\n", file_name);
 
   rsvg_init();
 
   file_handle = rsvg_handle_new_from_file(file_name, NULL);
   if(NULL == file_handle)
   {
-    DEBUGMSG(dbg_loaders, "load_svg(): file %s not found\n", file_name);
+    DEBUGMSG(debug_loaders, "load_svg(): file %s not found\n", file_name);
     rsvg_term();
     return NULL;
   }
@@ -112,14 +112,14 @@
   char lay_name[20];
   int i;
 
-  DEBUGMSG(dbg_loaders, "load_svg_sprite(): loading sprite from %s\n", file_name);
+  DEBUGMSG(debug_loaders, "load_svg_sprite(): loading sprite from %s\n", file_name);
 
   rsvg_init();
 
   file_handle = rsvg_handle_new_from_file(file_name, NULL);
   if(NULL == file_handle)
   {
-    DEBUGMSG(dbg_loaders, "load_svg_sprite(): file %s not found\n", file_name);
+    DEBUGMSG(debug_loaders, "load_svg_sprite(): file %s not found\n", file_name);
     rsvg_term();
     return NULL;
   }
@@ -129,7 +129,7 @@
 
   /* get number of frames from description */
   sscanf(rsvg_handle_get_desc(file_handle), "%d", &new_sprite->num_frames);
-  DEBUGMSG(dbg_loaders, "load_svg_sprite(): loading %d frames\n", new_sprite->num_frames);
+  DEBUGMSG(debug_loaders, "load_svg_sprite(): loading %d frames\n", new_sprite->num_frames);
 
   for(i = 0; i < new_sprite->num_frames; i++)
   {
@@ -180,7 +180,7 @@
   else
     Amask = GetScreen()->format->Amask;
 
-  DEBUGMSG(dbg_loaders, "render_svg_from_handle(): color masks: R=%u, G=%u, B=%u, A=%u\n",
+  DEBUGMSG(debug_loaders, "render_svg_from_handle(): color masks: R=%u, G=%u, B=%u, A=%u\n",
         Rmask, Gmask, Bmask, Amask);
 
   dest = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA,
@@ -193,7 +193,7 @@
   context = cairo_create(temp_surf);
   if(cairo_status(context) != CAIRO_STATUS_SUCCESS)
   {
-    DEBUGMSG(dbg_loaders, "render_svg_from_handle(): error rendering SVG\n");
+    DEBUGMSG(debug_loaders, "render_svg_from_handle(): error rendering SVG\n");
     cairo_surface_destroy(temp_surf);
     return NULL;
   }
@@ -220,7 +220,7 @@
   file_handle = rsvg_handle_new_from_file(file_name, NULL);
   if(file_handle == NULL)
   {
-    DEBUGMSG(dbg_loaders, "get_svg_dimensions(): file %s not found\n", file_name);
+    DEBUGMSG(debug_loaders, "get_svg_dimensions(): file %s not found\n", file_name);
     rsvg_term();
     return;
   }
@@ -273,7 +273,7 @@
 
   if(NULL == file_name)
   {
-    DEBUGMSG(dbg_loaders, "load_image(): file_name is NULL, exiting.\n");
+    DEBUGMSG(debug_loaders, "load_image(): file_name is NULL, exiting.\n");
     return NULL;
   }
 
@@ -285,20 +285,20 @@
 
   if(strcmp(fn + fn_len - 4, ".svg"))
   {
-    DEBUGMSG(dbg_loaders, "load_image(): %s is not an SVG, loading using IMG_Load()\n", fn);
+    DEBUGMSG(debug_loaders, "load_image(): %s is not an SVG, loading using IMG_Load()\n", fn);
     loaded_pic = IMG_Load(fn);
     is_svg = false;
     if (NULL == loaded_pic)
     {
       is_svg = true;
-      DEBUGMSG(dbg_loaders, "load_image(): Trying to load SVG equivalent of %s\n", fn);
+      DEBUGMSG(debug_loaders, "load_image(): Trying to load SVG equivalent of %s\n", fn);
       sprintf(strrchr(fn, '.'), ".svg");
     }
   }
   if (is_svg)
   {
 #ifdef HAVE_RSVG
-    DEBUGMSG(dbg_loaders, "load_image(): trying to load %s as SVG.\n", fn);
+    DEBUGMSG(debug_loaders, "load_image(): trying to load %s as SVG.\n", fn);
     if(proportional)
     {
       get_svg_dimensions(fn, &width, &height);
@@ -316,17 +316,17 @@
     if(loaded_pic == NULL)
     {
 #ifdef HAVE_RSVG
-      DEBUGMSG(dbg_loaders, "load_image(): failed to load %s as SVG.\n", fn);
+      DEBUGMSG(debug_loaders, "load_image(): failed to load %s as SVG.\n", fn);
 #else
-      DEBUGMSG(dbg_loaders, "load_image(): SVG support not available.\n");
+      DEBUGMSG(debug_loaders, "load_image(): SVG support not available.\n");
 #endif
       if(mode & IMG_NO_PNG_FALLBACK)
       {
-        DEBUGMSG(dbg_loaders, "load_image(): %s : IMG_NO_PNG_FALLBACK is set.\n", fn);
+        DEBUGMSG(debug_loaders, "load_image(): %s : IMG_NO_PNG_FALLBACK is set.\n", fn);
       }
       else
       {
-        DEBUGMSG(dbg_loaders, "load_image(): Trying to load PNG equivalent of %s\n", fn);
+        DEBUGMSG(debug_loaders, "load_image(): Trying to load PNG equivalent of %s\n", fn);
         strcpy(fn + fn_len - 3, "png");
 
         loaded_pic = IMG_Load(fn);
@@ -339,7 +339,7 @@
   {
     if (mode & IMG_NOT_REQUIRED)
     {
-      DEBUGMSG(dbg_loaders, "load_image(): Warning: could not load optional graphics file %s\n", file_name);
+      DEBUGMSG(debug_loaders, "load_image(): Warning: could not load optional graphics file %s\n", file_name);
       return NULL;  /* Allow program to continue */
     }
     /* If image was required, exit from program: */
@@ -368,7 +368,7 @@
 
   final_pic = set_format(loaded_pic, mode);
   SDL_FreeSurface(loaded_pic);
-  DEBUGMSG(dbg_loaders, "Leaving load_image()\n\n");
+  DEBUGMSG(debug_loaders, "Leaving load_image()\n\n");
 
   return final_pic;
 }
@@ -394,19 +394,19 @@
   {
     case IMG_REGULAR:
     {
-      DEBUGMSG(dbg_loaders, "set_format(): handling IMG_REGULAR mode.\n");
+      DEBUGMSG(debug_loaders, "set_format(): handling IMG_REGULAR mode.\n");
       return SDL_DisplayFormat(img);
     }
 
     case IMG_ALPHA:
     {
-      DEBUGMSG(dbg_loaders, "set_format(): handling IMG_ALPHA mode.\n");
+      DEBUGMSG(debug_loaders, "set_format(): handling IMG_ALPHA mode.\n");
       return SDL_DisplayFormatAlpha(img);
     }
 
     case IMG_COLORKEY:
     {
-      DEBUGMSG(dbg_loaders, "set_format(): handling IMG_COLORKEY mode.\n");
+      DEBUGMSG(debug_loaders, "set_format(): handling IMG_COLORKEY mode.\n");
       SDL_LockSurface(img);
       SDL_SetColorKey(img, (SDL_SRCCOLORKEY | SDL_RLEACCEL),
                       SDL_MapRGB(img->format, 255, 255, 0));
@@ -415,7 +415,7 @@
 
     default:
     {
-      DEBUGMSG(dbg_loaders, "set_format(): Image mode not recognized\n");
+      DEBUGMSG(debug_loaders, "set_format(): Image mode not recognized\n");
     }
   }
 
@@ -434,7 +434,7 @@
 
   if (!orig)
   {
-    DEBUGMSG(dbg_loaders, "In LoadBkgd(), LoadImage() returned NULL on %s\n",
+    DEBUGMSG(debug_loaders, "In LoadBkgd(), LoadImage() returned NULL on %s\n",
              file_name);
     return NULL;
   }
@@ -510,7 +510,7 @@
       new_sprite->default_img = LoadScaledImage(fn, mode | IMG_NOT_REQUIRED, w, h);
 
     if(!new_sprite->default_img)
-      DEBUGMSG(dbg_loaders, "load_sprite(): failed to load default image for %s\n", name);
+      DEBUGMSG(debug_loaders, "load_sprite(): failed to load default image for %s\n", name);
 
     for(i = 0; i < MAX_SPRITE_FRAMES; i++)
     {
@@ -527,7 +527,7 @@
         break;
       }
       else
-        DEBUGMSG(dbg_loaders, "load_sprite(): loaded frame %d of %s\n", i, name);
+        DEBUGMSG(debug_loaders, "load_sprite(): loaded frame %d of %s\n", i, name);
     }
   }
 
@@ -555,10 +555,10 @@
   if (!gfx)
     return;
 
-  DEBUGMSG(dbg_loaders, "Freeing image at %p", gfx);
+  DEBUGMSG(debug_loaders, "Freeing image at %p", gfx);
   for (x = 0; x < gfx->num_frames; x++)
   {
-    DEBUGMSG(dbg_loaders, ".");
+    DEBUGMSG(debug_loaders, ".");
     if (gfx->frame[x])
     {
       SDL_FreeSurface(gfx->frame[x]);
@@ -572,7 +572,7 @@
     gfx->default_img = NULL;
   }
 
-  DEBUGMSG(dbg_loaders, "FreeSprite() - done\n");
+  DEBUGMSG(debug_loaders, "FreeSprite() - done\n");
   free(gfx);
 }
 

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-main.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-main.c	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-main.c	2009-08-02 13:51:32 UTC (rev 1328)
@@ -14,14 +14,14 @@
 #include "tux4kids-common.h"
 #include "t4k-globals.h"
 
-int dbg_status;
+int debug_status;
 
 /* these values have to match those used in games */
-const int dbg_loaders       = 1 << 2;
-const int dbg_menu          = 1 << 4;
-const int dbg_menu_parser   = 1 << 5;
-const int dbg_sdl           = 1 << 10;
-const int dbg_all           = ~0;
+const int debug_loaders       = 1 << 0;
+const int debug_menu          = 1 << 1;
+const int debug_menu_parser   = 1 << 2;
+const int debug_sdl           = 1 << 3;
+const int debug_all           = ~0;
 
 SDL_Color red, yellow, white, black;
 
@@ -29,7 +29,7 @@
 /* set global variables */
 void InitT4KCommon(int debug_flags)
 {
-  dbg_status = debug_flags;
+  debug_status = debug_flags;
 
   black.r       = 0x00; black.g       = 0x00; black.b       = 0x00;
   red.r         = 0xff; red.g         = 0x00; red.b         = 0x00;

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-menu.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-menu.c	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-menu.c	2009-08-02 13:51:32 UTC (rev 1328)
@@ -162,12 +162,12 @@
   {
     fscanf(xml_file, " %[^=\n]", attr_name);
 
-    DEBUGMSG(dbg_menu_parser, "read_attributes(): read attribute name: %s\n", attr_name);
+    DEBUGMSG(debug_menu_parser, "read_attributes(): read attribute name: %s\n", attr_name);
     if(strchr(attr_name, '>'))
       break;
 
     fscanf(xml_file, "=\"%[^\"]\"", attr_val);
-    DEBUGMSG(dbg_menu_parser, "read_attributes(): read attribute value: %s\n", attr_val);
+    DEBUGMSG(debug_menu_parser, "read_attributes(): read attribute value: %s\n", attr_val);
 
     if(strcmp(attr_name, "title") == 0)
       node->title = strdup(attr_val);
@@ -186,7 +186,7 @@
           node->activity = i;
     }
     else
-      DEBUGMSG(dbg_menu_parser, "read_attributes(): unknown attribute %s , omitting\n", attr_name);
+      DEBUGMSG(debug_menu_parser, "read_attributes(): unknown attribute %s , omitting\n", attr_name);
 
   } while(strchr(attr_val, '>') == NULL);
 }
@@ -201,7 +201,7 @@
 
   new_node->parent = parent;
 
-  DEBUGMSG(dbg_menu_parser, "entering load_menu_from_file()\n");
+  DEBUGMSG(debug_menu_parser, "entering load_menu_from_file()\n");
   fscanf(xml_file, " < %s", buffer);
 
   if(strcmp(buffer, "menu") == 0)
@@ -209,7 +209,7 @@
     read_attributes(xml_file, new_node);
     if(new_node->title == NULL)
     {
-      DEBUGMSG(dbg_menu_parser, "load_menu_from_file(): no title attribute, exiting\n");
+      DEBUGMSG(debug_menu_parser, "load_menu_from_file(): no title attribute, exiting\n");
       return NULL;
     }
 
@@ -222,24 +222,24 @@
 
     fscanf(xml_file, " </%[^>\n]> ", buffer);
     if(strcmp(buffer, "menu") != 0)
-      DEBUGMSG(dbg_menu_parser, "load_menu_from_file(): warning - no closing menu tag, found %s instead\n", buffer);
+      DEBUGMSG(debug_menu_parser, "load_menu_from_file(): warning - no closing menu tag, found %s instead\n", buffer);
   }
   else if(strcmp(buffer, "item") == 0)
   {
     read_attributes(xml_file, new_node);
     if(new_node->title == NULL)
     {
-      DEBUGMSG(dbg_menu_parser, "load_menu_from_file(): no title attribute, exiting\n");
+      DEBUGMSG(debug_menu_parser, "load_menu_from_file(): no title attribute, exiting\n");
       return NULL;
     }
   }
   else
   {
-    DEBUGMSG(dbg_menu_parser, "load_menu_from_file(): unknown tag: %s\n, exiting\n", buffer);
+    DEBUGMSG(debug_menu_parser, "load_menu_from_file(): unknown tag: %s\n, exiting\n", buffer);
     return NULL;
   }
 
-  DEBUGMSG(dbg_menu_parser, "load_menu_from_file(): node loaded successfully\n");
+  DEBUGMSG(debug_menu_parser, "load_menu_from_file(): node loaded successfully\n");
   return new_node;
 }
 
@@ -248,7 +248,7 @@
 {
   int i;
 
-  DEBUGMSG(dbg_menu, "entering free_menu()\n");
+  DEBUGMSG(debug_menu, "entering free_menu()\n");
   if(menu != NULL)
   {
     if(menu->title != NULL)
@@ -336,7 +336,7 @@
 
   for(;;) /* one loop body execution for one menu page */
   {
-    DEBUGMSG(dbg_menu, "run_menu(): drawing whole new menu page\n");
+    DEBUGMSG(debug_menu, "run_menu(): drawing whole new menu page\n");
 
     draw_background();
     /* render buttons for current menu page */
@@ -344,7 +344,7 @@
     menu_item_selected = render_buttons(menu, true);
     items = min(menu->entries_per_screen, menu->submenu_size - menu->first_entry);
 
-    DEBUGMSG(dbg_menu, "run_menu(): drawing %d buttons\n", items);
+    DEBUGMSG(debug_menu, "run_menu(): drawing %d buttons\n", items);
     for(i = 0; i < items; i++)
     {
       if(loc == i)
@@ -386,7 +386,7 @@
 
     /******** Main loop: *********/
     stop = false;
-    DEBUGMSG(dbg_menu, "run_menu(): entering menu loop\n");
+    DEBUGMSG(debug_menu, "run_menu(): entering menu loop\n");
     while (!stop)
     {
       frame_start = SDL_GetTicks();         /* For keeping frame rate constant.*/
@@ -612,7 +612,7 @@
         }  // End event switch statement
 
         if (old_loc != loc) {
-          DEBUGMSG(dbg_menu, "run_menu(): changed button focus, old=%d, new=%d\n", old_loc, loc);
+          DEBUGMSG(debug_menu, "run_menu(): changed button focus, old=%d, new=%d\n", old_loc, loc);
           if(old_loc >= 0 && old_loc < items)
           {
             tmp_rect = menu->submenu[old_loc + menu->first_entry]->button_rect;
@@ -650,7 +650,7 @@
           case CLICK:
             if(loc < 0 || loc >= items)
             {
-              DEBUGMSG(dbg_menu, "run_menu(): incorrect location for CLICK action (%d) !\n", loc);
+              DEBUGMSG(debug_menu, "run_menu(): incorrect location for CLICK action (%d) !\n", loc);
             }
             else
             {
@@ -674,7 +674,7 @@
                   {
                     if(handle_activity(tmp_node->activity, tmp_node->param) == QUIT)
                     {
-                      DEBUGMSG(dbg_menu, "run_menu(): handle_activity() returned QUIT message, exiting.\n");
+                      DEBUGMSG(debug_menu, "run_menu(): handle_activity() returned QUIT message, exiting.\n");
                       FreeSurfaceArray(menu_item_unselected, items);
                       FreeSurfaceArray(menu_item_selected, items);
                       return QUIT;
@@ -745,7 +745,7 @@
     } // End of while(!stop) loop
 
     /* free button surfaces */
-    DEBUGMSG(dbg_menu, "run_menu(): freeing %d button surfaces\n", items);
+    DEBUGMSG(debug_menu, "run_menu(): freeing %d button surfaces\n", items);
     FreeSurfaceArray(menu_item_unselected, items);
     FreeSurfaceArray(menu_item_selected, items);
   }
@@ -765,7 +765,7 @@
   menu_items = (SDL_Surface**) malloc(items * sizeof(SDL_Surface*));
   if(NULL == menu_items)
   {
-    DEBUGMSG(dbg_menu, "render_buttons(): failed to allocate memory for buttons!\n");
+    DEBUGMSG(debug_menu, "render_buttons(): failed to allocate memory for buttons!\n");
     return NULL;  // error
   }
 
@@ -811,13 +811,13 @@
 
   if(NULL == menu)
   {
-    DEBUGMSG(dbg_menu, "prerender_menu(): NULL pointer, exiting !\n");
+    DEBUGMSG(debug_menu, "prerender_menu(): NULL pointer, exiting !\n");
     return;
   }
 
   if(0 == menu->submenu_size)
   {
-    DEBUGMSG(dbg_menu, "prerender_menu(): no submenu, exiting.\n");
+    DEBUGMSG(debug_menu, "prerender_menu(): no submenu, exiting.\n");
     return;
   }
 
@@ -864,11 +864,11 @@
     if(curr_node->icon_name)
     {
       sprintf(filename, "%s/images/sprites/%s", data_prefix, curr_node->icon_name);
-      DEBUGMSG(dbg_menu, "prerender_menu(): loading sprite %s for item #%d.\n", filename, i);
+      DEBUGMSG(debug_menu, "prerender_menu(): loading sprite %s for item #%d.\n", filename, i);
       curr_node->icon = LoadSpriteOfBoundingBox(filename, IMG_ALPHA, button_h, button_h);
     }
     else
-      DEBUGMSG(dbg_menu, "prerender_menu(): no sprite for item #%d.\n", i);
+      DEBUGMSG(debug_menu, "prerender_menu(): no sprite for item #%d.\n", i);
 
     prerender_menu(menu->submenu[i]);
   }
@@ -1003,7 +1003,7 @@
   menu_file = fopen(file_name, "r");
   if(menu_file == NULL)
   {
-    DEBUGMSG(dbg_menu, "LoadMenu(): Could not load %s !\n", file_name);
+    DEBUGMSG(debug_menu, "LoadMenu(): Could not load %s !\n", file_name);
   }
   else
   {
@@ -1019,7 +1019,7 @@
 {
   int i;
 
-  DEBUGMSG(dbg_menu, "entering UnloadMenus()\n");
+  DEBUGMSG(debug_menu, "entering UnloadMenus()\n");
 
   if(stop_button)
   {
@@ -1042,10 +1042,10 @@
   for(i = 0; i < N_OF_MENUS; i++)
     if(menus[i] != NULL)
     {
-      DEBUGMSG(dbg_menu, "UnloadMenus(): freeing menu #%d\n", i);
+      DEBUGMSG(debug_menu, "UnloadMenus(): freeing menu #%d\n", i);
       free_menu(menus[i]);
     }
 
-  DEBUGMSG(dbg_menu, "leaving UnloadMenus()\n");
+  DEBUGMSG(debug_menu, "leaving UnloadMenus()\n");
 }
 

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-sdl.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-sdl.c	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-sdl.c	2009-08-02 13:51:32 UTC (rev 1328)
@@ -490,7 +490,7 @@
     }
     else
     {
-      DEBUGMSG(dbg_sdl, "ChangeWindowSize(): Changed window size to %d x %d\n", screen->w, screen->h);
+      DEBUGMSG(debug_sdl, "ChangeWindowSize(): Changed window size to %d x %d\n", screen->w, screen->h);
       oldscreen = NULL;
       win_res_x = screen->w;
       win_res_y = screen->h;
@@ -498,7 +498,7 @@
     }
   }
   else
-    DEBUGMSG(dbg_sdl, "ChangeWindowSize() can be run only in windowed mode !");
+    DEBUGMSG(debug_sdl, "ChangeWindowSize() can be run only in windowed mode !");
 }
 
 /* switch between fullscreen and windowed mode */
@@ -525,7 +525,7 @@
   else
   {
     //success, no need to free the old video surface
-    DEBUGMSG(dbg_sdl, "Switched screen mode to %s\n", window ? "windowed" : "fullscreen");
+    DEBUGMSG(debug_sdl, "Switched screen mode to %s\n", window ? "windowed" : "fullscreen");
     oldscreen = NULL;
     SDL_UpdateRect(screen, 0, 0, 0, 0);
   }
@@ -577,7 +577,7 @@
   Uint8 r4, g4, b4, a4;
   Uint8 r, g, b, a;
 
-  DEBUGMSG(dbg_sdl, "Entering zoom():\n");
+  DEBUGMSG(debug_sdl, "Entering zoom():\n");
 
   /* Create surface for zoom: */
 
@@ -598,9 +598,9 @@
 //    exit(1);
   }
 
-  DEBUGMSG(dbg_sdl, "zoom(): orig surface %dx%d, %d bytes per pixel\n",
+  DEBUGMSG(debug_sdl, "zoom(): orig surface %dx%d, %d bytes per pixel\n",
             src->w, src->h, src->format->BytesPerPixel);
-  DEBUGMSG(dbg_sdl, "zoom(): new surface %dx%d, %d bytes per pixel\n",
+  DEBUGMSG(debug_sdl, "zoom(): new surface %dx%d, %d bytes per pixel\n",
             s->w, s->h, s->format->BytesPerPixel);
 
   /* Now assign function pointers to correct functions based */
@@ -675,7 +675,7 @@
   SDL_UnlockSurface(s);
   SDL_UnlockSurface(src);
 
-  DEBUGMSG(dbg_sdl, "Leaving zoom():\n");
+  DEBUGMSG(debug_sdl, "Leaving zoom():\n");
 
   return s;
 }
@@ -724,7 +724,7 @@
 {
 #ifdef HAVE_LIBSDL_PANGO
 
-  DEBUGMSG(dbg_sdl, "Setup_SDL_Text() - using SDL_Pango\n");
+  DEBUGMSG(debug_sdl, "Setup_SDL_Text() - using SDL_Pango\n");
 
   SDLPango_Init();
   if (!Set_SDL_Pango_Font_Size(DEFAULT_FONT_SIZE))
@@ -736,7 +736,7 @@
 
 #else
 /* using SDL_ttf: */
-  DEBUGMSG(dbg_sdl, "Setup_SDL_Text() - using SDL_ttf\n");
+  DEBUGMSG(debug_sdl, "Setup_SDL_Text() - using SDL_ttf\n");
 
   if (TTF_Init() < 0)
   {
@@ -805,8 +805,8 @@
     return NULL;
   }
 
-  DEBUGMSG(dbg_sdl, "Entering BlackOutline():\n");
-  DEBUGMSG(dbg_sdl, "BlackOutline of \"%s\"\n", t );
+  DEBUGMSG(debug_sdl, "Entering BlackOutline():\n");
+  DEBUGMSG(debug_sdl, "BlackOutline of \"%s\"\n", t );
 
 #ifdef HAVE_LIBSDL_PANGO
   Set_SDL_Pango_Font_Size(size);
@@ -879,7 +879,7 @@
   out = SDL_DisplayFormatAlpha(bg);
   SDL_FreeSurface(bg);
 
-  DEBUGMSG(dbg_sdl, "\nLeaving BlackOutline(): \n");
+  DEBUGMSG(debug_sdl, "\nLeaving BlackOutline(): \n");
 
   return out;
 }
@@ -1013,7 +1013,7 @@
   {
     char buf[64];
 
-    DEBUGMSG(dbg_sdl, "Setting font size to %d\n", size);
+    DEBUGMSG(debug_sdl, "Setting font size to %d\n", size);
 
     if(context != NULL)
       SDLPango_FreeContext(context);
@@ -1131,7 +1131,7 @@
 
   if (f)
   {
-    DEBUGMSG(dbg_sdl, "LoadFont(): %s loaded successfully\n\n", fontfile);
+    DEBUGMSG(debug_sdl, "LoadFont(): %s loaded successfully\n\n", fontfile);
     return f;
   }
   else

Modified: branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h	2009-08-02 13:02:22 UTC (rev 1327)
+++ branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h	2009-08-02 13:51:32 UTC (rev 1328)
@@ -32,6 +32,12 @@
 
 typedef enum { false, true } bool;
 
+extern const int debug_loaders;
+extern const int debug_menu;
+extern const int debug_menu_parser;
+extern const int debug_sdl;
+extern const int debug_all;
+
 #define MAX_SPRITE_FRAMES 10
 
 typedef struct {




More information about the Tux4kids-commits mailing list