[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/input/pointers axis_pointer.cxx,1.3,1
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/input/pointers axis_pointer.cxx,1.3,1.4 axis_pointer.hxx,1.3,1.4 dummy_pointer.hxx,1.3,1.4 mouse_pointer.cxx,1.1,1.2 mouse_pointer.hxx,1.3,1.4 multiple_pointer.cxx,1.2,1.3 multiple_pointer.hxx,1.3,1.4 |
Date: |
19 Apr 2003 10:23:21 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/input/pointers
In directory dark:/tmp/cvs-serv20737/input/pointers
Modified Files:
axis_pointer.cxx axis_pointer.hxx dummy_pointer.hxx
mouse_pointer.cxx mouse_pointer.hxx multiple_pointer.cxx
multiple_pointer.hxx
Log Message:
removed trailing whitespace
Index: axis_pointer.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/axis_pointer.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- axis_pointer.cxx 28 Oct 2002 22:40:23 -0000 1.3
+++ axis_pointer.cxx 19 Apr 2003 10:23:19 -0000 1.4
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -25,7 +25,7 @@
namespace Input {
namespace Pointers {
-
+
AxisPointer::AxisPointer (float speed_, const std::vector<Axis*>& axes_) :
speed(speed_), axes(axes_)
{
assert(axes.size() >= 2);
@@ -56,17 +56,17 @@
x_pos = new_x;
y_pos = new_y;
}
-
+
void
AxisPointer::update (float delta)
{
for (std::vector<Axis*>::const_iterator it = axes.begin(); it !=
axes.end(); it++)
{
(*it)->update(delta);
-
+
x_pos += cos((*it)->get_angle() * 3.14159265 / 180) * speed * delta
* (*it)->get_pos();
y_pos += sin((*it)->get_angle() * 3.14159265 / 180) * speed * delta
* (*it)->get_pos();
- }
+ }
}
}
Index: axis_pointer.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/axis_pointer.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- axis_pointer.hxx 27 Sep 2002 11:26:48 -0000 1.3
+++ axis_pointer.hxx 19 Apr 2003 10:23:19 -0000 1.4
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -29,26 +29,26 @@
class Axis;
namespace Pointers {
-
+
/**
@brief maps two or more axes into a pointer
-
+
XML definition: <axis-pointer> <axis 1><axis 2>[... <axis N>]
</axis-pointer>
-
+
The number of axes used to create the pointer and their respective
angles is
unlimited as long as there are at least two axes and the first two axes
must have
different angles.
*/
class AxisPointer : public Pointer {
-
+
private:
const float speed;
std::vector<Axis*> axes;
-
+
float x_pos;
float y_pos;
-
+
public:
AxisPointer (float speed, const std::vector<Axis*>& axes_);
@@ -56,11 +56,11 @@
virtual const float& get_x_pos () const;
virtual const float& get_y_pos () const;
-
+
virtual void set_pos(float new_x, float new_y);
-
+
virtual void update (float delta);
-
+
private:
AxisPointer (const AxisPointer&);
AxisPointer& operator= (const AxisPointer&);
Index: dummy_pointer.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/dummy_pointer.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dummy_pointer.hxx 27 Sep 2002 11:26:48 -0000 1.3
+++ dummy_pointer.hxx 19 Apr 2003 10:23:19 -0000 1.4
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -28,24 +28,24 @@
/**
@brief dummy class to be used if a pointer is required but none defined
-
+
XML definition: none
*/
class DummyPointer : public Pointer {
-
+
private:
const float pos;
-
+
public:
DummyPointer () : pos(0) { }
virtual const float& get_x_pos () const { return pos; }
virtual const float& get_y_pos () const { return pos; }
-
+
virtual void set_pos (float, float) { }
virtual void update (float) { }
-
+
private:
DummyPointer (const DummyPointer&);
DummyPointer& operator= (const DummyPointer&);
Index: mouse_pointer.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/mouse_pointer.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mouse_pointer.cxx 24 Aug 2002 11:37:31 -0000 1.1
+++ mouse_pointer.cxx 19 Apr 2003 10:23:19 -0000 1.2
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
Index: mouse_pointer.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/mouse_pointer.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mouse_pointer.hxx 27 Sep 2002 11:26:48 -0000 1.3
+++ mouse_pointer.hxx 19 Apr 2003 10:23:19 -0000 1.4
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -25,28 +25,28 @@
namespace Input {
namespace Pointers {
-
+
/**
@brief maps the standard mouse into a pointer
-
+
XML definition: <mouse-pointer/>
*/
class MousePointer : public Pointer {
-
+
private:
float x_pos;
float y_pos;
-
+
public:
MousePointer ();
-
+
virtual const float& get_x_pos () const;
virtual const float& get_y_pos () const;
-
+
virtual void set_pos (float new_x, float new_y);
-
+
virtual void update (float);
-
+
private:
MousePointer (const MousePointer&);
MousePointer& operator= (const MousePointer&);
Index: multiple_pointer.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/multiple_pointer.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multiple_pointer.cxx 12 Oct 2002 00:49:10 -0000 1.2
+++ multiple_pointer.cxx 19 Apr 2003 10:23:19 -0000 1.3
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -23,7 +23,7 @@
namespace Pointers {
- MultiplePointer::MultiplePointer (const std::vector<Pointer*>& pointers_)
+ MultiplePointer::MultiplePointer (const std::vector<Pointer*>& pointers_)
: pointers(pointers_),
old_x_pos(0),
old_y_pos(0),
@@ -55,16 +55,16 @@
{
for (unsigned int i = 0; i < pointers.size(); ++i)
pointers[i]->set_pos(x_pos_, y_pos_);
- }
+ }
void
MultiplePointer::update (float delta)
{
unsigned int do_break = UINT_MAX;
-
+
for (unsigned int i = 0; i < pointers.size(); ++i)
pointers[i]->update(delta);
-
+
for (unsigned int i = 0; i < pointers.size(); ++i)
{
if (pointers[i]->get_x_pos() != old_x_pos)
@@ -73,14 +73,14 @@
x_pos = pointers[i]->get_x_pos();
do_break = i;
}
-
+
if (pointers[i]->get_y_pos() != old_y_pos)
{
old_y_pos = y_pos;
y_pos = pointers[i]->get_y_pos();
do_break = i;
}
-
+
if (do_break != UINT_MAX)
break;
}
@@ -88,7 +88,7 @@
// no pointer changed, so there's no need to update the other pointers
if (do_break == UINT_MAX)
return;
-
+
for (unsigned int n = 0; n < pointers.size(); ++n)
if (n != do_break)
pointers[n]->set_pos(x_pos, y_pos);
Index: multiple_pointer.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/pointers/multiple_pointer.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- multiple_pointer.hxx 27 Sep 2002 11:26:48 -0000 1.3
+++ multiple_pointer.hxx 19 Apr 2003 10:23:19 -0000 1.4
@@ -1,5 +1,5 @@
// $Id$
-//
+//
// Pingus - A free Lemmings clone
// Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
@@ -12,7 +12,7 @@
// 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.
@@ -29,18 +29,18 @@
/**
@brief wrapper class allowing multiple pointers to be used as one
-
+
XML definition: <multiple-pointer> <pointer 1>...<pointer N>
</multiple-pointer>
-
+
This class will check every contained pointer for changes and if any
changes all
pointers are updated to the new coordinates. If more than one pointer
changes at
the same time only the change of the first will be registered.
*/
class MultiplePointer : public Pointer {
-
+
private:
std::vector<Pointer*> pointers;
-
+
float old_x_pos;
float old_y_pos;
@@ -50,14 +50,14 @@
public:
MultiplePointer (const std::vector<Pointer*>& pointers_);
~MultiplePointer ();
-
+
virtual const float& get_x_pos () const;
virtual const float& get_y_pos () const;
-
+
virtual void set_pos (float x_pos, float y_pos);
-
+
virtual void update (float delta);
-
+
private:
MultiplePointer (const MultiplePointer&);
MultiplePointer& operator= (const MultiplePointer&);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/input/pointers axis_pointer.cxx,1.3,1.4 axis_pointer.hxx,1.3,1.4 dummy_pointer.hxx,1.3,1.4 mouse_pointer.cxx,1.1,1.2 mouse_pointer.hxx,1.3,1.4 multiple_pointer.cxx,1.2,1.3 multiple_pointer.hxx,1.3,1.4,
torangan <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.5,1.6 explosive_particle.hxx,1.5,1.6 ground_particle.cxx,1.3,1.4 ground_particle.hxx,1.5,1.6 pingu_particle_holder.cxx,1.8,1.9 pingu_particle_holder.hxx,1.3,1.4 rain_particle_holder.cxx,1.5,1.6 rain_particle_holder.hxx,1.4,1.5 smoke_particle_holder.cxx,1.4,1.5 smoke_particle_holder.hxx,1.2,1.3 snow_particle_holder.cxx,1.6,1.7 snow_particle_holder.hxx,1.3,1.4
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs bumper_obj.cxx,1.9,1.10 bumper_obj.hxx,1.9,1.10 conveyor_belt_obj.cxx,1.7,1.8 conveyor_belt_obj.hxx,1.7,1.8 entrance_obj.cxx,1.7,1.8 entrance_obj.hxx,1.3,1.4 exit_obj.cxx,1.1,1.2 exit_obj.hxx,1.2,1.3 fake_exit_obj.cxx,1.10,1.11 fake_exit_obj.hxx,1.10,1.11 groundpiece_obj.cxx,1.14,1.15 groundpiece_obj.hxx,1.4,1.5 guillotine_obj.cxx,1.9,1.10 guillotine_obj.hxx,1.9,1.10 hammer_obj.cxx,1.10,1.11 hammer_obj.hxx,1.9,1.10 hotspot_obj.cxx,1.2,1.3 hotspot_obj.hxx,1.5,1.6 ice_block_obj.cxx,1.6,1.7 ice_block_obj.hxx,1.5,1.6 info_box_obj.cxx,1.4,1.5 info_box_obj.hxx,1.6,1.7 laser_exit_obj.cxx,1.10,1.11 laser_exit_obj.hxx,1.9,1.10 liquid_obj.cxx,1.5,1.6 liquid_obj.hxx,1.5,1.6 prefab_obj.hxx,1.3,1.4 smasher_obj.cxx,1.8,1.9 smasher_obj.hxx,1.10,1.11 solid_color_background_obj.cxx,1.6,1.7 solid_color_background_obj.hxx,1.6,1.7 spike_obj.cxx,1.10,1.11 spike_obj.hxx,1.10,1.11 starfield_background_obj.cxx,1.5,1.6 starfield_background_obj.hxx,1.6,1.7surface_background_obj.cxx,1.9,1.10 surface_background_obj.hxx,1.6,1.7 switch_door_obj.cxx,1.7,1.8 switch_door_obj.hxx,1.7,1.8 switch_door_switch_obj.cxx,1.2,1.3 switch_door_switch_obj.hxx,1.4,1.5 teleporter_obj.cxx,1.9,1.10 teleporter_obj.hxx,1.9,1.10 teleporter_target_obj.cxx,1.6,1.7 teleporter_target_obj.hxx,1.4,1.5thunderstorm_background_obj.hxx,1.4,1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.5,1.6 explosive_particle.hxx,1.5,1.6 ground_particle.cxx,1.3,1.4 ground_particle.hxx,1.5,1.6 pingu_particle_holder.cxx,1.8,1.9 pingu_particle_holder.hxx,1.3,1.4 rain_particle_holder.cxx,1.5,1.6 rain_particle_holder.hxx,1.4,1.5 smoke_particle_holder.cxx,1.4,1.5 smoke_particle_holder.hxx,1.2,1.3 snow_particle_holder.cxx,1.6,1.7 snow_particle_holder.hxx,1.3,1.4
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs bumper_obj.cxx,1.9,1.10 bumper_obj.hxx,1.9,1.10 conveyor_belt_obj.cxx,1.7,1.8 conveyor_belt_obj.hxx,1.7,1.8 entrance_obj.cxx,1.7,1.8 entrance_obj.hxx,1.3,1.4 exit_obj.cxx,1.1,1.2 exit_obj.hxx,1.2,1.3 fake_exit_obj.cxx,1.10,1.11 fake_exit_obj.hxx,1.10,1.11 groundpiece_obj.cxx,1.14,1.15 groundpiece_obj.hxx,1.4,1.5 guillotine_obj.cxx,1.9,1.10 guillotine_obj.hxx,1.9,1.10 hammer_obj.cxx,1.10,1.11 hammer_obj.hxx,1.9,1.10 hotspot_obj.cxx,1.2,1.3 hotspot_obj.hxx,1.5,1.6 ice_block_obj.cxx,1.6,1.7 ice_block_obj.hxx,1.5,1.6 info_box_obj.cxx,1.4,1.5 info_box_obj.hxx,1.6,1.7 laser_exit_obj.cxx,1.10,1.11 laser_exit_obj.hxx,1.9,1.10 liquid_obj.cxx,1.5,1.6 liquid_obj.hxx,1.5,1.6 prefab_obj.hxx,1.3,1.4 smasher_obj.cxx,1.8,1.9 smasher_obj.hxx,1.10,1.11 solid_color_background_obj.cxx,1.6,1.7 solid_color_background_obj.hxx,1.6,1.7 spike_obj.cxx,1.10,1.11 spike_obj.hxx,1.10,1.11 starfield_background_obj.cxx,1.5,1.6 starfield_background_obj.hxx,1.6,1.7surface_background_obj.cxx,1.9,1.10 surface_background_obj.hxx,1.6,1.7 switch_door_obj.cxx,1.7,1.8 switch_door_obj.hxx,1.7,1.8 switch_door_switch_obj.cxx,1.2,1.3 switch_door_switch_obj.hxx,1.4,1.5 teleporter_obj.cxx,1.9,1.10 teleporter_obj.hxx,1.9,1.10 teleporter_target_obj.cxx,1.6,1.7 teleporter_target_obj.hxx,1.4,1.5thunderstorm_background_obj.hxx,1.4,1.5
- Index(es):