windstille-devel
[Top][All Lists]
Advanced

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

[Windstille-devel] rev 408 - trunk/src


From: Ingo Ruhnke
Subject: [Windstille-devel] rev 408 - trunk/src
Date: Thu, 17 Jun 2004 00:57:54 +0200

Author: grumbel
Date: 2004-06-17 00:57:54 +0200 (Thu, 17 Jun 2004)
New Revision: 408

Modified:
   trunk/src/SConstruct
   trunk/src/supertux.rb
Log:
- stuff

Modified: trunk/src/SConstruct
===================================================================
--- trunk/src/SConstruct        2004-06-16 22:04:20 UTC (rev 407)
+++ trunk/src/SConstruct        2004-06-16 22:57:54 UTC (rev 408)
@@ -18,9 +18,12 @@
 ##  along with this program; if not, write to the Free Software
 ##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+import os
+
 opts = Options('custom.py')
 opts.Add('CXX', 'The C++ compiler.', 'g++')
 opts.Add('CXXFLAGS', 'The C++ compiler flags.', '-g -O0 -Wall')
+opts.Add('RUBYDIR', 'Ruby directory', os.popen('ruby -e "require \'rbconfig\'; 
puts Config::CONFIG[\'archdir\']"').read()[:-1])
 
 env = Environment(SHLIBPREFIX='',
                   options=opts)
@@ -58,8 +61,8 @@
 env.Command('flexlay_python_wrap.cxx', 'flexlay_wrap.i', "swig -python -o 
flexlay_python_wrap.cxx -c++ $SOURCE")
 env.Command('flexlay_ruby_wrap.cxx',   'flexlay_wrap.i', "swig -ruby   -o 
flexlay_ruby_wrap.cxx -c++ $SOURCE")
 
-env.Program('sharedptrtest', 'sharedptrtest.cxx',
-            
CPPPATH=['/home/ingo/run/ClanLib-0.7-current/include/ClanLib-0.7/'])
+#env.Program('sharedptrtest', 'sharedptrtest.cxx',
+#            
CPPPATH=['/home/ingo/run/ClanLib-0.7-current/include/ClanLib-0.7/'])
 
 # env.Program('simpleed',
 #             ['simpleed.cxx'],
@@ -152,7 +155,7 @@
 #     LIBS=['flexlay'])
 
 env.SharedLibrary(
-    target = '_flexlay_ruby_wrap.so',
+    target = 'flexlay_wrap.so',
     source = [
     'flexlay_ruby_wrap.cxx',
     'ruby_functor.cxx',
@@ -161,7 +164,7 @@
     'ruby_object.cxx'
     ],
     CPPPATH=['/home/ingo/run/ClanLib-0.7-current//include/ClanLib-0.7/',
-            '/usr/lib/ruby/1.8/i386-linux/',
+             '$RUBYDIR',
             '..'],
     LIBPATH=['.', '/home/ingo/run/ClanLib-0.7-current//lib/'],
     LIBS=['flexlay'])

Modified: trunk/src/supertux.rb
===================================================================
--- trunk/src/supertux.rb       2004-06-16 22:04:20 UTC (rev 407)
+++ trunk/src/supertux.rb       2004-06-16 22:57:54 UTC (rev 408)
@@ -1,10 +1,32 @@
-require "/home/ingo/.flexlay/supertux.rb"
+##  $Id$
+##
+##  Flexlay - A Generic 2D Game Editor
+##  Copyright (C) 2004 Ingo Ruhnke <address@hidden>
+##
+##  This program is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU General Public License
+##  as published by the Free Software Foundation; either version 2
+##  of the License, or (at your option) any later version.
+##
+##  This program is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+##  GNU General Public License for more details.
+##
+##  You should have received a copy of the GNU General Public License
+##  along with this program; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+$config_file = File.expand_path("~/.flexlay/supertux.rb")
+
+if File.exist?($config_file) then
+  require $config_file
+end
+
 BACKGROUND_LAYER  = 1
 INTERACTIVE_LAYER = 2
 FOREGROUND_LAYER  = 3
 
-# bla
 require "flexlay_wrap"
 include Flexlay_wrap
 
@@ -12,12 +34,6 @@
 require "gameobj.rb"
 require "sexpr.rb"
 
-#import os
-#import sys
-#import code
-#from flexlay import *
-#from sexpr   import *
-
 flexlay = Flexlay.new()
 flexlay.init()
 
@@ -57,12 +73,10 @@
   attr_accessor :datadir, :recent_files
 
   def initialize()
-    @datadir      = "/home/ingo/cvs/supertux/supertux/data/"
     @recent_files = []
   end
 
   def save(filename)
-    filename = File.expand_path("~/.flexlay/supertux.rb")
     f = File.new(filename, "w")
     f.write("# Autogenerated Script, don't edit by hand!\n\n")
     f.write("$datadir      = " + $datadir.inspect() + "\n")
@@ -72,7 +86,9 @@
 end
 
 $config  = Config.new()
-$datadir = "/home/ingo/cvs/supertux/supertux/data/"
+if !$datadir then
+  $datadir = File.expand_path("~/cvs/supertux/supertux/data/")+"/"
+end
 
 class DisplayProperties
   attr_reader :layer, :show_all, :current_only
@@ -124,6 +140,11 @@
 class Tileset
   def load(filename)
     tree = sexpr_read_from_file(filename)
+    if tree == nil then
+      puts "Error; Couldn't load: ", filename
+      return 
+    end
+
     tree = tree[1..-1]
     tree.each do |i|
       if i[0] == "tile"
@@ -177,7 +198,7 @@
 
 $gui.run()
 
-$config.save("~/.flexlay/supertux.rb")
+$config.save($config_file)
 
 flexlay.deinit()
 





reply via email to

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