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

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Tue Aug 4 23:36:37 UTC 2009


Author: bolekk-guest
Date: 2009-08-04 23:36:37 +0000 (Tue, 04 Aug 2009)
New Revision: 1362

Modified:
   branches/commonification/tux4kids-common/trunk/src/t4k-audio.c
   branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
   branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h
Log:
made CheckFile() public

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-audio.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-audio.c	2009-08-04 19:34:19 UTC (rev 1361)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-audio.c	2009-08-04 23:36:37 UTC (rev 1362)
@@ -28,7 +28,8 @@
 
 void PlaySound(Mix_Chunk* sound)
 {
-  Mix_PlayChannel(-1, sound, 0);
+  if(sound)
+    Mix_PlayChannel(-1, sound, 0);
 }
 
 /* audioMusicLoad attempts to load and play the music file

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-08-04 19:34:19 UTC (rev 1361)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-08-04 23:36:37 UTC (rev 1362)
@@ -31,7 +31,6 @@
 #endif
 
 /* local functions */
-int             check_file(const char* file);
 
 #ifdef HAVE_RSVG
 SDL_Surface*    load_svg(const char* file_name, int width, int height, const char* layer_name);
@@ -47,27 +46,27 @@
 
 
 
-int check_file(const char* file)
+int CheckFile(const char* file)
 {
   FILE* fp = NULL;
 
   if (!file)
   {
-    DEBUGMSG(debug_loaders, "check_file(): invalid char* argument!\n");
+    DEBUGMSG(debug_loaders, "CheckFile(): invalid char* argument!\n");
     return 0;
   }
 
-  DEBUGMSG(debug_loaders, "check_file(): checking: %s\n", file);
+  DEBUGMSG(debug_loaders, "CheckFile(): checking: %s\n", file);
 
   fp = fopen(file, "r");
   if (fp)
   {
-    DEBUGMSG(debug_loaders, "check_file(): Opened successfully as FILE\n");
+    DEBUGMSG(debug_loaders, "CheckFile(): Opened successfully as FILE\n");
     fclose(fp);
     return 1;
   }
 
-  DEBUGMSG(debug_loaders, "check_file(): Unable to open '%s' as either FILE or DIR\n", file);
+  DEBUGMSG(debug_loaders, "CheckFile(): Unable to open '%s' as either FILE or DIR\n", file);
   return 0;
 }
 
@@ -472,7 +471,7 @@
 #ifdef HAVE_RSVG
   /* check if SVG sprite file is present */
   sprintf(fn, "%s.svg", name);
-  if(1 == check_file(fn))
+  if(1 == CheckFile(fn))
   {
     if(proportional)
     {
@@ -606,7 +605,7 @@
   Mix_Music* tempMusic = NULL;
 
   sprintf(fn, "%s", datafile);
-  if (1 != check_file(fn))
+  if (1 != CheckFile(fn))
   {
     fprintf(stderr, "LoadMusic(): %s not found\n\n", fn);
     return NULL;

Modified: branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h	2009-08-04 19:34:19 UTC (rev 1361)
+++ branches/commonification/tux4kids-common/trunk/src/tux4kids-common.h	2009-08-04 23:36:37 UTC (rev 1362)
@@ -105,6 +105,8 @@
 #define IMG_NO_PNG_FALLBACK 0x20
 
 
+int             CheckFile(const char* file);
+
 SDL_Surface*    LoadImage(const char* file_name, int mode);
 SDL_Surface*    LoadScaledImage(const char* file_name, int mode, int width, int height);
 SDL_Surface*    LoadImageOfBoundingBox(const char* file_name, int mode, int max_width, int max_height);




More information about the Tux4kids-commits mailing list