stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/video font.c


From: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src/video font.c
Date: Sat, 29 Nov 2003 14:45:57 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/11/29 14:45:57

Modified files:
        src/video      : font.c 

Log message:
        Fixed errors with lua and sdl surface

Patches:
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.63 stratagus/src/video/font.c:1.64
--- stratagus/src/video/font.c:1.63     Thu Nov 20 15:04:55 2003
+++ stratagus/src/video/font.c  Sat Nov 29 14:45:57 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: font.c,v 1.63 2003/11/20 20:04:55 jsalmon3 Exp $
+//     $Id: font.c,v 1.64 2003/11/29 19:45:57 jsalmon3 Exp $
 
 //@{
 
@@ -1292,9 +1292,17 @@
     } else {
        fcmp = &FontColorMappings;
        while (*fcmp) {
+#ifdef USE_SDL_SURFACE
+           if (!strcmp((*fcmp)->ColorName, color)) {
+#else
            if (!strcmp((*fcmp)->Color, color)) {
+#endif
                fprintf(stderr, "Warning: Redefining color '%s'\n", color);
+#ifdef USE_SDL_SURFACE
+               free((*fcmp)->ColorName);
+#else
                free((*fcmp)->Color);
+#endif
                fcm = *fcmp;
                break;
            }
@@ -1303,7 +1311,11 @@
        *fcmp = calloc(sizeof(*FontColorMappings), 1);
        fcm = *fcmp;
     }
+#ifdef USE_SDL_SURFACE
+    fcm->ColorName = color;
+#else
     fcm->Color = color;
+#endif
     fcm->Next = NULL;
 
     if (luaL_getn(l, 2) != NumFontColors * 3) {
@@ -1311,13 +1323,25 @@
     }
     for (i = 0; i < NumFontColors; ++i) {
        lua_rawgeti(l, 2, i * 3 + 1);
+#ifdef USE_SDL_SURFACE
+       fcm->Color[i].r = LuaToNumber(l, -1);
+#else
        fcm->RGB[i].R = LuaToNumber(l, -1);
+#endif
        lua_pop(l, 1);
        lua_rawgeti(l, 2, i * 3 + 2);
+#ifdef USE_SDL_SURFACE
+       fcm->Color[i].g = LuaToNumber(l, -1);
+#else
        fcm->RGB[i].G = LuaToNumber(l, -1);
+#endif
        lua_pop(l, 1);
        lua_rawgeti(l, 2, i * 3 + 3);
+#ifdef USE_SDL_SURFACE
+       fcm->Color[i].b = LuaToNumber(l, -1);
+#else
        fcm->RGB[i].B = LuaToNumber(l, -1);
+#endif
        lua_pop(l, 1);
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]