super-tux-commit Mailing List for Super Tux (Page 24)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Matze B. <mat...@us...> - 2004-11-20 14:49:25
|
Update of /cvsroot/super-tux/supertux/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14282/lib Modified Files: SConscript Log Message: add defaults to Scons files so that you can use scons -U Index: SConscript =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/SConscript,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SConscript 16 Nov 2004 16:09:11 -0000 1.1 +++ SConscript 20 Nov 2004 14:49:11 -0000 1.2 @@ -1,5 +1,20 @@ Import('*') -libsupertux_src = Glob(dirs=["app", "audio", "gui", "math", - "special", "utils", "video"], pattern="*.cpp") -env.Library(target="supertux", source=libsupertux_src) +libsupertux_src = Glob( + dirs=[ + "app", + "audio", + "gui", + "math", + "special", + "utils", + "video" + ], + pattern="*.cpp" +) +lib = env.Library( + target="supertux", + source=libsupertux_src +) +Default(lib) + |
From: Matze B. <mat...@us...> - 2004-11-20 14:49:25
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14282 Modified Files: SConstruct Log Message: add defaults to Scons files so that you can use scons -U Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- SConstruct 20 Nov 2004 02:08:33 -0000 1.16 +++ SConstruct 20 Nov 2004 14:49:10 -0000 1.17 @@ -143,3 +143,4 @@ env.Export(["env", "Glob"]) env.SConscript("lib/SConscript", build_dir=build_dir + "/lib", duplicate=0) env.SConscript("src/SConscript", build_dir=build_dir + "/src", duplicate=0) +Default("supertux") |
From: Matze B. <mat...@us...> - 2004-11-20 14:49:25
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14282/src Modified Files: SConscript Log Message: add defaults to Scons files so that you can use scons -U Index: SConscript =================================================================== RCS file: /cvsroot/super-tux/supertux/src/SConscript,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SConscript 16 Nov 2004 17:51:31 -0000 1.3 +++ SConscript 20 Nov 2004 14:49:11 -0000 1.4 @@ -1,13 +1,13 @@ Import('*') supertux_src = Glob( - dirs=[".", "object"], + dirs=[".", "object", "badguy"], pattern="*.cpp" ) app = env.Program( target="supertux", source = supertux_src ) - -# hacky way for now... AddPostAction(app, "ln -sf $TARGET .") +Default(app) + |
From: Ondra H. <ond...@ao...> - 2004-11-20 06:32:23
|
I suppose it is time to checkout CVS once again... and see if SCons takes it :-) ~~ Ondra Hosek Matze Braun wrote: >Update of /cvsroot/super-tux/supertux >In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10083 > >Modified Files: > SConstruct TODO >Log Message: >config.h file is now generated > >Index: SConstruct >=================================================================== >RCS file: /cvsroot/super-tux/supertux/SConstruct,v >retrieving revision 1.15 >retrieving revision 1.16 >diff -u -d -r1.15 -r1.16 >--- SConstruct 19 Nov 2004 00:09:58 -0000 1.15 >+++ SConstruct 20 Nov 2004 02:08:33 -0000 1.16 >@@ -2,6 +2,31 @@ > # SConstruct build file. See http://www.scons.org for details. > import os > >+class ConfigHeader: >+ def __init__(self): >+ self.defines = { } >+ self.prefix = "" >+ self.postfix = "" >+ >+ def SetPrefix(self, prefix): >+ self.prefix = prefix >+ >+ def SetPostfix(self, postfix): >+ self.postfix = postfix >+ >+ def Define(self, name, value = ""): >+ self.defines[name] = value >+ >+ def Save(self, filename): >+ file = open(filename, 'w') >+ file.write("/* %s. Generated by SConstruct */\n" % (filename)) >+ file.write("\n") >+ file.write(self.prefix + "\n") >+ for key, value in self.defines.iteritems(): >+ file.write("#define %s \"%s\"\n" % (key, value)) >+ file.write(self.postfix + "\n") >+ file.close() >+ > def Glob(dirs, pattern = '*' ): > import os, fnmatch > files = [] >@@ -39,7 +64,14 @@ > context.Result(ret) > return ret > >+# Package options >+PACKAGE_NAME = "SuperTux" >+PACKAGE_VERSION = "0.2-cvs" >+PACKAGE_BUGREPORT = "sup...@li..." >+PACKAGE = PACKAGE_NAME.lower() >+PACKAGE_STRING = PACKAGE_NAME + " " + PACKAGE_VERSION > >+# User configurable options > opts = Options('build_config.py') > opts.Add('CXX', 'The C++ compiler', 'g++') > opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') >@@ -56,13 +88,20 @@ > > env = Environment(options = opts) > >-if not os.path.exists("build_config.py"): >- print "build_config.py doesn't exist - Generating new build config..." >+# Create build_config.py and config.h >+if not os.path.exists("build_config.py") or not os.path.exists("config.h"): >+ print "build_config.py or config.h don't exist - Generating new build config..." >+ >+ header = ConfigHeader() >+ header.Define("PACKAGE", PACKAGE) >+ header.Define("PACKAGE_NAME", PACKAGE_NAME) >+ header.Define("PACKAGE_VERSION", PACKAGE_VERSION) >+ header.Define("PACKAGE_BUGREPORT", PACKAGE_BUGREPORT) >+ header.Define("PACKAGE_STRING", PACKAGE_STRING) > > conf = Configure(env, custom_tests = { > 'CheckSDLConfig' : CheckSDLConfig > }) >- > if not conf.CheckSDLConfig('1.2.4'): > print "Couldn't find libSDL >= 1.2.4" > Exit(1) >@@ -83,9 +122,9 @@ > {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , > 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) > opts.Save("build_config.py", env) >+ header.Save("config.h") > else: > print "Using build_config.py" >- > > if env['VARIANT'] == "optimize": > env.Append(CXXFLAGS = "-O2 -g -Wall") > >Index: TODO >=================================================================== >RCS file: /cvsroot/super-tux/supertux/TODO,v >retrieving revision 1.77 >retrieving revision 1.78 >diff -u -d -r1.77 -r1.78 >--- TODO 19 Nov 2004 14:57:51 -0000 1.77 >+++ TODO 20 Nov 2004 02:08:33 -0000 1.78 >@@ -19,7 +19,6 @@ > > --Scons-- > * [H] Add an install target >- * [H] Generate the config.h file > * [M] improve opengl check to work on win32 and eventually more strange > systems again > * [H] Make sure compilation on win32 and cross-compilation works > > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >Super-tux-commit mailing list >Sup...@li... >https://lists.sourceforge.net/lists/listinfo/super-tux-commit > > > > |
From: Matze B. <mat...@us...> - 2004-11-20 02:08:52
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10083 Modified Files: SConstruct TODO Log Message: config.h file is now generated Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- SConstruct 19 Nov 2004 00:09:58 -0000 1.15 +++ SConstruct 20 Nov 2004 02:08:33 -0000 1.16 @@ -2,6 +2,31 @@ # SConstruct build file. See http://www.scons.org for details. import os +class ConfigHeader: + def __init__(self): + self.defines = { } + self.prefix = "" + self.postfix = "" + + def SetPrefix(self, prefix): + self.prefix = prefix + + def SetPostfix(self, postfix): + self.postfix = postfix + + def Define(self, name, value = ""): + self.defines[name] = value + + def Save(self, filename): + file = open(filename, 'w') + file.write("/* %s. Generated by SConstruct */\n" % (filename)) + file.write("\n") + file.write(self.prefix + "\n") + for key, value in self.defines.iteritems(): + file.write("#define %s \"%s\"\n" % (key, value)) + file.write(self.postfix + "\n") + file.close() + def Glob(dirs, pattern = '*' ): import os, fnmatch files = [] @@ -39,7 +64,14 @@ context.Result(ret) return ret +# Package options +PACKAGE_NAME = "SuperTux" +PACKAGE_VERSION = "0.2-cvs" +PACKAGE_BUGREPORT = "sup...@li..." +PACKAGE = PACKAGE_NAME.lower() +PACKAGE_STRING = PACKAGE_NAME + " " + PACKAGE_VERSION +# User configurable options opts = Options('build_config.py') opts.Add('CXX', 'The C++ compiler', 'g++') opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') @@ -56,13 +88,20 @@ env = Environment(options = opts) -if not os.path.exists("build_config.py"): - print "build_config.py doesn't exist - Generating new build config..." +# Create build_config.py and config.h +if not os.path.exists("build_config.py") or not os.path.exists("config.h"): + print "build_config.py or config.h don't exist - Generating new build config..." + + header = ConfigHeader() + header.Define("PACKAGE", PACKAGE) + header.Define("PACKAGE_NAME", PACKAGE_NAME) + header.Define("PACKAGE_VERSION", PACKAGE_VERSION) + header.Define("PACKAGE_BUGREPORT", PACKAGE_BUGREPORT) + header.Define("PACKAGE_STRING", PACKAGE_STRING) conf = Configure(env, custom_tests = { 'CheckSDLConfig' : CheckSDLConfig }) - if not conf.CheckSDLConfig('1.2.4'): print "Couldn't find libSDL >= 1.2.4" Exit(1) @@ -83,9 +122,9 @@ {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) opts.Save("build_config.py", env) + header.Save("config.h") else: print "Using build_config.py" - if env['VARIANT'] == "optimize": env.Append(CXXFLAGS = "-O2 -g -Wall") Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- TODO 19 Nov 2004 14:57:51 -0000 1.77 +++ TODO 20 Nov 2004 02:08:33 -0000 1.78 @@ -19,7 +19,6 @@ --Scons-- * [H] Add an install target - * [H] Generate the config.h file * [M] improve opengl check to work on win32 and eventually more strange systems again * [H] Make sure compilation on win32 and cross-compilation works |
From: Matze B. <mat...@us...> - 2004-11-19 14:58:06
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12145 Modified Files: TODO Log Message: TODO update Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- TODO 18 Nov 2004 23:35:38 -0000 1.76 +++ TODO 19 Nov 2004 14:57:51 -0000 1.77 @@ -76,7 +76,6 @@ - Tux's buttjump animation [H] Background code have the following bugs: - Gradient in software rendering doesn't currently work (at least here). - - Images tiling code sucks resulting in glitches and unecessary drawings. Matze: can you give more details? The code looks perfectly fine to me [M] There are some weird graphical glitches when Tux bumps more than one block @@ -90,9 +89,6 @@ the roof [M] Implement Unisolid type for tiles (where collisions from below are ignored). - done -[M] Menu doesn't jump titles, and doesn't seem to like having menu entries - created after initialization. - Matze: what does "menu doesn't jump titles" mean? [L] Allow any object to be inside of a [?] box, ie. trampoline or badguy - Not sure if this would be gameplay wise. |
From: Matze B. <mat...@us...> - 2004-11-19 00:10:08
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25124 Modified Files: SConstruct Log Message: improve exception feedback a bit Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- SConstruct 19 Nov 2004 00:01:24 -0000 1.14 +++ SConstruct 19 Nov 2004 00:09:58 -0000 1.15 @@ -10,8 +10,8 @@ for file in os.listdir( Dir(dir).srcnode().abspath ): if fnmatch.fnmatch(file, pattern) : files.append( os.path.join( dir, file ) ) - except: - print "Warning, couldn't find directory " + dir + except Exception, e: + print "Warning, couldn't find directory '%s': %s" % (dir, str(e)) return files |
From: Matze B. <mat...@us...> - 2004-11-19 00:01:37
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23085 Modified Files: SConstruct Log Message: make glob rule robust against non-existant directories Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- SConstruct 18 Nov 2004 21:26:54 -0000 1.13 +++ SConstruct 19 Nov 2004 00:01:24 -0000 1.14 @@ -6,9 +6,13 @@ import os, fnmatch files = [] for dir in dirs: - for file in os.listdir( Dir(dir).srcnode().abspath ): - if fnmatch.fnmatch(file, pattern) : - files.append( os.path.join( dir, file ) ) + try: + for file in os.listdir( Dir(dir).srcnode().abspath ): + if fnmatch.fnmatch(file, pattern) : + files.append( os.path.join( dir, file ) ) + except: + print "Warning, couldn't find directory " + dir + return files # thanks to Michael P Jung @@ -84,7 +88,7 @@ if env['VARIANT'] == "optimize": - env.Append(CXXFLAGS = "-O2 -g") + env.Append(CXXFLAGS = "-O2 -g -Wall") elif env['VARIANT'] == "debug": env.Append(CXXFLAGS = "-O0 -g3 -Wall -Werror") env.Append(CPPDEFINES = { "DEBUG":"1" }) |
From: Matze B. <mat...@us...> - 2004-11-18 23:52:59
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20581 Modified Files: autogen.sh Log Message: make autogen.sh more complete so that it installs libtool and config.h.in automatically Index: autogen.sh =================================================================== RCS file: /cvsroot/super-tux/supertux/autogen.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- autogen.sh 7 Jun 2004 19:21:03 -0000 1.9 +++ autogen.sh 18 Nov 2004 23:52:49 -0000 1.10 @@ -5,8 +5,9 @@ # see AUTOMAKE_OPTIONS in Makefile.am export WANT_AUTOMAKE=1.6 +autoheader +libtoolize --force aclocal -I m4 automake --copy --add-missing autoconf -# EOF # |
From: Matze B. <mat...@us...> - 2004-11-18 23:35:48
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16478 Modified Files: TODO Log Message: make last point a bit more verbose Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- TODO 18 Nov 2004 23:32:45 -0000 1.75 +++ TODO 18 Nov 2004 23:35:38 -0000 1.76 @@ -29,7 +29,14 @@ * [M] Create a dist target * [M] Add instructions to the README * [L] If all of the [H] and [M] issues are fixed, remove autoconf/automake - * [L] Take a look if it is possible to make it a bit more quiet. + * [L] Take a look if it is possible to make it a bit more quiet. (Similar to + linux kernel, samba or jam output would be optimum, ie. + C++ build/linux/src/bla.o + C++ build/linux/src/blup.o + C++ build/linux/src/error.o + Error on line xx in error.o: This source contained an error + + g++ -Wall .... -o build/linux/src/error.o src/error.cpp --Miscelaneous-- [?] Default keyboard setup should change. Up will be needed for other features |
From: Matze B. <mat...@us...> - 2004-11-18 23:32:57
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15807 Modified Files: TODO Log Message: moved my personal scons todo to the global one, so that someone else can work on it (I'll concentrate on collision detection rewrite first) Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- TODO 18 Aug 2004 10:44:15 -0000 1.74 +++ TODO 18 Nov 2004 23:32:45 -0000 1.75 @@ -17,22 +17,35 @@ ?: bug or feature? - needs discussion +--Scons-- + * [H] Add an install target + * [H] Generate the config.h file + * [M] improve opengl check to work on win32 and eventually more strange + systems again + * [H] Make sure compilation on win32 and cross-compilation works + * [M] compile some test executables to test for SDL, SDL_mixer and SDL_image. + Also test for version of SDL_mixer and SDL_image + * [M] Create a distclean target + * [M] Create a dist target + * [M] Add instructions to the README + * [L] If all of the [H] and [M] issues are fixed, remove autoconf/automake + * [L] Take a look if it is possible to make it a bit more quiet. + +--Miscelaneous-- [?] Default keyboard setup should change. Up will be needed for other features like going through doors and looking up, etc. - Ricardo: IMO, there should be the following keys for the following actions: - Up arrow - Look up + Up arrow - Look up / activate Down arrow - Look down / duck Left arrow - Left move Right arrow - Right move Ctrl - Run / Power - Alt - Jump - Not sure if Open doors action would be attributed to Up or Ctrl... + Space - Jump [H] Worldmap should have a flag to allow to go to another map after finishing a level from that one. - It might be cool to have a (place group in the worldmap file that would allow - such stuff as: levels, messages, wrapping and worldmap changing (or even - combinations). + It might be cool to have a (place group in the worldmap file that would + allow such stuff as: levels, messages, wrapping and worldmap changing + (or even combinations). [H] Change resolution to 800x600 - Levels need to be updated to resolution - half of the levels have been already updated @@ -54,13 +67,10 @@ - New forest tileset - Badguy sprites - Tux's buttjump animation -[H] Backgrounds should be square tiles instead of just tiling one image - - Useful for vertical scrolling when we only want a sky background on the - top of the level - - Support for this is already available using a paralax tilemap layer [H] Background code have the following bugs: - Gradient in software rendering doesn't currently work (at least here). - Images tiling code sucks resulting in glitches and unecessary drawings. + Matze: can you give more details? The code looks perfectly fine to me [M] There are some weird graphical glitches when Tux bumps more than one block at the same time @@ -72,8 +82,10 @@ [M] You shouldn't be able to stand on invisible blocks, before you bumped them the roof [M] Implement Unisolid type for tiles (where collisions from below are ignored). -[M] Menu doesn't jump titles, and doesn't seem to like having menu entries created - after initialization. + - done +[M] Menu doesn't jump titles, and doesn't seem to like having menu entries + created after initialization. + Matze: what does "menu doesn't jump titles" mean? [L] Allow any object to be inside of a [?] box, ie. trampoline or badguy - Not sure if this would be gameplay wise. @@ -85,8 +97,6 @@ instead of fall, pause mode doesn't seem to have this problem, only menu) [L] catch exceptions thrown by lispreader -[L] we only have a global counter for multiple coin blocks. This should be handled - per block. - Why is this a bad thing? It avoids unnecessary cpu and memory use. Beyond Milestone2 ----------------- |
From: Matze B. <mat...@us...> - 2004-11-18 21:27:05
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16638 Modified Files: SConstruct Log Message: use -Wall -Werror in debug mode Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- SConstruct 16 Nov 2004 20:36:42 -0000 1.12 +++ SConstruct 18 Nov 2004 21:26:54 -0000 1.13 @@ -86,7 +86,7 @@ if env['VARIANT'] == "optimize": env.Append(CXXFLAGS = "-O2 -g") elif env['VARIANT'] == "debug": - env.Append(CXXFLAGS = "-O0 -g3") + env.Append(CXXFLAGS = "-O0 -g3 -Wall -Werror") env.Append(CPPDEFINES = { "DEBUG":"1" }) elif env['VARIANT'] == "profile": env.Append(CXXFLAGS = "-pg -O2") |
From: Matze B. <mat...@us...> - 2004-11-18 15:10:06
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23985 Modified Files: menu.h menu.cpp Log Message: change braindamaging usage of STL to something saner Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- menu.cpp 9 Oct 2004 08:19:17 -0000 1.15 +++ menu.cpp 18 Nov 2004 15:09:53 -0000 1.16 @@ -18,6 +18,8 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef WIN32 +#include <config.h> + #include <sys/types.h> #include <ctype.h> #endif @@ -34,7 +36,6 @@ #include "../video/screen.h" #include "../video/drawing_context.h" #include "../app/setup.h" -#include "../special/timer.h" #include "../app/gettext.h" #include "../math/vector.h" @@ -152,14 +153,14 @@ current_ = menu; } -MenuItem::MenuItem(MenuItemKind _kind, int _id) : kind(_kind) , id(_id) +MenuItem::MenuItem(MenuItemKind _kind, int _id) + : kind(_kind) , id(_id) { - list.second = 0; } -MenuItem::MenuItem(MenuItemKind _kind, int _id, const std::string& _text) : kind(_kind) , id(_id) , text(_text) +MenuItem::MenuItem(MenuItemKind _kind, int _id, const std::string& _text) + : kind(_kind) , id(_id) , text(_text) { - list.second = 0; } /* Return a pointer to a new menu item */ @@ -178,8 +179,8 @@ pnew_item->target_menu = target_menu_; pnew_item->int_p = int_p_; - - pnew_item->list.second = 0; + + pnew_item->selected = 0; pnew_item->input_flickering = false; pnew_item->input_flickering_timer.init(true); @@ -286,19 +287,10 @@ item->change_input(oss.str().c_str()); } -/* Free a menu and all its items */ Menu::~Menu() { - if(item.size() != 0) - { - for(unsigned int i = 0; i < item.size(); ++i) - { - item[i].list.first.clear(); - } - } } - Menu::Menu() { hit_item = -1; @@ -394,25 +386,21 @@ break; case MENU_ACTION_LEFT: - if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list.first.size() != 0) - { - if(item[active_item].list.second != item[active_item].list.first.begin()) - --item[active_item].list.second; - else - item[active_item].list.second = item[active_item].list.first.end(); - } + if(item[active_item].kind == MN_STRINGSELECT) { + if(item[active_item].selected > 0) + item[active_item].selected--; + else + item[active_item].selected = item[active_item].list.size()-1; + } break; case MENU_ACTION_RIGHT: - if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list.first.size() != 0) - { - if(item[active_item].list.second != item[active_item].list.first.end()) - ++item[active_item].list.second; - else - item[active_item].list.second = item[active_item].list.first.begin(); - } + if(item[active_item].kind == MN_STRINGSELECT) { + if(item[active_item].selected+1 < item[active_item].list.size()) + item[active_item].selected++; + else + item[active_item].selected = 0; + } break; case MENU_ACTION_HIT: @@ -519,9 +507,9 @@ int text_width = int(text_font->get_text_width(pitem.text)); int input_width = int(text_font->get_text_width(pitem.input) + 10); int list_width = 0; - std::set<std::string>::iterator tmp = 0; - if(pitem.list.second != tmp) - list_width = int(text_font->get_text_width((*pitem.list.second))); + if(pitem.list.size() > 0) { + list_width = (int) text_font->get_text_width(pitem.list[pitem.selected]); + } if (arrange_left) x_pos += 24 - menu_width/2 + (text_width + input_width + list_width)/2; @@ -631,7 +619,7 @@ Vector(list_pos_2, 18), Color(0,0,0,128), LAYER_GUI - 5); - context.draw_text(text_font, (*pitem.list.second), + context.draw_text(text_font, pitem.list[pitem.selected], Vector(screen->w/2 + text_pos, y_pos - int(text_font->get_height()/2)), CENTER_ALLIGN, LAYER_GUI); context.draw_text(text_font, pitem.text, @@ -687,7 +675,7 @@ int menu_width = 0; for(unsigned int i = 0; i < item.size(); ++i) { - int w = item[i].text.size() + item[i].input.size() + 1; //+ ((item[i].list.second != item[i].list.first.end()) ? (strlen((*(item[i].list.second)).c_str())) : 0); + int w = item[i].text.size() + item[i].input.size() + 1; if( w > menu_width ) { menu_width = w; @@ -917,5 +905,3 @@ } } - -// EOF // Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- menu.h 28 Jul 2004 23:06:11 -0000 1.6 +++ menu.h 18 Nov 2004 15:09:53 -0000 1.7 @@ -30,7 +30,6 @@ #include "../video/surface.h" #include "../video/font.h" #include "../special/timer.h" -#include "../special/base.h" #include "../gui/mousecursor.h" namespace SuperTux @@ -73,13 +72,17 @@ std::string text; std::string input; int *int_p; // used for setting keys (can be used for more stuff...) - std::pair<std::set<std::string>, std::set<std::string>::iterator> list; + + std::vector<std::string> list; // list of values for a STRINGSELECT item + size_t selected; // currently selected item + Menu* target_menu; void change_text (const std::string& text); void change_input(const std::string& text); - static MenuItem* create(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id, int* int_p); + static MenuItem* create(MenuItemKind kind, const std::string& text, + int init_toggle, Menu* target_menu, int id, int* int_p); std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol private: |
From: Matze B. <mat...@us...> - 2004-11-16 20:37:40
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26669 Modified Files: gettext.h globals.cpp setup.cpp setup.h Log Message: make it possible to start supertux from top soruce directory Index: gettext.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/gettext.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gettext.h 20 Jul 2004 17:51:34 -0000 1.1 +++ gettext.h 16 Nov 2004 20:37:30 -0000 1.2 @@ -32,6 +32,8 @@ /* Get declarations of GNU message catalog functions. */ #include <libintl.h> +// needed for LC_ALL constant +#include <locale.h> #else Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- setup.cpp 13 Aug 2004 11:43:15 -0000 1.15 +++ setup.cpp 16 Nov 2004 20:37:30 -0000 1.16 @@ -17,6 +17,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include <config.h> + #include <cassert> #include <cstdio> #include <iostream> @@ -285,6 +287,12 @@ mkdir((st_dir + "/levels").c_str(), 0755); + // try current directory as datadir + if(datadir.empty()) { + if(FileSystem::faccessible("./data/intro.txt")) + datadir = "./data"; + } + // User has not that a datadir, so we try some magic if (datadir.empty()) { Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- globals.cpp 6 Aug 2004 11:43:07 -0000 1.8 +++ globals.cpp 16 Nov 2004 20:37:30 -0000 1.9 @@ -18,6 +18,8 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. +#include <config.h> + #include "../app/globals.h" namespace SuperTux { Index: setup.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- setup.h 6 Aug 2004 11:43:08 -0000 1.8 +++ setup.h 16 Nov 2004 20:37:30 -0000 1.9 @@ -24,7 +24,6 @@ #include <set> #include <string> #include "../gui/menu.h" -#include "../special/base.h" namespace SuperTux { |
From: Matze B. <mat...@us...> - 2004-11-16 20:37:01
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26480 Modified Files: SConstruct Log Message: fix for the config stuff Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- SConstruct 16 Nov 2004 18:32:39 -0000 1.11 +++ SConstruct 16 Nov 2004 20:36:42 -0000 1.12 @@ -2,15 +2,14 @@ # SConstruct build file. See http://www.scons.org for details. import os -# based on a script from ch...@us... def Glob(dirs, pattern = '*' ): - import os, fnmatch + import os, fnmatch files = [] for dir in dirs: - for file in os.listdir( Dir(dir).srcnode().abspath ): - if fnmatch.fnmatch(file, pattern) : - files.append( os.path.join( dir, file ) ) - return files + for file in os.listdir( Dir(dir).srcnode().abspath ): + if fnmatch.fnmatch(file, pattern) : + files.append( os.path.join( dir, file ) ) + return files # thanks to Michael P Jung def CheckSDLConfig(context, minVersion): @@ -36,11 +35,13 @@ context.Result(ret) return ret + opts = Options('build_config.py') opts.Add('CXX', 'The C++ compiler', 'g++') opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') opts.Add('CPPPATH', 'Additional preprocessor paths', '') opts.Add('CPPFLAGS', 'Additional preprocessor flags', '') +opts.Add('CPPDEFINES', 'defined constants', '') opts.Add('LIBPATH', 'Additional library paths', '') opts.Add('LIBS', 'Additional libraries', '') opts.Add('DESTDIR', \ @@ -50,7 +51,6 @@ ['optimize', 'debug', 'profile'])) env = Environment(options = opts) -env.SourceSignatures('timestamp') if not os.path.exists("build_config.py"): print "build_config.py doesn't exist - Generating new build config..." |
From: Matze B. <mat...@us...> - 2004-11-16 18:32:49
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26881 Modified Files: SConstruct Log Message: save buildconfig to file Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- SConstruct 16 Nov 2004 17:49:35 -0000 1.10 +++ SConstruct 16 Nov 2004 18:32:39 -0000 1.11 @@ -1,5 +1,6 @@ # # SConstruct build file. See http://www.scons.org for details. +import os # based on a script from ch...@us... def Glob(dirs, pattern = '*' ): @@ -11,6 +12,7 @@ files.append( os.path.join( dir, file ) ) return files +# thanks to Michael P Jung def CheckSDLConfig(context, minVersion): context.Message('Checking for sdl-config >= %s... ' % minVersion) from popen2 import Popen3 @@ -34,7 +36,7 @@ context.Result(ret) return ret -opts = Options('custom.py') +opts = Options('build_config.py') opts.Add('CXX', 'The C++ compiler', 'g++') opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') opts.Add('CPPPATH', 'Additional preprocessor paths', '') @@ -44,47 +46,54 @@ opts.Add('DESTDIR', \ 'destination directory for installation. It is prepended to PREFIX', '') opts.Add('PREFIX', 'Installation prefix', '/usr/local') -opts.Add(ListOption('VARIANT', 'Build variant', 'optimize', +opts.Add(EnumOption('VARIANT', 'Build variant', 'optimize', ['optimize', 'debug', 'profile'])) env = Environment(options = opts) -conf = Configure(env, custom_tests = { - 'CheckSDLConfig' : CheckSDLConfig -}) +env.SourceSignatures('timestamp') -# TODO check -config apps in the Configure context - -if not conf.CheckSDLConfig('1.2.4'): - print "Couldn't find libSDL >= 1.2.4" - Exit(1) -if not conf.CheckLib('SDL_mixer'): - print "Couldn't find SDL_mixer library!" - Exit(1) -if not conf.CheckLib('SDL_image'): - print "Couldn't find SDL_image library!" - Exit(1) -if not conf.CheckLib('GL'): - print "Couldn't find OpenGL library!" - Exit(1) +if not os.path.exists("build_config.py"): + print "build_config.py doesn't exist - Generating new build config..." + + conf = Configure(env, custom_tests = { + 'CheckSDLConfig' : CheckSDLConfig + }) -env = conf.Finish() + if not conf.CheckSDLConfig('1.2.4'): + print "Couldn't find libSDL >= 1.2.4" + Exit(1) + if not conf.CheckLib('SDL_mixer'): + print "Couldn't find SDL_mixer library!" + Exit(1) + if not conf.CheckLib('SDL_image'): + print "Couldn't find SDL_image library!" + Exit(1) + if not conf.CheckLib('GL'): + print "Couldn't find OpenGL library!" + Exit(1) -if str(env['VARIANT']) == "optimize": + env = conf.Finish() + + env.ParseConfig('sdl-config --cflags --libs') + env.Append(CPPDEFINES = \ + {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , + 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) + opts.Save("build_config.py", env) +else: + print "Using build_config.py" + + +if env['VARIANT'] == "optimize": env.Append(CXXFLAGS = "-O2 -g") -elif str(env['VARIANT']) == "debug": +elif env['VARIANT'] == "debug": env.Append(CXXFLAGS = "-O0 -g3") env.Append(CPPDEFINES = { "DEBUG":"1" }) -elif str(env['VARIANT']) == "profile": +elif env['VARIANT'] == "profile": env.Append(CXXFLAGS = "-pg -O2") -env.ParseConfig('sdl-config --cflags --libs') -env.Append(CPPPATH = ["#", "#/src", "#/lib"]) -env.Append(CPPDEFINES = \ - {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , - 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) - -build_dir="build/" + env['PLATFORM'] + "/" + str(env['VARIANT']) +build_dir="build/" + env['PLATFORM'] + "/" + env['VARIANT'] +env.Append(CPPPATH = ["#", "#/src", "#/lib"]) env.Append(LIBS = ["supertux"]) env.Append(LIBPATH=["#" + build_dir + "/lib"]) |
From: Matze B. <mat...@us...> - 2004-11-16 17:51:43
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16844/src Modified Files: SConscript Log Message: add variants and link executable to toplevel Index: SConscript =================================================================== RCS file: /cvsroot/super-tux/supertux/src/SConscript,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SConscript 16 Nov 2004 17:46:56 -0000 1.2 +++ SConscript 16 Nov 2004 17:51:31 -0000 1.3 @@ -10,4 +10,4 @@ ) # hacky way for now... -AddPostAction(app, "ln -s $TARGET .") +AddPostAction(app, "ln -sf $TARGET .") |
From: Matze B. <mat...@us...> - 2004-11-16 17:49:44
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16400 Modified Files: SConstruct Log Message: add variants and link executable to toplevel Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- SConstruct 16 Nov 2004 17:46:56 -0000 1.9 +++ SConstruct 16 Nov 2004 17:49:35 -0000 1.10 @@ -73,7 +73,7 @@ env.Append(CXXFLAGS = "-O2 -g") elif str(env['VARIANT']) == "debug": env.Append(CXXFLAGS = "-O0 -g3") - env.Append(CPPDEFINES = "DEBUG") + env.Append(CPPDEFINES = { "DEBUG":"1" }) elif str(env['VARIANT']) == "profile": env.Append(CXXFLAGS = "-pg -O2") |
From: Matze B. <mat...@us...> - 2004-11-16 17:47:06
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15868/src Modified Files: SConscript Log Message: add variants and link executable to toplevel Index: SConscript =================================================================== RCS file: /cvsroot/super-tux/supertux/src/SConscript,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SConscript 16 Nov 2004 16:09:10 -0000 1.1 +++ SConscript 16 Nov 2004 17:46:56 -0000 1.2 @@ -1,5 +1,13 @@ Import('*') -supertux_src = Glob(dirs=[".", "object"], pattern="*.cpp") -env.Program(target="#/supertux", source = supertux_src) +supertux_src = Glob( + dirs=[".", "object"], + pattern="*.cpp" +) +app = env.Program( + target="supertux", + source = supertux_src +) +# hacky way for now... +AddPostAction(app, "ln -s $TARGET .") |
From: Matze B. <mat...@us...> - 2004-11-16 17:47:05
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15868 Modified Files: SConstruct Log Message: add variants and link executable to toplevel Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SConstruct 16 Nov 2004 16:41:03 -0000 1.8 +++ SConstruct 16 Nov 2004 17:46:56 -0000 1.9 @@ -44,10 +44,12 @@ opts.Add('DESTDIR', \ 'destination directory for installation. It is prepended to PREFIX', '') opts.Add('PREFIX', 'Installation prefix', '/usr/local') +opts.Add(ListOption('VARIANT', 'Build variant', 'optimize', + ['optimize', 'debug', 'profile'])) env = Environment(options = opts) conf = Configure(env, custom_tests = { - 'CheckSDLConfig' : CheckSDLConfig + 'CheckSDLConfig' : CheckSDLConfig }) # TODO check -config apps in the Configure context @@ -67,13 +69,21 @@ env = conf.Finish() +if str(env['VARIANT']) == "optimize": + env.Append(CXXFLAGS = "-O2 -g") +elif str(env['VARIANT']) == "debug": + env.Append(CXXFLAGS = "-O0 -g3") + env.Append(CPPDEFINES = "DEBUG") +elif str(env['VARIANT']) == "profile": + env.Append(CXXFLAGS = "-pg -O2") + env.ParseConfig('sdl-config --cflags --libs') env.Append(CPPPATH = ["#", "#/src", "#/lib"]) env.Append(CPPDEFINES = \ {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) -build_dir="build/" + env['PLATFORM'] +build_dir="build/" + env['PLATFORM'] + "/" + str(env['VARIANT']) env.Append(LIBS = ["supertux"]) env.Append(LIBPATH=["#" + build_dir + "/lib"]) @@ -81,8 +91,3 @@ env.Export(["env", "Glob"]) env.SConscript("lib/SConscript", build_dir=build_dir + "/lib", duplicate=0) env.SConscript("src/SConscript", build_dir=build_dir + "/src", duplicate=0) - -#for i in env.items(): -# print str(i) - -# link all program targets to top builddir as a convenience |
From: Matze B. <mat...@us...> - 2004-11-16 16:41:12
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv601 Modified Files: SConstruct Log Message: more fixes Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- SConstruct 16 Nov 2004 16:09:11 -0000 1.7 +++ SConstruct 16 Nov 2004 16:41:03 -0000 1.8 @@ -11,6 +11,29 @@ files.append( os.path.join( dir, file ) ) return files +def CheckSDLConfig(context, minVersion): + context.Message('Checking for sdl-config >= %s... ' % minVersion) + from popen2 import Popen3 + p = Popen3(['sdl-config', '--version']) + ret = p.wait() + out = p.fromchild.readlines() + if ret != 0: + context.Result(False) + return False + if len(out) != 1: + # unable to parse output! + context.Result(False) + return False + # TODO validate output and catch exceptions + version = map(int, out[0].strip().split('.')) + minVersion = map(int, minVersion.split('.')) + # TODO comparing versions that way only works for pure numeric version + # numbers and fails for custom extensions. I don't care about this at + # the moment as sdl-config never used such version numbers afaik. + ret = (version >= minVersion) + context.Result(ret) + return ret + opts = Options('custom.py') opts.Add('CXX', 'The C++ compiler', 'g++') opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') @@ -23,10 +46,15 @@ opts.Add('PREFIX', 'Installation prefix', '/usr/local') env = Environment(options = opts) -conf = Configure(env) +conf = Configure(env, custom_tests = { + 'CheckSDLConfig' : CheckSDLConfig +}) # TODO check -config apps in the Configure context - + +if not conf.CheckSDLConfig('1.2.4'): + print "Couldn't find libSDL >= 1.2.4" + Exit(1) if not conf.CheckLib('SDL_mixer'): print "Couldn't find SDL_mixer library!" Exit(1) @@ -45,11 +73,16 @@ {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) -env.Append(LIBS = ["supertux"]) -env.Append(LIBPATH=["#"]) +build_dir="build/" + env['PLATFORM'] -build_dir="build/linux" +env.Append(LIBS = ["supertux"]) +env.Append(LIBPATH=["#" + build_dir + "/lib"]) env.Export(["env", "Glob"]) env.SConscript("lib/SConscript", build_dir=build_dir + "/lib", duplicate=0) env.SConscript("src/SConscript", build_dir=build_dir + "/src", duplicate=0) + +#for i in env.items(): +# print str(i) + +# link all program targets to top builddir as a convenience |
From: Matze B. <mat...@us...> - 2004-11-16 16:09:19
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24447 Modified Files: SConstruct Log Message: improve the sconsbuild, still lots of work needed to completely replace automake with it Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SConstruct 16 Nov 2004 12:30:09 -0000 1.6 +++ SConstruct 16 Nov 2004 16:09:11 -0000 1.7 @@ -1,123 +1,55 @@ # -# A simple SConstruct file. -# See http://www.scons.org/ for more information about what SCons is and how it -# may help you... :-) -# I've never done anything with SCons before. Quite obviously this script is in -# a non-working state!! Maybe someone with more knowledge of the materia can -# take over.... -# - Benjamin P. 'litespeed' Jung - -# - -# TODO: such static entries are obviously not what we want. -# Using e.g. 'sdl-config' to obtain parameters would be muuuuuch -# better. - +# SConstruct build file. See http://www.scons.org for details. -DATA_PREFIX = '\\\"/usr/local/share/supertux\\\"' -LOCALEDIR = '\\\"/usr/local/share/locale\\\"' +# based on a script from ch...@us... +def Glob(dirs, pattern = '*' ): + import os, fnmatch + files = [] + for dir in dirs: + for file in os.listdir( Dir(dir).srcnode().abspath ): + if fnmatch.fnmatch(file, pattern) : + files.append( os.path.join( dir, file ) ) + return files -CCFLAGS = [ - '-O2', - '-DDATA_PREFIX=' + DATA_PREFIX, - '-DLOCALEDIR=' + LOCALEDIR -] +opts = Options('custom.py') +opts.Add('CXX', 'The C++ compiler', 'g++') +opts.Add('CXXFLAGS', 'Additional C++ compiler flags', '') +opts.Add('CPPPATH', 'Additional preprocessor paths', '') +opts.Add('CPPFLAGS', 'Additional preprocessor flags', '') +opts.Add('LIBPATH', 'Additional library paths', '') +opts.Add('LIBS', 'Additional libraries', '') +opts.Add('DESTDIR', \ + 'destination directory for installation. It is prepended to PREFIX', '') +opts.Add('PREFIX', 'Installation prefix', '/usr/local') -CPPPATH = ['/usr/include/SDL', '/usr/include/X11', 'src', 'lib', 'intl', '.'] +env = Environment(options = opts) +conf = Configure(env) -LIBPATH = [ - 'lib', - '/lib', - '/usr/lib', - '/usr/lib/X11', - '/usr/local/lib' -] +# TODO check -config apps in the Configure context + +if not conf.CheckLib('SDL_mixer'): + print "Couldn't find SDL_mixer library!" + Exit(1) +if not conf.CheckLib('SDL_image'): + print "Couldn't find SDL_image library!" + Exit(1) +if not conf.CheckLib('GL'): + print "Couldn't find OpenGL library!" + Exit(1) -LIBS = [ - 'supertux', - 'SDL', - 'SDL_gfx', - 'SDL_image', - 'SDL_mixer', - 'SDL_sound', - 'pthread', - 'm', - 'dl', - 'asound', - 'GL', - 'GLU' -] - +env = conf.Finish() -libsupertux_src = [ - 'lib/app/globals.cpp', - 'lib/app/setup.cpp', - 'lib/audio/musicref.cpp', - 'lib/audio/sound_manager.cpp', - 'lib/gui/button.cpp', - 'lib/gui/menu.cpp', - 'lib/gui/mousecursor.cpp', - 'lib/math/physic.cpp', - 'lib/math/vector.cpp', - 'lib/special/game_object.cpp', - 'lib/special/moving_object.cpp', - 'lib/special/sprite.cpp', - 'lib/special/sprite_manager.cpp', - 'lib/special/timer.cpp', - 'lib/special/frame_rate.cpp', - 'lib/utils/configfile.cpp', - 'lib/utils/lispreader.cpp', - 'lib/utils/lispwriter.cpp', - 'lib/video/drawing_context.cpp', - 'lib/video/font.cpp', - 'lib/video/screen.cpp', - 'lib/video/surface.cpp' -] +env.ParseConfig('sdl-config --cflags --libs') +env.Append(CPPPATH = ["#", "#/src", "#/lib"]) +env.Append(CPPDEFINES = \ + {'DATA_PREFIX':"'\"" + env['PREFIX'] + "/share/supertux\"'" , + 'LOCALEDIR' :"'\"" + env['PREFIX'] + "/locales\"'"}) -supertux_src = [ - 'src/background.cpp', - 'src/badguy.cpp', - 'src/badguy_specs.cpp', - 'src/bitmask.cpp', - 'src/camera.cpp', - 'src/collision.cpp', - 'src/door.cpp', - 'src/gameloop.cpp', - 'src/gameobjs.cpp', - 'src/high_scores.cpp', - 'src/interactive_object.cpp', - 'src/intro.cpp', - 'src/level.cpp', - 'src/level_subset.cpp', - 'src/leveleditor.cpp', - 'src/misc.cpp', - 'src/particlesystem.cpp', - 'src/player.cpp', - 'src/resources.cpp', - 'src/scene.cpp', - 'src/sector.cpp', - 'src/special.cpp', - 'src/statistics.cpp', - 'src/supertux.cpp', - 'src/tile.cpp', - 'src/tile_manager.cpp', - 'src/tilemap.cpp', - 'src/title.cpp', - 'src/worldmap.cpp' -] - +env.Append(LIBS = ["supertux"]) +env.Append(LIBPATH=["#"]) -StaticLibrary( - target = 'lib/supertux', - source = libsupertux_src, - CPPPATH = CPPPATH, - CCFLAGS = CCFLAGS -) +build_dir="build/linux" -Program( - target = 'src/supertux', - source = supertux_src, - CPPPATH = CPPPATH, - CCFLAGS = CCFLAGS, - LIBPATH = LIBPATH, - LIBS = LIBS -) +env.Export(["env", "Glob"]) +env.SConscript("lib/SConscript", build_dir=build_dir + "/lib", duplicate=0) +env.SConscript("src/SConscript", build_dir=build_dir + "/src", duplicate=0) |
From: Matze B. <mat...@us...> - 2004-11-16 16:09:19
|
Update of /cvsroot/super-tux/supertux/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24447/lib Added Files: SConscript Log Message: improve the sconsbuild, still lots of work needed to completely replace automake with it --- NEW FILE: SConscript --- Import('*') libsupertux_src = Glob(dirs=["app", "audio", "gui", "math", "special", "utils", "video"], pattern="*.cpp") env.Library(target="supertux", source=libsupertux_src) |
From: Matze B. <mat...@us...> - 2004-11-16 16:09:19
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24447/src Added Files: SConscript Log Message: improve the sconsbuild, still lots of work needed to completely replace automake with it --- NEW FILE: SConscript --- Import('*') supertux_src = Glob(dirs=[".", "object"], pattern="*.cpp") env.Program(target="#/supertux", source = supertux_src) |
From: Benjamin P. J. <lit...@us...> - 2004-11-16 12:30:19
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8408 Modified Files: SConstruct Log Message: It works... All the static entries had to be determined dynamically.... well: maybe tomorrow. Index: SConstruct =================================================================== RCS file: /cvsroot/super-tux/supertux/SConstruct,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SConstruct 16 Nov 2004 11:53:40 -0000 1.5 +++ SConstruct 16 Nov 2004 12:30:09 -0000 1.6 @@ -3,28 +3,50 @@ # See http://www.scons.org/ for more information about what SCons is and how it # may help you... :-) # I've never done anything with SCons before. Quite obviously this script is in -# a non-working state!! Maybe someone with more knowledge of the materia who -# thinks that SCons might be better suited than make can take over.... +# a non-working state!! Maybe someone with more knowledge of the materia can +# take over.... # - Benjamin P. 'litespeed' Jung - # # TODO: such static entries are obviously not what we want. -# Using e.g. 'sdl-config' to obtain parameters would be muuuuuch -# better. +# Using e.g. 'sdl-config' to obtain parameters would be muuuuuch +# better. DATA_PREFIX = '\\\"/usr/local/share/supertux\\\"' LOCALEDIR = '\\\"/usr/local/share/locale\\\"' -SDL_DYNAMIC_CCFLAGS = ['-D_REENTRANT', '-lSDL -lpthread'] -SDL_STATIC_CCFLAGS = ['-lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -lvga -laa'] +CCFLAGS = [ + '-O2', + '-DDATA_PREFIX=' + DATA_PREFIX, + '-DLOCALEDIR=' + LOCALEDIR +] -CCFLAGS = ['-DHAVE_CONFIG_H', '-O2', '-DDATA_PREFIX=' + DATA_PREFIX, '-DLOCALEDIR=' + LOCALEDIR] +CPPPATH = ['/usr/include/SDL', '/usr/include/X11', 'src', 'lib', 'intl', '.'] -LIBSUPERTUX_DYNAMIC_CCFLAGS = SDL_DYNAMIC_CCFLAGS + CCFLAGS -LIBSUPERTUX_STATIC_CCFLAGS = SDL_STATIC_CCFLAGS + CCFLAGS +LIBPATH = [ + 'lib', + '/lib', + '/usr/lib', + '/usr/lib/X11', + '/usr/local/lib' +] -CPPPATH = ['/usr/include/SDL', 'src', 'lib', 'intl', '.'] +LIBS = [ + 'supertux', + 'SDL', + 'SDL_gfx', + 'SDL_image', + 'SDL_mixer', + 'SDL_sound', + 'pthread', + 'm', + 'dl', + 'asound', + 'GL', + 'GLU' +] + libsupertux_src = [ 'lib/app/globals.cpp', @@ -84,39 +106,18 @@ ] - StaticLibrary( - target='lib/supertux', - source=libsupertux_src, - CPPPATH=CPPPATH, - CCFLAGS=LIBSUPERTUX_STATIC_CCFLAGS + target = 'lib/supertux', + source = libsupertux_src, + CPPPATH = CPPPATH, + CCFLAGS = CCFLAGS ) Program( - target='src/supertux', - source=supertux_src, - CPPPATH=CPPPATH, - CCFLAGS=LIBSUPERTUX_STATIC_CCFLAGS, - LIBPATH='lib', - LIBS='supertux' + target = 'src/supertux', + source = supertux_src, + CPPPATH = CPPPATH, + CCFLAGS = CCFLAGS, + LIBPATH = LIBPATH, + LIBS = LIBS ) - - - -# -# The following lines _should_ (hehe!) build a shared SuperTux library (hey! At -# least that part works pretty fine...) and then create a supertux exceutable -# which links dynamically against that lib. -# -#SharedLibrary( -# target='lib/supertux', -# source=libsupertux_src, -# CPPPATH=CPPPATH, -# CCFLAGS=CCFLAGS -#) -#Program( -# target='src/supertux', -# source=supertux_src, -# CPPPATH=CPPPATH, -# CCFLAGS=LIBSUPERTUX_DYNAMIC_CCFLAGS -#) |