[Scummvm-cvs-logs] CVS: scummvm/saga actionmap.cpp,1.30,1.31 actor.cpp,1.44,1.45 animation.cpp,1.27,1.28 events.cpp,1.33,1.34 font.cpp,1.19,1.20 game.cpp,1.32,1.33 game.h,1.13,1.14 ihnm_introproc.cpp,1.31,1.32 image.cpp,1.18,1.19 interface.cpp,1.40,1.41 isomap.cpp,1.21,1.22 ite_introproc.cpp,1.33,1.34 music.cpp,1.39,1.40 music.h,1.15,1.16 objectmap.cpp,1.28,1.29 palanim.cpp,1.17,1.18 render.cpp,1.41,1.42 rscfile.cpp,1.12,1.13 saga.cpp,1.72,1.73 saga.h,1.49,1.50 scene.cpp,1.59,1.60 script.cpp,1.34,1.35 sdebug.cpp,1.21,1.22 sndres.cpp,1.32,1.33 sndres.h,1.16,1.17 sound.cpp,1.16,1.17 sound.h,1.13,1.14 sprite.cpp,1.29,1.30 sthread.cpp,1.43,1.44 game_mod.h,1.12,NONE
Eugene Sandulenko
sev at users.sourceforge.net
Wed Dec 22 05:11:01 CET 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28091
Modified Files:
actionmap.cpp actor.cpp animation.cpp events.cpp font.cpp
game.cpp game.h ihnm_introproc.cpp image.cpp interface.cpp
isomap.cpp ite_introproc.cpp music.cpp music.h objectmap.cpp
palanim.cpp render.cpp rscfile.cpp saga.cpp saga.h scene.cpp
script.cpp sdebug.cpp sndres.cpp sndres.h sound.cpp sound.h
sprite.cpp sthread.cpp
Removed Files:
game_mod.h
Log Message:
o Moved GAME_* to SagaEngine object
o Renamed GAME_ITE_* to GID_ITE_*
o Renamed GID_ITE and GID_IHNM to GType_ITE and GType_IHNM
Index: actionmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actionmap.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- actionmap.cpp 15 Dec 2004 00:24:10 -0000 1.30
+++ actionmap.cpp 22 Dec 2004 13:09:37 -0000 1.31
@@ -28,7 +28,6 @@
#include "saga/console.h"
#include "saga/actionmap.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
namespace Saga {
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- actor.cpp 21 Dec 2004 10:30:49 -0000 1.44
+++ actor.cpp 22 Dec 2004 13:09:46 -0000 1.45
@@ -24,7 +24,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/game_mod.h"
#include "saga/console.h"
#include "saga/rscfile_mod.h"
#include "saga/script.h"
@@ -66,7 +65,7 @@
debug(9, "Actor::Actor()");
// Get actor resource file context
- _actorContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ _actorContext = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (_actorContext == NULL) {
error("Actor::Actor(): Couldn't load actor module resource context.");
}
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- animation.cpp 15 Dec 2004 00:24:10 -0000 1.27
+++ animation.cpp 22 Dec 2004 13:09:46 -0000 1.28
@@ -26,7 +26,6 @@
#include "saga/gfx.h"
#include "saga/console.h"
-#include "saga/game_mod.h"
#include "saga/events.h"
#include "saga/render.h"
@@ -89,7 +88,7 @@
new_anim->resdata = anim_resdata;
new_anim->resdata_len = anim_resdata_len;
- if (GAME_GetGameType() == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
if (getNumFrames(anim_resdata, anim_resdata_len, &new_anim->n_frames) != SUCCESS) {
warning("Anim::load Couldn't get animation frame count");
return FAILURE;
@@ -176,7 +175,7 @@
return FAILURE;
}
- GAME_GetDisplayInfo(&disp_info);
+ _vm->getDisplayInfo(&disp_info);
_vm->_render->getBufferInfo(&buf_info);
display_buf = buf_info.bg_buf;
@@ -191,7 +190,7 @@
if (anim->play_flag) {
frame = anim->current_frame;
- if (GAME_GetGameType() == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
result = ITE_DecodeFrame(anim->resdata, anim->resdata_len, anim->frame_offsets[frame - 1], display_buf,
disp_info.logical_w * disp_info.logical_h);
if (result != SUCCESS) {
@@ -346,7 +345,7 @@
return FAILURE;
}
- if (GAME_GetGameType() == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
free(anim->frame_offsets);
anim->frame_offsets = NULL;
}
@@ -385,7 +384,7 @@
ah.unknown07 = readS.readByte();
ah.nframes = readS.readByte();
- if (GAME_GetGameType() == GID_IHNM) {
+ if (_vm->_gameType == GType_IHNM) {
*n_frames = ah.nframes;
}
@@ -618,7 +617,7 @@
GAME_DISPLAYINFO di;
- GAME_GetDisplayInfo(&di);
+ _vm->getDisplayInfo(&di);
*nextf_p = NULL;
Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- events.cpp 15 Dec 2004 00:24:10 -0000 1.33
+++ events.cpp 22 Dec 2004 13:09:46 -0000 1.34
@@ -35,7 +35,6 @@
#include "saga/text.h"
#include "saga/palanim.h"
#include "saga/render.h"
-#include "saga/game_mod.h"
#include "saga/sndres.h"
#include "saga/music.h"
Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/font.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- font.cpp 15 Dec 2004 00:24:10 -0000 1.19
+++ font.cpp 22 Dec 2004 13:09:46 -0000 1.20
@@ -26,7 +26,6 @@
#include "saga/gfx.h"
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "saga/font.h"
#include "saga/stream.h"
@@ -38,13 +37,13 @@
int i;
// Load font module resource context
- _fontContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ _fontContext = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (_fontContext == NULL) {
error("Font::Font(): Couldn't get resource context.");
}
// Allocate font table
- GAME_GetFontInfo(&gamefonts, &_nFonts);
+ _vm->getFontInfo(&gamefonts, &_nFonts);
assert(_nFonts > 0);
Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- game.cpp 18 Dec 2004 16:08:59 -0000 1.32
+++ game.cpp 22 Dec 2004 13:09:46 -0000 1.33
@@ -33,31 +33,30 @@
#include "saga/interface.h"
#include "saga/scene.h"
-#include "saga/game_mod.h"
#include "saga/game.h"
namespace Saga {
// Inherit the Earth - DOS Demo version
-GAME_FILEDESC ITEDEMO_GameFiles[] = {
+static GAME_FILEDESC ITEDEMO_GameFiles[] = {
{"ITE.RSC", GAME_RESOURCEFILE},
{"ITE.DMO", GAME_DEMOFILE},
{"SCRIPTS.RSC", GAME_SCRIPTFILE},
{"VOICES.RSC", GAME_SOUNDFILE | GAME_VOICEFILE}
};
-GAME_FONTDESC ITEDEMO_GameFonts[] = {
+static GAME_FONTDESC ITEDEMO_GameFonts[] = {
{GAME_FONT_SMALL, 0},
{GAME_FONT_MEDIUM, 1}
};
-GAME_SOUNDINFO ITEDEMO_GameSound = {
+static GAME_SOUNDINFO ITEDEMO_GameSound = {
GAME_SOUND_VOC, 0, 0, 0
};
// Inherit the Earth - MAC Wyrmkeep Demo version
-GAME_FILEDESC ITEMACDEMO_GameFiles[] = {
+static GAME_FILEDESC ITEMACDEMO_GameFiles[] = {
{"ITED.RSC", GAME_RESOURCEFILE},
{"SCRIPTSD.RSC", GAME_SCRIPTFILE},
{"SOUNDSD.RSC", GAME_SOUNDFILE},
@@ -65,13 +64,13 @@
{"MUSICD.RSC", GAME_MUSICFILE}
};
-GAME_FONTDESC ITEMACDEMO_GameFonts[] = {
+static GAME_FONTDESC ITEMACDEMO_GameFonts[] = {
{GAME_FONT_MEDIUM, 0},
{GAME_FONT_SMALL, 2}
};
// Inherit the Earth - win32 Wyrmkeep Linux Demo version
-GAME_FILEDESC ITEWINDEMO_GameFiles[] = {
+static GAME_FILEDESC ITEWINDEMO_GameFiles[] = {
{"ITED.RSC", GAME_RESOURCEFILE},
{"SCRIPTSD.RSC", GAME_SCRIPTFILE},
{"SOUNDSD.RSC", GAME_SOUNDFILE},
@@ -79,13 +78,13 @@
{"MUSICD.RSC", GAME_MUSICFILE}
};
-GAME_FONTDESC ITEWINDEMO_GameFonts[] = {
+static GAME_FONTDESC ITEWINDEMO_GameFonts[] = {
{GAME_FONT_MEDIUM, 0},
{GAME_FONT_SMALL, 2}
};
// Inherit the Earth - win32 Wyrmkeep Demo version older release
-GAME_FILEDESC ITEWINDEMOOld_GameFiles[] = {
+static GAME_FILEDESC ITEWINDEMOOld_GameFiles[] = {
{"ITED.RSC", GAME_RESOURCEFILE},
{"SCRIPTSD.RSC", GAME_SCRIPTFILE},
{"SOUNDSD.RSC", GAME_SOUNDFILE},
@@ -93,45 +92,44 @@
};
// Inherit the Earth - Diskette version
-GAME_FILEDESC ITEDISK_GameFiles[] = {
+static GAME_FILEDESC ITEDISK_GameFiles[] = {
{"ITE.RSC", GAME_RESOURCEFILE},
{"SCRIPTS.RSC", GAME_SCRIPTFILE},
{"VOICES.RSC", GAME_SOUNDFILE | GAME_VOICEFILE}
};
-GAME_FONTDESC ITEDISK_GameFonts[] = {
+static GAME_FONTDESC ITEDISK_GameFonts[] = {
{GAME_FONT_MEDIUM, 0},
{GAME_FONT_LARGE, 1},
{GAME_FONT_SMALL, 2}
};
-GAME_RESOURCEDESC ITE_Resources = {
+static GAME_RESOURCEDESC ITE_Resources = {
ITE_SCENE_LUT, // Scene lookup table RN
ITE_SCRIPT_LUT, // Script lookup table RN
ITE_COMMAND_PANEL,
ITE_DIALOGUE_PANEL
};
-
-GAME_SOUNDINFO ITE_GameSound = {
+static GAME_SOUNDINFO ITE_GameSound = {
GAME_SOUND_VOC, 0, 0, 0
};
// Inherit the Earth - CD Enhanced version
-GAME_FILEDESC ITECD_GameFiles[] = {
+static GAME_FILEDESC ITECD_GameFiles[] = {
{"ITE.RSC", GAME_RESOURCEFILE},
{"SCRIPTS.RSC", GAME_SCRIPTFILE},
{"SOUNDS.RSC", GAME_SOUNDFILE},
{"VOICES.RSC", GAME_VOICEFILE}
};
-GAME_FONTDESC ITECD_GameFonts[] = {
+static GAME_FONTDESC ITECD_GameFonts[] = {
{GAME_FONT_MEDIUM, 0},
{GAME_FONT_LARGE, 1},
{GAME_FONT_SMALL, 2}
};
-GAME_SOUNDINFO ITECD_GameSound = {
+static GAME_SOUNDINFO ITECD_GameSound = {
GAME_SOUND_PCM,
22050,
16,
@@ -139,7 +137,7 @@
};
// I Have No Mouth and I Must Scream - Demo version
-GAME_FILEDESC IHNMDEMO_GameFiles[] = {
+static GAME_FILEDESC IHNMDEMO_GameFiles[] = {
{"SCREAM.RES", GAME_RESOURCEFILE},
{"SCRIPTS.RES", GAME_SCRIPTFILE},
{"SFX.RES", GAME_SOUNDFILE},
@@ -147,7 +145,7 @@
};
// I Have No Mouth and I Must Scream - Retail CD version
-GAME_FILEDESC IHNMCD_GameFiles[] = {
+static GAME_FILEDESC IHNMCD_GameFiles[] = {
{"MUSICFM.RES", GAME_MUSICFILE_FM},
{"MUSICGM.RES", GAME_MUSICFILE_GM},
{"SCREAM.RES", GAME_RESOURCEFILE},
@@ -162,7 +160,7 @@
{"VOICESS.RES", GAME_VOICEFILE}
};
-GAME_FONTDESC IHNMCD_GameFonts[] = {
+static GAME_FONTDESC IHNMCD_GameFonts[] = {
{GAME_FONT_MEDIUM, 2},
{GAME_FONT_LARGE, 3},
{GAME_FONT_SMALL, 4},
@@ -172,23 +170,23 @@
{GAME_FONT_LARGE3, 8}
};
-GAME_RESOURCEDESC IHNM_Resources = {
+static GAME_RESOURCEDESC IHNM_Resources = {
IHNM_SCENE_LUT, // Scene lookup table RN
IHNM_SCRIPT_LUT, // Script lookup table RN
IHNM_COMMAND_PANEL,
IHNM_DIALOGUE_PANEL
};
-GAME_SOUNDINFO IHNM_GameSound = {
+static GAME_SOUNDINFO IHNM_GameSound = {
GAME_SOUND_WAV, 0, 0, 0
};
-GAMEDESC GameDescs[] = {
+static GAMEDESC GameDescs[] = {
// Inherit the earth - DOS Demo version
{
"ite-demo",
- GID_ITE,
- GAME_ITE_DEMO, // Game id
+ GType_ITE,
+ GID_ITE_DEMO, // Game id
"Inherit the Earth (DOS Demo)", // Game title
320, 200, // Logical resolution
137, // Scene viewport height
@@ -205,28 +203,28 @@
// Inherit the earth - MAC Demo version
// Note: it should be before win32 version ???
{
- "ite-demo",
- GID_ITE,
- GAME_ITE_MACDEMO,
- "Inherit the Earth (MAC Demo)",
- 320, 200,
- 137,
- ITE_DEFAULT_SCENE,
- &ITE_Resources,
- ARRAYSIZE(ITEMACDEMO_GameFiles),
- ITEMACDEMO_GameFiles,
- ARRAYSIZE(ITEMACDEMO_GameFonts),
- ITEMACDEMO_GameFonts,
- &ITECD_GameSound,
- GF_VOX_VOICES | GF_BIG_ENDIAN_DATA
+ "ite-demo",
+ GType_ITE,
+ GID_ITE_MACDEMO,
+ "Inherit the Earth (MAC Demo)",
+ 320, 200,
+ 137,
+ ITE_DEFAULT_SCENE,
+ &ITE_Resources,
+ ARRAYSIZE(ITEMACDEMO_GameFiles),
+ ITEMACDEMO_GameFiles,
+ ARRAYSIZE(ITEMACDEMO_GameFonts),
+ ITEMACDEMO_GameFonts,
+ &ITECD_GameSound,
+ GF_VOX_VOICES | GF_BIG_ENDIAN_DATA
},
// Inherit the earth - Linux Demo version
// Note: it should be before win32 version
{
"ite-demo",
- GID_ITE,
- GAME_ITE_WINDEMO,
+ GType_ITE,
+ GID_ITE_WINDEMO,
"Inherit the Earth (Linux Demo)",
320, 200,
137,
@@ -243,8 +241,8 @@
// Inherit the earth - Win32 Demo version
{
"ite-demo",
- GID_ITE,
- GAME_ITE_WINDEMO,
+ GType_ITE,
+ GID_ITE_WINDEMO,
"Inherit the Earth (Win32 Demo)",
320, 200,
137,
@@ -262,8 +260,8 @@
// NOTE: it should be before floppy version
{
"ite",
- GID_ITE,
- GAME_ITE_CD,
+ GType_ITE,
+ GID_ITE_CD,
"Inherit the Earth (DOS CD Version)",
320, 200,
137,
@@ -280,8 +278,8 @@
// Inherit the earth - Disk version
{
"ite",
- GID_ITE,
- GAME_ITE_DISK,
+ GType_ITE,
+ GID_ITE_DISK,
"Inherit the Earth (DOS)",
320, 200,
137,
@@ -298,8 +296,8 @@
// I Have No Mouth And I Must Scream - Demo version
{
"ihnm-demo",
- GID_IHNM,
- GAME_IHNM_DEMO,
+ GType_IHNM,
+ GID_IHNM_DEMO,
"I Have No Mouth and I Must Scream (DOS Demo)",
640, 480,
7,
@@ -316,8 +314,8 @@
// I Have No Mouth And I Must Scream - CD version
{
"ihnm",
- GID_IHNM,
- GAME_IHNM_CD,
+ GType_IHNM,
+ GID_IHNM_CD,
"I Have No Mouth and I Must Scream (DOS)",
640, 480,
7,
@@ -334,26 +332,26 @@
static GAMEMODULE GameModule;
-int GAME_Init() {
+int SagaEngine::initGame() {
uint16 game_n;
- if (DetectGame(&game_n) != SUCCESS) {
+ if (detectGame(&game_n) != SUCCESS) {
warning("No valid games were found in the specified directory.");
return FAILURE;
}
- if (LoadGame(game_n) != SUCCESS) {
+ if (loadGame(game_n) != SUCCESS) {
warning("Error loading game resource files.");
return FAILURE;
}
// Load dialogue file
- LoadLanguage();
+ loadLanguage();
return SUCCESS;
}
-int LoadLanguage() {
+int SagaEngine::loadLanguage() {
char lang_file[MAXPATH];
uint16 game_n;
@@ -361,7 +359,7 @@
game_n = GameModule.game_number;
- if (GameDescs[game_n].gd_game_type == GID_ITE) {
+ if (GameDescs[game_n].gd_game_type == GType_ITE) {
snprintf(lang_file, MAXPATH, "%s%s.%s", GAME_ITE_LANG_PREFIX, GameModule.game_language, GAME_LANG_EXT);
if (!test_file.open(lang_file)) {
debug(0, "Couldn't open language file %s. Using default (US English)", lang_file);
@@ -390,7 +388,7 @@
return SUCCESS;
}
-RSCFILE_CONTEXT *GAME_GetFileContext(uint16 type, int param) {
+RSCFILE_CONTEXT *SagaEngine::getFileContext(uint16 type, int param) {
RSCFILE_CONTEXT *found_ctxt = NULL;
uint16 i;
@@ -452,7 +450,7 @@
return detectedGames;
}
-int DetectGame(uint16 *game_n_p) {
+int SagaEngine::detectGame(uint16 *game_n_p) {
uint16 game_count = ARRAYSIZE(GameDescs);
uint16 game_n;
@@ -493,7 +491,7 @@
return FAILURE;
}
-int LoadGame(uint16 game_n) {
+int SagaEngine::loadGame(uint16 game_n) {
RSCFILE_CONTEXT *load_ctxt;
uint16 game_count = ARRAYSIZE(GameDescs);
const char *game_fname;
@@ -534,37 +532,26 @@
GameModule.gd_fontct = GameDescs[game_n].gd_fontct;
GameModule.gd_fontdescs = GameDescs[game_n].gd_fontdescs;
- // Finish initialization
- GameModule.game_init = 1;
+ _gameId = GameModule.gamedesc->gd_game_id;
+ _gameType = GameModule.gamedesc->gd_game_type;
+ _features = GameModule.gamedesc->features;
return SUCCESS;
}
-int GAME_GetResourceInfo(GAME_RESOURCEDESC *rsc_desc) {
- assert(rsc_desc != NULL);
-
- *rsc_desc = *GameModule.gamedesc->gd_resource_desc;
-
- return SUCCESS;
+const GAME_RESOURCEDESC SagaEngine::getResourceInfo(void) {
+ return *GameModule.gamedesc->gd_resource_desc;
}
-int GAME_GetSoundInfo(GAME_SOUNDINFO *snd_info) {
- assert(snd_info != NULL);
-
- *snd_info = *GameModule.gamedesc->gd_soundinfo;
-
- return SUCCESS;
+const GAME_SOUNDINFO SagaEngine::getSoundInfo(void) {
+ return *GameModule.gamedesc->gd_soundinfo;
}
-int GAME_GetDisplayInfo(GAME_DISPLAYINFO *disp_info) {
+int SagaEngine::getDisplayInfo(GAME_DISPLAYINFO *disp_info) {
int game_n;
assert(disp_info != NULL);
- if (!GameModule.game_init) {
- return FAILURE;
- }
-
game_n = GameModule.game_number;
disp_info->logical_w = GameDescs[game_n].gd_logical_w;
@@ -574,7 +561,7 @@
return SUCCESS;
}
-int GAME_GetFontInfo(GAME_FONTDESC **gf_desc, int *font_n) {
+int SagaEngine::getFontInfo(GAME_FONTDESC **gf_desc, int *font_n) {
assert((gf_desc != NULL) && (font_n != NULL));
*gf_desc = GameModule.gd_fontdescs;
@@ -583,7 +570,7 @@
return SUCCESS;
}
-int GAME_GetSceneInfo(GAME_SCENEDESC *gs_desc) {
+int SagaEngine::getSceneInfo(GAME_SCENEDESC *gs_desc) {
assert(gs_desc != NULL);
gs_desc->first_scene = GameModule.gamedesc->gd_startscene;
@@ -592,16 +579,4 @@
return SUCCESS;
}
-GAME_IDS GAME_GetGame() {
- return GameModule.gamedesc->gd_game_id;
-}
-
-SAGAGameId GAME_GetGameType() {
- return GameModule.gamedesc->gd_game_type;
-}
-
-uint32 GAME_GetFeatures() {
- return GameModule.gamedesc->features;
-}
-
} // End of namespace Saga
Index: game.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- game.h 15 Dec 2004 00:24:11 -0000 1.13
+++ game.h 22 Dec 2004 13:09:47 -0000 1.14
@@ -26,7 +26,7 @@
#ifndef SAGA_GAME_H_
#define SAGA_GAME_H_
-#include "base/plugins.h"
+#include "saga/saga.h"
namespace Saga {
@@ -47,7 +47,7 @@
struct GAMEDESC {
const char *name;
- SAGAGameId gd_game_type;
+ SAGAGameType gd_game_type;
GAME_IDS gd_game_id;
const char *gd_title;
int gd_logical_w;
@@ -75,7 +75,6 @@
};
struct GAMEMODULE {
- int game_init;
int game_number;
GAMEDESC *gamedesc;
int g_skipintro;
@@ -88,9 +87,7 @@
const char *err_str;
};
-int LoadLanguage();
-int LoadGame(uint16 game_n_p);
-int DetectGame(uint16 *game_n_p);
+DetectedGameList GAME_ProbeGame(const FSList &fslist);
} // End of namespace Saga
Index: ihnm_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ihnm_introproc.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- ihnm_introproc.cpp 15 Dec 2004 00:24:11 -0000 1.31
+++ ihnm_introproc.cpp 22 Dec 2004 13:09:47 -0000 1.32
@@ -105,7 +105,7 @@
// it will cause the end titles music to play, which is wrong. (But
// hey, it's a nice piece of music!)
- GAME_GetSceneInfo(&gs_desc);
+ _vm->getSceneInfo(&gs_desc);
first_scene.load_flag = BY_SCENE;
first_scene.scene_n = gs_desc.first_scene;
Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/image.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- image.cpp 15 Dec 2004 00:24:11 -0000 1.18
+++ image.cpp 22 Dec 2004 13:09:47 -0000 1.19
@@ -24,8 +24,6 @@
// SAGA Image resource management routines
#include "saga/saga.h"
-#include "saga/game_mod.h"
-
#include "saga/image.h"
#include "saga/stream.h"
@@ -94,7 +92,7 @@
unbankBGImage(out_buf, decode_buf, hdr.width, hdr.height);
// For some reason bg images in IHNM are upside down
- if (GAME_GetGameType() == GID_IHNM) {
+ if (_vm->_gameType == GType_IHNM) {
flipImage(out_buf, hdr.width, hdr.height);
}
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- interface.cpp 19 Dec 2004 13:38:11 -0000 1.40
+++ interface.cpp 22 Dec 2004 13:09:47 -0000 1.41
@@ -25,7 +25,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/game_mod.h"
#include "saga/actor.h"
#include "saga/console.h"
#include "saga/font.h"
@@ -164,7 +163,6 @@
Interface::Interface(SagaEngine *vm) : _vm(vm), _initialized(false) {
GAME_RESOURCEDESC g_resdesc;
- int game_type;
int result;
if (_initialized) {
@@ -178,20 +176,19 @@
}
// Load interface module resource file context
- _interfaceContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ _interfaceContext = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (_interfaceContext == NULL) {
return;
}
// Initialize interface data by game type
- game_type = GAME_GetGameType();
- if (game_type == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
// Load Inherit the Earth interface desc
_cPanel.buttons = ITE_c_buttons;
_cPanel.nbuttons = ARRAYSIZE(ITE_c_buttons);
_iDesc = ITE_interface;
- } else if (game_type == GID_IHNM) {
+ } else if (_vm->_gameType == GType_IHNM) {
// Load I Have No Mouth interface desc
_cPanel.buttons = IHNM_c_buttons;
_cPanel.nbuttons = ARRAYSIZE(IHNM_c_buttons);
@@ -201,7 +198,7 @@
}
// Load interface resources
- GAME_GetResourceInfo(&g_resdesc);
+ g_resdesc = _vm->getResourceInfo();
// Load command panel resource
result = RSC_LoadResource(_interfaceContext, g_resdesc.command_panel_rn,
@@ -330,7 +327,7 @@
}
// Get game display info
- GAME_GetDisplayInfo(&g_di);
+ _vm->getDisplayInfo(&g_di);
drawStatusBar(back_buf);
@@ -390,7 +387,7 @@
back_buf = _vm->_gfx->getBackBuffer();
// Get game display info
- GAME_GetDisplayInfo(&g_di);
+ _vm->getDisplayInfo(&g_di);
if (_panelMode == kPanelCommand) {
// Update playfield space ( only if cursor is inside )
@@ -425,12 +422,12 @@
// Disable this for IHNM for now, since that game uses the full screen
// in some cases.
- if (GAME_GetGameType() == GID_IHNM) {
+ if (_vm->_gameType == GType_IHNM) {
return SUCCESS;
}
// Get game display info
- GAME_GetDisplayInfo(&g_di);
+ _vm->getDisplayInfo(&g_di);
// Erase background of status bar
rect.left = 0;
Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- isomap.cpp 15 Dec 2004 00:24:11 -0000 1.21
+++ isomap.cpp 22 Dec 2004 13:09:47 -0000 1.22
@@ -24,7 +24,6 @@
// Isometric level module
#include "saga/saga.h"
-#include "saga/game_mod.h"
#include "saga/gfx.h"
#include "saga/isomap.h"
@@ -134,7 +133,8 @@
int IsoMap::draw(SURFACE *dst_s) {
GAME_DISPLAYINFO disp_info;
- GAME_GetDisplayInfo(&disp_info);
+
+ _vm->getDisplayInfo(&disp_info);
Rect iso_rect(disp_info.logical_w, disp_info.scene_h);
drawRect(dst_s, &iso_rect, 0);
drawMetamap(dst_s, -1000, -500);
Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- ite_introproc.cpp 18 Dec 2004 16:08:59 -0000 1.33
+++ ite_introproc.cpp 22 Dec 2004 13:09:47 -0000 1.34
@@ -30,7 +30,6 @@
#include "saga/animation.h"
#include "saga/events.h"
#include "saga/font.h"
-#include "saga/game_mod.h"
#include "saga/rscfile_mod.h"
#include "saga/sndres.h"
#include "saga/text.h"
@@ -137,7 +136,7 @@
_vm->_scene->queueScene(&tempScene);
}
- GAME_GetSceneInfo(&gs_desc);
+ _vm->getSceneInfo(&gs_desc);
first_scene.load_flag = BY_SCENE;
first_scene.scene_n = gs_desc.first_scene;
Index: music.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/music.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- music.cpp 17 Dec 2004 11:18:56 -0000 1.39
+++ music.cpp 22 Dec 2004 13:09:47 -0000 1.40
@@ -24,7 +24,6 @@
#include "saga/music.h"
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
#include "sound/audiostream.h"
#include "sound/mididrv.h"
@@ -298,7 +297,7 @@
_musicInitialized = 1;
_mixer->setMusicVolume(ConfMan.getInt("music_volume"));
- if (GAME_GetGameType() == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
File file;
byte footerBuf[ARRAYSIZE(_digiTableITECD) * 8];
@@ -314,7 +313,7 @@
// Proper approach would be to extend resource manager so it could
// return File object.
- _musicContext = GAME_GetFileContext(GAME_MUSICFILE, 0);
+ _musicContext = _vm->getFileContext(GAME_MUSICFILE, 0);
if (_musicContext != NULL) {
_hasDigiMusic = true;
@@ -407,7 +406,7 @@
MidiParser *parser;
File midiFile;
- if (GAME_GetGameType() == GID_ITE) {
+ if (_vm->_gameType == GType_ITE) {
if (music_rn >= 9 && music_rn <= 34) {
if (flags == MUSIC_DEFAULT) {
flags = _midiTableITECD[music_rn - 9].flags;
@@ -457,8 +456,8 @@
} else {
// Load MIDI/XMI resource data
- if (GAME_GetGameType() == GID_ITE) {
- rsc_ctxt = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ if (_vm->_gameType == GType_ITE) {
+ rsc_ctxt = _vm->getFileContext(GAME_RESOURCEFILE, 0);
} else {
// I've listened to music from both the FM and the GM
// file, and I've tentatively reached the conclusion
@@ -484,9 +483,9 @@
// different in the two files. I have no idea why.
if (hasAdlib()) {
- rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_FM, 0);
+ rsc_ctxt = _vm->getFileContext(GAME_MUSICFILE_FM, 0);
} else {
- rsc_ctxt = GAME_GetFileContext(GAME_MUSICFILE_GM, 0);
+ rsc_ctxt = _vm->getFileContext(GAME_MUSICFILE_GM, 0);
}
_player->setGM(true);
Index: music.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/music.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- music.h 20 Nov 2004 17:19:15 -0000 1.15
+++ music.h 22 Dec 2004 13:09:47 -0000 1.16
@@ -27,7 +27,6 @@
#define SAGA_MUSIC_H_
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "sound/mixer.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
Index: objectmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/objectmap.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- objectmap.cpp 15 Dec 2004 00:24:11 -0000 1.28
+++ objectmap.cpp 22 Dec 2004 13:09:47 -0000 1.29
@@ -32,7 +32,6 @@
#include "saga/console.h"
#include "saga/font.h"
#include "saga/objectmap.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
namespace Saga {
Index: palanim.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/palanim.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- palanim.cpp 15 Dec 2004 00:24:11 -0000 1.17
+++ palanim.cpp 22 Dec 2004 13:09:47 -0000 1.18
@@ -26,7 +26,6 @@
#include "saga/gfx.h"
#include "saga/events.h"
-#include "saga/game_mod.h"
#include "saga/palanim.h"
#include "saga/stream.h"
@@ -57,7 +56,7 @@
MemoryReadStreamEndian readS(resdata, resdata_len, IS_BIG_ENDIAN);
- if (GAME_GetGameType() == GID_IHNM) {
+ if (_vm->_gameType == GType_IHNM) {
return SUCCESS;
}
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- render.cpp 18 Dec 2004 20:33:02 -0000 1.41
+++ render.cpp 22 Dec 2004 13:09:47 -0000 1.42
@@ -27,7 +27,6 @@
#include "saga/gfx.h"
#include "saga/actor.h"
#include "saga/font.h"
-#include "saga/game_mod.h"
#include "saga/interface.h"
#include "saga/scene.h"
#include "saga/text.h"
@@ -51,7 +50,7 @@
int tmp_w, tmp_h, tmp_bytepp;
// Initialize system graphics
- GAME_GetDisplayInfo(&disp_info);
+ _vm->getDisplayInfo(&disp_info);
// Initialize FPS timer callback
g_timer->installTimerProc(&fpsTimerCallback, 1000000, this);
@@ -119,7 +118,7 @@
mouse_pt = _vm->getMousePos();
_vm->_scene->getBGInfo(&bg_info);
- GAME_GetDisplayInfo(&disp_info);
+ _vm->getDisplayInfo(&disp_info);
bg_pt.x = 0;
bg_pt.y = 0;
Index: rscfile.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/rscfile.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- rscfile.cpp 15 Dec 2004 00:24:11 -0000 1.12
+++ rscfile.cpp 22 Dec 2004 13:09:47 -0000 1.13
@@ -26,7 +26,6 @@
#include "saga/rscfile_mod.h"
#include "saga/rscfile.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
namespace Saga {
Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- saga.cpp 21 Dec 2004 06:49:07 -0000 1.72
+++ saga.cpp 22 Dec 2004 13:09:47 -0000 1.73
@@ -40,7 +40,6 @@
#include "saga/console.h"
#include "saga/events.h"
#include "saga/font.h"
-#include "saga/game_mod.h"
#include "saga/game.h"
#include "saga/interface.h"
#include "saga/isomap.h"
@@ -51,7 +50,6 @@
#include "saga/sprite.h"
#include "saga/sound.h"
#include "saga/music.h"
-#include "saga/game_mod.h"
#include "saga/palanim.h"
static const GameSettings saga_games[] = {
@@ -142,7 +140,7 @@
// Process command line
// Detect game and open resource files
- if (GAME_Init() != SUCCESS) {
+ if (initGame() != SUCCESS) {
return -1;
}
@@ -171,7 +169,7 @@
// Initialize graphics
GAME_DISPLAYINFO disp_info;
- GAME_GetDisplayInfo(&disp_info);
+ getDisplayInfo(&disp_info);
_gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h, detector);
// Graphics driver should be initialized before console
Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- saga.h 21 Dec 2004 08:03:32 -0000 1.49
+++ saga.h 22 Dec 2004 13:09:47 -0000 1.50
@@ -28,6 +28,8 @@
#include "common/scummsys.h"
#include "base/engine.h"
#include "base/gameDetector.h"
+#include "base/plugins.h"
+
#include "common/util.h"
#include "common/stream.h"
#include "common/rect.h"
@@ -72,9 +74,9 @@
SUCCESS = 0
};
-enum SAGAGameId {
- GID_ITE,
- GID_IHNM
+enum SAGAGameType {
+ GType_ITE,
+ GType_IHNM
};
enum scriptTimings {
@@ -86,6 +88,84 @@
Point *points;
};
+
+#define IS_BIG_ENDIAN ((_vm->_features & GF_BIG_ENDIAN_DATA) != 0)
+#define IS_MAC_VERSION (_vm->_gameId == GID_ITE_MACDEMO)
+
+
+enum GAME_IDS {
+ GID_ITE_DEMO = 0,
+ GID_ITE_DISK = 1,
+ GID_ITE_CD = 2,
+ GID_IHNM_DEMO = 3,
+ GID_IHNM_CD = 4,
+ GID_ITE_WINDEMO = 5,
+ GID_ITE_MACDEMO = 6
+};
+
+enum GAME_FILETYPES {
+ GAME_RESOURCEFILE = 0x01,
+ GAME_SCRIPTFILE = 0x02,
+ GAME_SOUNDFILE = 0x04,
+ GAME_VOICEFILE = 0x08,
+ GAME_DEMOFILE = 0x10,
+ GAME_MUSICFILE = 0x20,
+ GAME_MUSICFILE_GM = 0x40,
+ GAME_MUSICFILE_FM = 0x80
+};
+
+enum GAME_SOUNDINFO_TYPES {
+ GAME_SOUND_PCM = 0,
+ GAME_SOUND_VOC,
+ GAME_SOUND_WAV,
+ GAME_SOUND_VOX
+};
+
+enum GAME_FONT_IDS {
+ GAME_FONT_SMALL = 0,
+ GAME_FONT_MEDIUM,
+ GAME_FONT_LARGE,
+ GAME_FONT_SMALL2,
+ GAME_FONT_MEDIUM2,
+ GAME_FONT_LARGE2,
+ GAME_FONT_LARGE3
+};
+
+enum GAME_FEATURES {
+ GF_VOX_VOICES = 1,
+ GF_BIG_ENDIAN_DATA = 2
+};
+
+struct GAME_DISPLAYINFO {
+ int logical_w;
+ int logical_h;
+ int scene_h;
+};
+
+struct GAME_SOUNDINFO {
+ int res_type;
+ long freq;
+ int sample_size;
+ int stereo;
+};
+
+struct GAME_FONTDESC {
+ uint16 font_id;
+ uint32 font_rn;
+};
+
+struct GAME_SCENEDESC {
+ uint32 scene_lut_rn;
+ uint32 first_scene;
+};
+
+struct GAME_RESOURCEDESC {
+ uint32 scene_lut_rn;
+ uint32 script_lut_rn;
+ uint32 command_panel_rn;
+ uint32 dialogue_panel_rn;
+};
+
inline int ticksToMSec(int tick) {
return tick * 1000 / kScriptTimeTicksPerSecond;
}
@@ -106,6 +186,10 @@
int _soundEnabled;
int _musicEnabled;
+ int _gameId;
+ int _gameType;
+ uint32 _features;
+
SndRes *_sndRes;
Sound *_sound;
Music *_music;
@@ -159,8 +243,23 @@
int processInput(void);
Point getMousePos();
- private:
+private:
Point _mousePos;
+
+public:
+ int initGame();
+ RSCFILE_CONTEXT *getFileContext(uint16 type, int param);
+ int getFontInfo(GAME_FONTDESC **, int *);
+ const GAME_RESOURCEDESC getResourceInfo(void);
+ const GAME_SOUNDINFO getSoundInfo(void);
+ int getDisplayInfo(GAME_DISPLAYINFO *disp_info);
+ int getSceneInfo(GAME_SCENEDESC *);
+
+private:
+ int loadLanguage();
+ int loadGame(uint16 game_n_p);
+ int detectGame(uint16 *game_n_p);
+
};
// FIXME: Global var. We use it until everything will be turned into objects
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- scene.cpp 19 Dec 2004 13:38:11 -0000 1.59
+++ scene.cpp 22 Dec 2004 13:09:47 -0000 1.60
@@ -25,7 +25,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/game_mod.h"
#include "saga/animation.h"
#include "saga/console.h"
#include "saga/interface.h"
@@ -55,10 +54,10 @@
int i;
// Load game-specific scene data
- GAME_GetSceneInfo(&gs_desc);
+ _vm->getSceneInfo(&gs_desc);
// Load scene module resource context
- _sceneContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ _sceneContext = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (_sceneContext == NULL) {
warning("Scene::Scene(): Couldn't load scene resource context");
return;
@@ -173,11 +172,11 @@
event.op = EVENT_HIDE;
_vm->_events->queue(&event);
- switch (GAME_GetGameType()) {
- case GID_ITE:
+ switch (_vm->_gameType) {
+ case GType_ITE:
ITEStartProc();
break;
- case GID_IHNM:
+ case GType_IHNM:
IHNMStartProc();
break;
default:
@@ -334,7 +333,7 @@
bginfo->bg_h = _bg.h;
bginfo->bg_p = _bg.p;
- GAME_GetDisplayInfo(&di);
+ _vm->getDisplayInfo(&di);
x = 0;
y = 0;
@@ -784,7 +783,7 @@
assert(_initialized);
_vm->_render->getBufferInfo(&buf_info);
- GAME_GetDisplayInfo(&disp_info);
+ _vm->getDisplayInfo(&disp_info);
bg_pt.x = 0;
bg_pt.y = 0;
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- script.cpp 21 Dec 2004 06:49:07 -0000 1.34
+++ script.cpp 22 Dec 2004 13:09:47 -0000 1.35
@@ -26,7 +26,6 @@
#include "saga/gfx.h"
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "saga/console.h"
#include "saga/script.h"
@@ -55,17 +54,17 @@
_skipSpeeches = false;
memset(_dataBuf, 0, sizeof(_dataBuf));
- GAME_GetResourceInfo(&gr_desc);
+ gr_desc = _vm->getResourceInfo();
debug(0, "Initializing scripting subsystem");
// Load script resource file context
- _scriptContext = GAME_GetFileContext(GAME_SCRIPTFILE, 0);
+ _scriptContext = _vm->getFileContext(GAME_SCRIPTFILE, 0);
if (_scriptContext == NULL) {
error("Couldn't get script file context");
}
// Load script LUT resource
- s_lut_ctxt = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ s_lut_ctxt = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (s_lut_ctxt == NULL) {
error("Couldn't get resource file context");
}
@@ -156,7 +155,7 @@
uint32 voicelut_rn;
int result;
- if (GAME_GetGameType() == GID_IHNM) {
+ if (_vm->_gameType == GType_IHNM) {
return SUCCESS;
}
Index: sdebug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sdebug.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- sdebug.cpp 21 Dec 2004 06:49:07 -0000 1.21
+++ sdebug.cpp 22 Dec 2004 13:09:47 -0000 1.22
@@ -30,7 +30,6 @@
#include "saga/font.h"
#include "saga/script.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
namespace Saga {
Index: sndres.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sndres.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- sndres.cpp 15 Dec 2004 00:24:11 -0000 1.32
+++ sndres.cpp 22 Dec 2004 13:09:47 -0000 1.33
@@ -25,7 +25,6 @@
#include "saga/saga.h"
-#include "saga/game_mod.h"
#include "saga/rscfile_mod.h"
#include "saga/sndres.h"
@@ -40,18 +39,18 @@
SndRes::SndRes(SagaEngine *vm) : _vm(vm) {
/* Load sound module resource file contexts */
- _sfx_ctxt = GAME_GetFileContext(GAME_SOUNDFILE, 0);
+ _sfx_ctxt = _vm->getFileContext(GAME_SOUNDFILE, 0);
if (_sfx_ctxt == NULL) {
return;
}
- _voice_ctxt = GAME_GetFileContext(GAME_VOICEFILE, 0);
+ _voice_ctxt = _vm->getFileContext(GAME_VOICEFILE, 0);
if (_voice_ctxt == NULL) {
return;
}
// Grab sound resource information for the current game
- GAME_GetSoundInfo(&_snd_info);
+ _snd_info = _vm->getSoundInfo();
_init = 1;
}
@@ -78,7 +77,7 @@
debug(0, "SndRes::playVoice(%ld)", voice_rn);
- if (GAME_GetGameType() == GID_ITE && voice_rn == 4) {
+ if (_vm->_gameType == GType_ITE && voice_rn == 4) {
// The Wyrmkeep release of Inherit the Earth provides a
// separate file (p2_a.voc or P2_A.iaf), to correct voice 4 in
// the intro. Use that, if available.
@@ -122,7 +121,7 @@
return FAILURE;
}
- if (GAME_GetFeatures() & GF_VOX_VOICES && !voiceFile)
+ if (_vm->_features & GF_VOX_VOICES && !voiceFile)
_vm->_sound->playVoxVoice(&snd_buffer);
else
_vm->_sound->playVoice(&snd_buffer);
@@ -274,7 +273,7 @@
// (p2_a.voc or P2_A.iaf), to correct voice 4 in the intro. Use that,
// if available.
- if (GAME_GetGameType() == GID_ITE && voice_rn == 4) {
+ if (_vm->_gameType == GType_ITE && voice_rn == 4) {
if (f.open("p2_a.voc")) {
result = SUCCESS;
length = f.size();
@@ -298,7 +297,7 @@
}
}
- if (GAME_GetFeatures() & GF_VOX_VOICES && !voiceFile) {
+ if (_vm->_features & GF_VOX_VOICES && !voiceFile) {
// Rough hack, fix this to be accurate
ms_f = (double)length / 22050 * 2000.0;
ms_i = (int)ms_f;
Index: sndres.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sndres.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- sndres.h 11 Dec 2004 23:36:17 -0000 1.16
+++ sndres.h 22 Dec 2004 13:09:47 -0000 1.17
@@ -27,7 +27,6 @@
#define SAGA_SNDRES_H_
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "saga/sound.h"
namespace Saga {
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sound.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- sound.cpp 26 Nov 2004 13:28:00 -0000 1.16
+++ sound.cpp 22 Dec 2004 13:09:47 -0000 1.17
@@ -23,7 +23,6 @@
#include "saga/saga.h"
#include "saga/sound.h"
-#include "saga/game_mod.h"
#include "sound/audiostream.h"
#include "sound/mixer.h"
@@ -172,19 +171,6 @@
if (!buf->s_signed)
flags |= SoundMixer::FLAG_UNSIGNED;
- // FIXME: Remove the code below if the code above works.
-
-#if 0
- int game_id = GAME_GetGame();
-
- if((game_id == GAME_ITE_DISK) || (game_id == GAME_ITE_DEMO)) {
- flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE;
- } else {
- flags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS |
- SoundMixer::FLAG_LITTLE_ENDIAN;
- }
-#endif
-
_mixer->playRaw(handle, buf->s_buf, buf->s_buf_len, buf->s_freq, flags, -1, volume);
return SUCCESS;
Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sound.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sound.h 26 Nov 2004 13:28:00 -0000 1.13
+++ sound.h 22 Dec 2004 13:09:47 -0000 1.14
@@ -27,7 +27,6 @@
#define SAGA_SOUND_H_
#include "saga/rscfile_mod.h"
-#include "saga/game_mod.h"
#include "sound/mixer.h"
namespace Saga {
Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- sprite.cpp 21 Dec 2004 16:12:03 -0000 1.29
+++ sprite.cpp 22 Dec 2004 13:09:47 -0000 1.30
@@ -24,7 +24,6 @@
// Sprite management module
#include "saga/saga.h"
-#include "saga/game_mod.h"
#include "saga/gfx.h"
#include "saga/scene.h"
#include "saga/rscfile_mod.h"
@@ -41,7 +40,7 @@
debug(0, "Initializing sprite subsystem...");
// Load sprite module resource context
- _spriteContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0);
+ _spriteContext = _vm->getFileContext(GAME_RESOURCEFILE, 0);
if (_spriteContext == NULL) {
return;
}
Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- sthread.cpp 21 Dec 2004 06:49:07 -0000 1.43
+++ sthread.cpp 22 Dec 2004 13:09:47 -0000 1.44
@@ -31,7 +31,6 @@
#include "saga/script.h"
#include "saga/sdata.h"
-#include "saga/game_mod.h"
#include "saga/stream.h"
#include "saga/scene.h"
#include "saga/resnames.h"
@@ -763,7 +762,7 @@
}
// now data contains last string index
- if (GAME_GetGame() == GAME_ITE_DISK) { // special ITE dos
+ if (_vm->_gameId == GID_ITE_DISK) { // special ITE dos
if ((_vm->_scene->currentSceneNumber() == ITE_DEFAULT_SCENE) && (data >= 288) && (data <= (SCENE1_VOICE_138 - SCENE1_VOICE_009 + 288))) {
sampleResourceId = SCENE1_VOICE_009 + data - 288;
}
--- game_mod.h DELETED ---
More information about the Scummvm-git-logs
mailing list