wesnoth-cvs-commits
[Top][All Lists]
Advanced

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

[Wesnoth-cvs-commits] wesnoth ./configure.ac data/terrain.cfg src/Mak...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth ./configure.ac data/terrain.cfg src/Mak...
Date: Tue, 26 Oct 2004 15:09:17 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      04/10/26 19:03:55

Modified files:
        .              : configure.ac 
        data           : terrain.cfg 
        src            : Makefile.am font.cpp language.cpp 
Added files:
        src/sdl_ttf    : SDL_ttf.c SDL_ttf.h 

Log message:
        Added a CVS snapshot of SDL_ttf in the wesnoth tree
        Made wesnoth link statically to those SDL_ttf files
        Added checking for libfreetype in the autotools scripts.
        
        Warning: changes made to the autotools script! they work for me, but 
need testing and reviewing!
        
        The main reason for that is that SDL_ttf 2.0.6 still has fatal
        memory-corruption bugs, fixed in CVS. This fix looks like to prevent 
manu
        segfaults for some configurations using the French translation.
        
        This fix may be reverted when SDL_ttf 2.0.7 is released (or not).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/configure.ac.diff?tr1=1.98&tr2=1.99&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/data/terrain.cfg.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/Makefile.am.diff?tr1=1.53&tr2=1.54&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/font.cpp.diff?tr1=1.86&tr2=1.87&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/language.cpp.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_ttf/SDL_ttf.c?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_ttf/SDL_ttf.h?rev=1.1

Patches:
Index: wesnoth/configure.ac
diff -u wesnoth/configure.ac:1.98 wesnoth/configure.ac:1.99
--- wesnoth/configure.ac:1.98   Tue Oct 19 22:29:23 2004
+++ wesnoth/configure.ac        Tue Oct 26 19:03:55 2004
@@ -10,7 +10,7 @@
 dnl AC_DEFINE([WESNOTH_DEFAULT_SERVER], ["devsrv.wesnoth.org"], [The default 
server for this version])
 AC_DEFINE([WESNOTH_DEFAULT_SERVER], ["devsrv.wesnoth.org:14999"], [The default 
server for this version])
 
-AC_REVISION([$Revision: 1.98 $])
+AC_REVISION([$Revision: 1.99 $])
 
 AC_CONFIG_AUX_DIR([config])
 AM_INIT_AUTOMAKE([foreign 1.5])
