aboutsummaryrefslogtreecommitdiff
path: root/saga/game.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-10-01 06:45:13 +0000
committerTorbjörn Andersson2004-10-01 06:45:13 +0000
commit54cec2e011b56d875022ec6a6c05654b08300876 (patch)
treebbd54527e158f9e9cd6cca8c47b040d0a49c280d /saga/game.cpp
parent2f8136b703a5738e8a7f715b2cb3c4c4dd013473 (diff)
downloadscummvm-rg350-54cec2e011b56d875022ec6a6c05654b08300876.tar.gz
scummvm-rg350-54cec2e011b56d875022ec6a6c05654b08300876.tar.bz2
scummvm-rg350-54cec2e011b56d875022ec6a6c05654b08300876.zip
Set up file paths to handle the differences between the file layout of the
Windows and Linux versions. (TODO: Handle game detection.) Added preliminary support for the P2_A.aif file that the Linux version uses, where the Windows version uses p2_a.voc. Someone will have to verify the actual format of it, and we have a silly bug in playVoice() which will have to be fixed before things work properly. svn-id: r15365
Diffstat (limited to 'saga/game.cpp')
-rw-r--r--saga/game.cpp34
1 files changed, 7 insertions, 27 deletions
diff --git a/saga/game.cpp b/saga/game.cpp
index dff6a692ca..f680f172f7 100644
--- a/saga/game.cpp
+++ b/saga/game.cpp
@@ -268,27 +268,11 @@ R_GAMEDESC GameDescs[] = {
static R_GAMEMODULE GameModule;
-void GAME_setGameDirectory(const char *gamedir) {
- assert(gamedir != NULL);
-
- debug(0, "Using game data path: %s", gamedir);
-
- strcpy(GameModule.game_dir, gamedir);
-}
-
int GAME_Register() {
return R_SUCCESS;
- // Register "gamedir" cfg cvar
- strncpy(GameModule.game_dir, "./", R_MAXPATH);
-
- if (CVAR_Register_S(GameModule.game_dir,
- "gamedir", NULL, R_CVAR_CFG, R_MAXPATH) != R_SUCCESS) {
- return R_FAILURE;
- }
-
// Register "g_language" cfg cvar
- strncpy(GameModule.game_dir, "us", R_MAXPATH);
+ strncpy(GameModule.game_language, "us", R_MAXPATH);
if (CVAR_Register_S(GameModule.game_language, "g_language",
NULL, R_CVAR_CFG, R_GAME_LANGSTR_LIMIT) != R_SUCCESS) {
@@ -305,16 +289,13 @@ int GAME_Register() {
int GAME_Init() {
uint16 game_n;
- char *game_dir;
-
- game_dir = GameModule.game_dir;
- if (DetectGame(game_dir, &game_n) != R_SUCCESS) {
+ if (DetectGame(&game_n) != R_SUCCESS) {
warning("No valid games were found in the specified directory.");
return R_FAILURE;
}
- if (LoadGame(game_dir, game_n) != R_SUCCESS) {
+ if (LoadGame(game_n) != R_SUCCESS) {
warning("Error loading game resource files.");
return R_FAILURE;
}
@@ -432,7 +413,7 @@ DetectedGameList GAME_ProbeGame(const FSList &fslist) {
return detectedGames;
}
-int DetectGame(const char *game_dir, uint16 *game_n_p) {
+int DetectGame(uint16 *game_n_p) {
uint16 game_count = ARRAYSIZE(GameDescs);
uint16 game_n;
@@ -442,7 +423,7 @@ int DetectGame(const char *game_dir, uint16 *game_n_p) {
int file_missing = 0;
- if ((game_dir == NULL) || (game_n_p == NULL)) {
+ if (game_n_p == NULL) {
return R_FAILURE;
}
@@ -473,14 +454,14 @@ int DetectGame(const char *game_dir, uint16 *game_n_p) {
return R_FAILURE;
}
-int LoadGame(const char *game_dir, uint16 game_n) {
+int LoadGame(uint16 game_n) {
R_RSCFILE_CONTEXT *load_ctxt;
uint16 game_count = ARRAYSIZE(GameDescs);
const char *game_fname;
uint16 game_filect;
uint16 i;
- if ((game_dir == NULL) || (game_n >= game_count)) {
+ if (game_n >= game_count) {
return R_FAILURE;
}
@@ -491,7 +472,6 @@ int LoadGame(const char *game_dir, uint16 game_n) {
return R_MEM;
}
- File::addDefaultDirectory(game_dir);
GameModule.gfile_n = game_filect;
// Load game resource files