Use Saga namespace everywhere

svn-id: r13293
This commit is contained in:
Eugene Sandulenko 2004-03-15 01:59:06 +00:00
parent af80eef70e
commit 8ca8912dbd
7 changed files with 41 additions and 47 deletions

View File

@ -23,6 +23,8 @@
#include "binread.h" #include "binread.h"
namespace Saga {
BinReader::BinReader() { BinReader::BinReader() {
_buf = NULL; _buf = NULL;
_bufPtr = NULL; _bufPtr = NULL;
@ -146,4 +148,4 @@ int32 BinReader::readSint32BE() {
return u32_be; return u32_be;
} }
}

View File

@ -31,7 +31,7 @@
#include "gamedesc.h" #include "gamedesc.h"
#include "gamedesc_priv.h" #include "gamedesc_priv.h"
using namespace SagaGameDesc; namespace Saga {
/*--------------------------------------------------------------------------*\ /*--------------------------------------------------------------------------*\
* Inherit the Earth - Demo version * Inherit the Earth - Demo version
@ -308,7 +308,7 @@ R_GAMEDESC GameDescs[] = {
static R_GAMEMODULE GameModule; static R_GAMEMODULE GameModule;
void SagaGameDesc::setGameDirectory(const char *gamedir) { void setGameDirectory(const char *gamedir) {
assert(gamedir != NULL); assert(gamedir != NULL);
debug(1, "Using game data path: %s", gamedir); debug(1, "Using game data path: %s", gamedir);
@ -316,7 +316,7 @@ void SagaGameDesc::setGameDirectory(const char *gamedir) {
GameModule.game_dir = gamedir; GameModule.game_dir = gamedir;
} }
int SagaGameDesc::detectGame() { int detectGame() {
File test_file; File test_file;
bool disqualified = false; bool disqualified = false;
@ -381,7 +381,7 @@ int SagaGameDesc::detectGame() {
return -1; return -1;
} }
bool SagaGameDesc::openGame() { bool openGame() {
int game_filect; int game_filect;
if ((GameModule.game_index = detectGame()) < 0) { if ((GameModule.game_index = detectGame()) < 0) {
@ -445,3 +445,5 @@ bool verifyIHNMDEMO() {
bool verifyIHNMCD() { bool verifyIHNMCD() {
return true; return true;
} }
}

View File

@ -26,7 +26,7 @@
/* Public stuff */ /* Public stuff */
namespace SagaGameDesc { namespace Saga {
enum R_GAME_BASETYPES { enum R_GAME_BASETYPES {
R_GAMETYPE_ITE, R_GAMETYPE_ITE,
@ -120,9 +120,6 @@ typedef struct R_GAME_RESOURCEINFO_tag {
} // end namespace } // end namespace
#endif #endif

View File

@ -24,7 +24,7 @@
#include "gamedesc.h" #include "gamedesc.h"
using namespace SagaGameDesc; namespace Saga {
//------------------------------------------------------------------- //-------------------------------------------------------------------
// Private stuff // Private stuff
@ -43,32 +43,30 @@ using namespace SagaGameDesc;
typedef bool (ResourceFile::*R_GAME_VERIFYFUNC)(); typedef bool (ResourceFile::*R_GAME_VERIFYFUNC)();
typedef struct R_GAME_FILEDESC_tag { typedef struct R_GAME_FILEDESC_tag {
const char *gf_fname;
const char * gf_fname; unsigned int gf_type;
unsigned int gf_type;
} R_GAME_FILEDESC; } R_GAME_FILEDESC;
typedef struct R_GAMEDESC_tag { typedef struct R_GAMEDESC_tag {
int gd_game_type; int gd_game_type;
int gd_game_id; 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; int gd_startscene;
R_GAME_RESOURCEINFO * gd_resource_info; R_GAME_RESOURCEINFO *gd_resource_info;
int gd_filect; int gd_filect;
R_GAME_FILEDESC * gd_filedescs; R_GAME_FILEDESC *gd_filedescs;
int gd_fontct; int gd_fontct;
R_GAME_FONTDESC * gd_fontdescs; R_GAME_FONTDESC *gd_fontdescs;
R_GAME_SOUNDINFO * gd_soundinfo; R_GAME_SOUNDINFO *gd_soundinfo;
int gd_supported; int gd_supported;
@ -76,7 +74,6 @@ typedef struct R_GAMEDESC_tag {
typedef struct R_GAME_FILEDATA_tag { typedef struct R_GAME_FILEDATA_tag {
ResourceFile *file_ctxt; ResourceFile *file_ctxt;
unsigned int file_types; unsigned int file_types;
@ -86,26 +83,25 @@ typedef struct R_GAME_FILEDATA_tag {
typedef struct R_GAMEMODULE_tag { typedef struct R_GAMEMODULE_tag {
int game_init; int game_init;
int game_index; int game_index;
R_GAMEDESC * gamedesc; R_GAMEDESC *gamedesc;
int g_skipintro; int g_skipintro;
const char *game_dir; const char *game_dir;
char game_language[ R_GAME_LANGSTR_LIMIT ]; char game_language[R_GAME_LANGSTR_LIMIT];
unsigned int gfile_n; unsigned int gfile_n;
R_GAME_FILEDATA * gfile_data; R_GAME_FILEDATA *gfile_data;
unsigned int gd_fontct; unsigned int gd_fontct;
R_GAME_FONTDESC * gd_fontdescs; R_GAME_FONTDESC *gd_fontdescs;
int err_n; int err_n;
const char * err_str; const char *err_str;
} R_GAMEMODULE; } R_GAMEMODULE;
@ -115,6 +111,8 @@ bool verifyITECD();
bool verifyIHNMDEMO(); bool verifyIHNMDEMO();
bool verifyIHNMCD(); bool verifyIHNMCD();
}
#endif // SAGA_GAMEDESC_PRIV_H #endif // SAGA_GAMEDESC_PRIV_H

View File

@ -26,6 +26,7 @@
#include "resfile.h" #include "resfile.h"
#include "binread.h" #include "binread.h"
namespace Saga {
ResourceFile::ResourceFile() { ResourceFile::ResourceFile() {
_resTblOffset = 0; _resTblOffset = 0;
@ -130,7 +131,7 @@ bool ResourceFile::loadResource(int32 rn, byte **res, int32 *res_len) {
*res = NULL; *res = NULL;
*res_len = NULL; *res_len = NULL;
if (!R_PBOUNDS( rn, _resTblCt)) { if (!R_PBOUNDS(rn, _resTblCt)) {
return false; return false;
} }
@ -158,13 +159,4 @@ void ResourceFile::freeResource(byte *res) {
delete[] res; delete[] res;
} }
}

View File

@ -48,13 +48,13 @@ struct SAGAGameSettings {
static const SAGAGameSettings saga_settings[] = { static const SAGAGameSettings saga_settings[] = {
/* Inherit the Earth - Original floppy version */ /* 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" }, MDT_ADLIB, "ite.rsc" },
/* Inherit the Earth - CD version */ /* 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" }, MDT_ADLIB, "sounds.rsc" },
/* I Have No Mouth and I Must Scream */ /* 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" }, MDT_ADLIB, "scream.res" },
{ NULL, NULL, 0, 0, NULL } { NULL, NULL, 0, 0, NULL }
@ -90,7 +90,7 @@ DetectedGameList Engine_SAGA_detectGames(const FSList &fslist) {
} }
Engine *Engine_SAGA_create(GameDetector *detector, OSystem *syst) { 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) 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) SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
: Engine(syst) { : Engine(syst) {
SagaGameDesc::setGameDirectory(getGameDataPath()); setGameDirectory(getGameDataPath());
SagaGameDesc::openGame(); openGame();
// Setup mixer // Setup mixer
if (!_mixer->isReady()) { if (!_mixer->isReady()) {

View File

@ -29,6 +29,8 @@
#include "gamedesc.h" #include "gamedesc.h"
namespace Saga {
#define R_PBOUNDS(n,max) (((n)>=(0))&&((n)<(max))) #define R_PBOUNDS(n,max) (((n)>=(0))&&((n)<(max)))
enum SAGAGameId { enum SAGAGameId {
@ -52,5 +54,6 @@ public:
}; };
}
#endif #endif