[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3724 - in trunk/pingus: . src src/worldobjs
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3724 - in trunk/pingus: . src src/worldobjs |
Date: |
Tue, 8 Jul 2008 01:26:25 +0200 |
Author: grumbel
Date: 2008-07-08 01:26:24 +0200 (Tue, 08 Jul 2008)
New Revision: 3724
Removed:
trunk/pingus/src/worldobjs/info_box.cpp
trunk/pingus/src/worldobjs/info_box.hpp
Modified:
trunk/pingus/SConstruct
trunk/pingus/src/worldobj_factory.cpp
Log:
Removed InfoBox
Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct 2008-07-07 23:21:23 UTC (rev 3723)
+++ trunk/pingus/SConstruct 2008-07-07 23:26:24 UTC (rev 3724)
@@ -236,7 +236,6 @@
'src/worldobjs/hammer.cpp',
'src/worldobjs/hotspot.cpp',
'src/worldobjs/ice_block.cpp',
-'src/worldobjs/info_box.cpp',
'src/worldobjs/laser_exit.cpp',
'src/worldobjs/liquid.cpp',
'src/worldobjs/rain_generator.cpp',
Modified: trunk/pingus/src/worldobj_factory.cpp
===================================================================
--- trunk/pingus/src/worldobj_factory.cpp 2008-07-07 23:21:23 UTC (rev
3723)
+++ trunk/pingus/src/worldobj_factory.cpp 2008-07-07 23:26:24 UTC (rev
3724)
@@ -27,7 +27,6 @@
#include "worldobjs/hammer.hpp"
#include "worldobjs/hotspot.hpp"
#include "worldobjs/ice_block.hpp"
-#include "worldobjs/info_box.hpp"
#include "worldobjs/laser_exit.hpp"
#include "worldobjs/liquid.hpp"
#include "worldobjs/rain_generator.hpp"
@@ -46,7 +45,7 @@
using namespace WorldObjs;
WorldObjFactory* WorldObjFactory::instance_ = 0;
-
+
/** WorldObjAbstractFactory, interface for creating factories */
class WorldObjAbstractFactory
{
@@ -63,7 +62,7 @@
WorldObjAbstractFactory (const WorldObjAbstractFactory&);
WorldObjAbstractFactory& operator= (const WorldObjAbstractFactory&);
};
-
+
/** Template to create factories, usage:
new WorldObjFactoryImpl<"liquid", Liquid>; */
template<class T>
@@ -81,7 +80,7 @@
WorldObjFactoryImpl (const WorldObjFactoryImpl&);
WorldObjFactoryImpl& operator= (const WorldObjFactoryImpl&);
};
-
+
WorldObjFactory::WorldObjFactory ()
{
// Register all WorldObj's
@@ -111,7 +110,6 @@
// Special Objects
new WorldObjFactoryImpl<SwitchDoor>("switchdoor");
- new WorldObjFactoryImpl<InfoBox>("infobox");
new WorldObjFactoryImpl<IceBlock>("iceblock");
new WorldObjFactoryImpl<ConveyorBelt>("conveyorbelt");
new WorldObjFactoryImpl<Teleporter>("teleporter");
@@ -175,6 +173,5 @@
delete i->second;
}
}
-
-
+
/* EOF */
Deleted: trunk/pingus/src/worldobjs/info_box.cpp
===================================================================
--- trunk/pingus/src/worldobjs/info_box.cpp 2008-07-07 23:21:23 UTC (rev
3723)
+++ trunk/pingus/src/worldobjs/info_box.cpp 2008-07-07 23:26:24 UTC (rev
3724)
@@ -1,91 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2000 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 3 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, see <http://www.gnu.org/licenses/>.
-
-#include "../display/scene_context.hpp"
-#include "../pingu.hpp"
-#include "../pingu_holder.hpp"
-#include "../fonts.hpp"
-#include "../world.hpp"
-#include "../resource.hpp"
-#include "info_box.hpp"
-
-namespace WorldObjs {
-
-InfoBox::InfoBox(const FileReader& reader)
- : sprite("worldobjs/infobox"),
- is_open (false)
-{
- reader.read_vector("position", pos);
- reader.read_string("info-text", info_text);
-}
-
-void
-InfoBox::draw (SceneContext& gc)
-{
-#if 0 // FIXME:
- int x = static_cast<int>(gc.get_x_offset() + (gc.get_width ()/2));
- int y = static_cast<int>(gc.get_y_offset() + (gc.get_height()/2));
-
- int x_pos = static_cast<int>(pos.x) + x;
- int y_pos = static_cast<int>(pos.y) + y - 100;
-
- if (is_open)
- {
- int width = Fonts::pingus_small.bounding_rect(0, 0,
info_text).get_width();
- int border = 6;
- gc.color().draw_line(pos, pos + Vector3f(0, 0 - 100), 0.0f, 1.0f, 0.0f,
1.0f);
- gc.color().draw(sprite, pos);
- CL_Display::fill_rect(CL_Rect(x_pos - width/2 - border,
- y_pos - border,
- x_pos + width/2 + border,
- y_pos + Fonts::pingus_small.get_height() +
border),
- Color(0, 0, 0, 255));
- gc.print_center(Fonts::pingus_small, x_pos, y_pos, info_text);
- }
- else
- {
- gc.color().draw(sprite, pos);
- }
-#endif
-}
-
-void
-InfoBox::update ()
-{
- sprite.update();
-
- PinguHolder* holder = world->get_pingus();
- for (PinguIter pingu = holder->begin (); pingu != holder->end (); ++pingu)
- {
- if ((*pingu)->is_inside (static_cast<int>(pos.x - 16),
- static_cast<int>(pos.y - 32),
- static_cast<int>(pos.x + 16),
- static_cast<int>(pos.y)))
- {
- is_open = true;
- }
- }
-}
-
-float
-InfoBox::get_z_pos() const
-{
- return pos.z;
-}
-
-} // namespace WorldObjs
-
-/* EOF */
Deleted: trunk/pingus/src/worldobjs/info_box.hpp
===================================================================
--- trunk/pingus/src/worldobjs/info_box.hpp 2008-07-07 23:21:23 UTC (rev
3723)
+++ trunk/pingus/src/worldobjs/info_box.hpp 2008-07-07 23:26:24 UTC (rev
3724)
@@ -1,54 +0,0 @@
-// Pingus - A free Lemmings clone
-// Copyright (C) 2000 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 3 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, see <http://www.gnu.org/licenses/>.
-
-#ifndef HEADER_PINGUS_WORLDOBJS_INFO_BOX_HPP
-#define HEADER_PINGUS_WORLDOBJS_INFO_BOX_HPP
-
-#include "../worldobj.hpp"
-
-namespace WorldObjsData {
-class InfoBoxData;
-}
-
-namespace WorldObjs {
-
-class InfoBox : public WorldObj
-{
-private:
- std::string info_text;
- Vector3f pos;
- Vector3f text_pos;
-
- Sprite sprite;
- bool is_open;
-
-public:
- InfoBox(const FileReader& reader);
-
- void draw(SceneContext& gc);
- void update();
- float get_z_pos () const;
-
-private:
- InfoBox (const InfoBox&);
- InfoBox& operator= (const InfoBox&);
-};
-
-} // namespace WorldObjs
-
-#endif
-
-/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3724 - in trunk/pingus: . src src/worldobjs,
grumbel at BerliOS <=