[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Windstille-devel] rev 393 - in trunk/src: . SuperTux
From: |
Ingo Ruhnke |
Subject: |
[Windstille-devel] rev 393 - in trunk/src: . SuperTux |
Date: |
Sun, 06 Jun 2004 01:39:26 +0200 |
Author: grumbel
Date: 2004-06-06 01:39:25 +0200 (Sun, 06 Jun 2004)
New Revision: 393
Modified:
trunk/src/SConstruct
trunk/src/SuperTux/gui.py
trunk/src/SuperTux/level.py
trunk/src/SuperTux/sector.py
trunk/src/flexlay_wrap.i
trunk/src/supertux.py
Log:
- more sector support
- started to add ruby support
Modified: trunk/src/SConstruct
===================================================================
--- trunk/src/SConstruct 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/SConstruct 2004-06-05 23:39:25 UTC (rev 393)
@@ -24,7 +24,7 @@
SWIGFLAGS='-c++ -python',
SHLIBPREFIX='')
-Depends('flexlay_wrap.cxx', ['flexlay_wrap.i',
+Depends('flexlay_python_wrap.cxx', ['flexlay_wrap.i',
'clanlib.i',
'scripting/editor.hxx',
'command.hxx',
@@ -52,7 +52,8 @@
'object_brush.hxx',
'object_selector.hxx'])
-env.Command('flexlay_wrap.cxx', 'flexlay_wrap.i', "swig -python -o
flexlay_wrap.cxx -c++ $SOURCE")
+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/'])
@@ -134,7 +135,7 @@
env.SharedLibrary(
target = '_flexlay_wrap.so',
source = [
- 'flexlay_wrap.cxx',
+ 'flexlay_python_wrap.cxx',
'scripting/editor.cxx',
'python_functor.cxx',
'python_object.cxx',
@@ -146,4 +147,15 @@
LIBPATH=['.', '/home/ingo/run/ClanLib-0.7-current//lib/'],
LIBS=['flexlay'])
+env.SharedLibrary(
+ target = '_flexlay_ruby_wrap.so',
+ source = [
+ 'flexlay_ruby_wrap.cxx',
+ ],
+ CPPPATH=['/home/ingo/run/ClanLib-0.7-current//include/ClanLib-0.7/',
+ '/usr/lib/ruby/1.8/i386-linux/',
+ '..'],
+ LIBPATH=['.', '/home/ingo/run/ClanLib-0.7-current//lib/'],
+ LIBS=['flexlay'])
+
# EOF #
Modified: trunk/src/SuperTux/gui.py
===================================================================
--- trunk/src/SuperTux/gui.py 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/SuperTux/gui.py 2004-06-05 23:39:25 UTC (rev 393)
@@ -217,4 +217,24 @@
lambda i=i:
workspace.get_map().get_metadata().parent.activate_sector(i, workspace))
mymenu.run()
+def gui_add_sector():
+ level = workspace.get_map().get_data().get_level()
+ dialog = GenericDialog("Add Sector", gui.get_component())
+
+ name = "newsector"
+ width = 50
+ height = 20
+
+ dialog.add_string("Name: ", name)
+ dialog.add_int("Width: ", width)
+ dialog.add_int("Height: ", height)
+
+ def resize_callback(name, w, h):
+ sector = Sector().new(w, h)
+ sector.name = name
+ level.add_sector(sector)
+
+ dialog.set_callback(resize_callback)
+
+
# EOF #
Modified: trunk/src/SuperTux/level.py
===================================================================
--- trunk/src/SuperTux/level.py 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/SuperTux/level.py 2004-06-05 23:39:25 UTC (rev 393)
@@ -222,6 +222,9 @@
sec.activate(workspace)
break
+ def add_sector(self, sector):
+ sectors.append(sector)
+
def get_sectors(self):
return map(lambda sec: sec.name, self.sectors)
Modified: trunk/src/SuperTux/sector.py
===================================================================
--- trunk/src/SuperTux/sector.py 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/SuperTux/sector.py 2004-06-05 23:39:25 UTC (rev 393)
@@ -17,6 +17,9 @@
def __init__(self, parent):
self.parent = parent
+ def get_level(self):
+ return self.parent
+
def new(self, width, height):
self.name = "<No Name>"
self.song = "<No Song>"
@@ -37,6 +40,7 @@
self.editormap.add_layer(self.foreground.to_layer())
# FIXME: Data might not get freed since its 'recursively' refcounted
self.editormap.set_metadata(make_metadata(self))
+ return self
def load_v1(self, data):
self.name = "<No Name>"
Modified: trunk/src/flexlay_wrap.i
===================================================================
--- trunk/src/flexlay_wrap.i 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/flexlay_wrap.i 2004-06-05 23:39:25 UTC (rev 393)
@@ -7,18 +7,15 @@
#include <ClanLib/GUI/window.h>
#include <ClanLib/Core/Math/rect.h>
#include <ClanLib/Core/Math/point.h>
-#include "scripting/editor.hxx"
#include "command.hxx"
#include "paint_command.hxx"
#include "object_move_command.hxx"
#include "object_add_command.hxx"
#include "object_delete_command.hxx"
-#include "scripting/editor.hxx"
#include "tile.hxx"
#include "tile_brush.hxx"
#include "editor.hxx"
#include "meta_data.hxx"
-#include "python_meta_data.hxx"
#include "layer.hxx"
#include "tilemap_layer.hxx"
@@ -31,12 +28,10 @@
#include "editor_map_component.hxx"
#include "flexlay.hxx"
#include "globals.hxx"
-#include "python_functor.hxx"
#include "gui_manager.hxx"
#include "tile_selector.hxx"
#include "object_brush.hxx"
#include "object_selector.hxx"
-#include "sexpr_parser.hxx"
#include "icon.hxx"
#include "window.hxx"
#include "panel.hxx"
@@ -55,26 +50,30 @@
#include "objmap_path_node.hxx"
#include "netpanzer.hxx"
+
+#ifdef SWIGPYTHON
+#include "sexpr_parser.hxx"
+#include "scripting/editor.hxx"
+#include "python_meta_data.hxx"
+#include "python_functor.hxx"
+#endif
%}
%include "std_string.i"
%include "std_vector.i"
-%template(std_vector_int) std::vector<int>;
-%template(std_vector_ObjMapObject) std::vector<ObjMapObject>;
+%template(Std_vector_int) std::vector<int>;
+%template(Std_vector_ObjMapObject) std::vector<ObjMapObject>;
%include "clanlib.i"
-%include "scripting/editor.hxx"
%include "command.hxx"
%include "paint_command.hxx"
%include "object_move_command.hxx"
%include "object_add_command.hxx"
%include "object_delete_command.hxx"
-%include "scripting/editor.hxx"
%include "tile.hxx"
%include "tile_brush.hxx"
%include "editor.hxx"
%include "meta_data.hxx"
-%include "python_meta_data.hxx"
%include "layer.hxx"
%include "tilemap_layer.hxx"
@@ -90,7 +89,6 @@
%include "tile_selector.hxx"
%include "object_brush.hxx"
%include "object_selector.hxx"
-%include "sexpr_parser.hxx"
%include "icon.hxx"
%include "window.hxx"
%include "panel.hxx"
@@ -110,4 +108,10 @@
%include "netpanzer.hxx"
+#ifdef SWIGPYTHON
+%include "scripting/editor.hxx"
+%include "python_meta_data.hxx"
+%include "sexpr_parser.hxx"
+#endif
+
/* EOF */
Modified: trunk/src/supertux.py
===================================================================
--- trunk/src/supertux.py 2004-06-05 19:04:56 UTC (rev 392)
+++ trunk/src/supertux.py 2004-06-05 23:39:25 UTC (rev 393)
@@ -183,6 +183,7 @@
menu.add_item("Edit/Resize", lambda: gui_resize_level())
menu.add_item("Edit/Resize to selection", lambda:
gui_resize_level_to_selection())
menu.add_item("Edit/Debug Shell", lambda: run_python())
+menu.add_item("Edit/Add Sector...", lambda: gui_add_sector())
menu.add_item("Zoom/1:4 (25%) ", lambda: gui_set_zoom(0.25))
menu.add_item("Zoom/1:2 (50%) ", lambda: gui_set_zoom(0.5))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Windstille-devel] rev 393 - in trunk/src: . SuperTux,
Ingo Ruhnke <=