[Tux4kids-commits] r1311 - in branches/commonification/tux4kids-common/trunk: . src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Fri Jul 31 20:25:31 UTC 2009


Author: bolekk-guest
Date: 2009-07-31 20:25:31 +0000 (Fri, 31 Jul 2009)
New Revision: 1311

Modified:
   branches/commonification/tux4kids-common/trunk/CMakeLists.txt
   branches/commonification/tux4kids-common/trunk/src/CMakeLists.txt
   branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
Log:
tux4kids-common builds with librsvg

Modified: branches/commonification/tux4kids-common/trunk/CMakeLists.txt
===================================================================
--- branches/commonification/tux4kids-common/trunk/CMakeLists.txt	2009-07-31 19:59:29 UTC (rev 1310)
+++ branches/commonification/tux4kids-common/trunk/CMakeLists.txt	2009-07-31 20:25:31 UTC (rev 1311)
@@ -4,5 +4,22 @@
 
 cmake_minimum_required(VERSION 2.6)
 find_package(SDL REQUIRED)
+find_package(SDL_image REQUIRED)
+find_package(SDL_ttf REQUIRED)
+find_package(SDL_mixer REQUIRED)
+
+include(FindPkgConfig OPTIONAL)
+
+if(PKG_CONFIG_FOUND)
+  include(FindPkgConfig)
+  PKG_CHECK_MODULES(RSVG librsvg-2.0)
+  if(RSVG_FOUND)
+    PKG_CHECK_MODULES(CAIRO cairo)
+    if(CAIRO_FOUND)
+      set(HAVE_RSVG 1)  # For the config.h file
+    endif(CAIRO_FOUND)
+  endif(RSVG_FOUND)
+endif(PKG_CONFIG_FOUND)
+
 add_subdirectory(src)
 

Modified: branches/commonification/tux4kids-common/trunk/src/CMakeLists.txt
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/CMakeLists.txt	2009-07-31 19:59:29 UTC (rev 1310)
+++ branches/commonification/tux4kids-common/trunk/src/CMakeLists.txt	2009-07-31 20:25:31 UTC (rev 1311)
@@ -19,6 +19,30 @@
 add_library( t4kcommon STATIC
 	${T4KCOMMON_SOURCES} ${T4KCOMMON_HEADERS} )
 
+# getting rid of semicolons
+set(_rsvg_cflags "")
+foreach(f ${RSVG_CFLAGS})
+  set(_rsvg_cflags "${_rsvg_cflags} ${f}")
+endforeach(f)
+
+set(_cairo_cflags "")
+foreach(f ${CAIRO_CFLAGS})
+  set(_cairo_cflags "${_cairo_cflags} ${f}")
+endforeach(f)
+
+set(_rsvg_def "")
+if(HAVE_RSVG)
+  set(_rsvg_def "-DHAVE_RSVG=1")
+endif(HAVE_RSVG)
+
+
+set_target_properties (
+  t4kcommon
+  PROPERTIES COMPILE_FLAGS
+  "${_rsvg_def} ${_rsvg_cflags} ${_cairo_cflags}"
+  )
+
+
 INSTALL( TARGETS t4kcommon
 	ARCHIVE DESTINATION lib )
 INSTALL( TARGETS t4kcommon

Modified: branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-07-31 19:59:29 UTC (rev 1310)
+++ branches/commonification/tux4kids-common/trunk/src/t4k-loaders.c	2009-07-31 20:25:31 UTC (rev 1311)
@@ -46,15 +46,6 @@
 
 
 
-/* check to see if file exists, if so return true */
-// int checkFile( const char *file ) {
-//         static struct stat fileStats;
-//         fileStats.st_mode = 0;
-//         stat( file, &fileStats );
-//         return (S_IFREG & fileStats.st_mode);
-// }
-
-
 int check_file(const char* file)
 {
   FILE* fp = NULL;
@@ -179,20 +170,20 @@
   }
 
   /* set color masks */
-  Rmask = screen->format->Rmask;
-  Gmask = screen->format->Gmask;
-  Bmask = screen->format->Bmask;
-  if(screen->format->Amask == 0)
+  Rmask = GetScreen()->format->Rmask;
+  Gmask = GetScreen()->format->Gmask;
+  Bmask = GetScreen()->format->Bmask;
+  if(GetScreen()->format->Amask == 0)
     /* find a free byte to use for Amask */
     Amask = ~(Rmask | Gmask | Bmask);
   else
-    Amask = screen->format->Amask;
+    Amask = GetScreen()->format->Amask;
 
   DEBUGMSG(dbg_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,
-        width, height, screen->format->BitsPerPixel, Rmask, Gmask, Bmask, Amask);
+        width, height, GetScreen()->format->BitsPerPixel, Rmask, Gmask, Bmask, Amask);
 
   SDL_LockSurface(dest);
   temp_surf = cairo_image_surface_create_for_data(dest->pixels,




More information about the Tux4kids-commits mailing list