aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/actor.cpp3
-rw-r--r--engines/saga/actor_walk.cpp5
-rw-r--r--engines/saga/detection.cpp4
-rw-r--r--engines/saga/detection_tables.h138
-rw-r--r--engines/saga/gfx.cpp4
-rw-r--r--engines/saga/interface.cpp9
-rw-r--r--engines/saga/interface.h4
-rw-r--r--engines/saga/isomap.cpp9
-rw-r--r--engines/saga/isomap.h2
-rw-r--r--engines/saga/ite_introproc.cpp108
-rw-r--r--engines/saga/itedata.cpp149
-rw-r--r--engines/saga/music.cpp20
-rw-r--r--engines/saga/palanim.cpp21
-rw-r--r--engines/saga/puzzle.cpp18
-rw-r--r--engines/saga/saga.cpp35
-rw-r--r--engines/saga/saga.h16
-rw-r--r--engines/saga/sagaresnames.h274
-rw-r--r--engines/saga/saveload.cpp1
-rw-r--r--engines/saga/scene.cpp1
-rw-r--r--engines/saga/scene.h14
-rw-r--r--engines/saga/sfuncs.cpp1
-rw-r--r--engines/saga/sndres.cpp16
-rw-r--r--engines/saga/sprite.cpp6
-rw-r--r--engines/saga/sthread.cpp8
24 files changed, 320 insertions, 546 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 52b921d000..96d901fbba 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -31,7 +31,6 @@
#include "saga/events.h"
#include "saga/isomap.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/script.h"
#include "saga/sndres.h"
@@ -997,7 +996,7 @@ void Actor::createDrawOrderList() {
}
bool Actor::getSpriteParams(CommonObjectData *commonObjectData, int &frameNumber, SpriteList *&spriteList) {
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
if (!(commonObjectData->_flags & kProtagonist)){
// warning("not protagonist");
return false;
diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp
index 0c573c0c40..d62c1c61d7 100644
--- a/engines/saga/actor_walk.cpp
+++ b/engines/saga/actor_walk.cpp
@@ -30,7 +30,6 @@
#include "saga/events.h"
#include "saga/isomap.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
#include "saga/script.h"
#include "saga/sound.h"
#include "saga/scene.h"
@@ -209,7 +208,7 @@ void Actor::updateActorsScene(int actorsEntrance) {
actor->_finalTarget = actor->_location;
_centerActor = _protagonist = actor;
} else if (_vm->getGameType() == GType_ITE &&
- _vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ _vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
continue;
}
@@ -416,7 +415,7 @@ void Actor::handleActions(int msec, bool setup) {
speed = 4;
}
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
speed = 2;
}
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index b7d2a3aa39..7fd1024405 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -36,7 +36,6 @@
#include "saga/rscfile.h"
#include "saga/interface.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
namespace Saga {
struct SAGAGameDescription {
@@ -63,10 +62,7 @@ const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->s
const GameSoundInfo *SagaEngine::getMusicInfo() const {
static GameSoundInfo musicInfo;
musicInfo.resourceType = kSoundPCM;
- musicInfo.frequency = 11025;
musicInfo.sampleBits = 16;
- // The digital music in the ITE Mac demo version is not stereo
- musicInfo.stereo = _gameDescription->gameType == GID_ITE_MACDEMO2 ? false : true;
musicInfo.isBigEndian = false;
musicInfo.isSigned = true;
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 0017f34957..cbc3152f70 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -28,71 +28,81 @@
namespace Saga {
static const GameResourceDescription ITE_Resources = {
- RID_ITE_SCENE_LUT, // Scene lookup table RN
- RID_ITE_SCRIPT_LUT, // Script lookup table RN
- RID_ITE_MAIN_PANEL,
- RID_ITE_CONVERSE_PANEL,
- RID_ITE_OPTION_PANEL,
- 0, // Warning panel (IHNM only)
- 0, // Warning panel sprites (IHNM only)
- RID_ITE_MAIN_SPRITES,
- RID_ITE_MAIN_PANEL_SPRITES,
- 0, // Option panel sprites (IHNM only)
- RID_ITE_DEFAULT_PORTRAITS,
- 0, // Psychic profile background (IHNM only)
- RID_ITE_MAIN_STRINGS,
- RID_ITE_ACTOR_NAMES
+ 1806, // Scene lookup table RN
+ 216, // Script lookup table RN
+ 3, // Main panel
+ 4, // Converse panel
+ 5, // Option panel
+ 6, // Main sprites
+ 7, // Main panel sprites
+ 35, // Main strings
+ // ITE specific resources
+ 36, // Actor names
+ 125, // Default portraits
+ // IHNM specific resources
+ 0, // Option panel sprites
+ 0, // Warning panel
+ 0, // Warning panel sprites
+ 0 // Psychic profile background
};
+// FIXME: Option panel should be 4 but it is an empty resource.
+// Proper fix would be to not load the options panel when the demo is running
static const GameResourceDescription ITEDemo_Resources = {
- RID_ITEDEMO_SCENE_LUT, // Scene lookup table RN
- RID_ITEDEMO_SCRIPT_LUT, // Script lookup table RN
- RID_ITEDEMO_MAIN_PANEL,
- RID_ITEDEMO_CONVERSE_PANEL,
- RID_ITEDEMO_OPTION_PANEL,
- 0, // Warning panel (IHNM only)
- 0, // Warning panel sprites (IHNM only)
- RID_ITEDEMO_MAIN_SPRITES,
- RID_ITEDEMO_MAIN_PANEL_SPRITES,
- 0, // Option panel sprites (IHNM only)
- RID_ITEDEMO_DEFAULT_PORTRAITS,
- 0, // Psychic profile background (IHNM only)
- RID_ITEDEMO_MAIN_STRINGS,
- RID_ITEDEMO_ACTOR_NAMES
+ 318, // Scene lookup table RN
+ 146, // Script lookup table RN
+ 2, // Main panel
+ 3, // Converse panel
+ 3, // Option panel
+ 5, // Main sprites
+ 6, // Main panel sprites
+ 8, // Main strings
+ // ITE specific resources
+ 9, // Actor names
+ 80, // Default portraits
+ // IHNM specific resources
+ 0, // Option panel sprites
+ 0, // Warning panel
+ 0, // Warning panel sprites
+ 0 // Psychic profile background
};
static const GameResourceDescription IHNM_Resources = {
- RID_IHNM_SCENE_LUT, // Scene lookup table RN
- RID_IHNM_SCRIPT_LUT, // Script lookup table RN
- RID_IHNM_MAIN_PANEL,
- RID_IHNM_CONVERSE_PANEL,
- RID_IHNM_OPTION_PANEL,
- RID_IHNM_WARNING_PANEL,
- RID_IHNM_WARNING_PANEL_SPRITES,
- RID_IHNM_MAIN_SPRITES,
- RID_IHNM_MAIN_PANEL_SPRITES,
- RID_IHNM_OPTION_PANEL_SPRITES,
- 0, // Default portraits (ITE only)
- RID_IHNM_PROFILE_BG,
- RID_IHNM_MAIN_STRINGS,
- 0 // Actors strings (ITE only)
+ 1272, // Scene lookup table RN
+ 29, // Script lookup table RN
+ 9, // Main panel
+ 10, // Converse panel
+ 15, // Option panel
+ 12, // Main sprites
+ 12, // Main panel sprites
+ 21, // Main strings
+ // ITE specific resources
+ 0, // Actor names
+ 0, // Default portraits
+ // IHNM specific resources
+ 16, // Option panel sprites
+ 17, // Warning panel
+ 18, // Warning panel sprites
+ 20 // Psychic profile background
};
static const GameResourceDescription IHNMDEMO_Resources = {
- RID_IHNMDEMO_SCENE_LUT, // Scene lookup table RN
- RID_IHNMDEMO_SCRIPT_LUT, // Script lookup table RN
- RID_IHNMDEMO_MAIN_PANEL,
- RID_IHNMDEMO_CONVERSE_PANEL,
- RID_IHNMDEMO_OPTION_PANEL,
- RID_IHNMDEMO_WARNING_PANEL,
- RID_IHNMDEMO_WARNING_PANEL_SPRITES,
- RID_IHNMDEMO_MAIN_SPRITES,
- RID_IHNMDEMO_MAIN_PANEL_SPRITES,
- RID_IHNMDEMO_OPTION_PANEL_SPRITES,
- 0, // Default portraits (ITE only)
- RID_IHNMDEMO_PROFILE_BG,
- RID_IHNMDEMO_MAIN_STRINGS,
- 0 // Actors strings (ITE only)
+ 286, // Scene lookup table RN
+ 18, // Script lookup table RN
+ 5, // Main panel
+ 6, // Converse panel
+ 10, // Option panel
+ 7, // Main sprites
+ 7, // Main panel sprites
+ 16, // Main strings
+ // ITE specific resources
+ 0, // Actor names
+ 0, // Default portraits
+ // IHNM specific resources
+ 11, // Option panel sprites
+ 12, // Warning panel
+ 13, // Warning panel sprites
+ 15 // Psychic profile background
};
static const GameFontDescription ITEDEMO_GameFonts[] = { {0}, {1} };
@@ -102,14 +112,14 @@ static const GameFontDescription IHNMDEMO_GameFonts[] = { {2}, {3}, {4} };
// Font 6 is kIHNMFont8, font 8 is kIHNMMainFont
static const GameFontDescription IHNMCD_GameFonts[] = { {2}, {3}, {4}, {5}, {6}, {7}, {8} };
-// frequency, sampleBits, stereo, isBigEndian, isSigned
-static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 22050, 16, false, false, true };
-static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 22050, 8, false, false, false };
-static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 22050, 8, false, false, false };
-static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, -1, false, false, true };
-static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 22050, 16, false, false, true };
-static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, -1, false, false, true };
-static const GameSoundInfo MAC_GameSound = { kSoundPCM, 22050, 16, false, true, true };
+// sampleBits, isBigEndian, isSigned
+static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 16, false, true };
+static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 8, false, false };
+static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 8, false, false };
+static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, false, true };
+static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 16, false, true };
+static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, false, true };
+static const GameSoundInfo MAC_GameSound = { kSoundPCM, 16, true, true };
// Patch files. Files not found will be ignored
static const GamePatchDescription ITEPatch_Files[] = {
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index d1f592e38b..85416991db 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
#include "saga/interface.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/scene.h"
@@ -37,6 +36,9 @@
namespace Saga {
+#define RID_IHNM_DEFAULT_PALETTE 1
+#define RID_IHNM_HOURGLASS_CURSOR 11 // not in demo
+
Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height) : _vm(vm), _system(system) {
_system->beginGFXTransaction();
_vm->initCommonGFX(width > 320);
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index ef31b85156..fe1ee0eefc 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -43,7 +43,6 @@
#include "saga/sound.h"
#include "saga/sprite.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "saga/interface.h"
@@ -477,9 +476,9 @@ void Interface::setMode(int mode) {
bool Interface::processAscii(Common::KeyState keystate) {
// TODO: Checking for Esc and Enter below is a bit hackish, and
- // and probably only works with the English version. Maybe we should
- // add a flag to the button so it can indicate if it's the default or
- // cancel button?
+ // probably only works with the English version. Maybe we should
+ // add a flag to the button so it can indicate if it's the default
+ // or cancel button?
uint16 ascii = keystate.ascii;
int i;
PanelButton *panelButton;
@@ -2755,7 +2754,7 @@ void Interface::mapPanelDrawCrossHair() {
if (screen.contains(mapPosition)) {
_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _vm->_sprite->_mainSprites,
- _mapPanelCrossHairState? RID_ITE_SPR_XHAIR1 : RID_ITE_SPR_XHAIR2,
+ _mapPanelCrossHairState? RID_ITE_SPR_CROSSHAIR : RID_ITE_SPR_CROSSHAIR + 1,
mapPosition, 256);
}
}
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index af59fe64d2..74cf5ace44 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -56,6 +56,10 @@ enum InterfaceUpdateFlags {
#define STATUS_TEXT_LEN 128
#define STATUS_TEXT_INPUT_MAX 256
+#define RID_IHNM_BOSS_SCREEN 19 // not in demo
+#define RID_ITE_TYCHO_MAP 1686
+#define RID_ITE_SPR_CROSSHAIR (73 + 9)
+
// Converse-specific stuff
enum PanelModes {
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index 7a6d6a4398..e607adb4cb 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -27,7 +27,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/sagaresnames.h"
#include "saga/scene.h"
#include "saga/isomap.h"
@@ -285,7 +284,7 @@ void IsoMap::adjustScroll(bool jump) {
tileCoordsToScreenPoint(_vm->_actor->_centerActor->_location, playerPoint);
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
_mapPosition.x = (playerPoint.x + _viewScroll.x) * 30 / 100 - (381);
_mapPosition.y = (playerPoint.y + _viewScroll.y) * 30 / 100 - (342);
}
@@ -322,7 +321,7 @@ void IsoMap::adjustScroll(bool jump) {
_viewScroll.x = smoothSlide( _viewScroll.x, minScrollPos.x, maxScrollPos.x );
}
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
ObjectData *obj;
uint16 objectId;
objectId = _vm->_actor->objIndexToId(ITE_OBJ_MAP);
@@ -1510,7 +1509,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio
memset( &_searchArray, 0, sizeof(_searchArray));
if (!(actor->_actorFlags & kActorNoCollide) &&
- (_vm->_scene->currentSceneResourceId() != RID_ITE_OVERMAP_SCENE)) {
+ (_vm->_scene->currentSceneResourceId() != ITE_SCENE_OVERMAP)) {
for (i = 0; i < _vm->_actor->_actorsCount; i++) {
other = _vm->_actor->_actors[i];
if (!other->_inScene) continue;
@@ -1664,7 +1663,7 @@ void IsoMap::screenPointToTileCoords(const Point &position, Location &location)
Point mPos(position);
int x,y;
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE){
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP){
if (mPos.y < 16) {
mPos.y = 16;
}
diff --git a/engines/saga/isomap.h b/engines/saga/isomap.h
index c79ae7cd0a..eb548ce5dc 100644
--- a/engines/saga/isomap.h
+++ b/engines/saga/isomap.h
@@ -32,6 +32,8 @@
namespace Saga {
+#define ITE_OBJ_MAP 14
+
#define SAGA_ISOTILEDATA_LEN 8
#define SAGA_ISOTILE_WIDTH 32
#define SAGA_ISOTILE_BASEHEIGHT 15
diff --git a/engines/saga/ite_introproc.cpp b/engines/saga/ite_introproc.cpp
index 2aa263b097..a33a55c375 100644
--- a/engines/saga/ite_introproc.cpp
+++ b/engines/saga/ite_introproc.cpp
@@ -36,7 +36,6 @@
#include "saga/music.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
namespace Saga {
@@ -46,6 +45,21 @@ using Common::EN_ANY;
using Common::DE_DEU;
using Common::IT_ITA;
+// Intro scenes
+#define RID_ITE_INTRO_ANIM_SCENE 1538
+#define RID_ITE_CAVE_SCENE_1 1542
+#define RID_ITE_CAVE_SCENE_2 1545
+#define RID_ITE_CAVE_SCENE_3 1548
+#define RID_ITE_CAVE_SCENE_4 1551
+#define RID_ITE_VALLEY_SCENE 1556
+#define RID_ITE_TREEHOUSE_SCENE 1560
+#define RID_ITE_FAIREPATH_SCENE 1564
+#define RID_ITE_FAIRETENT_SCENE 1567
+
+// ITE intro music
+#define MUSIC_1 9
+#define MUSIC_2 10
+
LoadSceneParams ITE_IntroList[] = {
{RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
{RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0, NO_CHAPTER_CHANGE},
@@ -380,63 +394,65 @@ int Scene::ITEIntroCave1Proc(int param) {
static const IntroDialogue dialogue[][4] = {
{ { // English
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"We see the sky, we see the land, we see the water, "
"and we wonder: Are we the only ones?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Long before we came to exist, the humans ruled the "
"Earth."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"They made marvelous things, and moved whole "
"mountains."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"They knew the Secret of Flight, the Secret of "
"Happiness, and other secrets beyond our imagining."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"Um uns sind der Himmel, das Land und die Seen; und "
"wir fragen uns - sind wir die einzigen?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Lange vor unserer Zeit herrschten die Menschen "
"\201ber die Erde."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"Sie taten wundersame Dinge und versetzten ganze "
"Berge."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"Sie kannten das Geheimnis des Fluges, das Geheimnis "
"der Fr\224hlichkeit und andere Geheimnisse, die "
"unsere Vorstellungskraft \201bersteigen."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"Guardiamo il cielo, guardiamo la terra, guardiamo "
"l'acqua, e ci chiediamo: Siamo forse soli?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Molto tempo prima che noi esistessimo, gli Umani "
"dominavano la terra."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"Fecero cose meravigliose, e mossero intere "
"montagne."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"Conoscevano il Segreto del Volo, il Segreto della "
"Felicit\224, ed altri segreti oltre ogni nostra "
"immaginazione."
@@ -493,47 +509,49 @@ int Scene::ITEIntroCave2Proc(int param) {
static const IntroDialogue dialogue[][3] = {
{ { // English
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"The humans also knew the Secret of Life, and they "
"used it to give us the Four Great Gifts:"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"Thinking minds, feeling hearts, speaking mouths, and "
"reaching hands."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"We are their children."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"Au$erdem kannten die Menschen das Geheimnis des "
"Lebens. Und sie nutzten es, um uns die vier gro$en "
"Geschenke zu geben -"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"den denkenden Geist, das f\201hlende Herz, den "
"sprechenden Mund und die greifende Hand."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"Wir sind ihre Kinder."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"Gli Umani conoscevano anche il Segreto della Vita, "
"e lo usarono per darci i Quattro Grandi Doni:"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"Il pensiero, le emozioni, la parola e la manualit\224."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"Siamo i loro figli."
} }
};
@@ -595,46 +613,48 @@ int Scene::ITEIntroCave3Proc(int param) {
static const IntroDialogue dialogue[][3] = {
{ { // English
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"They taught us how to use our hands, and how to "
"speak."
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"They showed us the joy of using our minds."
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"They loved us, and when we were ready, they surely "
"would have given us the Secret of Happiness."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"Sie lehrten uns zu sprechen und unsere H\204nde zu "
"benutzen."
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"Sie zeigten uns die Freude am Denken."
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"Sie liebten uns, und w\204ren wir bereit gewesen, "
"h\204tten sie uns sicherlich das Geheimnis der "
"Fr\224hlichkeit offenbart."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"Ci insegnarono come usare le mani e come parlare. "
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"Ci mostrarono le gioie che l'uso della mente "
"pu\242 dare. "
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"Ci amarono, ed una volta pronti, ci avrebbero "
"sicuramente svelato il Segreto della Felicit\224."
@@ -698,60 +718,62 @@ int Scene::ITEIntroCave4Proc(int param) {
static const IntroDialogue dialogue[][4] = {
{ { // English
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"And now we see the sky, the land, and the water that "
"we are heirs to, and we wonder: why did they leave?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Do they live still, in the stars? In the oceans "
"depths? In the wind?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"We wonder, was their fate good or evil?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"And will we also share the same fate one day?"
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"Und nun sehen wir den Himmel, das Land und die "
"Seen - unser Erbe. Und wir fragen uns - warum "
"verschwanden sie?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Leben sie noch in den Sternen? In den Tiefen des "
"Ozeans? Im Wind?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"Wir fragen uns - war ihr Schicksal gut oder b\224se?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"Und wird uns eines Tages das gleiche Schicksal "
"ereilen?"
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"Ed ora che guardiamo il cielo, la terra e l'acqua "
"che abbiamo ereditato, pensiamo: Perch\233 partirono?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Vivono ancora, nelle stelle? Nelle profondit\224 "
"dell'oceano? Nel vento?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"Ci domandiamo, il loro destino fu felice o nefasto?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"E un giorno, condivideremo anche noi lo stesso "
"destino?"
} }
diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp
index 1274f72b45..43c3d21012 100644
--- a/engines/saga/itedata.cpp
+++ b/engines/saga/itedata.cpp
@@ -26,7 +26,6 @@
// Actor and Object data tables
#include "saga/saga.h"
#include "saga/itedata.h"
-#include "saga/sagaresnames.h"
#include "saga/sndres.h"
namespace Saga {
@@ -245,7 +244,7 @@ ObjectTableData ITE_ObjectTable[ITE_OBJECTCOUNT] = {
{ 23, 0, 480, 480, 0, 24, 23, 0 }, // Silver Medallion
{ 24, 0, 480, 480, 0, 25, 24, 0 }, // Mud in Fur
{ 25, 0, 480, 480, 0, 26, 25, 0 }, // Gold Ring
- { 27, 13, 1036, 572, 40, 47, 14, kObjUseWith }, // Screwdriver
+ { 27, 13, 1036, 572, 40, 47, 14, kObjUseWith }, // Screwdriver
{ 28, 0, 480, 480, 0, 29, 26, 0 }, // Apple Token
{ 29, 0, 480, 480, 0, 30, 22, kObjUseWith }, // Letter from Elara
{ 30, 0, 164, 440, 0, 31, 16, kObjUseWith }, // Spoon
@@ -258,82 +257,86 @@ ObjectTableData ITE_ObjectTable[ITE_OBJECTCOUNT] = {
{ 40, 269, 644, 416, 0, 41, 39, kObjNotFlat }, // Electrical Cable
{ 41, 12, 280, 516, 0, 43, 17, kObjUseWith }, // Piece of flint
{ 42, 5, 876, 332, 32, 65, 18, 0 }, // Rat Cloak
- { 43, 52, 556, 1612, 0, 49, 28, kObjUseWith | kObjNotFlat }, // Bucket
+ { 43, 52, 556, 1612, 0, 49, 28, kObjUseWith |
+ kObjNotFlat }, // Bucket
{ 48, 52, 732, 948, 0, 50, 27, kObjUseWith }, // Cup
{ 49, 52, 520, 1872, 0, 53, 29, 0 }, // Fertilizer
{ 50, 52, 1012, 1268, 0, 52, 30, 0 }, // Feeder
- { 51, 252, -20, -20, 0, 71, 32, kObjUseWith | kObjNotFlat }, // Bowl in jail cell
+ { 51, 252, -20, -20, 0, 71, 32, kObjUseWith |
+ kObjNotFlat }, // Bowl in jail cell
{ 53, 252, 1148, 388, 0, 70, 33, 0 }, // Loose stone block in jail cell
{ 26, 12, 496, 368, 0, 76, 31, 0 }, // Coil of Rope from Quarry
{ 54, 281, 620, 352, 0, 80, 46, 0 } // Orb of Storms in Dam Lab
};
FxTable ITE_SfxTable[ITE_SFXCOUNT] = {
- { FX_DOOR_OPEN, 127 },
- { FX_DOOR_CLOSE, 127 },
- { FX_RUSH_WATER, 63 }, // Floppy volume: 127
- { FX_RUSH_WATER, 26 }, // Floppy volume: 40
- { FX_CRICKET, 64 },
- { FX_PORTICULLIS, 84 }, // Floppy volume: 127
- { FX_CLOCK_1, 64 },
- { FX_CLOCK_2, 64 },
- { FX_DAM_MACHINE, 64 },
- { FX_DAM_MACHINE, 40 },
- { FX_HUM1, 64 },
- { FX_HUM2, 64 },
- { FX_HUM3, 64 },
- { FX_HUM4, 64 },
- { FX_WATER_LOOP_S, 32 }, // Floppy volume: 64
- { FX_SURF, 42 }, // Floppy volume: 127
- { FX_SURF, 32 }, // Floppy volume: 64
- { FX_FIRELOOP, 64 }, // Floppy volume: 96
- { FX_SCRAPING, 84 }, // Floppy volume: 127
- { FX_BEE_SWARM, 64 }, // Floppy volume: 96
- { FX_BEE_SWARM, 26 }, // Floppy volume: 40
- { FX_SQUEAKBOARD, 64 },
- { FX_KNOCK, 127 },
- { FX_COINS, 32 }, // Floppy volume: 48
- { FX_STORM, 84 }, // Floppy volume: 127
- { FX_DOOR_CLOSE_2, 84 }, // Floppy volume: 127
- { FX_ARCWELD, 84 }, // Floppy volume: 127
- { FX_RETRACT_ORB, 127 },
- { FX_DRAGON, 127 },
- { FX_SNORES, 127 },
- { FX_SPLASH, 127 },
- { FX_LOBBY_DOOR, 127 },
- { FX_CHIRP_LOOP, 26 }, // Floppy volume: 40
- { FX_DOOR_CREAK, 96 },
- { FX_SPOON_DIG, 64 },
- { FX_CROW, 96 },
- { FX_COLDWIND, 42 }, // Floppy volume: 64
- { FX_TOOL_SND_1, 96 },
- { FX_TOOL_SND_2, 127 },
- { FX_TOOL_SND_3, 64 },
- { FX_DOOR_METAL, 96 },
- { FX_WATER_LOOP_S, 32 },
- { FX_WATER_LOOP_L, 32 }, // Floppy volume: 64
- { FX_DOOR_OPEN_2, 127 },
- { FX_JAIL_DOOR, 64 },
- { FX_KILN_FIRE, 53 }, // Floppy volume: 80
-
- // Only in the CD version
- { FX_CROWD_01, 64 },
- { FX_CROWD_02, 64 },
- { FX_CROWD_03, 64 },
- { FX_CROWD_04, 64 },
- { FX_CROWD_05, 64 },
- { FX_CROWD_06, 64 },
- { FX_CROWD_07, 64 },
- { FX_CROWD_08, 64 },
- { FX_CROWD_09, 64 },
- { FX_CROWD_10, 64 },
- { FX_CROWD_11, 64 },
- { FX_CROWD_12, 64 },
- { FX_CROWD_13, 64 },
- { FX_CROWD_14, 64 },
- { FX_CROWD_15, 64 },
- { FX_CROWD_16, 64 },
- { FX_CROWD_17, 64 }
+ { 14, 127 }, // Door open
+ { 15, 127 }, // Door close
+ { 16, 63 }, // Rush water (floppy volume: 127)
+ { 16, 26 }, // Rush water (floppy volume: 40)
+ { 17, 64 }, // Cricket
+ { 18, 84 }, // Porticullis (floppy volume: 127)
+ { 19, 64 }, // Clock 1
+ { 20, 64 }, // Clock 2
+ { 21, 64 }, // Dam machine
+ { 21, 40 }, // Dam machine
+ { 22, 64 }, // Hum 1
+ { 23, 64 }, // Hum 2
+ { 24, 64 }, // Hum 3
+ { 25, 64 }, // Hum 4
+ // Note: the following effect was set to 51 for
+ // some unknown reason
+ { 26, 32 }, // Stream
+ { 27, 42 }, // Surf (floppy volume: 127)
+ { 27, 32 }, // Surf (floppy volume: 64)
+ { 28, 64 }, // Fire loop (floppy volume: 96)
+ { 29, 84 }, // Scraping (floppy volume: 127)
+ { 30, 64 }, // Bee swarm (floppy volume: 96)
+ { 30, 26 }, // Bee swarm (floppy volume: 40)
+ { 31, 64 }, // Squeaky board
+ { 32, 127 }, // Knock
+ { 33, 32 }, // Coins (floppy volume: 48)
+ { 34, 84 }, // Storm (floppy volume: 127)
+ { 35, 84 }, // Door close 2 (floppy volume: 127)
+ { 36, 84 }, // Arcweld (floppy volume: 127)
+ { 37, 127 }, // Retract orb
+ { 38, 127 }, // Dragon
+ { 39, 127 }, // Snores
+ { 40, 127 }, // Splash
+ { 41, 127 }, // Lobby door
+ { 42, 26 }, // Chirp loop (floppy volume: 40)
+ { 43, 96 }, // Door creak
+ { 44, 64 }, // Spoon dig
+ { 45, 96 }, // Crow
+ { 46, 42 }, // Cold wind (floppy volume: 64)
+ { 47, 96 }, // Tool sound 1
+ { 48, 127 }, // Tool sound 2
+ { 49, 64 }, // Tool sound 3
+ { 50, 96 }, // Metal door
+ { 51, 32 }, // Water loop S
+ { 52, 32 }, // Water loop L (floppy volume: 64)
+ { 53, 127 }, // Door open 2
+ { 54, 64 }, // Jail door
+ { 55, 53 }, // Killing fire (floppy volume: 80)
+ //{ 56, 0 }, // Dummy FX
+ // Crowd effects, which exist only in the CD version
+ { 57, 64 },
+ { 58, 64 },
+ { 59, 64 },
+ { 60, 64 },
+ { 61, 64 },
+ { 62, 64 },
+ { 63, 64 },
+ { 64, 64 },
+ { 65, 64 },
+ { 66, 64 },
+ { 67, 64 },
+ { 68, 64 },
+ { 69, 64 },
+ { 70, 64 },
+ { 71, 64 },
+ { 72, 64 },
+ { 73, 64 }
};
const char *ITEinterfaceTextStrings[][52] = {
@@ -493,14 +496,6 @@ const char *solicitStr[][NUM_SOLICIT_REPLIES] = {
}
};
-const char portraitList[] = {
- RID_ITE_JFERRET_SERIOUS,
- RID_ITE_JFERRET_GOOFY,
- RID_ITE_JFERRET_SERIOUS,
- RID_ITE_JFERRET_GOOFY,
- RID_ITE_JFERRET_ALOOF
-};
-
const char *sakkaStr[][NUM_SAKKA] = {
{ "Hey, you're not supposed to help the applicants!",
"Guys! This is supposed to be a test!",
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 1cbc38dfb5..732bd0b50c 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "saga/music.h"
#include "sound/audiostream.h"
@@ -40,6 +39,7 @@
namespace Saga {
#define BUFFER_SIZE 4096
+#define MUSIC_SUNSPOT 26
class DigitalMusicInputStream : public Audio::AudioStream {
private:
@@ -58,6 +58,7 @@ private:
const int16 *_pos;
const GameSoundInfo *_musicInfo;
MemoryReadStream *_memoryStream;
+ SagaEngine *_vm;
void refill();
bool eosIntern() const {
@@ -73,18 +74,21 @@ public:
int readBuffer(int16 *buffer, const int numSamples);
bool endOfData() const { return eosIntern(); }
- bool isStereo() const { return _musicInfo->stereo; }
- int getRate() const { return _musicInfo->frequency; }
+ bool isStereo() const {
+ // The digital music in the ITE Mac demo version is not stereo
+ return _vm->getGameId() == GID_ITE_MACDEMO2 ? false : true;
+ }
+ int getRate() const { return 11025; }
};
DigitalMusicInputStream::DigitalMusicInputStream(SagaEngine *vm, ResourceContext *context, uint32 resourceId, bool looping, uint32 loopStart)
- : _context(context), _finished(false), _looping(looping), _bufferEnd(_buf + BUFFER_SIZE) {
+ : _vm(vm), _context(context), _finished(false), _looping(looping), _bufferEnd(_buf + BUFFER_SIZE) {
byte compressedHeader[10];
- resourceData = vm->_resource->getResourceData(context, resourceId);
+ resourceData = _vm->_resource->getResourceData(context, resourceId);
_file = context->getFile(resourceData);
- _musicInfo = vm->getMusicInfo();
+ _musicInfo = _vm->getMusicInfo();
if (_musicInfo == NULL) {
error("DigitalMusicInputStream() wrong musicInfo");
@@ -480,7 +484,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
if (_digitalMusicContext != NULL) {
//TODO: check resource size
loopStart = 0;
- // fix ITE sunstatm score
+ // fix ITE sunstatm/sunspot score
if ((_vm->getGameType() == GType_ITE) && (resourceId == MUSIC_SUNSPOT)) {
loopStart = 4 * 18727;
}
@@ -557,7 +561,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
musicFile.read(resourceData, resourceSize);
musicFile.close();
- // TODO: The Mac music format is unknown (probably TFMX?)
+ // TODO: The Mac music format is unsupported (QuickTime MIDI)
// so stop here
return;
} else {
diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp
index c5129fcf06..319946f2d5 100644
--- a/engines/saga/palanim.cpp
+++ b/engines/saga/palanim.cpp
@@ -66,12 +66,7 @@ int PalAnim::loadPalAnim(const byte *resdata, size_t resdata_len) {
debug(3, "PalAnim::loadPalAnim(): Loading %d PALANIM entries.", _entryCount);
- test_p = calloc(_entryCount, sizeof(PalanimEntry));
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(_entryCount * sizeof(PalanimEntry));
_entries = (PalanimEntry *)test_p;
for (i = 0; i < _entryCount; i++) {
@@ -87,22 +82,12 @@ int PalAnim::loadPalAnim(const byte *resdata, size_t resdata_len) {
debug(2, "PalAnim::loadPalAnim(): Entry %d: Loading %d palette indices.\n", i, pal_count);
- test_p = calloc(1, sizeof(char) * pal_count);
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(sizeof(char) * pal_count);
_entries[i].pal_index = (byte *)test_p;
debug(2, "PalAnim::loadPalAnim(): Entry %d: Loading %d SAGA_COLOR structures.", i, color_count);
- test_p = calloc(1, sizeof(Color) * color_count);
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(sizeof(Color) * color_count);
_entries[i].colors = (Color *)test_p;
for (p = 0; p < pal_count; p++) {
diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp
index 59cb50dcf3..2835775320 100644
--- a/engines/saga/puzzle.cpp
+++ b/engines/saga/puzzle.cpp
@@ -31,13 +31,14 @@
#include "saga/sprite.h"
#include "saga/puzzle.h"
#include "saga/render.h"
-#include "saga/sagaresnames.h"
#include "common/system.h"
#include "common/timer.h"
namespace Saga {
+#define ITE_ACTOR_PUZZLE 176
+
#define PUZZLE_X_OFFSET 72
#define PUZZLE_Y_OFFSET 46
@@ -45,6 +46,21 @@ namespace Saga {
#define PUZZLE_MOVED 0x04 // 1 when somewhere in the box
#define PUZZLE_ALL_SET PUZZLE_FIT | PUZZLE_MOVED
+// Puzzle portraits
+#define RID_ITE_SAKKA_APPRAISING 6
+#define RID_ITE_SAKKA_DENIAL 7
+#define RID_ITE_SAKKA_EXCITED 8
+#define RID_ITE_JFERRET_SERIOUS 9
+#define RID_ITE_JFERRET_GOOFY 10
+#define RID_ITE_JFERRET_ALOOF 11
+
+const char portraitList[] = {
+ RID_ITE_JFERRET_SERIOUS,
+ RID_ITE_JFERRET_GOOFY,
+ RID_ITE_JFERRET_SERIOUS,
+ RID_ITE_JFERRET_GOOFY,
+ RID_ITE_JFERRET_ALOOF
+};
enum rifOptions {
kROLater = 0,
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 8200526ecf..40eb32b276 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -53,7 +53,6 @@
#include "saga/music.h"
#include "saga/palanim.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
namespace Saga {
@@ -251,7 +250,7 @@ int SagaEngine::go() {
_scene->changeScene(ConfMan.getInt("start_scene"), 0, kTransitionNoFade);
} else if (ConfMan.hasKey("boot_param")) {
if (getGameType() == GType_ITE)
- _interface->addToInventory(_actor->objIndexToId(ITE_OBJ_MAGIC_HAT));
+ _interface->addToInventory(_actor->objIndexToId(0)); // Magic hat
_scene->changeScene(ConfMan.getInt("boot_param"), 0, kTransitionNoFade);
} else if (ConfMan.hasKey("save_slot")) {
// First scene sets up palette
@@ -421,25 +420,25 @@ const char *SagaEngine::getTextString(int textStringId) {
void SagaEngine::getExcuseInfo(int verb, const char *&textString, int &soundResourceId) {
textString = NULL;
- if (verb == _script->getVerbType(kVerbPickUp)) {
- textString = getTextString(kTextICantPickup);
- soundResourceId = RID_BOAR_VOICE_007;
- } else
- if (verb == _script->getVerbType(kVerbLookAt)) {
- textString = getTextString(kTextNothingSpecial);
- soundResourceId = RID_BOAR_VOICE_006;
- }
- if (verb == _script->getVerbType(kVerbOpen)) {
+ if (verb == _script->getVerbType(kVerbOpen)) {
textString = getTextString(kTextNoPlaceToOpen);
- soundResourceId = RID_BOAR_VOICE_000;
- }
- if (verb == _script->getVerbType(kVerbClose)) {
+ soundResourceId = 239; // Boar voice 0
+ }
+ if (verb == _script->getVerbType(kVerbClose)) {
textString = getTextString(kTextNoOpening);
- soundResourceId = RID_BOAR_VOICE_002;
- }
- if (verb == _script->getVerbType(kVerbUse)) {
+ soundResourceId = 241; // Boar voice 2
+ }
+ if (verb == _script->getVerbType(kVerbUse)) {
textString = getTextString(kTextDontKnow);
- soundResourceId = RID_BOAR_VOICE_005;
+ soundResourceId = 244; // Boar voice 5
+ }
+ if (verb == _script->getVerbType(kVerbLookAt)) {
+ textString = getTextString(kTextNothingSpecial);
+ soundResourceId = 245; // Boar voice 6
+ }
+ if (verb == _script->getVerbType(kVerbPickUp)) {
+ textString = getTextString(kTextICantPickup);
+ soundResourceId = 246; // Boar voice 7
}
}
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 35c3736b31..4fd789cb4e 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -82,11 +82,11 @@ using Common::MemoryReadStreamEndian;
#define OBJECT_TYPE_MASK ((1 << OBJECT_TYPE_SHIFT) - 1)
#define OBJ_SPRITE_BASE 9
+#define IHNM_OBJ_PROFILE 0x4000
#define memoryError(Place) error("%s Memory allocation error.", Place)
enum ERRORCODE {
- MEM = -2,//todo: remove
FAILURE = -1,
SUCCESS = 0
};
@@ -303,15 +303,17 @@ struct GameResourceDescription {
uint32 mainPanelResourceId;
uint32 conversePanelResourceId;
uint32 optionPanelResourceId;
- uint32 warningPanelResourceId;
- uint32 warningPanelSpritesResourceId;
uint32 mainSpritesResourceId;
uint32 mainPanelSpritesResourceId;
- uint32 optionPanelSpritesResourceId;
- uint32 defaultPortraitsResourceId;
- uint32 psychicProfileResourceId;
uint32 mainStringsResourceId;
+ // ITE specific resources
uint32 actorsStringsResourceId;
+ uint32 defaultPortraitsResourceId;
+ // IHNM specific resources
+ uint32 optionPanelSpritesResourceId;
+ uint32 warningPanelResourceId;
+ uint32 warningPanelSpritesResourceId;
+ uint32 psychicProfileResourceId;
};
struct GameFontDescription {
@@ -322,9 +324,7 @@ struct GameDisplayInfo;
struct GameSoundInfo {
GameSoundTypes resourceType;
- long frequency;
int sampleBits;
- bool stereo;
bool isBigEndian;
bool isSigned;
};
diff --git a/engines/saga/sagaresnames.h b/engines/saga/sagaresnames.h
deleted file mode 100644
index 5bce483c3e..0000000000
--- a/engines/saga/sagaresnames.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-// Descriptive names for game resource numbers
-
-#ifndef SAGA_RESOURCENAMES_H
-#define SAGA_RESOURCENAMES_H
-
-namespace Saga {
-
-// Prefix RID_ means Resource Id
-
-// Lookup tables
-#define RID_ITE_SCENE_LUT 1806
-#define RID_ITE_SCRIPT_LUT 216
-
-#define RID_ITEDEMO_SCENE_LUT 318
-#define RID_ITEDEMO_SCRIPT_LUT 146
-
-#define RID_IHNM_SCENE_LUT 1272
-#define RID_IHNM_SCRIPT_LUT 29
-#define RID_IHNM_SFX_LUT 265
-
-#define RID_IHNMDEMO_SCENE_LUT 286
-#define RID_IHNMDEMO_SCRIPT_LUT 18
-#define RID_IHNMDEMO_SFX_LUT 222
-
-// Object names
-#define ITE_OBJ_MAP 14
-#define ITE_OBJ_MAGIC_HAT 0
-
-#define IHNM_OBJ_PROFILE 0x4000
-
-#define RID_IHNM_DEFAULT_PALETTE 1
-
-// Actor names
-#define ITE_ACTOR_PUZZLE 176
-
-// Scenes
-#define ITE_SCENE_INV -1
-#define ITE_SCENE_PUZZLE 26
-#define ITE_SCENE_LODGE 21
-#define ITE_SCENE_ENDCREDIT1 295
-
-#define ITE_DEFAULT_SCENE 32
-#define IHNM_DEFAULT_SCENE 151
-
-#define ITEDEMO_DEFAULT_SCENE 68
-#define IHNMDEMO_DEFAULT_SCENE 144
-
-// Fonts
-#define RID_MEDIUM_FONT 0
-#define RID_BIG_FONT 1
-#define RID_SMALL_FONT 2
-
-// Interface images
-#define RID_ITE_MAIN_PANEL 3
-#define RID_ITE_CONVERSE_PANEL 4
-#define RID_ITE_OPTION_PANEL 5
-#define RID_ITE_MAIN_SPRITES 6
-#define RID_ITE_MAIN_PANEL_SPRITES 7
-#define RID_ITE_MAIN_STRINGS 35 //main strings
-#define RID_ITE_ACTOR_NAMES 36 //actors names
-#define RID_ITE_DEFAULT_PORTRAITS 125
-
-#define RID_ITEDEMO_MAIN_PANEL 2
-#define RID_ITEDEMO_CONVERSE_PANEL 3
-#define RID_ITEDEMO_OPTION_PANEL 3 // FIXME: should be 4 but it is an empty resource.
-#define RID_ITEDEMO_MAIN_SPRITES 5 // Proper fix would be not load options panel when demo is running
-#define RID_ITEDEMO_MAIN_PANEL_SPRITES 6
-#define RID_ITEDEMO_MAIN_STRINGS 8 //main strings
-#define RID_ITEDEMO_ACTOR_NAMES 9 //actors names
-#define RID_ITEDEMO_DEFAULT_PORTRAITS 80
-
-#define RID_ITE_TYCHO_MAP 1686
-#define RID_ITE_SPR_XHAIR1 (73 + 9)
-#define RID_ITE_SPR_XHAIR2 (74 + 9)
-
-#define RID_IHNM_MAIN_PANEL 9
-#define RID_IHNM_CONVERSE_PANEL 10
-#define RID_IHNM_HOURGLASS_CURSOR 11
-#define RID_IHNM_MAIN_SPRITES 12
-#define RID_IHNM_MAIN_PANEL_SPRITES 12
-#define RID_IHNM_ARROW_SPRITES 13
-#define RID_IHNM_SAVEREMINDER_SPRITES 14
-#define RID_IHNM_OPTION_PANEL 15
-#define RID_IHNM_OPTION_PANEL_SPRITES 16
-#define RID_IHNM_WARNING_PANEL 17
-#define RID_IHNM_WARNING_PANEL_SPRITES 18
-#define RID_IHNM_BOSS_SCREEN 19
-#define RID_IHNM_PROFILE_BG 20
-#define RID_IHNM_MAIN_STRINGS 21
-
-#define RID_IHNMDEMO_MAIN_PANEL 5
-#define RID_IHNMDEMO_CONVERSE_PANEL 6
-#define RID_IHNMDEMO_HOURGLASS_CURSOR 6 // Does not exist in the demo
-#define RID_IHNMDEMO_MAIN_SPRITES 7
-#define RID_IHNMDEMO_MAIN_PANEL_SPRITES 7
-#define RID_IHNMDEMO_ARROW_SPRITES 8
-#define RID_IHNMDEMO_SAVEREMINDER_SPRITES 9
-#define RID_IHNMDEMO_OPTION_PANEL 10
-#define RID_IHNMDEMO_OPTION_PANEL_SPRITES 11
-#define RID_IHNMDEMO_WARNING_PANEL 12
-#define RID_IHNMDEMO_WARNING_PANEL_SPRITES 13
-#define RID_IHNMDEMO_BOSS_SCREEN 14 // Does not exist in the demo
-#define RID_IHNMDEMO_PROFILE_BG 15
-#define RID_IHNMDEMO_MAIN_STRINGS 16
-
-// Puzzle portraits
-#define RID_ITE_SAKKA_APPRAISING 6
-#define RID_ITE_SAKKA_DENIAL 7
-#define RID_ITE_SAKKA_EXCITED 8
-#define RID_ITE_JFERRET_SERIOUS 9
-#define RID_ITE_JFERRET_GOOFY 10
-#define RID_ITE_JFERRET_ALOOF 11
-
-// ITE Scene resource numbers
-#define RID_ITE_OVERMAP_SCENE 226
-#define RID_ITE_INTRO_ANIM_SCENE 1538
-#define RID_ITE_CAVE_SCENE_1 1542
-#define RID_ITE_CAVE_SCENE_2 1545
-#define RID_ITE_CAVE_SCENE_3 1548
-#define RID_ITE_CAVE_SCENE_4 1551
-
-#define RID_ITE_VALLEY_SCENE 1556
-#define RID_ITE_TREEHOUSE_SCENE 1560
-#define RID_ITE_FAIREPATH_SCENE 1564
-#define RID_ITE_FAIRETENT_SCENE 1567
-
-#define RID_ITE_INTRO_ANIM_STARTFRAME 1529
-
-#define RID_ITE_INTRO_ANIM_1 1530
-#define RID_ITE_INTRO_ANIM_2 1531
-#define RID_ITE_INTRO_ANIM_3 1532
-#define RID_ITE_INTRO_ANIM_4 1533
-#define RID_ITE_INTRO_ANIM_5 1534
-#define RID_ITE_INTRO_ANIM_6 1535
-#define RID_ITE_INTRO_ANIM_7 1536
-
-#define RID_ITE_CAVE_IMG_1 1540
-#define RID_ITE_CAVE_IMG_2 1543
-#define RID_ITE_CAVE_IMG_3 1546
-#define RID_ITE_CAVE_IMG_4 1549
-
-#define RID_ITE_INTRO_IMG_1 1552
-#define RID_ITE_INTRO_IMG_2 1557
-#define RID_ITE_INTRO_IMG_3 1561
-#define RID_ITE_INTRO_IMG_4 1565
-
-// ITE voices
-#define RID_CAVE_VOICE_0 0
-#define RID_CAVE_VOICE_1 1
-#define RID_CAVE_VOICE_2 2
-#define RID_CAVE_VOICE_3 3
-#define RID_CAVE_VOICE_4 4
-#define RID_CAVE_VOICE_5 5
-#define RID_CAVE_VOICE_6 6
-#define RID_CAVE_VOICE_7 7
-#define RID_CAVE_VOICE_8 8
-#define RID_CAVE_VOICE_9 9
-#define RID_CAVE_VOICE_10 10
-#define RID_CAVE_VOICE_11 11
-#define RID_CAVE_VOICE_12 12
-#define RID_CAVE_VOICE_13 13
-
-#define RID_SCENE1_VOICE_009 57
-//TODO: fill it
-#define RID_SCENE1_VOICE_138 186
-
-#define RID_BOAR_VOICE_000 239
-#define RID_BOAR_VOICE_002 241
-#define RID_BOAR_VOICE_005 244
-#define RID_BOAR_VOICE_006 245
-#define RID_BOAR_VOICE_007 246
-
-// Music
-#define MUSIC_1 9
-#define MUSIC_2 10
-#define MUSIC_SUNSPOT 26
-
-// TODO: If the sound effects are numbered sequentially, we don't really need
-// these constants. But for now they might be useful for debugging.
-
-// Sound effects
-
-#define FX_DOOR_OPEN 14
-#define FX_DOOR_CLOSE 15
-#define FX_RUSH_WATER 16
-#define FX_CRICKET 17
-#define FX_PORTICULLIS 18
-#define FX_CLOCK_1 19
-#define FX_CLOCK_2 20
-#define FX_DAM_MACHINE 21
-#define FX_HUM1 22
-#define FX_HUM2 23
-#define FX_HUM3 24
-#define FX_HUM4 25
-#define FX_STREAM 26
-#define FX_SURF 27
-#define FX_FIRELOOP 28
-#define FX_SCRAPING 29
-#define FX_BEE_SWARM 30
-#define FX_SQUEAKBOARD 31
-#define FX_KNOCK 32
-#define FX_COINS 33
-#define FX_STORM 34
-#define FX_DOOR_CLOSE_2 35
-#define FX_ARCWELD 36
-#define FX_RETRACT_ORB 37
-#define FX_DRAGON 38
-#define FX_SNORES 39
-#define FX_SPLASH 40
-#define FX_LOBBY_DOOR 41
-#define FX_CHIRP_LOOP 42
-#define FX_DOOR_CREAK 43
-#define FX_SPOON_DIG 44
-#define FX_CROW 45
-#define FX_COLDWIND 46
-#define FX_TOOL_SND_1 47
-#define FX_TOOL_SND_2 48
-#define FX_TOOL_SND_3 49
-#define FX_DOOR_METAL 50
-#define FX_WATER_LOOP_S 51
-#define FX_WATER_LOOP_L 52
-#define FX_DOOR_OPEN_2 53
-#define FX_JAIL_DOOR 54
-#define FX_KILN_FIRE 55
-#define FX_DUMMY 56
-
-// These are only in the CD version
-
-#define FX_CROWD_01 57
-#define FX_CROWD_02 58
-#define FX_CROWD_03 59
-#define FX_CROWD_04 60
-#define FX_CROWD_05 61
-#define FX_CROWD_06 62
-#define FX_CROWD_07 63
-#define FX_CROWD_08 64
-#define FX_CROWD_09 65
-#define FX_CROWD_10 66
-#define FX_CROWD_11 67
-#define FX_CROWD_12 68
-#define FX_CROWD_13 69
-#define FX_CROWD_14 70
-#define FX_CROWD_15 71
-#define FX_CROWD_16 72
-#define FX_CROWD_17 73
-
-} // End of namespace Saga
-
-#endif
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 53290cbc5d..8d00f9d2d0 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -37,7 +37,6 @@
#include "saga/isomap.h"
#include "saga/music.h"
#include "saga/render.h"
-#include "saga/sagaresnames.h"
#include "saga/scene.h"
#include "saga/script.h"
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 4520c3f406..c3c1587822 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -43,7 +43,6 @@
#include "saga/scene.h"
#include "saga/actor.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "graphics/iff.h"
#include "common/util.h"
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 0e4c0ed66a..723792f050 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -38,9 +38,21 @@ namespace Saga {
//#define SCENE_DEBUG // for scene debugging
#define SCENE_DOORS_MAX 16
-
#define NO_CHAPTER_CHANGE -2
+// Scenes
+#define ITE_SCENE_INV -1
+#define ITE_SCENE_PUZZLE 26
+#define ITE_SCENE_LODGE 21
+#define ITE_SCENE_ENDCREDIT1 295
+#define ITE_SCENE_OVERMAP 226
+
+// Default scenes
+#define ITE_DEFAULT_SCENE 32
+#define IHNM_DEFAULT_SCENE 151
+#define ITEDEMO_DEFAULT_SCENE 68
+#define IHNMDEMO_DEFAULT_SCENE 144
+
class ObjectMap;
struct Event;
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 4862ce3be0..ea61f5ce04 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -47,7 +47,6 @@
#include "saga/scene.h"
#include "saga/isomap.h"
-#include "saga/sagaresnames.h"
#include "common/config-manager.h"
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp
index 9d3d4a9afa..8d269fb3e8 100644
--- a/engines/saga/sndres.cpp
+++ b/engines/saga/sndres.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/itedata.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/sndres.h"
#include "saga/sound.h"
@@ -43,6 +42,9 @@
namespace Saga {
+#define RID_IHNM_SFX_LUT 265
+#define RID_IHNMDEMO_SFX_LUT 222
+
SndRes::SndRes(SagaEngine *vm) : _vm(vm) {
// Load sound module resource file contexts
_sfxContext = _vm->_resource->getContext(GAME_SOUNDFILE);
@@ -259,11 +261,11 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
switch (resourceType) {
case kSoundPCM:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
buffer.size = soundResourceLength;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
if (onlyHeader) {
buffer.buffer = NULL;
free(soundResource);
@@ -273,11 +275,11 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
result = true;
break;
case kSoundMacPCM:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
buffer.size = soundResourceLength - 36;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
if (onlyHeader) {
buffer.buffer = NULL;
} else {
@@ -288,10 +290,10 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
result = true;
break;
case kSoundVOX:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
buffer.size = soundResourceLength * 4;
if (onlyHeader) {
buffer.buffer = NULL;
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index b5c675a403..e9d002819c 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -29,7 +29,6 @@
#include "saga/gfx.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/font.h"
@@ -37,6 +36,11 @@
namespace Saga {
+#define RID_IHNM_ARROW_SPRITES 13
+#define RID_IHNM_SAVEREMINDER_SPRITES 14
+#define RID_IHNMDEMO_ARROW_SPRITES 8
+#define RID_IHNMDEMO_SAVEREMINDER_SPRITES 9
+
Sprite::Sprite(SagaEngine *vm) : _vm(vm) {
debug(8, "Initializing sprite subsystem...");
diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp
index bc18632659..c1b289a060 100644
--- a/engines/saga/sthread.cpp
+++ b/engines/saga/sthread.cpp
@@ -34,10 +34,12 @@
#include "saga/script.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
namespace Saga {
+#define RID_SCENE1_VOICE_START 57
+#define RID_SCENE1_VOICE_END 186
+
ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntryPointNumber) {
ScriptThread *newThread;
@@ -653,8 +655,8 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
if (_vm->getGameId() == GID_ITE_DISK_G) { // special ITE dos
if ((_vm->_scene->currentSceneNumber() == ITE_DEFAULT_SCENE) &&
- (iparam1 >= 288) && (iparam1 <= (RID_SCENE1_VOICE_138 - RID_SCENE1_VOICE_009 + 288))) {
- sampleResourceId = RID_SCENE1_VOICE_009 + iparam1 - 288;
+ (iparam1 >= 288) && (iparam1 <= (RID_SCENE1_VOICE_END - RID_SCENE1_VOICE_START + 288))) {
+ sampleResourceId = RID_SCENE1_VOICE_START + iparam1 - 288;
}
} else {
if (thread->_voiceLUT->voicesCount > first) {