[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2664 - in branches/pingus_sdl/src: . actions colliders com
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2664 - in branches/pingus_sdl/src: . actions colliders components |
Date: |
Tue, 16 Jan 2007 02:00:12 +0100 |
Author: grumbel
Date: 2007-01-16 02:00:10 +0100 (Tue, 16 Jan 2007)
New Revision: 2664
Modified:
branches/pingus_sdl/src/SConscript
branches/pingus_sdl/src/actions/basher.hxx
branches/pingus_sdl/src/actions/blocker.cxx
branches/pingus_sdl/src/actions/blocker.hxx
branches/pingus_sdl/src/actions/boarder.cxx
branches/pingus_sdl/src/actions/bomber.cxx
branches/pingus_sdl/src/actions/bomber.hxx
branches/pingus_sdl/src/actions/bridger.cxx
branches/pingus_sdl/src/actions/bridger.hxx
branches/pingus_sdl/src/col_map.cxx
branches/pingus_sdl/src/collider.cxx
branches/pingus_sdl/src/colliders/pingu_collider.cxx
branches/pingus_sdl/src/components/smallmap.cxx
branches/pingus_sdl/src/ground_map.cxx
branches/pingus_sdl/src/pingu.cxx
branches/pingus_sdl/src/pingu_action.cxx
branches/pingus_sdl/src/pingu_holder.cxx
branches/pingus_sdl/src/result_screen.cxx
branches/pingus_sdl/src/smallmap_image.cxx
branches/pingus_sdl/src/smallmap_image.hxx
branches/pingus_sdl/src/sprite.cpp
branches/pingus_sdl/src/sprite.hpp
branches/pingus_sdl/src/worldobj_factory.cxx
Log:
- most stuff compiles now, input, editor and worldobjs still left
Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript 2007-01-16 00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/SConscript 2007-01-16 01:00:10 UTC (rev 2664)
@@ -69,13 +69,13 @@
# # 'theme_selector.cxx',
# # 'xml_eval.cxx',
-# 'action_holder.cxx',
-# 'actions/angel.cxx',
-# 'actions/basher.cxx',
-# 'actions/blocker.cxx',
-# 'actions/boarder.cxx',
-# 'actions/bomber.cxx',
-# 'actions/bridger.cxx',
+'action_holder.cxx',
+'actions/angel.cxx',
+'actions/basher.cxx',
+'actions/blocker.cxx',
+'actions/boarder.cxx',
+'actions/bomber.cxx',
+'actions/bridger.cxx',
'actions/climber.cxx',
'actions/digger.cxx',
'actions/drown.cxx',
@@ -98,9 +98,9 @@
'capture_rectangle.cxx',
'cheat.cxx',
'client.cxx',
-# 'col_map.cxx',
-# 'collider.cxx',
-# 'colliders/pingu_collider.cxx',
+'col_map.cxx',
+'collider.cxx',
+'colliders/pingu_collider.cxx',
'components/action_button.cxx',
'components/button_panel.cxx',
'components/hurry_up.cxx',
@@ -114,9 +114,9 @@
'debug.cxx',
'debug_stream.cxx',
# 'demo_player.cxx',
-# 'demo_recorder.cxx',
+'demo_recorder.cxx',
# 'demo_session.cxx',
-# 'direction.cxx',
+'direction.cxx',
'display/drawing_context.cxx',
'display/scene_context.cxx',
@@ -211,11 +211,11 @@
'particles/smoke_particle_holder.cxx',
'particles/snow_particle_holder.cxx',
'path_manager.cxx',
-# 'pingu.cxx',
-# 'pingu_action.cxx',
-# 'pingu_action_factory.cxx',
-# 'pingu_enums.cxx',
-# 'pingu_holder.cxx',
+'pingu.cxx',
+'pingu_action.cxx',
+'pingu_action_factory.cxx',
+'pingu_enums.cxx',
+'pingu_holder.cxx',
'pingus_error.cxx',
'pingus_level.cxx',
'pingus_main.cxx',
@@ -231,19 +231,19 @@
'resource.cxx',
'resource_manager.cpp',
'resource_modifier.cxx',
-# 'result.cxx',
-# 'result_screen.cxx',
+'result.cxx',
+'result_screen.cxx',
'savegame.cxx',
'savegame_manager.cxx',
# 'screenshot.cxx',
'server.cxx',
'server_event.cxx',
-# 'smallmap_image.cxx',
+'smallmap_image.cxx',
'sound/sound.cxx',
'sound/sound_dummy.cxx',
# 'sound/sound_real.cxx',
'sound/sound_res_mgr.cxx',
-# 'ground_map.cxx',
+'ground_map.cxx',
'start_screen.cxx',
'stat_manager.cxx',
'state_sprite.cxx',
@@ -279,9 +279,9 @@
'worldmap/world_dot.cxx',
'worldmap/worldmap.cxx',
'worldmap/worldmap_story.cxx',
-# 'worldobj.cxx',
-# 'worldobj_factory.cxx',
-# 'worldobjs/conveyor_belt.cxx',
+'worldobj.cxx',
+'worldobj_factory.cxx',
+#'worldobjs/conveyor_belt.cxx',
# 'worldobjs/entrance.cxx',
# 'worldobjs/exit.cxx',
# 'worldobjs/fake_exit.cxx',
Modified: branches/pingus_sdl/src/actions/basher.hxx
===================================================================
--- branches/pingus_sdl/src/actions/basher.hxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/basher.hxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_ACTIONS_BASHER_HXX
#define HEADER_PINGUS_ACTIONS_BASHER_HXX
-#include <ClanLib/Display/pixel_buffer.h>
#include "../state_sprite.hxx"
#include "../pingu_action.hxx"
@@ -30,8 +29,8 @@
{
private:
StateSprite sprite;
- CL_PixelBuffer bash_radius;
- CL_PixelBuffer bash_radius_gfx;
+ PixelBuffer bash_radius;
+ PixelBuffer bash_radius_gfx;
int basher_c;
bool first_bash;
Modified: branches/pingus_sdl/src/actions/blocker.cxx
===================================================================
--- branches/pingus_sdl/src/actions/blocker.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/blocker.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -17,8 +17,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Core/Math/origin.h>
-
#include "../col_map.hxx"
#include "../display/scene_context.hxx"
#include "../pingu.hxx"
Modified: branches/pingus_sdl/src/actions/blocker.hxx
===================================================================
--- branches/pingus_sdl/src/actions/blocker.hxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/blocker.hxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_ACTIONS_BLOCKER_HXX
#define HEADER_PINGUS_ACTIONS_BLOCKER_HXX
-#include <ClanLib/Display/sprite.h>
#include "../state_sprite.hxx"
#include "../pingu_action.hxx"
Modified: branches/pingus_sdl/src/actions/boarder.cxx
===================================================================
--- branches/pingus_sdl/src/actions/boarder.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/boarder.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -50,12 +50,12 @@
}
// Incremental update so that we don't skip pixels
- Vector new_pos = pingu->get_pos();
+ Vector3f new_pos = pingu->get_pos();
new_pos.x = new_pos.x + pingu->direction * speed;
while (new_pos.x != pingu->get_pos().x)
{
- Vector old_pos = pingu->get_pos();
- pingu->set_pos(Vector(old_pos.x + (old_pos.x < new_pos.x) ? 1.0f :
-1.0f,
+ Vector3f old_pos = pingu->get_pos();
+ pingu->set_pos(Vector3f(old_pos.x + (old_pos.x < new_pos.x) ? 1.0f :
-1.0f,
old_pos.y, old_pos.z));
if (pingu->rel_getpixel (1, 0))
@@ -64,7 +64,7 @@
pingu->set_pos(old_pos); // + (pingu->direction * 10);
////pingu->pos.y = 10;
- pingu->apply_force (Vector(float(speed * pingu->direction * 0.5),
+ pingu->apply_force (Vector3f(float(speed * pingu->direction * 0.5),
-float(speed * abs(pingu->direction) * 0.5)));
pingu->set_action(Actions::Walker);
return;
@@ -73,7 +73,7 @@
}
else
{
- pingu->apply_force (Vector((float)speed * pingu->direction, 0));
+ pingu->apply_force (Vector3f((float)speed * pingu->direction, 0));
pingu->set_action(Actions::Walker);
}
}
Modified: branches/pingus_sdl/src/actions/bomber.cxx
===================================================================
--- branches/pingus_sdl/src/actions/bomber.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/bomber.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -35,8 +35,8 @@
namespace Actions {
bool Bomber::static_surface_loaded = false;
-CL_PixelBuffer Bomber::bomber_radius;
-CL_PixelBuffer Bomber::bomber_radius_gfx;
+PixelBuffer Bomber::bomber_radius;
+PixelBuffer Bomber::bomber_radius_gfx;
Bomber::Bomber (Pingu* p)
: PinguAction(p),
@@ -69,7 +69,7 @@
{
if (sprite[pingu->direction].get_current_frame() >= 13 && !gfx_exploded)
{
- gc.color().draw (explo_surf, Vector(pingu->get_x () - 32, pingu->get_y
() - 48));
+ gc.color().draw (explo_surf, Vector3f(pingu->get_x () - 32, pingu->get_y
() - 48));
gfx_exploded = true;
}
@@ -83,7 +83,7 @@
Movers::LinearMover mover(WorldObj::get_world(), pingu->get_pos());
- Vector velocity = pingu->get_velocity();
+ Vector3f velocity = pingu->get_velocity();
// Move the Pingu
mover.update(velocity, Colliders::PinguCollider(pingu_height));
Modified: branches/pingus_sdl/src/actions/bomber.hxx
===================================================================
--- branches/pingus_sdl/src/actions/bomber.hxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/bomber.hxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -36,8 +36,8 @@
bool colmap_exploded;
static bool static_surface_loaded;
- static CL_PixelBuffer bomber_radius;
- static CL_PixelBuffer bomber_radius_gfx;
+ static PixelBuffer bomber_radius;
+ static PixelBuffer bomber_radius_gfx;
StateSprite sprite;
Modified: branches/pingus_sdl/src/actions/bridger.cxx
===================================================================
--- branches/pingus_sdl/src/actions/bridger.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/bridger.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <cassert>
-#include <ClanLib/Core/System/clanstring.h>
#include "../col_map.hxx"
#include "../display/scene_context.hxx"
#include "../pingu.hxx"
@@ -37,17 +36,17 @@
mode(B_BUILDING),
bricks(MAX_BRICKS),
block_build(false),
- name(_("Bridger") + std::string(" (") + CL_String::to(bricks) + ")")
+ name(_("Bridger") + std::string(" (")) ////+ CL_String::to(bricks) + ")")
{
walk_sprite.load (Direction::LEFT, Resource::load_sprite("pingus/player" +
- pingu->get_owner_str() + "/bridger_walk/left"));
+
pingu->get_owner_str() + "/bridger_walk/left"));
walk_sprite.load (Direction::RIGHT, Resource::load_sprite("pingus/player" +
- pingu->get_owner_str() + "/bridger_walk/right"));
+
pingu->get_owner_str() + "/bridger_walk/right"));
build_sprite.load (Direction::LEFT, Resource::load_sprite("pingus/player" +
- pingu->get_owner_str() + "/bridger/left"));
+
pingu->get_owner_str() + "/bridger/left"));
build_sprite.load (Direction::RIGHT, Resource::load_sprite("pingus/player" +
- pingu->get_owner_str() + "/bridger/right"));
+
pingu->get_owner_str() + "/bridger/right"));
brick_l = Resource::load_pixelbuffer("other/brick_left");
brick_r = Resource::load_pixelbuffer("other/brick_right");
@@ -73,13 +72,13 @@
switch (mode)
{
case B_BUILDING:
- gc.color().draw(build_sprite[pingu->direction],
Vector(pingu->get_pos().x - (x_offset * pingu->direction),
- pingu->get_pos().y +
y_offset));
+ gc.color().draw(build_sprite[pingu->direction],
Vector3f(pingu->get_pos().x - (x_offset * pingu->direction),
+
pingu->get_pos().y + y_offset));
break;
case B_WALKING:
- gc.color().draw(walk_sprite[pingu->direction], Vector(pingu->get_pos().x
- (x_offset * pingu->direction),
- pingu->get_pos().y +
y_offset));
+ gc.color().draw(walk_sprite[pingu->direction],
Vector3f(pingu->get_pos().x - (x_offset * pingu->direction),
+ pingu->get_pos().y
+ y_offset));
break;
}
}
@@ -214,7 +213,7 @@
Bridger::place_a_brick()
{
bricks--;
- name = _("Bridger") + std::string(" (") + CL_String::to(bricks) + ")";
+ name = _("Bridger") + std::string(" (");//// + CL_String::to(bricks) + ")";
if (bricks < 4)
Sound::PingusSound::play_sound("ting");
@@ -245,7 +244,7 @@
Bridger::walk_one_step_up()
{
pingu->set_pos(pingu->get_pos().x + (float)(4 * pingu->direction),
- pingu->get_pos().y - 2);
+ pingu->get_pos().y - 2);
}
std::string
Modified: branches/pingus_sdl/src/actions/bridger.hxx
===================================================================
--- branches/pingus_sdl/src/actions/bridger.hxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/actions/bridger.hxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -36,8 +36,8 @@
private:
StateSprite walk_sprite;
StateSprite build_sprite;
- CL_PixelBuffer brick_l;
- CL_PixelBuffer brick_r;
+ PixelBuffer brick_l;
+ PixelBuffer brick_r;
int bricks;
//int step;
Modified: branches/pingus_sdl/src/col_map.cxx
===================================================================
--- branches/pingus_sdl/src/col_map.cxx 2007-01-16 00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/col_map.cxx 2007-01-16 01:00:10 UTC (rev 2664)
@@ -18,12 +18,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Display/pixel_buffer.h>
-#include <ClanLib/Display/pixel_format.h>
-#include <ClanLib/Display/surface.h>
#include "display/drawing_context.hxx"
#include "globals.hxx"
#include "col_map.hxx"
+#include "pixel_buffer.hpp"
#include "pingus_error.hxx"
#include "gettext.h"
@@ -78,6 +76,7 @@
void
ColMap::remove(PixelBuffer provider, int x, int y)
{
+#if 0
++serial;
int swidth = provider.get_width();
@@ -126,6 +125,7 @@
}
provider.unlock();
+#endif
}
void
@@ -164,6 +164,7 @@
void
ColMap::put(PixelBuffer provider, int sur_x, int sur_y, Groundtype::GPType
pixel)
{
+#if 0
// transparent groundpieces are only drawn on the gfx map, not on the colmap
if (pixel == Groundtype::GP_TRANSPARENT)
return;
@@ -237,11 +238,13 @@
// FIXME: Memory hole
// provider.unlock();
+#endif
}
void
ColMap::draw(DrawingContext& gc)
{
+#if 0
PixelBuffer canvas(width, height, width*4, CL_PixelFormat::rgba8888);
CL_Surface sur;
unsigned char* buffer;
@@ -288,6 +291,7 @@
sur = CL_Surface(canvas);
//FIXME:gc.draw(sur, 0, 0);
+#endif
}
unsigned
Modified: branches/pingus_sdl/src/collider.cxx
===================================================================
--- branches/pingus_sdl/src/collider.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/collider.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -19,7 +19,7 @@
#include "collider.hxx"
#include "col_map.hxx"
-#include "math/vector3f.hxx"
+#include "math/vector3f.hpp"
#include "world.hxx"
Collider::Collider()
Modified: branches/pingus_sdl/src/colliders/pingu_collider.cxx
===================================================================
--- branches/pingus_sdl/src/colliders/pingu_collider.cxx 2007-01-16
00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/colliders/pingu_collider.cxx 2007-01-16
01:00:10 UTC (rev 2664)
@@ -19,7 +19,7 @@
#include "../pingu_action.hxx"
#include "../groundtype.hxx"
-#include "../vector.hxx"
+#include "../math/vector3f.hpp"
#include "pingu_collider.hxx"
namespace Colliders {
Modified: branches/pingus_sdl/src/components/smallmap.cxx
===================================================================
--- branches/pingus_sdl/src/components/smallmap.cxx 2007-01-16 00:34:58 UTC
(rev 2663)
+++ branches/pingus_sdl/src/components/smallmap.cxx 2007-01-16 01:00:10 UTC
(rev 2664)
@@ -80,6 +80,7 @@
void
SmallMap::draw (DrawingContext& gc)
{
+#if 0
// FIXME: This is potentially dangerous, since we don't know how
// long 'gc' will be alive. Should use a DrawingContext for caching.
gc_ptr = &gc;
@@ -114,6 +115,7 @@
}
gc_ptr = 0;
+#endif
}
void
Modified: branches/pingus_sdl/src/ground_map.cxx
===================================================================
--- branches/pingus_sdl/src/ground_map.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/ground_map.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -19,10 +19,6 @@
#include <stdio.h>
#include <iostream>
-#include <ClanLib/Display/pixel_buffer.h>
-#include <ClanLib/Display/pixel_format.h>
-#include <ClanLib/Core/core_iostream.h>
-#include <ClanLib/Core/IOData/cl_endian.h>
#include "display/scene_context.hxx"
#include "pingus_error.hxx"
#include "blitter.hxx"
@@ -31,269 +27,276 @@
#include "gettext.h"
#include "col_map.hxx"
#include "math.hxx"
-#include <ClanLib/Core/IOData/datatypes.h>
-#include <ClanLib/Display/palette.h>
+MapTile::MapTile ()
+{
+}
- MapTile::MapTile ()
- {
- }
+MapTile::~MapTile()
+{
+}
- MapTile::~MapTile()
- {
- }
+void
+MapTile::prepare()
+{
+#if 0
+ if (!pixelbuffer)
+ {
+ pixelbuffer = PixelBuffer(tile_size, tile_size, tile_size*4,
CL_PixelFormat::rgba8888);
+ Blitter::clear_canvas(pixelbuffer);
+ }
+#endif
+}
- void
- MapTile::prepare()
- {
- if (!pixelbuffer)
- {
- pixelbuffer = PixelBuffer(tile_size, tile_size,
tile_size*4, CL_PixelFormat::rgba8888);
- Blitter::clear_canvas(pixelbuffer);
- }
- }
+void
+MapTile::remove(PixelBuffer obj, int x, int y,
+ int real_x, int real_y, GroundMap* parent)
+{
+#if 0
+ if (surface)
+ {
+ parent->put_alpha_surface(pixelbuffer, obj, x, y, real_x, real_y);
+ surface = CL_Surface(pixelbuffer);
+ }
+#endif
+}
- void
- MapTile::remove(PixelBuffer obj, int x, int y,
- int real_x, int real_y,
GroundMap* parent)
- {
- if (surface)
- {
- parent->put_alpha_surface(pixelbuffer, obj, x, y,
real_x, real_y);
- surface = CL_Surface(pixelbuffer);
- }
- }
+void
+MapTile::put(PixelBuffer obj, int x, int y)
+{
+#if 0
+ prepare();
+ Blitter::put_surface(pixelbuffer, obj, x, y);
+ surface = CL_Surface(pixelbuffer);
+#endif
+}
- void
- MapTile::put(PixelBuffer obj, int x, int y)
- {
- prepare();
- Blitter::put_surface(pixelbuffer, obj, x, y);
- surface = CL_Surface(pixelbuffer);
- }
+GroundMap::GroundMap(const PingusLevel& plf)
+{
+ width = plf.get_size().width;
+ height = plf.get_size().height;
- GroundMap::GroundMap(const PingusLevel& plf)
- {
- width = plf.get_size().width;
- height = plf.get_size().height;
+ colmap = new ColMap(width, height);
- colmap = new ColMap(width, height);
+ // Checking that the map has the correct size, only multiples of
+ // tile_size are allowed, anything else wouldn't fit very well on
+ // the colmap
+ if ((width % tile_size) != 0)
+ {
+ width += (tile_size - (width % tile_size));
+ }
- // Checking that the map has the correct size, only multiples of
- // tile_size are allowed, anything else wouldn't fit very well
on
- // the colmap
- if ((width % tile_size) != 0)
- {
- width += (tile_size - (width % tile_size));
- }
+ if ((height % tile_size) != 0)
+ {
+ height += (tile_size - (height % tile_size));
+ }
- if ((height % tile_size) != 0)
- {
- height += (tile_size - (height % tile_size));
- }
+ tile_width = width/tile_size;
+ tile_height = height/tile_size;
- tile_width = width/tile_size;
- tile_height = height/tile_size;
+ // Allocating tile map
+ tile.resize(tile_width);
+ for(unsigned int i=0; i < tile.size(); ++i)
+ tile[i].resize(tile_height);
- // Allocating tile map
- tile.resize(tile_width);
- for(unsigned int i=0; i < tile.size(); ++i)
- tile[i].resize(tile_height);
+ // fix the height back to the correct values
+ width = plf.get_size().width;
+ height = plf.get_size().height;
+}
- // fix the height back to the correct values
- width = plf.get_size().width;
- height = plf.get_size().height;
- }
+GroundMap::~GroundMap(void)
+{
+ delete colmap;
+}
- GroundMap::~GroundMap(void)
- {
- delete colmap;
- }
+void
+GroundMap::draw_colmap(SceneContext& gc)
+{
+ colmap->draw(gc.color());
+}
- void
- GroundMap::draw_colmap(SceneContext& gc)
- {
- colmap->draw(gc.color());
- }
-
// Draws the map with a offset, needed for scrolling
- void
- GroundMap::draw(SceneContext& gc)
- {
- const CL_Rect& display = gc.color().get_clip_rect();
+void
+GroundMap::draw(SceneContext& gc)
+{
+#if 0
+ const Rect& display = gc.color().get_clip_rect();
- // FIXME: delete the next four lines and replace them with
gc.get_clip_rect()
- if (draw_collision_map)
- {
- draw_colmap(gc);
- }
- else
- {
- // Trying to calc which parts of the tilemap needs to
be drawn
- int start_x = Math::max(0, display.left/tile_size);
- int start_y = Math::max(0, display.top/tile_size);
- int tilemap_width = display.get_width() / tile_size +
1;
- int tilemap_height = display.get_height() / tile_size +
1;
+ // FIXME: delete the next four lines and replace them with gc.get_clip_rect()
+ if (draw_collision_map)
+ {
+ draw_colmap(gc);
+ }
+ else
+ {
+ // Trying to calc which parts of the tilemap needs to be drawn
+ int start_x = Math::max(0, display.left/tile_size);
+ int start_y = Math::max(0, display.top/tile_size);
+ int tilemap_width = display.get_width() / tile_size + 1;
+ int tilemap_height = display.get_height() / tile_size + 1;
- // drawing the stuff
- for (int x = start_x; x <= (start_x + tilemap_width) &&
x < int(tile.size()); ++x)
- for (int y = start_y; y <= start_y +
tilemap_height && y < int(tile[x].size()); ++y)
- {
- if (tile[x][y].get_surface())
- {
-
gc.color().draw(tile[x][y].get_surface(),
-
Vector(static_cast<float>(x * tile_size),
-
static_cast<float>(y * tile_size)));
- }
- else
- {
- if (pingus_debug_flags &
PINGUS_DEBUG_TILES)
-
gc.color().draw_fillrect(static_cast<float>(x * tile_size),
-
static_cast<float>(y * tile_size),
-
static_cast<float>(x * tile_size +
tile_size),
-
static_cast<float>(y * tile_size +
tile_size),
-
Color(255, 0, 0, 75));
- }
- }
- }
- }
+ // drawing the stuff
+ for (int x = start_x; x <= (start_x + tilemap_width) && x <
int(tile.size()); ++x)
+ for (int y = start_y; y <= start_y + tilemap_height && y <
int(tile[x].size()); ++y)
+ {
+ if (tile[x][y].get_surface())
+ {
+ gc.color().draw(tile[x][y].get_surface(),
+ Vector(static_cast<float>(x * tile_size),
+ static_cast<float>(y * tile_size)));
+ }
+ else
+ {
+ if (pingus_debug_flags & PINGUS_DEBUG_TILES)
+ gc.color().draw_fillrect(static_cast<float>(x * tile_size),
+ static_cast<float>(y * tile_size),
+ static_cast<float>(x * tile_size +
tile_size),
+ static_cast<float>(y * tile_size +
tile_size),
+ Color(255, 0, 0, 75));
+ }
+ }
+ }
+#endif
+}
// Returns the width of the map, it is read directly from the *.psm file
- int
- GroundMap::get_width(void)
- {
- return width;
- }
+int
+GroundMap::get_width(void)
+{
+ return width;
+}
// Returns the height of the map, it is read directly from the *.psm file
- int
- GroundMap::get_height(void)
- {
- return height;
- }
+int
+GroundMap::get_height(void)
+{
+ return height;
+}
- void
- GroundMap::remove(PixelBuffer sprovider, int x, int y)
- {
- // Get the start tile and end tile
- int start_x = Math::max(x / tile_size, 0);
- int start_y = Math::max(y / tile_size, 0);
- int end_x = Math::min((x + sprovider.get_width()) / tile_size,
-
(width - 1) / tile_size);
- int end_y = Math::min((y + sprovider.get_height()) /
tile_size,
-
(height - 1) / tile_size);
+void
+GroundMap::remove(PixelBuffer sprovider, int x, int y)
+{
+ // Get the start tile and end tile
+ int start_x = Math::max(x / tile_size, 0);
+ int start_y = Math::max(y / tile_size, 0);
+ int end_x = Math::min((x + sprovider.get_width()) / tile_size,
+ (width - 1) / tile_size);
+ int end_y = Math::min((y + sprovider.get_height()) / tile_size,
+ (height - 1) / tile_size);
- for(int ix = start_x; ix <= end_x; ++ix)
- for(int iy = start_y; iy <= end_y; ++iy)
- {
- tile[ix][iy].remove(sprovider, x - (ix *
tile_size),
-
y - (iy * tile_size), x, y, this);
- }
- }
+ for(int ix = start_x; ix <= end_x; ++ix)
+ for(int iy = start_y; iy <= end_y; ++iy)
+ {
+ tile[ix][iy].remove(sprovider, x - (ix * tile_size),
+ y - (iy * tile_size), x, y, this);
+ }
+}
- void
- GroundMap::put_alpha_surface(PixelBuffer provider, PixelBuffer
sprovider,
-
int x_pos, int y_pos, int real_x_arg, int real_y_arg)
- {
- if (sprovider.get_format().get_depth() != 8)
- {
-
PingusError::raise(std::string("SpotMap::put_alpha_surface: Image has wrong
color depth: "
-
+ sprovider.get_format().get_depth()));
- }
+void
+GroundMap::put_alpha_surface(PixelBuffer provider, PixelBuffer sprovider,
+ int x_pos, int y_pos, int real_x_arg, int
real_y_arg)
+{
+#if 0
+ if (sprovider.get_format().get_depth() != 8)
+ {
+ PingusError::raise(std::string("SpotMap::put_alpha_surface: Image has
wrong color depth: "
+ + sprovider.get_format().get_depth()));
+ }
- provider.lock();
- sprovider.lock();
+ provider.lock();
+ sprovider.lock();
- int swidth = sprovider.get_width();
- int twidth = provider.get_width();
+ int swidth = sprovider.get_width();
+ int twidth = provider.get_width();
- int start_x = std::max(0, -x_pos);
- int start_y = std::max(0, -y_pos);
+ int start_x = std::max(0, -x_pos);
+ int start_y = std::max(0, -y_pos);
- int end_x = std::min(swidth, twidth - x_pos);
- int end_y = std::min(sprovider.get_height(),
provider.get_height() - y_pos);
+ int end_x = std::min(swidth, twidth - x_pos);
+ int end_y = std::min(sprovider.get_height(), provider.get_height() - y_pos);
- if (end_x - start_x <= 0 || end_y - start_y <= 0)
- return;
+ if (end_x - start_x <= 0 || end_y - start_y <= 0)
+ return;
- cl_uint8* target_buf =
static_cast<cl_uint8*>(provider.get_data());
- cl_uint8* source_buf =
static_cast<cl_uint8*>(sprovider.get_data());
+ cl_uint8* target_buf = static_cast<cl_uint8*>(provider.get_data());
+ cl_uint8* source_buf = static_cast<cl_uint8*>(sprovider.get_data());
- CL_Palette palette = sprovider.get_palette();
+ CL_Palette palette = sprovider.get_palette();
- if (sprovider.get_format().has_colorkey())
- {
- unsigned int colorkey =
sprovider.get_format().get_colorkey();
+ if (sprovider.get_format().has_colorkey())
+ {
+ unsigned int colorkey = sprovider.get_format().get_colorkey();
- for (int y = start_y; y < end_y; ++y)
- {
- cl_uint8* tptr = target_buf +
4*((twidth*(y+y_pos)) + x_pos + start_x);
- cl_uint8* sptr = source_buf + swidth*y +
start_x;
+ for (int y = start_y; y < end_y; ++y)
+ {
+ cl_uint8* tptr = target_buf + 4*((twidth*(y+y_pos)) + x_pos +
start_x);
+ cl_uint8* sptr = source_buf + swidth*y + start_x;
- for (int x = start_x; x < end_x; ++x)
+ for (int x = start_x; x < end_x; ++x)
{
- if (*sptr != colorkey &&
colmap->getpixel(real_x_arg+x, real_y_arg+y) != Groundtype::GP_SOLID)
- { // FIXME: Slow?! if inside a blit
loop probally not such a good idea
+ if (*sptr != colorkey && colmap->getpixel(real_x_arg+x,
real_y_arg+y) != Groundtype::GP_SOLID)
+ { // FIXME: Slow?! if inside a blit loop probally not such a
good idea
if (!CL_Endian::is_system_big())
- *tptr = 0;
+ *tptr = 0;
else
- tptr[3] = 0;
- }
+ tptr[3] = 0;
+ }
- tptr += 4;
- sptr += 1;
+ tptr += 4;
+ sptr += 1;
}
- }
- }
- else
- {
- for (int y = start_y; y < end_y; ++y)
- {
- cl_uint8* tptr = target_buf +
4*((twidth*(y+y_pos)) + x_pos + start_x);
- cl_uint8* sptr = source_buf + swidth*y +
start_x;
+ }
+ }
+ else
+ {
+ for (int y = start_y; y < end_y; ++y)
+ {
+ cl_uint8* tptr = target_buf + 4*((twidth*(y+y_pos)) + x_pos +
start_x);
+ cl_uint8* sptr = source_buf + swidth*y + start_x;
- for (int x = start_x; x < end_x; ++x)
+ for (int x = start_x; x < end_x; ++x)
{
- if
(colmap->getpixel(real_x_arg+x, real_y_arg+y) != Groundtype::GP_SOLID)
- { // FIXME: if inside blit loop
might not be such a good idea
- if
(!CL_Endian::is_system_big())
- *tptr = 0;
- else
- tptr[3] = 0;
- }
+ if (colmap->getpixel(real_x_arg+x, real_y_arg+y) !=
Groundtype::GP_SOLID)
+ { // FIXME: if inside blit loop might not be such a good idea
+ if (!CL_Endian::is_system_big())
+ *tptr = 0;
+ else
+ tptr[3] = 0;
+ }
-
tptr += 4;
- sptr += 1;
+ tptr += 4;
+ sptr += 1;
}
- }
- }
+ }
+ }
- sprovider.unlock();
- provider.unlock();
- }
+ sprovider.unlock();
+ provider.unlock();
+#endif
+}
- void
- GroundMap::put(PixelBuffer sprovider, int x, int y)
- {
- // Get the start tile and end tile
- int start_x = std::max(0, x / tile_size);
- int start_y = std::max(0, y / tile_size);
- int end_x = std::min(tile_width, (x + sprovider.get_width())
/ tile_size + 1);
- int end_y = std::min(tile_height, (y +
sprovider.get_height()) / tile_size + 1);
+void
+GroundMap::put(PixelBuffer sprovider, int x, int y)
+{
+ // Get the start tile and end tile
+ int start_x = std::max(0, x / tile_size);
+ int start_y = std::max(0, y / tile_size);
+ int end_x = std::min(tile_width, (x + sprovider.get_width()) / tile_size
+ 1);
+ int end_y = std::min(tile_height, (y + sprovider.get_height()) / tile_size
+ 1);
- for(int ix = start_x; ix < end_x; ++ix)
- for(int iy = start_y; iy < end_y; ++iy)
- {
- tile[ix][iy].put(sprovider,
- x -
(ix * tile_size), y - (iy * tile_size));
- }
- }
+ for(int ix = start_x; ix < end_x; ++ix)
+ for(int iy = start_y; iy < end_y; ++iy)
+ {
+ tile[ix][iy].put(sprovider,
+ x - (ix * tile_size), y - (iy * tile_size));
+ }
+}
- ColMap*
- GroundMap::get_colmap(void)
- {
- return colmap;
- }
+ColMap*
+GroundMap::get_colmap(void)
+{
+ return colmap;
+}
/* EOF */
Modified: branches/pingus_sdl/src/pingu.cxx
===================================================================
--- branches/pingus_sdl/src/pingu.cxx 2007-01-16 00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/pingu.cxx 2007-01-16 01:00:10 UTC (rev 2664)
@@ -38,7 +38,7 @@
using namespace Actions;
// Init a pingu at the given position while falling
-Pingu::Pingu (int arg_id, const Vector& arg_pos, int owner)
+Pingu::Pingu (int arg_id, const Vector3f& arg_pos, int owner)
: action(0),
countdown_action (0),
wall_action(0),
@@ -50,7 +50,7 @@
status(PS_ALIVE),
pos_x(arg_pos.x),
pos_y(arg_pos.y),
- velocity(new Vector(0, 0, 0))
+ velocity(new Vector3f(0, 0, 0))
{
direction.left ();
@@ -99,14 +99,14 @@
}
void
-Pingu::set_pos (const Vector& arg_pos)
+Pingu::set_pos (const Vector3f& arg_pos)
{
set_x (arg_pos.x);
set_y (arg_pos.y);
}
void
-Pingu::set_velocity (const Vector& velocity_)
+Pingu::set_velocity (const Vector3f& velocity_)
{
*velocity = velocity_;
}
@@ -279,7 +279,7 @@
bool
Pingu::is_over (int x, int y)
{
- Vector center = get_center_pos ();
+ Vector3f center = get_center_pos ();
return (center.x + 16 > x && center.x - 16 < x &&
center.y + 16 > y && center.y - 16 < y);
@@ -300,7 +300,7 @@
double
Pingu::dist (int x, int y)
{
- Vector p = get_center_pos ();
+ Vector3f p = get_center_pos ();
return sqrt(((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y)));
}
@@ -404,7 +404,7 @@
}
void
-Pingu::apply_force (Vector arg_v)
+Pingu::apply_force (Vector3f arg_v)
{
*velocity += arg_v;
// Moving the pingu on pixel up, so that the force can take effect
@@ -412,16 +412,16 @@
--pos_y;
}
-Vector
+Vector3f
Pingu::get_pos () const
{
- return Vector(pos_x, pos_y, 0);
+ return Vector3f(pos_x, pos_y, 0);
}
-Vector
+Vector3f
Pingu::get_center_pos () const
{
- return Vector(pos_x, pos_y) + Vector (0, -16);
+ return Vector3f(pos_x, pos_y) + Vector3f(0, -16);
}
int
Modified: branches/pingus_sdl/src/pingu_action.cxx
===================================================================
--- branches/pingus_sdl/src/pingu_action.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/pingu_action.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -19,7 +19,7 @@
#include <assert.h>
#include <math.h>
-#include "vector.hxx"
+#include "math/vector3f.hpp"
#include "col_map.hxx"
#include "world.hxx"
#include "pingu.hxx"
@@ -108,13 +108,13 @@
PinguAction::move_with_forces ()
{
// Apply gravity
- pingu->set_velocity(pingu->get_velocity() + Vector(0.0f, 1.0f));
+ pingu->set_velocity(pingu->get_velocity() + Vector3f(0.0f, 1.0f));
#if 0 // New Code
- Vector pos = pingu->get_pos();
- Vector target_pos = pos + pingu->get_velocity();
- Vector dir = target_pos - pingu->get_pos();
- Vector velocity = pingu->get_velocity();
+ Vector3f pos = pingu->get_pos();
+ Vector3f target_pos = pos + pingu->get_velocity();
+ Vector3f dir = target_pos - pingu->get_pos();
+ Vector3f velocity = pingu->get_velocity();
float length = dir.length();
dir.normalize();
@@ -137,7 +137,7 @@
else
{
// Make it so that the Pingu won't go down any further.
- pingu->set_velocity(Vector(0, 0));
+ pingu->set_velocity(Vector3f(0, 0));
return;
}
}
@@ -157,7 +157,7 @@
#else // Old Code
// FIXME: What does this variable do?
- Vector resultant_force = pingu->get_velocity();
+ Vector3f resultant_force = pingu->get_velocity();
// FIXME: and what is this all about?! Can't we just use floats?
// Strictly speaking x_numerator should be initialised with
@@ -187,7 +187,7 @@
y_inc = denominator;
}
- Vector force_counter = resultant_force;
+ Vector3f force_counter = resultant_force;
// Keep moving the Pingu until there is only a fraction left
while ( force_counter.x <= -1
@@ -244,7 +244,7 @@
return;
}
// Make it so that the Pingu won't go down any further.
- pingu->set_velocity(Vector(0, 0));
+ pingu->set_velocity(Vector3f(0, 0));
return;
}
else
Modified: branches/pingus_sdl/src/pingu_holder.cxx
===================================================================
--- branches/pingus_sdl/src/pingu_holder.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/pingu_holder.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -39,7 +39,7 @@
}
Pingu*
-PinguHolder::create_pingu (const Vector& pos, int owner_id)
+PinguHolder::create_pingu (const Vector3f& pos, int owner_id)
{
if (number_of_allowed > get_number_of_released())
{
Modified: branches/pingus_sdl/src/result_screen.cxx
===================================================================
--- branches/pingus_sdl/src/result_screen.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/result_screen.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -18,9 +18,8 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
-#include <ClanLib/Display/sprite_description.h>
#include "gettext.h"
+#include "gui/display.hxx"
#include "gui/surface_button.hxx"
#include "gui/gui_manager.hxx"
#include "gui/screen_manager.hxx"
@@ -39,10 +38,10 @@
{
public:
Result result;
- CL_Sprite background;
+ Sprite background;
std::string time_str;
- std::vector<CL_Sprite> chalk_pingus;
+ std::vector<Sprite> chalk_pingus;
ResultScreenComponent(Result arg_result);
virtual ~ResultScreenComponent() {}
@@ -56,8 +55,8 @@
ResultScreen* parent;
public:
ResultScreenOkButton(ResultScreen* p)
- : GUI::SurfaceButton(CL_Display::get_width()/2 + 225,
- CL_Display::get_height()/2 + 125,
+ : GUI::SurfaceButton(Display::get_width()/2 + 225,
+ Display::get_height()/2 + 125,
ResDescriptor("core/start/ok"),
ResDescriptor("core/start/ok_clicked"),
ResDescriptor("core/start/ok_hover")),
@@ -84,8 +83,8 @@
ResultScreen* parent;
public:
ResultScreenAbortButton(ResultScreen* p)
- : GUI::SurfaceButton(CL_Display::get_width()/2 - 278,
- CL_Display::get_height()/2 + 144,
+ : GUI::SurfaceButton(Display::get_width()/2 - 278,
+ Display::get_height()/2 + 144,
ResDescriptor("core/start/back"),
ResDescriptor("core/start/back_clicked"),
ResDescriptor("core/start/back_hover")),
@@ -117,8 +116,8 @@
ResultScreen* parent;
public:
ResultScreenRetryButton(ResultScreen* p)
- : GUI::SurfaceButton(CL_Display::get_width()/2 + 225,
- CL_Display::get_height()/2 + 125,
+ : GUI::SurfaceButton(Display::get_width()/2 + 225,
+ Display::get_height()/2 + 125,
ResDescriptor("core/start/ok"),
ResDescriptor("core/start/ok_clicked"),
ResDescriptor("core/start/ok_hover")),
@@ -141,17 +140,21 @@
ResultScreenComponent::ResultScreenComponent(Result arg_result)
: result(arg_result)
{
- if (CL_Display::get_width() == 800 && CL_Display::get_height() == 600)
- background = Resource::load_sprite("core/menu/startscreenbg");
- else
- {
- PixelBuffer pb =
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
- "core/menu/startscreenbg"), CL_Display::get_width(),
CL_Display::get_height());
- CL_SpriteDescription desc;
- desc.add_frame(pb);
- background = CL_Sprite(desc);
- }
- background.set_alignment(origin_center);
+ if (Display::get_width() == 800 && Display::get_height() == 600)
+ {
+ background = Resource::load_sprite("core/menu/startscreenbg");
+ }
+#if 0
+ else
+ {
+ PixelBuffer pb =
Blitter::scale_surface_to_canvas(Resource::load_pixelbuffer(
+
"core/menu/startscreenbg"), Display::get_width(), Display::get_height());
+ CL_SpriteDescription desc;
+ desc.add_frame(pb);
+ background = CL_Sprite(desc);
+ }
+ background.set_alignment(origin_center);
+#endif
chalk_pingus.push_back(Resource::load_sprite("core/misc/chalk_pingu1"));
chalk_pingus.push_back(Resource::load_sprite("core/misc/chalk_pingu2"));
@@ -167,30 +170,30 @@
void
ResultScreenComponent::draw(DrawingContext& gc)
{
- gc.draw(background, Vector(gc.get_width()/2, gc.get_height()/2));
+ gc.draw(background, Vector3f(gc.get_width()/2, gc.get_height()/2));
if (!result.success())
gc.print_right(Fonts::chalk_normal,
- (float)CL_Display::get_width()/2 + 275,
- (float)CL_Display::get_height()/2 + 110, _("Retry"));
+ (float)Display::get_width()/2 + 275,
+ (float)Display::get_height()/2 + 110, _("Retry"));
gc.print_center(Fonts::chalk_large, gc.get_width()/2,
-
(float)CL_Display::get_height()/2 - 200,
+ (float)Display::get_height()/2 - 200,
_(result.plf.get_levelname()));
if (result.success())
{
gc.print_center(Fonts::chalk_large, gc.get_width()/2,
- (float)CL_Display::get_height()/2 - 140, _("Success!"));
+ (float)Display::get_height()/2 - 140, _("Success!"));
/*gc.print_center(Fonts::pingus_small, gc.get_width()/2,
gc.get_height()-30,
"..:: Press Space to continue ::..");*/
}
else
{
- gc.print_center(Fonts::chalk_large, gc.get_width()/2,
(float)CL_Display::get_height()/2 - 140,
+ gc.print_center(Fonts::chalk_large, gc.get_width()/2,
(float)Display::get_height()/2 - 140,
_("Failure!"));
/*gc.print_center(Fonts::pingus_normal, gc.get_width()/2,
gc.get_height()-30,
- "..:: Press Space to retry the level ::..");*/
+ "..:: Press Space to retry the level ::..");*/
}
std::string message;
@@ -225,7 +228,7 @@
message = _("Better luck next time!");
}
gc.print_center(Fonts::chalk_normal, gc.get_width()/2,
- (float)CL_Display::get_height()/2 - 70, message);
+ (float)Display::get_height()/2 - 70, message);
#if 0
@@ -234,10 +237,12 @@
gc.draw(chalk_pingus[rand() % chalk_pingus.size()], 230 + i * 15, 210);
}
#endif
- int left_x = CL_Display::get_width()/2 - 100;
- int right_x = CL_Display::get_width()/2 + 100;
- int y = CL_Display::get_height()/2 + 10;
+#if 0
+ int left_x = Display::get_width()/2 - 100;
+ int right_x = Display::get_width()/2 + 100;
+ int y = Display::get_height()/2 + 10;
+
gc.print_left(Fonts::chalk_normal, (float)left_x, (float)y, _("Saved: "));
gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
CL_String::to(result.saved)
+ "/" + CL_String::to(result.needed));;
@@ -248,6 +253,7 @@
gc.print_left(Fonts::chalk_normal, (float)left_x, (float)(y+=30), _("Time
left: "));
gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y, time_str);
+#endif
}
ResultScreen::ResultScreen(Result arg_result)
Modified: branches/pingus_sdl/src/smallmap_image.cxx
===================================================================
--- branches/pingus_sdl/src/smallmap_image.cxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/smallmap_image.cxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -17,10 +17,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include <ClanLib/Core/IOData/cl_endian.h>
-#include <ClanLib/Display/pixel_buffer.h>
-#include <ClanLib/Display/pixel_format.h>
-#include <ClanLib/Display/sprite_description.h>
#include "world.hxx"
#include "smallmap_image.hxx"
#include "col_map.hxx"
Modified: branches/pingus_sdl/src/smallmap_image.hxx
===================================================================
--- branches/pingus_sdl/src/smallmap_image.hxx 2007-01-16 00:34:58 UTC (rev
2663)
+++ branches/pingus_sdl/src/smallmap_image.hxx 2007-01-16 01:00:10 UTC (rev
2664)
@@ -21,6 +21,7 @@
#define HEADER_PINGUS_SMALLMAP_IMAGE_HXX
#include "pingus.hxx"
+#include "sprite.hpp"
class Server;
Modified: branches/pingus_sdl/src/sprite.cpp
===================================================================
--- branches/pingus_sdl/src/sprite.cpp 2007-01-16 00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/sprite.cpp 2007-01-16 01:00:10 UTC (rev 2664)
@@ -159,4 +159,16 @@
return true;
}
+int
+Sprite::get_current_frame() const
+{
+ return 0;
+}
+
+void
+Sprite::restart()
+{
+
+}
+
/* EOF */
Modified: branches/pingus_sdl/src/sprite.hpp
===================================================================
--- branches/pingus_sdl/src/sprite.hpp 2007-01-16 00:34:58 UTC (rev 2663)
+++ branches/pingus_sdl/src/sprite.hpp 2007-01-16 01:00:10 UTC (rev 2664)
@@ -50,7 +50,9 @@
void draw(float x, float y, SDL_Surface* target);
void set_frame(int i);
int get_frame_count() const;
+ int get_current_frame() const;
bool is_finished() const;
+ void restart();
operator bool();
private:
SharedPtr<SpriteImpl> impl;
Modified: branches/pingus_sdl/src/worldobj_factory.cxx
===================================================================
--- branches/pingus_sdl/src/worldobj_factory.cxx 2007-01-16 00:34:58 UTC
(rev 2663)
+++ branches/pingus_sdl/src/worldobj_factory.cxx 2007-01-16 01:00:10 UTC
(rev 2664)
@@ -18,10 +18,9 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <iostream>
-#include <ClanLib/Core/System/clanstring.h>
#include "pingus_error.hxx"
#include "worldobj_factory.hxx"
-
+#if 0
#include "worldobjs/conveyor_belt.hxx"
#include "worldobjs/entrance.hxx"
#include "worldobjs/exit.hxx"
@@ -46,8 +45,8 @@
#include "worldobjs/thunderstorm_background.hxx"
#include "worldobjs/woodthing.hxx"
-
using namespace WorldObjs;
+#endif
WorldObjFactory* WorldObjFactory::instance_ = 0;
@@ -98,6 +97,7 @@
{
instance_ = new WorldObjFactory ();
+#if 0
// Registring Factories
new WorldObjFactoryImpl<Liquid>("liquid");
new WorldObjFactoryImpl<Hotspot>("hotspot");
@@ -135,6 +135,7 @@
// Groundpieces
new WorldObjFactoryImpl<Groundpiece>("groundpiece");
+#endif
}
return instance_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2664 - in branches/pingus_sdl/src: . actions colliders components,
grumbel at BerliOS <=