@@ -424,14 +424,14 @@
             [AC_MSG_ERROR([*** SDL_net lib not found! Get SDL_net from
 http://www.libsdl.org/projects/SDL_net/index.html])])
 
-AC_CHECK_LIB([SDL_ttf],
-            [TTF_OpenFont],
-            [if test -n "$LDPREFIX" -a -r /usr/lib/libSDL_ttf.la
-then SDL_TTF_LIBS=/usr/lib/libSDL_ttf.la
-else SDL_TTF_LIBS=-lSDL_ttf
-fi],
-            [AC_MSG_ERROR([*** SDL_ttf lib not found! Get SDL_ttf from
-http://www.libsdl.org/projects/SDL_ttf/index.html])])
+#AC_CHECK_LIB([SDL_ttf],
+#           [TTF_OpenFont],
+#           [if test -n "$LDPREFIX" -a -r /usr/lib/libSDL_ttf.la
+#then SDL_TTF_LIBS=/usr/lib/libSDL_ttf.la
+#else SDL_TTF_LIBS=-lSDL_ttf
+#fi],
+#           [AC_MSG_ERROR([*** SDL_ttf lib not found! Get SDL_ttf from
+#http://www.libsdl.org/projects/SDL_ttf/index.html])])
 
 LIBS=$OLD_LIBS
 
@@ -439,7 +439,47 @@
 AC_SUBST([SDL_IMAGE_LIBS])
 AC_SUBST([SDL_MIXER_LIBS])
 AC_SUBST([SDL_NET_LIBS])
-AC_SUBST([SDL_TTF_LIBS])
+#AC_SUBST([SDL_TTF_LIBS])
+
+# Cheching for the freetype library. This was directly copied from the config 
script
+# of SDL_ttf, and I do not really understand how this works.
+
+dnl Check for the FreeType 2 library
+dnl
+dnl Get the cflags and libraries from the freetype-config script
+dnl
+
+AC_ARG_WITH(freetype-prefix,[  --with-freetype-prefix=PFX   Prefix where 
FREETYPE is 
+installed (optional)],
+            freetype_prefix="$withval", freetype_prefix="")
+AC_ARG_WITH(freetype-exec-prefix,[  --with-freetype-exec-prefix=PFX Exec 
prefix 
+where FREETYPE is installed (optional)],
+            freetype_exec_prefix="$withval", freetype_exec_prefix="")
+
+if test x$freetype_exec_prefix != x ; then
+     freetype_args="$freetype_args --exec-prefix=$freetype_exec_prefix"
+     if test x${FREETYPE_CONFIG+set} != xset ; then
+        FREETYPE_CONFIG=$freetype_exec_prefix/bin/freetype-config
+     fi
+fi
+if test x$freetype_prefix != x ; then
+     freetype_args="$freetype_args --prefix=$freetype_prefix"
+     if test x${FREETYPE_CONFIG+set} != xset ; then
+        FREETYPE_CONFIG=$freetype_prefix/bin/freetype-config
+     fi
+fi
+AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
+no_freetype=""
+if test "$FREETYPE_CONFIG" = "no" ; then
+    AC_MSG_ERROR([
+*** Unable to find FreeType2 library (http://www.freetype.org/)
+])
+else
+    CFLAGS="$CFLAGS `$FREETYPE_CONFIG $freetypeconf_args --cflags`"
+    FREETYPE_LIBS=`$FREETYPE_CONFIG $freetypeconf_args --libs`
+fi
+
+AC_SUBST([FREETYPE_LIBS])
 
 
 #######################################################################
Index: wesnoth/data/terrain.cfg
diff -u wesnoth/data/terrain.cfg:1.48 wesnoth/data/terrain.cfg:1.49
--- wesnoth/data/terrain.cfg:1.48       Thu Oct 21 20:55:02 2004
+++ wesnoth/data/terrain.cfg    Tue Oct 26 19:03:55 2004
@@ -182,6 +182,7 @@
 symbol_image=snow-hills
 id=hills
 name= _ "Hills"
+light=true
 char=H
 aliasof=h
 [/terrain]
@@ -203,6 +204,7 @@
 [terrain]
 symbol_image=snow-forest
 id=forest
+light=true
 name= _ "Forest"
 aliasof=f
 char=F
Index: wesnoth/src/Makefile.am
diff -u wesnoth/src/Makefile.am:1.53 wesnoth/src/Makefile.am:1.54
--- wesnoth/src/Makefile.am:1.53        Tue Oct 12 22:38:20 2004
+++ wesnoth/src/Makefile.am     Tue Oct 26 19:03:55 2004
@@ -100,6 +100,7 @@
                  widgets/slider.cpp \
                  widgets/textbox.cpp \
                  widgets/widget.cpp \
+                 sdl_ttf/SDL_ttf.c \
                  about.hpp \
                  actions.hpp \
                  ai.hpp \
@@ -322,20 +323,26 @@
 
 AM_CXXFLAGS = @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
        -DLOCALEDIR=\"$(LOCALEDIR)\" 
-DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) \
-       -I../intl -I$(top_srcdir)/intl
+       -I sdl_ttf -I../intl -I$(top_srcdir)/intl
+
+AM_CFLAGS = @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
+       -DLOCALEDIR=\"$(LOCALEDIR)\" 
-DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) \
+       -I sdl_ttf -I../intl -I$(top_srcdir)/intl
 
 if X11
     CXXFLAGS += -D_X11 @X_CFLAGS@
+    CFLAGS += -D_X11 @X_CFLAGS@
 endif
 if GCC
     CXXFLAGS += -fno-omit-frame-pointer
+    CFLAGS += -fno-omit-frame-pointer
 endif
 
 CXXLD = $(LDPREFIX) $(CXX)
 
 
 LIBS = $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) $(SDL_NET_LIBS) \
-       $(SDL_TTF_LIBS) $(SDL_LIBS) $(LIBINTL)
+       $(SDL_TTF_LIBS) $(SDL_LIBS) $(FREETYPE_LIBS) $(LIBINTL)
 
 if STATIC
 LDFLAGS += -all-static
Index: wesnoth/src/font.cpp
diff -u wesnoth/src/font.cpp:1.86 wesnoth/src/font.cpp:1.87
--- wesnoth/src/font.cpp:1.86   Sat Sep 18 21:24:59 2004
+++ wesnoth/src/font.cpp        Tue Oct 26 19:03:55 2004
@@ -1,4 +1,4 @@
-/* $Id: font.cpp,v 1.86 2004/09/18 21:24:59 silene Exp $ */
+/* $Id: font.cpp,v 1.87 2004/10/26 19:03:55 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -273,6 +273,16 @@
 
        // Validate the UTF-8 string: workaround a SDL_TTF bug that makes it
        // crash when used with an invalid UTF-8 string
+       wide_string ws = string_to_wstring(str_);
+
+       for(wide_string::const_iterator itor = ws.begin(); itor != ws.end(); 
++itor) {
+               int minx, miny, maxx, maxy, advance;    
+
+               if(TTF_GlyphMetrics(font_, *itor, &minx, &maxx, &miny, &maxy, 
&advance) != 0 ) {
+                       std::cerr << "glyph with strange size: " << *itor << 
"(" << char(*itor) << ") " << minx << ", " << maxx  << ", " << miny << ", " << 
maxy << ", " << advance << "\n";
+               }
+       }
+
        std::string fixed_str = wstring_to_string(string_to_wstring(str_));
 
        font_style_setter const style_setter(font_, style_);
Index: wesnoth/src/language.cpp
diff -u wesnoth/src/language.cpp:1.54 wesnoth/src/language.cpp:1.55
--- wesnoth/src/language.cpp:1.54       Tue Oct 19 06:11:21 2004
+++ wesnoth/src/language.cpp    Tue Oct 26 19:03:55 2004
@@ -1,4 +1,4 @@
-/* $Id: language.cpp,v 1.54 2004/10/19 06:11:21 silene Exp $ */
+/* $Id: language.cpp,v 1.55 2004/10/26 19:03:55 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -55,17 +55,17 @@
 
 std::string languagedef_name (const language_def& def)
 {
-  return def.language;
+       return def.language;
 }
 
 bool languagedef_lessthan_p (const language_def& def1, const language_def& 
def2)
 {
-  return (def1.language < def2.language);
+       return (def1.language < def2.language);
 }
 
 bool language_def::operator== (const language_def& a)
 {
-  return ((language == a.language) /* && (localename == a.localename) */ );
+       return ((language == a.language) /* && (localename == a.localename) */ 
);
 }
 
 symbol_table string_table;
@@ -219,7 +219,7 @@
 {
 std::string wstring_to_utf8(const wide_string &src)
 {
-    wchar_t ch;
+       wchar_t ch;
        wide_string::const_iterator i;
        int j;
        Uint32 bitmask;




reply via email to

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