[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src action_button.hxx,1.10,1.11 blitter.c
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src action_button.hxx,1.10,1.11 blitter.cxx,1.13,1.14 client.hxx,1.15,1.16 console.cxx,1.9,1.10 display_graphic_context.cxx,1.3,1.4 fade_out.cxx,1.3,1.4 math.hxx,1.3,1.4 multiline_text.cxx,1.4,1.5 pingus.hxx,1.1,1.2 pingus_main.cxx,1.13,1.14 pingus_resource.cxx,1.15,1.16 pingus_resource.hxx,1.8,1.9 range.hxx,1.4,1.5 res_descriptor.cxx,1.9,1.10 res_descriptor.hxx,1.7,1.8 resource_modifier.cxx,1.1,1.2 resource_modifier.hxx,1.3,1.4 screen.cxx,1.1,1.2 smallmap.cxx,1.14,1.15 spot_map.cxx,1.11,1.12 story.cxx,1.9,1.10 surface_button.cxx,1.13,1.14 xml_helper.cxx,1.15,1.16 |
Date: |
11 Sep 2002 12:46:00 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv8556/src
Modified Files:
action_button.hxx blitter.cxx client.hxx console.cxx
display_graphic_context.cxx fade_out.cxx math.hxx
multiline_text.cxx pingus.hxx pingus_main.cxx
pingus_resource.cxx pingus_resource.hxx range.hxx
res_descriptor.cxx res_descriptor.hxx resource_modifier.cxx
resource_modifier.hxx screen.cxx smallmap.cxx spot_map.cxx
story.cxx surface_button.cxx xml_helper.cxx
Log Message:
- removed Pingus namespace mostly
- paked most Editor stuff into EditorNS
- added namespace for ResourceModifier
Index: action_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/action_button.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- action_button.hxx 5 Sep 2002 12:24:01 -0000 1.10
+++ action_button.hxx 11 Sep 2002 12:45:57 -0000 1.11
@@ -33,8 +33,10 @@
class CL_Font;
class CL_Vector;
-// ----------------- snip --------------------
-///
+/** ArmageddonButton, press it to start the armageddon and to turn all
+ pingus into bomber
+
+ \sa Client */
class ArmageddonButton : public GUI::Component
{
private:
@@ -65,7 +67,10 @@
// ----------------- snip --------------------
-///
+/** Fast Forward button, press it to let the game run faster, press it
+ again to return to normal speed
+
+ \sa Client */
class ForwardButton : public GUI::Component
{
private:
@@ -91,7 +96,10 @@
// ----------------- snip --------------------
-///
+/** Pause button, press it to pause the game, press it again to
+ continue
+
+ \sa Client */
class PauseButton : public GUI::Component
{
private:
@@ -163,7 +171,11 @@
};
// ----------------- snip --------------------
-///
+
+/** Button which represents an action, one you click it the current
+ action will be set to the action represented by the button.
+
+ \sa Client */
class VerticalActionButton : public ActionButton
{
private:
@@ -181,8 +193,6 @@
VerticalActionButton (const VerticalActionButton&);
VerticalActionButton operator= (const VerticalActionButton&);
};
-
-// ----------------- snip --------------------
#endif /* ACTIONBUTTON */
Index: blitter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/blitter.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- blitter.cxx 4 Sep 2002 14:55:11 -0000 1.13
+++ blitter.cxx 11 Sep 2002 12:45:57 -0000 1.14
@@ -34,8 +34,6 @@
#include <config.h>
#include "my_gettext.hxx"
-using namespace Pingus;
-
void
Blitter::put_surface(CL_Canvas* canvas, const CL_Surface& sur,
int x, int y)
Index: client.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/client.hxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- client.hxx 10 Sep 2002 19:24:19 -0000 1.15
+++ client.hxx 11 Sep 2002 12:45:57 -0000 1.16
@@ -120,7 +120,3 @@
#endif
/* EOF */
-
-
-
-
Index: console.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/console.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- console.cxx 5 Sep 2002 14:56:16 -0000 1.9
+++ console.cxx 11 Sep 2002 12:45:57 -0000 1.10
@@ -25,7 +25,6 @@
#include "console.hxx"
#include "math.hxx"
-using namespace Pingus;
using std::ostream;
// Globale console
Index: display_graphic_context.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/display_graphic_context.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- display_graphic_context.cxx 5 Sep 2002 11:26:35 -0000 1.3
+++ display_graphic_context.cxx 11 Sep 2002 12:45:57 -0000 1.4
@@ -23,8 +23,6 @@
#include "sprite.hxx"
#include "display_graphic_context.hxx"
-using namespace Pingus;
-
DisplayGraphicContext::DisplayGraphicContext (int x1, int y1, int x2, int y2,
int /*x_offset*/, int
/*y_offset*/)
: x1 (x1), y1 (y1), x2 (x2), y2 (y2), offset (-(x2 - x1)/2.0f,
-(y2-x1)/2.0f, 1.0f)
Index: fade_out.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/fade_out.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- fade_out.cxx 17 Aug 2002 17:56:23 -0000 1.3
+++ fade_out.cxx 11 Sep 2002 12:45:57 -0000 1.4
@@ -25,7 +25,6 @@
#include "globals.hxx"
#include "math.hxx"
-using namespace Pingus;
using namespace std;
FadeOut::FadeOut (float seconds, Color color)
Index: math.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/math.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- math.hxx 16 Aug 2002 13:03:35 -0000 1.3
+++ math.hxx 11 Sep 2002 12:45:57 -0000 1.4
@@ -22,35 +22,38 @@
#include "pingus.hxx"
-namespace Pingus
+/** A collection of small math helper functions, some of them might be
+ equal in functionality to standard STL functions, but provided
+ here for portability and broken STL implementations
+
+ @brief A collection of mathematical helper functions */
+namespace Math {
+
+template<class T>
+T min (const T& a, const T& b)
{
- namespace Math
- {
- template<class T>
- T min (const T& a, const T& b)
- {
- if (a < b)
- return a;
- else
- return b;
- }
+ if (a < b)
+ return a;
+ else
+ return b;
+}
- template<class T>
- T max (const T& a, const T& b)
- {
- if (a > b)
- return a;
- else
- return b;
- }
+template<class T>
+T max (const T& a, const T& b)
+{
+ if (a > b)
+ return a;
+ else
+ return b;
+}
- template<class T>
- T mid (const T& a, const T& b, const T& c)
- {
- return max((a), min((b), (c)));
- }
- }
+template<class T>
+T mid (const T& a, const T& b, const T& c)
+{
+ return max((a), min((b), (c)));
}
+
+} // namespace Math
#endif
Index: multiline_text.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/multiline_text.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- multiline_text.cxx 17 Aug 2002 17:56:23 -0000 1.4
+++ multiline_text.cxx 11 Sep 2002 12:45:57 -0000 1.5
@@ -22,7 +22,6 @@
#include "multiline_text.hxx"
#include "math.hxx"
-using namespace Pingus;
using namespace std;
MultiLineText::MultiLineText()
Index: pingus.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pingus.hxx 16 Aug 2002 13:27:35 -0000 1.1
+++ pingus.hxx 11 Sep 2002 12:45:57 -0000 1.2
@@ -20,14 +20,20 @@
#ifndef HEADER_PINGUS_PINGUS_HXX
#define HEADER_PINGUS_PINGUS_HXX
+/**
+ * Multiple hacks, workarounds and helper things which are included
+ * everywhere and are used to fix broken compilers or supress
+ * warrnings.
+ *
+ * @file pingus.hxx
+ **/
+
#ifdef WIN32
# define for if(0);else for
# pragma warning(disable:4786)
#endif
#define UNUSED_ARG(a) do {/* null */} while (&a == 0)
-
-
#endif
Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- pingus_main.cxx 5 Sep 2002 11:26:35 -0000 1.13
+++ pingus_main.cxx 11 Sep 2002 12:45:57 -0000 1.14
@@ -77,6 +77,8 @@
#include "fonts.hxx"
#include "sound_real.hxx"
+using EditorNS::Editor;
+
void
signal_handler(int signo)
{
Index: pingus_resource.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- pingus_resource.cxx 10 Sep 2002 15:36:44 -0000 1.15
+++ pingus_resource.cxx 11 Sep 2002 12:45:57 -0000 1.16
@@ -33,13 +33,10 @@
#include "blitter.hxx"
#include "debug.hxx"
-using namespace Pingus;
-
std::map<std::string, CL_ResourceManager*> PingusResource::resource_map;
std::map<ResDescriptor, CL_Surface> PingusResource::surface_map;
std::map<ResDescriptor, CL_Font*> PingusResource::font_map;
-
std::string
suffix_fixer(const std::string& filename)
{
@@ -113,7 +110,7 @@
CL_Surface
PingusResource::load_surface(const std::string& res_name,
const std::string& datafile,
- ResourceModifier modifier)
+ ResourceModifierNS::ResourceModifier modifier)
{
return load_surface(ResDescriptor(res_name, datafile,
ResDescriptor::RD_RESOURCE,
@@ -130,7 +127,7 @@
if (!surf) // not in cache
{
ResDescriptor desc = res_desc;
- desc.modifier = ROT0;
+ desc.modifier = ResourceModifierNS::ROT0;
// Try to an unmodified version from cache
surf = load_from_cache(desc);
@@ -146,7 +143,7 @@
else // never loaded, need to load it from source
{
ResDescriptor desc = res_desc;
- desc.modifier = ROT0;
+ desc.modifier = ResourceModifierNS::ROT0;
pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading surface from
source: " << res_desc << std::endl;
surf = load_from_source (desc);
@@ -173,34 +170,34 @@
CL_Surface
PingusResource::apply_modifier (const CL_Surface& surf, const ResDescriptor&
res_desc)
{
- if (res_desc.modifier != ROT0)
+ if (res_desc.modifier != ResourceModifierNS::ROT0)
pout << "PingusResource::apply_modifier: Using expensive blitting" <<
std::endl;
switch (res_desc.modifier)
{
// FIXME: muahhhaa... I write slower code than you....
- case ROT0:
+ case ResourceModifierNS::ROT0:
return surf;
- case ROT90:
+ case ResourceModifierNS::ROT90:
return Blitter::rotate_90(surf);
- case ROT180:
+ case ResourceModifierNS::ROT180:
return Blitter::rotate_90(Blitter::rotate_90(surf));
- case ROT270:
+ case ResourceModifierNS::ROT270:
return Blitter::rotate_90(Blitter::rotate_90(Blitter::rotate_90(surf)));
- case ROT0FLIP:
+ case ResourceModifierNS::ROT0FLIP:
return Blitter::flip_horizontal(surf);
- case ROT90FLIP:
+ case ResourceModifierNS::ROT90FLIP:
return Blitter::flip_horizontal(Blitter::rotate_90(surf));
- case ROT180FLIP:
+ case ResourceModifierNS::ROT180FLIP:
return
Blitter::flip_horizontal(Blitter::rotate_90(Blitter::rotate_90(surf)));
- case ROT270FLIP:
+ case ResourceModifierNS::ROT270FLIP:
return
Blitter::flip_horizontal(Blitter::rotate_90(Blitter::rotate_90(Blitter::rotate_90(surf))));
default:
Index: pingus_resource.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pingus_resource.hxx 4 Sep 2002 14:55:11 -0000 1.8
+++ pingus_resource.hxx 11 Sep 2002 12:45:57 -0000 1.9
@@ -43,7 +43,7 @@
static CL_Surface apply_modifier (const CL_Surface&, const ResDescriptor&
res_desc);
public:
- ///
+ /** */
PingusResource();
/** */
@@ -53,7 +53,8 @@
/** Load a surface with res_name from datafile */
static CL_Surface load_surface(const std::string& res_name,
const std::string& datafile,
- Pingus::ResourceModifier modifier =
Pingus::ROT0);
+ ResourceModifierNS::ResourceModifier modifier
+ = ResourceModifierNS::ROT0);
/** Load a surface from the ResDescriptor */
static CL_Surface load_surface(const ResDescriptor&);
Index: range.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/range.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- range.hxx 23 Aug 2002 15:49:50 -0000 1.4
+++ range.hxx 11 Sep 2002 12:45:57 -0000 1.5
@@ -22,8 +22,12 @@
#include "pingus.hxx"
-// A class similar to an integer, but keeps the value in a given range.
+/** A class similar to an integer, but keeps the value in a given range.
+ @deprecated The idea of this class is to keep a value inside a,
+ but this class is a bit cheap and I don't really know if we need
+ it or if we should handle the range-keeping in the client
+ source. */
class Range
{
private:
Index: res_descriptor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/res_descriptor.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- res_descriptor.cxx 23 Aug 2002 15:49:50 -0000 1.9
+++ res_descriptor.cxx 11 Sep 2002 12:45:57 -0000 1.10
@@ -23,14 +23,12 @@
#include "string_converter.hxx"
#include "pingus_error.hxx"
-using namespace Pingus;
-
ResDescriptor::ResDescriptor()
{
type = RD_RESOURCE;
res_name = "";
datafile = "global";
- modifier = ROT0;
+ modifier = ResourceModifierNS::ROT0;
}
ResDescriptor::ResDescriptor (const ResDescriptor& res_desc)
@@ -57,7 +55,7 @@
ResDescriptor::ResDescriptor(const std::string& arg_res_name,
const std::string& arg_datafile,
ResourceType arg_type,
- Pingus::ResourceModifier arg_modifier)
+ ResourceModifierNS::ResourceModifier arg_modifier)
{
res_name = arg_res_name;
datafile = arg_datafile;
@@ -67,7 +65,7 @@
ResDescriptor::ResDescriptor(const std::string& str)
{
- modifier = Pingus::ROT0;
+ modifier = ResourceModifierNS::ROT0;
std::string::size_type pos1;
std::string::size_type pos2;
@@ -93,7 +91,7 @@
ResDescriptor::ResDescriptor(const std::string& c_cast, const std::string&
value)
{
- modifier = Pingus::ROT0;
+ modifier = ResourceModifierNS::ROT0;
std::string cast;
if (c_cast.find_first_of(":") == std::string::npos) {
Index: res_descriptor.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/res_descriptor.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- res_descriptor.hxx 4 Sep 2002 14:55:11 -0000 1.7
+++ res_descriptor.hxx 11 Sep 2002 12:45:57 -0000 1.8
@@ -37,14 +37,16 @@
/// The name of the data, filename or resourcename ("Textures/desert")
std::string res_name;
- Pingus::ResourceModifier modifier;
+ ResourceModifierNS::ResourceModifier modifier;
ResDescriptor ();
ResDescriptor (const ResDescriptor& old);
ResDescriptor operator= (const ResDescriptor&);
ResDescriptor (const std::string& res_name, const std::string& datafile,
- ResourceType type, Pingus::ResourceModifier modifier =
Pingus::ROT0);
+ ResourceType type,
+ ResourceModifierNS::ResourceModifier modifier
+ = ResourceModifierNS::ROT0);
ResDescriptor (const std::string& cast, const std::string& value);
ResDescriptor (const std::string& str);
Index: resource_modifier.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/resource_modifier.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- resource_modifier.cxx 26 Jun 2002 09:40:32 -0000 1.1
+++ resource_modifier.cxx 11 Sep 2002 12:45:57 -0000 1.2
@@ -20,162 +20,163 @@
#include <assert.h>
#include "resource_modifier.hxx"
-namespace Pingus
-{
- ResourceModifier horizontal_flip (ResourceModifier modifier)
- {
- switch (modifier)
- {
- case ROT0:
- return ROT0FLIP;
- case ROT90:
- return ROT90FLIP;
- case ROT180:
- return ROT180FLIP;
- case ROT270:
- return ROT270FLIP;
- case ROT0FLIP:
- return ROT0;
- case ROT90FLIP:
- return ROT90;
- case ROT180FLIP:
- return ROT180;
- case ROT270FLIP:
- return ROT270;
- default:
- assert (0);
- return ROT0;
- }
- }
-
- ResourceModifier vertical_flip (ResourceModifier modifier)
- {
- switch (modifier)
- {
- case ROT0:
- return ROT180FLIP;
- case ROT90:
- return ROT270FLIP;
- case ROT180:
- return ROT0FLIP;
- case ROT270:
- return ROT90FLIP;
- case ROT0FLIP:
- return ROT180;
- case ROT90FLIP:
- return ROT270;
- case ROT180FLIP:
- return ROT0;
- case ROT270FLIP:
- return ROT90;
- default:
- assert (0);
- return ROT0;
- }
- }
-
- ResourceModifier rotate_90 (ResourceModifier modifier)
- {
- switch (modifier)
- {
- case ROT0:
- return ROT90;
- case ROT90:
- return ROT180;
- case ROT180:
- return ROT270;
- case ROT270:
- return ROT0;
- case ROT0FLIP:
- return ROT270FLIP;
- case ROT90FLIP:
- return ROT0FLIP;
- case ROT180FLIP:
- return ROT90FLIP;
- case ROT270FLIP:
- return ROT180FLIP;
- default:
- assert (0);
- return ROT0;
- }
- }
-
- ResourceModifier rotate_270 (ResourceModifier modifier)
- {
- switch (modifier)
- {
- case ROT0:
- return ROT270;
- case ROT90:
- return ROT0;
- case ROT180:
- return ROT90;
- case ROT270:
- return ROT180;
- case ROT0FLIP:
- return ROT90FLIP;
- case ROT90FLIP:
- return ROT180FLIP;
- case ROT180FLIP:
- return ROT270FLIP;
- case ROT270FLIP:
- return ROT0FLIP;
- default:
- assert (0);
- return ROT0;
- }
- }
-
- std::string rs_to_string (ResourceModifier modifier)
- {
- switch (modifier)
- {
- case ROT0:
- return "ROT0";
- case ROT90:
- return "ROT90";
- case ROT180:
- return "ROT180";
- case ROT270:
- return "ROT270";
- case ROT0FLIP:
- return "ROT0FLIP";
- case ROT90FLIP:
- return "ROT90FLIP";
- case ROT180FLIP:
- return "ROT180FLIP";
- case ROT270FLIP:
- return "ROT270FLIP";
- default:
- assert (0);
- return "--Error--";
- }
- }
+namespace ResourceModifierNS {
- ResourceModifier rs_from_string (const std::string& modifier)
- {
- if (modifier == "ROT0")
+ResourceModifier horizontal_flip (ResourceModifier modifier)
+{
+ switch (modifier)
+ {
+ case ROT0:
+ return ROT0FLIP;
+ case ROT90:
+ return ROT90FLIP;
+ case ROT180:
+ return ROT180FLIP;
+ case ROT270:
+ return ROT270FLIP;
+ case ROT0FLIP:
return ROT0;
- else if (modifier == "ROT90")
+ case ROT90FLIP:
return ROT90;
- else if (modifier == "ROT180")
+ case ROT180FLIP:
return ROT180;
- else if (modifier == "ROT270")
+ case ROT270FLIP:
return ROT270;
- else if (modifier == "ROT0FLIP")
+ default:
+ assert (0);
+ return ROT0;
+ }
+}
+
+ResourceModifier vertical_flip (ResourceModifier modifier)
+{
+ switch (modifier)
+ {
+ case ROT0:
+ return ROT180FLIP;
+ case ROT90:
+ return ROT270FLIP;
+ case ROT180:
return ROT0FLIP;
- else if (modifier == "ROT90FLIP")
+ case ROT270:
return ROT90FLIP;
- else if (modifier == "ROT180FLIP")
+ case ROT0FLIP:
+ return ROT180;
+ case ROT90FLIP:
+ return ROT270;
+ case ROT180FLIP:
+ return ROT0;
+ case ROT270FLIP:
+ return ROT90;
+ default:
+ assert (0);
+ return ROT0;
+ }
+}
+
+ResourceModifier rotate_90 (ResourceModifier modifier)
+{
+ switch (modifier)
+ {
+ case ROT0:
+ return ROT90;
+ case ROT90:
+ return ROT180;
+ case ROT180:
+ return ROT270;
+ case ROT270:
+ return ROT0;
+ case ROT0FLIP:
+ return ROT270FLIP;
+ case ROT90FLIP:
+ return ROT0FLIP;
+ case ROT180FLIP:
+ return ROT90FLIP;
+ case ROT270FLIP:
return ROT180FLIP;
- else if (modifier == "ROT270FLIP")
+ default:
+ assert (0);
+ return ROT0;
+ }
+}
+
+ResourceModifier rotate_270 (ResourceModifier modifier)
+{
+ switch (modifier)
+ {
+ case ROT0:
+ return ROT270;
+ case ROT90:
+ return ROT0;
+ case ROT180:
+ return ROT90;
+ case ROT270:
+ return ROT180;
+ case ROT0FLIP:
+ return ROT90FLIP;
+ case ROT90FLIP:
+ return ROT180FLIP;
+ case ROT180FLIP:
return ROT270FLIP;
- else
- {
- assert (0);
- return ROT0;
- }
- }
+ case ROT270FLIP:
+ return ROT0FLIP;
+ default:
+ assert (0);
+ return ROT0;
+ }
}
+
+std::string rs_to_string (ResourceModifier modifier)
+{
+ switch (modifier)
+ {
+ case ROT0:
+ return "ROT0";
+ case ROT90:
+ return "ROT90";
+ case ROT180:
+ return "ROT180";
+ case ROT270:
+ return "ROT270";
+ case ROT0FLIP:
+ return "ROT0FLIP";
+ case ROT90FLIP:
+ return "ROT90FLIP";
+ case ROT180FLIP:
+ return "ROT180FLIP";
+ case ROT270FLIP:
+ return "ROT270FLIP";
+ default:
+ assert (0);
+ return "--Error--";
+ }
+}
+
+ResourceModifier rs_from_string (const std::string& modifier)
+{
+ if (modifier == "ROT0")
+ return ROT0;
+ else if (modifier == "ROT90")
+ return ROT90;
+ else if (modifier == "ROT180")
+ return ROT180;
+ else if (modifier == "ROT270")
+ return ROT270;
+ else if (modifier == "ROT0FLIP")
+ return ROT0FLIP;
+ else if (modifier == "ROT90FLIP")
+ return ROT90FLIP;
+ else if (modifier == "ROT180FLIP")
+ return ROT180FLIP;
+ else if (modifier == "ROT270FLIP")
+ return ROT270FLIP;
+ else
+ {
+ assert (0);
+ return ROT0;
+ }
+}
+
+} // namespace ResourceModifierNS
/* EOF */
Index: resource_modifier.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/resource_modifier.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- resource_modifier.hxx 23 Aug 2002 15:49:50 -0000 1.3
+++ resource_modifier.hxx 11 Sep 2002 12:45:57 -0000 1.4
@@ -23,31 +23,31 @@
#include "pingus.hxx"
#include <string>
-namespace Pingus
-{
+namespace ResourceModifierNS {
- /** This array contains possible modifications of a surface */
- typedef enum {
- ROT0,
- ROT90,
- ROT180,
- ROT270,
- ROT0FLIP,
- ROT90FLIP,
- ROT180FLIP,
- ROT270FLIP
- } ResourceModifier;
+/** This array contains possible modifications of a surface */
+typedef enum {
+ ROT0,
+ ROT90,
+ ROT180,
+ ROT270,
+ ROT0FLIP,
+ ROT90FLIP,
+ ROT180FLIP,
+ ROT270FLIP
+} ResourceModifier;
- ResourceModifier horizontal_flip (ResourceModifier);
- ResourceModifier vertical_flip (ResourceModifier);
- ResourceModifier rotate_90 (ResourceModifier);
- ResourceModifier rotate_270 (ResourceModifier);
+ResourceModifier horizontal_flip (ResourceModifier);
+ResourceModifier vertical_flip (ResourceModifier);
+ResourceModifier rotate_90 (ResourceModifier);
+ResourceModifier rotate_270 (ResourceModifier);
- // we don't specialize the to_string templates here, since the enum
- // might get confused with 'int'
- std::string rs_to_string (ResourceModifier);
- ResourceModifier rs_from_string (const std::string&);
-}
+// we don't specialize the to_string templates here, since the enum
+// might get confused with 'int'
+std::string rs_to_string (ResourceModifier);
+ResourceModifier rs_from_string (const std::string&);
+
+} // namespace ResourceModifierNS
#endif
Index: screen.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/screen.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- screen.cxx 12 Jun 2002 19:09:37 -0000 1.1
+++ screen.cxx 11 Sep 2002 12:45:57 -0000 1.2
@@ -19,6 +19,4 @@
#include "screen.hxx"
-using namespace Pingus;
-
/* EOF */
Index: smallmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/smallmap.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- smallmap.cxx 6 Sep 2002 17:33:29 -0000 1.14
+++ smallmap.cxx 11 Sep 2002 12:45:57 -0000 1.15
@@ -32,7 +32,6 @@
#include "pingu.hxx"
#include "math.hxx"
-using namespace Pingus;
using namespace std;
SmallMap::SmallMap()
Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- spot_map.cxx 5 Sep 2002 16:47:46 -0000 1.11
+++ spot_map.cxx 11 Sep 2002 12:45:57 -0000 1.12
@@ -31,7 +31,6 @@
#include "col_map.hxx"
#include "math.hxx"
-using namespace Pingus;
using namespace std;
MapTileSurface::MapTileSurface () : empty(true)
Index: story.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/story.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- story.cxx 10 Sep 2002 12:46:55 -0000 1.9
+++ story.cxx 11 Sep 2002 12:45:57 -0000 1.10
@@ -26,7 +26,7 @@
#include "worldmap/manager.hxx"
// using NS_Pingus::NS_WorldMap::WorldMapManager;
-using pingus::worldmap::WorldMapManager;
+using WorldMapNS::WorldMapManager;
Story::Story(PingusMenuManager* manager)
: PingusSubMenu (manager)
Index: surface_button.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/surface_button.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- surface_button.cxx 7 Sep 2002 19:29:03 -0000 1.13
+++ surface_button.cxx 11 Sep 2002 12:45:57 -0000 1.14
@@ -36,6 +36,8 @@
#include <config.h>
#include "my_gettext.hxx"
+using EditorNS::Editor;
+
SurfaceButton::SurfaceButton ()
{
font = PingusResource::load_font("Fonts/pingus_small", "fonts");
Index: xml_helper.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_helper.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- xml_helper.cxx 10 Sep 2002 21:03:32 -0000 1.15
+++ xml_helper.cxx 11 Sep 2002 12:45:57 -0000 1.16
@@ -31,8 +31,6 @@
int xmlIsBlankNode(xmlNodePtr node) { return 0; }
#endif
-using namespace Pingus;
-
xmlNodePtr
XMLhelper::skip_blank (xmlNodePtr cur)
{
@@ -227,7 +225,7 @@
{
//std::cout << "Seen: modifier: " << ident <<
std::endl;
- desc.modifier = rs_from_string(ident);
+ desc.modifier =
ResourceModifierNS::rs_from_string(ident);
xmlFree(ident);
}
}
@@ -281,7 +279,7 @@
{
//std::cout << "Seen: modifier: " << ident <<
std::endl;
- desc.modifier = rs_from_string(ident);
+ desc.modifier =
ResourceModifierNS::rs_from_string(ident);
xmlFree(ident);
}
}
@@ -353,7 +351,7 @@
break;
}
- xml << " <modifier>" << rs_to_string(desc.modifier) << "</modifier>" <<
std::endl;
+ xml << " <modifier>" << ResourceModifierNS::rs_to_string(desc.modifier)
<< "</modifier>" << std::endl;
xml << " </resource></surface>" << std::endl;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src action_button.hxx,1.10,1.11 blitter.cxx,1.13,1.14 client.hxx,1.15,1.16 console.cxx,1.9,1.10 display_graphic_context.cxx,1.3,1.4 fade_out.cxx,1.3,1.4 math.hxx,1.3,1.4 multiline_text.cxx,1.4,1.5 pingus.hxx,1.1,1.2 pingus_main.cxx,1.13,1.14 pingus_resource.cxx,1.15,1.16 pingus_resource.hxx,1.8,1.9 range.hxx,1.4,1.5 res_descriptor.cxx,1.9,1.10 res_descriptor.hxx,1.7,1.8 resource_modifier.cxx,1.1,1.2 resource_modifier.hxx,1.3,1.4 screen.cxx,1.1,1.2 smallmap.cxx,1.14,1.15 spot_map.cxx,1.11,1.12 story.cxx,1.9,1.10 surface_button.cxx,1.13,1.14 xml_helper.cxx,1.15,1.16,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs bumper_obj.cxx,1.6,1.7 bumper_obj.hxx,1.4,1.5 fake_exit_obj.cxx,1.7,1.8 fake_exit_obj.hxx,1.5,1.6 guillotine_obj.cxx,1.6,1.7 guillotine_obj.hxx,1.4,1.5 hammer_obj.cxx,1.6,1.7 hammer_obj.hxx,1.4,1.5 laser_exit_obj.cxx,1.6,1.7 laser_exit_obj.hxx,1.4,1.5 smasher_obj.cxx,1.5,1.6 smasher_obj.hxx,1.5,1.6 spike_obj.cxx,1.6,1.7 spike_obj.hxx,1.4,1.5 teleporter_obj.cxx,1.3,1.4 teleporter_obj.hxx,1.3,1.4
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editor action_window.cxx,1.8,1.9 action_window.hxx,1.6,1.7 editor.cxx,1.29,1.30 editor.hxx,1.15,1.16 editor_event.cxx,1.31,1.32 editor_event.hxx,1.13,1.14 editor_groundpiece_obj.cxx,1.11,1.12 editor_groundpiece_obj.hxx,1.8,1.9 editor_view.cxx,1.2,1.3 editor_view.hxx,1.4,1.5 editorobj.cxx,1.4,1.5 editorobj.hxx,1.14,1.15 editorobj_group.cxx,1.4,1.5 editorobj_group.hxx,1.9,1.10 entrance_window.cxx,1.3,1.4 entrance_window.hxx,1.5,1.6 groundpiece_window.cxx,1.7,1.8 groundpiece_window.hxx,1.7,1.8 level_property_window.cxx,1.9,1.10 level_property_window.hxx,1.6,1.7 object_manager.cxx,1.27,1.28 object_manager.hxx,1.16,1.17 object_selector.cxx,1.12,1.13 object_selector.hxx,1.9,1.10 panel.cxx,1.4,1.5 panel.hxx,1.6,1.7 panel_icons.cxx,1.4,1.5 panel_icons.hxx,1.5,1.6 plfobj.cxx,1.11,1.12 plfobj.hxx,1.9,1.10 property_frame.cxx,1.1,1.2 property_frame.hxx,1.4,1.5 property_window.cxx,1.9,1.10 property_window.hxx,1.6,1.7 rect_editorobj.cxx,1.4,1.5 rect_editorobj.hxx,1.4,1.5 scroll_map.cxx,1.3,1.4 scroll_map.hxx,1.3,1.4 selection.cxx,1.12,1.13 selection.hxx,1.8,1.9 sprite_editorobj.cxx,1.5,1.6 sprite_editorobj.hxx,1.5,1.6 status_line.cxx,1.7,1.8 status_line.hxx,1.8,1.9 thumb_cache.cxx,1.9,1.10 thumb_cache.hxx,1.6,1.7 weather_obj.cxx,1.7,1.8 weather_obj.hxx,1.6,1.7
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editorobjs bumper_obj.cxx,1.6,1.7 bumper_obj.hxx,1.4,1.5 fake_exit_obj.cxx,1.7,1.8 fake_exit_obj.hxx,1.5,1.6 guillotine_obj.cxx,1.6,1.7 guillotine_obj.hxx,1.4,1.5 hammer_obj.cxx,1.6,1.7 hammer_obj.hxx,1.4,1.5 laser_exit_obj.cxx,1.6,1.7 laser_exit_obj.hxx,1.4,1.5 smasher_obj.cxx,1.5,1.6 smasher_obj.hxx,1.5,1.6 spike_obj.cxx,1.6,1.7 spike_obj.hxx,1.4,1.5 teleporter_obj.cxx,1.3,1.4 teleporter_obj.hxx,1.3,1.4
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editor action_window.cxx,1.8,1.9 action_window.hxx,1.6,1.7 editor.cxx,1.29,1.30 editor.hxx,1.15,1.16 editor_event.cxx,1.31,1.32 editor_event.hxx,1.13,1.14 editor_groundpiece_obj.cxx,1.11,1.12 editor_groundpiece_obj.hxx,1.8,1.9 editor_view.cxx,1.2,1.3 editor_view.hxx,1.4,1.5 editorobj.cxx,1.4,1.5 editorobj.hxx,1.14,1.15 editorobj_group.cxx,1.4,1.5 editorobj_group.hxx,1.9,1.10 entrance_window.cxx,1.3,1.4 entrance_window.hxx,1.5,1.6 groundpiece_window.cxx,1.7,1.8 groundpiece_window.hxx,1.7,1.8 level_property_window.cxx,1.9,1.10 level_property_window.hxx,1.6,1.7 object_manager.cxx,1.27,1.28 object_manager.hxx,1.16,1.17 object_selector.cxx,1.12,1.13 object_selector.hxx,1.9,1.10 panel.cxx,1.4,1.5 panel.hxx,1.6,1.7 panel_icons.cxx,1.4,1.5 panel_icons.hxx,1.5,1.6 plfobj.cxx,1.11,1.12 plfobj.hxx,1.9,1.10 property_frame.cxx,1.1,1.2 property_frame.hxx,1.4,1.5 property_window.cxx,1.9,1.10 property_window.hxx,1.6,1.7 rect_editorobj.cxx,1.4,1.5 rect_editorobj.hxx,1.4,1.5 scroll_map.cxx,1.3,1.4 scroll_map.hxx,1.3,1.4 selection.cxx,1.12,1.13 selection.hxx,1.8,1.9 sprite_editorobj.cxx,1.5,1.6 sprite_editorobj.hxx,1.5,1.6 status_line.cxx,1.7,1.8 status_line.hxx,1.8,1.9 thumb_cache.cxx,1.9,1.10 thumb_cache.hxx,1.6,1.7 weather_obj.cxx,1.7,1.8 weather_obj.hxx,1.6,1.7
- Index(es):