aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2004-03-15 01:59:06 +0000
committerEugene Sandulenko2004-03-15 01:59:06 +0000
commit8ca8912dbd61ec84e4df8dbe19e221aaed52ac72 (patch)
tree756d87682cb87ae66b3a842f9cd3d367a5caa4f3 /saga
parentaf80eef70e4f6ec3585425a9e0b8f3614cbbd57f (diff)
downloadscummvm-rg350-8ca8912dbd61ec84e4df8dbe19e221aaed52ac72.tar.gz
scummvm-rg350-8ca8912dbd61ec84e4df8dbe19e221aaed52ac72.tar.bz2
scummvm-rg350-8ca8912dbd61ec84e4df8dbe19e221aaed52ac72.zip
Use Saga namespace everywhere
svn-id: r13293
Diffstat (limited to 'saga')
-rw-r--r--saga/binread.cpp4
-rw-r--r--saga/gamedesc.cpp10
-rw-r--r--saga/gamedesc.h5
-rw-r--r--saga/gamedesc_priv.h40
-rw-r--r--saga/resfile.cpp14
-rw-r--r--saga/saga.cpp12
-rw-r--r--saga/saga.h3
7 files changed, 41 insertions, 47 deletions
diff --git a/saga/binread.cpp b/saga/binread.cpp
index 27ca8e8e70..906ce3d2e0 100644
--- a/saga/binread.cpp
+++ b/saga/binread.cpp
@@ -23,6 +23,8 @@
#include "binread.h"
+namespace Saga {
+
BinReader::BinReader() {
_buf = NULL;
_bufPtr = NULL;
@@ -146,4 +148,4 @@ int32 BinReader::readSint32BE() {
return u32_be;
}
-
+}
diff --git a/saga/gamedesc.cpp b/saga/gamedesc.cpp
index 66812158df..e9fe24385c 100644
--- a/saga/gamedesc.cpp
+++ b/saga/gamedesc.cpp
@@ -31,7 +31,7 @@
#include "gamedesc.h"
#include "gamedesc_priv.h"
-using namespace SagaGameDesc;
+namespace Saga {
/*--------------------------------------------------------------------------*\
* Inherit the Earth - Demo version
@@ -308,7 +308,7 @@ R_GAMEDESC GameDescs[] = {
static R_GAMEMODULE GameModule;
-void SagaGameDesc::setGameDirectory(const char *gamedir) {
+void setGameDirectory(const char *gamedir) {
assert(gamedir != NULL);
debug(1, "Using game data path: %s", gamedir);
@@ -316,7 +316,7 @@ void SagaGameDesc::setGameDirectory(const char *gamedir) {
GameModule.game_dir = gamedir;
}
-int SagaGameDesc::detectGame() {
+int detectGame() {
File test_file;
bool disqualified = false;
@@ -381,7 +381,7 @@ int SagaGameDesc::detectGame() {
return -1;
}
-bool SagaGameDesc::openGame() {
+bool openGame() {
int game_filect;
if ((GameModule.game_index = detectGame()) < 0) {
@@ -445,3 +445,5 @@ bool verifyIHNMDEMO() {
bool verifyIHNMCD() {
return true;
}
+
+}
diff --git a/saga/gamedesc.h b/saga/gamedesc.h
index cdcf2a1b19..4cc6952afc 100644
--- a/saga/gamedesc.h
+++ b/saga/gamedesc.h
@@ -26,7 +26,7 @@
/* Public stuff */
-namespace SagaGameDesc {
+namespace Saga {
enum R_GAME_BASETYPES {
R_GAMETYPE_ITE,
@@ -120,9 +120,6 @@ typedef struct R_GAME_RESOURCEINFO_tag {
} // end namespace
-
-
-
#endif
diff --git a/saga/gamedesc_priv.h b/saga/gamedesc_priv.h
index a48fabdf2b..eebf3ba942 100644
--- a/saga/gamedesc_priv.h
+++ b/saga/gamedesc_priv.h
@@ -24,7 +24,7 @@
#include "gamedesc.h"
-using namespace SagaGameDesc;
+namespace Saga {
//-------------------------------------------------------------------
// Private stuff
@@ -43,32 +43,30 @@ using namespace SagaGameDesc;
typedef bool (ResourceFile::*R_GAME_VERIFYFUNC)();
typedef struct R_GAME_FILEDESC_tag {
-
- const char * gf_fname;
- unsigned int gf_type;
+ const char *gf_fname;
+ unsigned int gf_type;
} R_GAME_FILEDESC;
typedef struct R_GAMEDESC_tag {
-
int gd_game_type;
int gd_game_id;
- const char * gd_title;
+ const char *gd_title;
- R_GAME_DISPLAYINFO * gd_display_info;
+ R_GAME_DISPLAYINFO *gd_display_info;
int gd_startscene;
- R_GAME_RESOURCEINFO * gd_resource_info;
+ R_GAME_RESOURCEINFO *gd_resource_info;
- int gd_filect;
- R_GAME_FILEDESC * gd_filedescs;
+ int gd_filect;
+ R_GAME_FILEDESC *gd_filedescs;
- int gd_fontct;
- R_GAME_FONTDESC * gd_fontdescs;
+ int gd_fontct;
+ R_GAME_FONTDESC *gd_fontdescs;
- R_GAME_SOUNDINFO * gd_soundinfo;
+ R_GAME_SOUNDINFO *gd_soundinfo;
int gd_supported;
@@ -76,7 +74,6 @@ typedef struct R_GAMEDESC_tag {
typedef struct R_GAME_FILEDATA_tag {
-
ResourceFile *file_ctxt;
unsigned int file_types;
@@ -86,26 +83,25 @@ typedef struct R_GAME_FILEDATA_tag {
typedef struct R_GAMEMODULE_tag {
-
int game_init;
int game_index;
- R_GAMEDESC * gamedesc;
+ R_GAMEDESC *gamedesc;
int g_skipintro;
const char *game_dir;
- char game_language[ R_GAME_LANGSTR_LIMIT ];
+ char game_language[R_GAME_LANGSTR_LIMIT];
unsigned int gfile_n;
- R_GAME_FILEDATA * gfile_data;
+ R_GAME_FILEDATA *gfile_data;
unsigned int gd_fontct;
- R_GAME_FONTDESC * gd_fontdescs;
+ R_GAME_FONTDESC *gd_fontdescs;
- int err_n;
- const char * err_str;
+ int err_n;
+ const char *err_str;
} R_GAMEMODULE;
@@ -115,6 +111,8 @@ bool verifyITECD();
bool verifyIHNMDEMO();
bool verifyIHNMCD();
+}
+
#endif // SAGA_GAMEDESC_PRIV_H
diff --git a/saga/resfile.cpp b/saga/resfile.cpp
index 31831994eb..ba1029e174 100644
--- a/saga/resfile.cpp
+++ b/saga/resfile.cpp
@@ -26,6 +26,7 @@
#include "resfile.h"
#include "binread.h"
+namespace Saga {
ResourceFile::ResourceFile() {
_resTblOffset = 0;
@@ -130,7 +131,7 @@ bool ResourceFile::loadResource(int32 rn, byte **res, int32 *res_len) {
*res = NULL;
*res_len = NULL;
- if (!R_PBOUNDS( rn, _resTblCt)) {
+ if (!R_PBOUNDS(rn, _resTblCt)) {
return false;
}
@@ -158,13 +159,4 @@ void ResourceFile::freeResource(byte *res) {
delete[] res;
}
-
-
-
-
-
-
-
-
-
-
+}
diff --git a/saga/saga.cpp b/saga/saga.cpp
index 02a233d1e5..5fe672cfda 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -48,13 +48,13 @@ struct SAGAGameSettings {
static const SAGAGameSettings saga_settings[] = {
/* Inherit the Earth - Original floppy version */
- { "ite", "Inherit the Earth (DOS)", GID_ITE,
+ { "ite", "Inherit the Earth (DOS)", Saga::GID_ITE,
MDT_ADLIB, "ite.rsc" },
/* Inherit the Earth - CD version */
- { "itecd", "Inherit the Earth (DOS CD Version)", GID_ITECD,
+ { "itecd", "Inherit the Earth (DOS CD Version)", Saga::GID_ITECD,
MDT_ADLIB, "sounds.rsc" },
/* I Have No Mouth and I Must Scream */
- { "ihnm", "I Have No Mouth and I Must Scream (DOS)", GID_IHNM,
+ { "ihnm", "I Have No Mouth and I Must Scream (DOS)", Saga::GID_IHNM,
MDT_ADLIB, "scream.res" },
{ NULL, NULL, 0, 0, NULL }
@@ -90,7 +90,7 @@ DetectedGameList Engine_SAGA_detectGames(const FSList &fslist) {
}
Engine *Engine_SAGA_create(GameDetector *detector, OSystem *syst) {
- return new SagaEngine(detector, syst);
+ return new Saga::SagaEngine(detector, syst);
}
REGISTER_PLUGIN("SAGA Engine", Engine_SAGA_gameList, Engine_SAGA_create, Engine_SAGA_detectGames)
@@ -100,8 +100,8 @@ namespace Saga {
SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
: Engine(syst) {
- SagaGameDesc::setGameDirectory(getGameDataPath());
- SagaGameDesc::openGame();
+ setGameDirectory(getGameDataPath());
+ openGame();
// Setup mixer
if (!_mixer->isReady()) {
diff --git a/saga/saga.h b/saga/saga.h
index fad1295826..ffb72b5a24 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -29,6 +29,8 @@
#include "gamedesc.h"
+namespace Saga {
+
#define R_PBOUNDS(n,max) (((n)>=(0))&&((n)<(max)))
enum SAGAGameId {
@@ -52,5 +54,6 @@ public:
};
+}
#endif