[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Windstille-devel] rev 414 - in trunk: . contrib src
From: |
Ingo Ruhnke |
Subject: |
[Windstille-devel] rev 414 - in trunk: . contrib src |
Date: |
Mon, 21 Jun 2004 21:19:37 +0200 |
Author: grumbel
Date: 2004-06-21 21:19:37 +0200 (Mon, 21 Jun 2004)
New Revision: 414
Added:
trunk/contrib/clanlib_braindead_translation_fix.diff
Modified:
trunk/NEWS
trunk/src/SConstruct
trunk/src/flexlay_wrap.i
trunk/src/gui.rb
trunk/src/netpanzer.cxx
trunk/src/supertux.rb
trunk/src/tile.cxx
trunk/src/tile_selector.cxx
trunk/src/tilemap_layer.cxx
trunk/src/tilemap_layer.hxx
trunk/src/tileset.cxx
trunk/src/tileset.hxx
Log:
- fixed some tile-id bugs
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/NEWS 2004-06-21 19:19:37 UTC (rev 414)
@@ -1,12 +1,15 @@
Flexlay 0.0.2
=============
- switched build system from autohell to SCons
- - switching scripting language to Python
- restructured the scripting bindings
- C++ object hierachy now completly available in scripting
- major GUI cleanup
- - a toolbar
- - splitted flexlay into a C++ library and a python module
+ - a icon-toolbar
+ - splitted flexlay into a C++ library and a scripting modules, Ruby
+ and Python support are available
+ - configurable keyboard shortcut support
+ - support for constrained object movement
+ - SuperTux: support for multiple sublevels
Flexlay 0.0.1
==============
Added: trunk/contrib/clanlib_braindead_translation_fix.diff
===================================================================
--- trunk/contrib/clanlib_braindead_translation_fix.diff 2004-06-18
11:58:15 UTC (rev 413)
+++ trunk/contrib/clanlib_braindead_translation_fix.diff 2004-06-21
19:19:37 UTC (rev 414)
@@ -0,0 +1,299 @@
+Index: GUI/component_generic.cpp
+===================================================================
+RCS file: /var/lib/cvs/Libs/ClanLib-0.7/Sources/GUI/component_generic.cpp,v
+retrieving revision 1.87
+diff -u -r1.87 component_generic.cpp
+--- GUI/component_generic.cpp 28 May 2004 12:22:30 -0000 1.87
++++ GUI/component_generic.cpp 21 Jun 2004 15:33:56 -0000
+@@ -143,6 +143,8 @@
+
+ void CL_Component_Generic::begin_paint()
+ {
++ CL_Display::push_translate(position.left, position.top);
++
+ paint_clipping = false;
+ if (clipping)
+ {
+@@ -154,6 +156,7 @@
+
+ void CL_Component_Generic::paint_children()
+ {
++
+ // we draw the children back to front because then all non-focus input
+ // will be routed to the topmost window.
+ for (
+@@ -169,6 +172,8 @@
+
+ void CL_Component_Generic::end_paint()
+ {
++ CL_Display::pop_modelview();
++
+ if (paint_clipping)
+ {
+ CL_Display::pop_cliprect();
+Index: GUIStyleSilver/button_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/button_silver.cpp,v
+retrieving revision 1.17
+diff -u -r1.17 button_silver.cpp
+--- GUIStyleSilver/button_silver.cpp 28 May 2004 12:22:30 -0000 1.17
++++ GUIStyleSilver/button_silver.cpp 21 Jun 2004 15:33:56 -0000
+@@ -201,8 +201,8 @@
+ int button_width = button->get_width();
+ int button_height = button->get_height();
+
+- int x_pos = button->get_screen_x() + (button_width - text_width) / 2;
+- int y_pos = button->get_screen_y() + (button_height - text_height) / 2;
++ int x_pos = 0 + (button_width - text_width) / 2;
++ int y_pos = 0 + (button_height - text_height) / 2;
+
+ int width = button->get_width();
+ int height = button->get_height();
+@@ -210,9 +210,9 @@
+ if(button->is_enabled() == false)
+ {
+ if(sur_disabled)
+- sur_disabled->draw(button->get_screen_x(),
button->get_screen_y());
++ sur_disabled->draw(0, 0);
+ else
+- CL_Display::draw_rect(button->get_screen_rect(),
CL_Color(128, 142, 159));
++ CL_Display::draw_rect(CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size()), CL_Color(128, 142, 159));
+
+ if(font_disabled)
+ font_disabled->draw(x_pos, y_pos, button->get_text());
+@@ -257,9 +257,9 @@
+ sur_up->draw(0, 0);
+ else
+ {
+-
CL_Display::draw_rect(button->get_screen_rect(), CL_Color(128, 142, 159));
++ CL_Display::draw_rect(CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size()), CL_Color(128, 142, 159));
+
+- CL_Rect rect = button->get_screen_rect();
++ CL_Rect rect = CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size());
+ rect.left++;
+ rect.right--;
+ rect.top++;
+@@ -268,7 +268,7 @@
+ rect,
+ CL_Gradient(CL_Color::white,
CL_Color::white, CL_Color(230, 235, 240), CL_Color(230, 235, 240)));
+
+- rect = button->get_screen_rect();
++ rect = CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size());
+ rect.left+=3;
+ rect.right-=3;
+ rect.top+=3;
+@@ -280,7 +280,7 @@
+ // Focus
+ if(button->has_focus())
+ {
+- rect = button->get_screen_rect();
++ rect = CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size());
+ rect.left+=2;
+ rect.right-=2;
+ rect.top+=2;
+@@ -289,7 +289,7 @@
+ CL_Display::draw_rect(
+ rect, CL_Color(254, 207, 147));
+
+- rect = button->get_screen_rect();
++ rect = CL_Rect(CL_Point(0,0),
button->get_screen_rect().get_size());
+ rect.left+=3;
+ rect.right-=3;
+ rect.top+=3;
+Index: GUIStyleSilver/inputbox_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/inputbox_silver.cpp,v
+retrieving revision 1.14
+diff -u -r1.14 inputbox_silver.cpp
+--- GUIStyleSilver/inputbox_silver.cpp 19 Jun 2004 23:31:37 -0000 1.14
++++ GUIStyleSilver/inputbox_silver.cpp 21 Jun 2004 15:33:56 -0000
+@@ -84,7 +84,7 @@
+ {
+ int width = inputbox->get_width();
+
+- CL_Rect rect = inputbox->get_screen_rect();
++ CL_Rect rect = CL_Rect(CL_Point(0,0),
inputbox->get_screen_rect().get_size());
+ rect.left++;
+ rect.top++;
+ rect.right--;
+@@ -97,13 +97,13 @@
+ if(inputbox->is_enabled() && inputbox->has_focus())
+ {
+ CL_Display::draw_rect(
+- inputbox->get_screen_rect(), CL_Color(254, 207, 147));
++ CL_Rect(CL_Point(0,0),
inputbox->get_screen_rect().get_size()), CL_Color(254, 207, 147));
+ CL_Display::draw_rect(
+ rect, CL_Color(255, 147, 22));
+ }
+ else
+ {
+- CL_Display::draw_rect(inputbox->get_screen_rect(),
CL_Color(128, 142, 159));
++ CL_Display::draw_rect(CL_Rect(CL_Point(0,0),
inputbox->get_screen_rect().get_size()), CL_Color(128, 142, 159));
+ }
+
+ // For easy reference, put inputfield-text into local variable
+@@ -158,10 +158,10 @@
+
+ CL_Display::fill_rect(
+ CL_Rect(
+- inputbox->get_screen_x()+border_size +
mark_x1 - 1,
+- inputbox->get_screen_y()+border_size,
+- inputbox->get_screen_x()+border_size +
mark_x1 + mark_x2,
+- inputbox->get_screen_y()+border_size +
font->get_height()),
++ 0+border_size + mark_x1 - 1,
++ 0+border_size,
++ 0+border_size + mark_x1 + mark_x2,
++ 0+border_size + font->get_height()),
+ CL_Color(204, 208, 232));
+ }
+ }
+@@ -169,14 +169,14 @@
+ // Display text
+ if(inputbox->is_enabled() == false)
+ if (inputbox->in_password_mode())
+-
font_disabled->draw(inputbox->get_screen_x()+border_size,
inputbox->get_screen_y()+2, std::string(strlen(text+character_offset), '*'));
++ font_disabled->draw(0+border_size, 0+2,
std::string(strlen(text+character_offset), '*'));
+ else
+-
font_disabled->draw(inputbox->get_screen_x()+border_size,
inputbox->get_screen_y()+2, &text[character_offset]);
++ font_disabled->draw(0+border_size, 0+2,
&text[character_offset]);
+ else
+ if (inputbox->in_password_mode())
+- font->draw(inputbox->get_screen_x()+border_size,
inputbox->get_screen_y()+2, std::string(strlen(text+character_offset), '*'));
++ font->draw(0+border_size, 0+2,
std::string(strlen(text+character_offset), '*'));
+ else
+- font->draw(inputbox->get_screen_x()+border_size,
inputbox->get_screen_y()+2, &text[character_offset]);
++ font->draw(0+border_size, 0+2, &text[character_offset]);
+
+ // Show blinking cursor
+ if(inputbox->has_focus() && inputbox->is_enabled())
+@@ -192,10 +192,10 @@
+ cursor_x += font->get_width(text[i]);
+
+ CL_Display::draw_line(
+- inputbox->get_screen_x()+cursor_x,
+- inputbox->get_screen_y()+border_size,
+- inputbox->get_screen_x()+cursor_x,
+- inputbox->get_screen_y()+border_size +
font->get_height() - 1,
++ 0+cursor_x,
++ 0+border_size,
++ 0+cursor_x,
++ 0+border_size + font->get_height() - 1,
+ CL_Color::black);
+ }
+
+Index: GUIStyleSilver/label_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/label_silver.cpp,v
+retrieving revision 1.5
+diff -u -r1.5 label_silver.cpp
+--- GUIStyleSilver/label_silver.cpp 28 May 2004 12:22:30 -0000 1.5
++++ GUIStyleSilver/label_silver.cpp 21 Jun 2004 15:33:56 -0000
+@@ -69,9 +69,9 @@
+
+ font->draw(
+ CL_Rect(
+- label->get_screen_x()+pos.x,
+- label->get_screen_y()+pos.y,
+- label->get_screen_x()+pos.x+label->get_width(),
+- label->get_screen_y()+pos.y+label->get_height()),
++ pos.x,
++ pos.y,
++ pos.x+label->get_width(),
++ pos.y+label->get_height()),
+ text);
+ }
+Index: GUIStyleSilver/menu_item_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/menu_item_silver.cpp,v
+retrieving revision 1.5
+diff -u -r1.5 menu_item_silver.cpp
+--- GUIStyleSilver/menu_item_silver.cpp 28 May 2004 12:22:30 -0000
1.5
++++ GUIStyleSilver/menu_item_silver.cpp 21 Jun 2004 15:33:56 -0000
+@@ -98,16 +98,16 @@
+ if( menu_item->is_selected() )
+ {
+ if( sur_checked )
+-
sur_checked->draw(menu_item->get_screen_x(),menu_item->get_screen_y());
++ sur_checked->draw(0,0);
+ }
+ else
+ {
+ if( sur_unchecked )
+-
sur_unchecked->draw(menu_item->get_screen_x(),menu_item->get_screen_y());
++ sur_unchecked->draw(0,0);
+ }
+ }
+ else if( sur_icon )
+-
sur_icon->draw(menu_item->get_screen_x(),menu_item->get_screen_y());
++ sur_icon->draw(0,0);
+
+ const char *text = menu_item->get_text().c_str();
+
+@@ -121,16 +121,16 @@
+ if( menu_item->use_icon() )
+ {
+ if( is_enabled )
+- font->draw(menu_item->get_screen_x()+20,
menu_item->get_screen_y()+2, text);
++ font->draw(0+20, 0+2, text);
+ else
+- font_disabled->draw(menu_item->get_screen_x()+18,
menu_item->get_screen_y()+2, text);
++ font_disabled->draw(0+18, 0+2, text);
+ }
+ else
+ {
+ if( is_enabled )
+- font->draw(menu_item->get_screen_x()+2,
menu_item->get_screen_y()+2, text);
++ font->draw(0+2, 0+2, text);
+ else
+- font_disabled->draw(menu_item->get_screen_x()+2,
menu_item->get_screen_y()+2, text);
++ font_disabled->draw(0+2, 0+2, text);
+ }
+ }
+
+Index: GUIStyleSilver/menu_node_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/menu_node_silver.cpp,v
+retrieving revision 1.8
+diff -u -r1.8 menu_node_silver.cpp
+--- GUIStyleSilver/menu_node_silver.cpp 28 May 2004 12:22:30 -0000
1.8
++++ GUIStyleSilver/menu_node_silver.cpp 21 Jun 2004 15:33:56 -0000
+@@ -63,10 +63,10 @@
+ void CL_MenuNode_Silver::on_paint()
+ {
+ CL_Rect area(
+- node->get_screen_x()+1,
+- node->get_screen_y(),
+- node->get_screen_x()+node->get_width()-1,
+- node->get_screen_y()+node->get_height());
++ 0+1,
++ 0,
++ 0+node->get_width()-1,
++ 0+node->get_height());
+
+ // mouseover fill
+ if( node->has_mouse_over() && node->is_enabled() &&
node->get_parent_menu()->is_enabled() )
+@@ -78,7 +78,7 @@
+ if( arrow && node->has_submenu() )
+ {
+ if( node->get_parent_menu()->is_vertical() ) // no arrow in
horizontal menus
+- arrow->draw( area.right-8, node->get_screen_y()+4 );
++ arrow->draw( area.right-8, 0+4 );
+ }
+ }
+
+Index: GUIStyleSilver/menu_silver.cpp
+===================================================================
+RCS file:
/var/lib/cvs/Libs/ClanLib-0.7/Sources/GUIStyleSilver/menu_silver.cpp,v
+retrieving revision 1.6
+diff -u -r1.6 menu_silver.cpp
+--- GUIStyleSilver/menu_silver.cpp 28 May 2004 12:22:30 -0000 1.6
++++ GUIStyleSilver/menu_silver.cpp 21 Jun 2004 15:33:57 -0000
+@@ -66,7 +66,7 @@
+ repositioned = true;
+ }
+
+- CL_Rect area = menu->get_screen_rect();
++ CL_Rect area(CL_Point(0, 0), menu->get_screen_rect().get_size());
+
+ if( !menu->is_vertical() )
+ {
Modified: trunk/src/SConstruct
===================================================================
--- trunk/src/SConstruct 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/SConstruct 2004-06-21 19:19:37 UTC (rev 414)
@@ -22,7 +22,7 @@
opts = Options('custom.py')
opts.Add('CXX', 'The C++ compiler.', 'g++')
-opts.Add('CXXFLAGS', 'The C++ compiler flags.', '-g -O0 -Wall')
+opts.Add('CXXFLAGS', 'The C++ compiler flags.', '-g -O2 -Wall')
opts.Add('RUBYDIR', 'Ruby directory', os.popen('ruby -e "require \'rbconfig\';
puts Config::CONFIG[\'archdir\']"').read()[:-1])
env = Environment(SHLIBPREFIX='',
Modified: trunk/src/flexlay_wrap.i
===================================================================
--- trunk/src/flexlay_wrap.i 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/flexlay_wrap.i 2004-06-21 19:19:37 UTC (rev 414)
@@ -133,4 +133,5 @@
%include "ruby_sexpr_parser.hxx"
#endif
+
/* EOF */
Modified: trunk/src/gui.rb
===================================================================
--- trunk/src/gui.rb 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/gui.rb 2004-06-21 19:19:37 UTC (rev 414)
@@ -338,7 +338,7 @@
level = $workspace.get_map().get_metadata().get_level()
dialog = GenericDialog.new("Add Sector", $gui.get_component())
- dialog.add_string("Name: ", newsector)
+ dialog.add_string("Name: ", "newsector")
dialog.add_int("Width: ", 30)
dialog.add_int("Height: ", 20)
Modified: trunk/src/netpanzer.cxx
===================================================================
--- trunk/src/netpanzer.cxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/netpanzer.cxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -267,9 +267,9 @@
for(int i = 0; i <= 11960; ++i)
{
sprintf(str, "../data/images/netpanzertiles/tile%04d.png", i);
- tileset.add_tile(i,
- Tile(str,
- CL_Color(255, 0, 0, 128)));
+ Tile* tile = new Tile(str, CL_Color(255, 0, 0, 128));
+ tileset.add_tile(i, tile);
+ delete tile;
}
}
Modified: trunk/src/supertux.rb
===================================================================
--- trunk/src/supertux.rb 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/supertux.rb 2004-06-21 19:19:37 UTC (rev 414)
@@ -161,16 +161,18 @@
image = get_value_from_tree(['images', '_'], data, "notile.png")
end
- if id != 0 # leave tile 0 transparent
- if image.is_a?(String) then
- pixelbuffer = make_pixelbuffer($datadir + 'images/tilesets/' +
image)
- elsif image.is_a?(Array) then
- if image[0] == "region" then
- pixelbuffer = make_region_pixelbuffer($datadir +
'images/tilesets/' + image[1],
- image[2], image[3],
image[4], image[5])
- end
+ if image.is_a?(String) then
+ pixelbuffer = make_pixelbuffer($datadir + 'images/tilesets/' + image)
+ elsif image.is_a?(Array) then
+ if image[0] == "region" then
+ pixelbuffer = make_region_pixelbuffer($datadir +
'images/tilesets/' + image[1],
+ image[2], image[3],
image[4], image[5])
end
-
+ end
+
+ if id == 0 then
+ add_tile(id, nil)
+ else
add_tile(id, Tile.new(pixelbuffer))
end
end
Modified: trunk/src/tile.cxx
===================================================================
--- trunk/src/tile.cxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tile.cxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -33,6 +33,7 @@
CL_Sprite sur;
CL_PixelBuffer pixelbuffer;
+ bool transparent;
bool has_color;
/** Color used for the minimap to represent this tile */
Modified: trunk/src/tile_selector.cxx
===================================================================
--- trunk/src/tile_selector.cxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tile_selector.cxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -138,7 +138,7 @@
if (TileMapPaintTool::current().get_brush().get_width() == 1
&& TileMapPaintTool::current().get_brush().get_height() == 1
- && TileMapPaintTool::current().get_brush().at(0, 0) == i)
+ && TileMapPaintTool::current().get_brush().at(0, 0) == tiles[i])
{
CL_Display::fill_rect(rect,
CL_Color(0,0,255, 100));
Modified: trunk/src/tilemap_layer.cxx
===================================================================
--- trunk/src/tilemap_layer.cxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tilemap_layer.cxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -236,7 +236,7 @@
{
field->at(pos.x + x, pos.y + y) = brush.at(x, y);
}
- }
+ }
}
void
Modified: trunk/src/tilemap_layer.hxx
===================================================================
--- trunk/src/tilemap_layer.hxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tilemap_layer.hxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -53,7 +53,7 @@
/** @param pos position of the old map in the new resized one
@param size height of the new map */
- void resize(const CL_Size& size, const CL_Point& point);
+ void resize(const CL_Size& size, const CL_Point& point);
std::vector<int> get_data();
void set_data(std::vector<int> d);
Modified: trunk/src/tileset.cxx
===================================================================
--- trunk/src/tileset.cxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tileset.cxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -30,6 +30,7 @@
extern CL_ResourceManager* resources;
typedef std::vector<Tile*> Tiles;
+typedef std::vector<int> TileIds;
typedef Tiles::iterator iterator;
class TilesetImpl
@@ -47,6 +48,7 @@
}
}
+ TileIds tile_ids;
Tiles tiles;
int tile_size;
};
@@ -69,12 +71,18 @@
}
void
-Tileset::add_tile(int id, const Tile& tile)
+Tileset::add_tile(int id, Tile* tile)
{
+ // FIXME: Check for tile-id dups
if (id >= int(impl->tiles.size()))
impl->tiles.resize(id+1, 0);
- impl->tiles[id] = new Tile(tile);
+ if (tile)
+ impl->tiles[id] = new Tile(*tile);
+ else
+ impl->tiles[id] = 0;
+
+ impl->tile_ids.push_back(id);
}
Tile*
@@ -95,13 +103,7 @@
std::vector<int>
Tileset::get_tiles() const
{
- std::vector<int> ret;
- for(Tiles::size_type i = 0; i < impl->tiles.size(); ++i)
- {
- if (impl->tiles[i] != 0)
- ret.push_back(i);
- }
- return ret;
+ return impl->tile_ids;
}
/* EOF */
Modified: trunk/src/tileset.hxx
===================================================================
--- trunk/src/tileset.hxx 2004-06-18 11:58:15 UTC (rev 413)
+++ trunk/src/tileset.hxx 2004-06-21 19:19:37 UTC (rev 414)
@@ -51,7 +51,7 @@
int get_tile_size() const;
- void add_tile(int id, const Tile& tile);
+ void add_tile(int id, Tile* tile);
/** Return the tiles which are available in this tileset */
std::vector<int> get_tiles() const;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Windstille-devel] rev 414 - in trunk: . contrib src,
Ingo Ruhnke <=