[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am, 1.157, 1.158 globals.hxx
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am, 1.157, 1.158 globals.hxx, 1.19, 1.20 pingus_error.cxx, 1.11, 1.12 pingus_error.hxx, 1.9, 1.10 pingus_resource.cxx, 1.33, 1.34 system.cxx, 1.22, 1.23 system.hxx, 1.11, 1.12 |
Date: |
Sat, 13 Dec 2003 12:21:26 +0100 |
Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv4987
Modified Files:
Makefile.am globals.hxx pingus_error.cxx pingus_error.hxx
pingus_resource.cxx system.cxx system.hxx
Log Message:
- some minimal changes to make it compilable
Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/Makefile.am,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- Makefile.am 22 Oct 2003 11:11:22 -0000 1.157
+++ Makefile.am 13 Dec 2003 11:21:23 -0000 1.158
@@ -230,6 +230,8 @@
range.hxx \
res_descriptor.cxx \
res_descriptor.hxx \
+resources.hxx \
+resources.cxx \
resource_modifier.cxx \
resource_modifier.hxx \
result_screen.cxx \
Index: globals.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/globals.hxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- globals.hxx 18 Oct 2003 23:17:27 -0000 1.19
+++ globals.hxx 13 Dec 2003 11:21:23 -0000 1.20
@@ -69,20 +69,21 @@
extern int min_frame_skip;
extern int max_frame_skip;
-enum { PINGUS_DEBUG_ACTIONS = (1 << 0),
- PINGUS_DEBUG_SOUND = (1 << 1),
- PINGUS_DEBUG_GAMETIME = (1 << 2),
- PINGUS_DEBUG_TILES = (1 << 3),
- PINGUS_DEBUG_LOADING = (1 << 4),
- PINGUS_DEBUG_EDITOR = (1 << 5),
- PINGUS_DEBUG_BLITTER = (1 << 6),
- PINGUS_DEBUG_TRANSLATOR = (1 << 7),
- PINGUS_DEBUG_RESOURCES = (1 << 8),
- PINGUS_DEBUG_GUI = (1 << 9),
- PINGUS_DEBUG_INPUT = (1 << 10),
- PINGUS_DEBUG_WORLDMAP = (1 << 11),
- PINGUS_DEBUG_PATHMGR = (1 << 12),
- PINGUS_DEBUG_ALL = (~0)
+enum { PINGUS_DEBUG_ACTIONS = (1 << 0),
+ PINGUS_DEBUG_SOUND = (1 << 1),
+ PINGUS_DEBUG_GAMETIME = (1 << 2),
+ PINGUS_DEBUG_TILES = (1 << 3),
+ PINGUS_DEBUG_LOADING = (1 << 4),
+ PINGUS_DEBUG_EDITOR = (1 << 5),
+ PINGUS_DEBUG_BLITTER = (1 << 6),
+ PINGUS_DEBUG_TRANSLATOR = (1 << 7),
+ PINGUS_DEBUG_RESOURCES = (1 << 8),
+ PINGUS_DEBUG_GUI = (1 << 9),
+ PINGUS_DEBUG_INPUT = (1 << 10),
+ PINGUS_DEBUG_WORLDMAP = (1 << 11),
+ PINGUS_DEBUG_PATHMGR = (1 << 12),
+ PINGUS_DEBUG_DIRECTORIES = (1 << 13),
+ PINGUS_DEBUG_ALL = (~0)
};
} // namespace Pingus
Index: pingus_error.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_error.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- pingus_error.cxx 18 Oct 2003 23:17:27 -0000 1.11
+++ pingus_error.cxx 13 Dec 2003 11:21:23 -0000 1.12
@@ -22,76 +22,13 @@
namespace Pingus {
-PingusException::PingusException (const std::string& mes) : message(mes)
-{
-}
-
-PingusException::~PingusException ()
-{
-}
-
-PingusException::PingusException (const PingusException& old) :
message(old.message)
-{
-}
-
-PingusException&
-PingusException::operator= (const PingusException& old)
-{
- if (this != &old)
- message = old.message;
-
- return *this;
-}
-
-
-PingusBug::PingusBug (const std::string& mes) : PingusException("PingusBug: "
+ mes)
-{
-}
-
-PingusBug::PingusBug (const PingusBug& old) : PingusException(old)
-{
-}
-
-PingusBug&
-PingusBug::operator= (const PingusBug& old)
-{
- if (this == &old)
- return *this;
-
- PingusException::operator=(old);
-
- return *this;
-}
-
-void
-PingusBug::raise (const std::string& msg)
-{
- throw PingusBug(msg);
-}
-
-const std::string&
-PingusBug::get_message () const
-{
- return message;
-}
-
-PingusError::PingusError (const std::string& mes) :
PingusException("PingusError: " + mes)
-{
-}
-
-PingusError::PingusError (const PingusError& old) : PingusException(old)
+PingusError::PingusError (const std::string& mes)
+ : message("PingusError: " + mes)
{
}
-PingusError&
-PingusError::operator= (const PingusError& old)
+PingusError::~PingusError() throw()
{
- if (this == &old)
- return *this;
-
- PingusException::operator=(old);
-
- return *this;
}
void
@@ -106,6 +43,12 @@
return message;
}
+const char*
+PingusError::what() const throw()
+{
+ return message.c_str();
+}
+
} // namespace Pingus
/* EOF */
Index: pingus_error.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_error.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pingus_error.hxx 18 Oct 2003 23:17:27 -0000 1.9
+++ pingus_error.hxx 13 Dec 2003 11:21:23 -0000 1.10
@@ -22,51 +22,22 @@
#include "pingus.hxx"
#include <string>
+#include <exception>
namespace Pingus {
-class PingusException
-{
-protected:
- std::string message;
-public:
- PingusException (const std::string& mes);
- virtual ~PingusException ();
- virtual const std::string& get_message () const =0;
-
-protected:
- PingusException (const PingusException& old);
- PingusException& operator= (const PingusException& old);
-};
-
-/** PingusBug gets thrown on events which are a bug in Pingus, this
- can be unsupported object types or things that must not happen
- when the thing is properly working. */
-class PingusBug : public PingusException
-{
-protected:
- PingusBug (const std::string& mes);
- PingusBug (const PingusBug& old);
- PingusBug& operator= (const PingusBug& old);
-
-public:
- virtual const std::string& get_message () const;
-
- static void raise (const std::string& msg);
-};
-
-
/** A PingusError is thrown in situation where an error occured due to
invalid user input, file not found events or similar stuff. */
-class PingusError : public PingusException
+class PingusError : public std::exception
{
protected:
- PingusError (const std::string& mes);
- PingusError (const PingusError& old);
- PingusError& operator= (const PingusError& old);
-
+ std::string message;
public:
- virtual const std::string& get_message () const;
+ PingusError(const std::string& mes);
+ ~PingusError() throw();
+
+ const std::string& get_message () const;
+ const char* what() const throw();
static void raise (const std::string& msg);
};
Index: pingus_resource.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- pingus_resource.cxx 22 Oct 2003 11:11:22 -0000 1.33
+++ pingus_resource.cxx 13 Dec 2003 11:21:23 -0000 1.34
@@ -100,6 +100,12 @@
}
CL_Sprite
+PingusResource::load_sprite(const ResDescriptor& desc)
+{
+ return load_sprite(desc.res_name, desc.datafile);
+}
+
+CL_Sprite
PingusResource::load_sprite(const std::string& res_name,
const std::string& datafile)
{
Index: system.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/system.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- system.cxx 18 Oct 2003 23:17:27 -0000 1.22
+++ system.cxx 13 Dec 2003 11:21:23 -0000 1.23
@@ -36,6 +36,7 @@
#include <iostream>
+#include "pingus_error.hxx"
#include "globals.hxx"
#include "string_converter.hxx"
#include "system.hxx"
@@ -184,11 +185,16 @@
System::create_dir(std::string directory)
{
#ifndef WIN32
+ if (pingus_debug_flags & PINGUS_DEBUG_DIRECTORIES)
+ {
+ std::cout << "System::create_dir: " << directory << std::endl;
+ }
+
if (!exist(directory))
{
if (mkdir(directory.c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
S_IXGRP) != 0)
{
- throw Error(directory + ": " + strerror(errno));
+ throw PingusError("System::create_dir: " + directory + ": " +
strerror(errno));
}
else
{
@@ -264,7 +270,7 @@
}
else
{
- throw Error(_("Environment variable $HOME not set, fix that and start
again."));
+ throw PingusError(_("Environment variable $HOME not set, fix that and
start again."));
}
#endif
}
@@ -434,7 +440,7 @@
if (bytes_read == -1)
{
- throw Error ("System:checksum: file read error");
+ throw PingusError("System:checksum: file read error");
}
for (int i=0; i < bytes_read; ++i)
Index: system.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/system.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- system.hxx 18 Oct 2003 23:17:27 -0000 1.11
+++ system.hxx 13 Dec 2003 11:21:23 -0000 1.12
@@ -37,13 +37,6 @@
static std::string default_email;
static std::string default_username;
public:
- struct Error {
- std::string message;
-
- Error (const std::string& str)
- : message (str) {}
- };
-
struct DirectoryEntry
{
enum FileType { DE_DIRECTORY, DE_FILE } type;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src Makefile.am, 1.157, 1.158 globals.hxx, 1.19, 1.20 pingus_error.cxx, 1.11, 1.12 pingus_error.hxx, 1.9, 1.10 pingus_resource.cxx, 1.33, 1.34 system.cxx, 1.22, 1.23 system.hxx, 1.11, 1.12,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_view.cxx, 1.13, 1.14
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx, 1.32, 1.33 basher.hxx, 1.18, 1.19
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_view.cxx, 1.13, 1.14
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx, 1.32, 1.33 basher.hxx, 1.18, 1.19
- Index(es):