aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/animation.cpp76
-rw-r--r--engines/sword1/animation.h32
-rw-r--r--engines/sword1/detection.cpp3
-rw-r--r--engines/sword1/logic.cpp2
-rw-r--r--engines/sword1/objectman.cpp253
-rw-r--r--engines/sword1/objectman.h19
-rw-r--r--engines/sword1/sound.cpp2
-rw-r--r--engines/sword1/text.cpp2
8 files changed, 308 insertions, 81 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index 1e2964054a..f7add4eed2 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -37,6 +37,7 @@
#include "gui/message.h"
+#include "video/dxa_decoder.h"
#include "video/psx_decoder.h"
#include "video/smk_decoder.h"
@@ -96,9 +97,8 @@ static const char *const sequenceListPSX[20] = {
// Basic movie player
///////////////////////////////////////////////////////////////////////////////
-MoviePlayer::MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, Audio::Mixer *snd, OSystem *system, Audio::SoundHandle *bgSoundHandle, Video::VideoDecoder *decoder, DecoderType decoderType)
- : _vm(vm), _textMan(textMan), _resMan(resMan), _snd(snd), _bgSoundHandle(bgSoundHandle), _system(system) {
- _bgSoundStream = NULL;
+MoviePlayer::MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType)
+ : _vm(vm), _textMan(textMan), _resMan(resMan), _system(system) {
_decoderType = decoderType;
_decoder = decoder;
@@ -107,7 +107,6 @@ MoviePlayer::MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, Audio::
}
MoviePlayer::~MoviePlayer() {
- delete _bgSoundHandle;
delete _decoder;
}
@@ -116,16 +115,12 @@ MoviePlayer::~MoviePlayer() {
* @param id the id of the file
*/
bool MoviePlayer::load(uint32 id) {
- Common::File f;
Common::String filename;
- if (_decoderType == kVideoDecoderDXA)
- _bgSoundStream = Audio::SeekableAudioStream::openStreamFile(sequenceList[id]);
- else
- _bgSoundStream = NULL;
-
if (SwordEngine::_systemVars.showText) {
+ Common::File f;
filename = Common::String::format("%s.txt", sequenceList[id]);
+
if (f.open(filename)) {
Common::String line;
int lineNo = 0;
@@ -169,7 +164,6 @@ bool MoviePlayer::load(uint32 id) {
_movieTexts.push_back(MovieText(startFrame, endFrame, ptr, color));
lastEnd = endFrame;
}
- f.close();
}
}
@@ -189,6 +183,7 @@ bool MoviePlayer::load(uint32 id) {
// Need to load here in case it fails in which case we'd need
// to go back to paletted mode
if (_decoder->loadFile(filename)) {
+ _decoder->start();
return true;
} else {
initGraphics(g_system->getWidth(), g_system->getHeight(), true);
@@ -197,30 +192,27 @@ bool MoviePlayer::load(uint32 id) {
break;
}
- return _decoder->loadFile(filename.c_str());
-}
+ if (!_decoder->loadFile(filename))
+ return false;
-void MoviePlayer::play() {
- if (_bgSoundStream)
- _snd->playStream(Audio::Mixer::kSFXSoundType, _bgSoundHandle, _bgSoundStream);
+ // For DXA, also add the external sound file
+ if (_decoderType == kVideoDecoderDXA)
+ _decoder->addStreamFileTrack(sequenceList[id]);
- bool terminated = false;
+ _decoder->start();
+ return true;
+}
+void MoviePlayer::play() {
_textX = 0;
_textY = 0;
- terminated = !playVideo();
-
- if (terminated)
- _snd->stopHandle(*_bgSoundHandle);
+ playVideo();
_textMan->releaseText(2, false);
_movieTexts.clear();
- while (_snd->isSoundHandleActive(*_bgSoundHandle))
- _system->delayMillis(100);
-
// It's tempting to call _screen->fullRefresh() here to restore the old
// palette. However, that causes glitches with DXA movies, where the
// previous location would be momentarily drawn, before switching to
@@ -316,11 +308,11 @@ bool MoviePlayer::playVideo() {
if (_decoderType == kVideoDecoderPSX)
drawFramePSX(frame);
else
- _vm->_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h);
+ _vm->_system->copyRectToScreen(frame->pixels, frame->pitch, x, y, frame->w, frame->h);
}
if (_decoder->hasDirtyPalette()) {
- _decoder->setSystemPalette();
+ _vm->_system->getPaletteManager()->setPalette(_decoder->getPalette(), 0, 256);
if (!_movieTexts.empty()) {
// Look for the best color indexes to use to display the subtitles
@@ -501,29 +493,17 @@ void MoviePlayer::drawFramePSX(const Graphics::Surface *frame) {
uint16 x = (g_system->getWidth() - scaledFrame.w) / 2;
uint16 y = (g_system->getHeight() - scaledFrame.h) / 2;
- _vm->_system->copyRectToScreen((byte *)scaledFrame.pixels, scaledFrame.pitch, x, y, scaledFrame.w, scaledFrame.h);
+ _vm->_system->copyRectToScreen(scaledFrame.pixels, scaledFrame.pitch, x, y, scaledFrame.w, scaledFrame.h);
scaledFrame.free();
}
-DXADecoderWithSound::DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle)
- : _mixer(mixer), _bgSoundHandle(bgSoundHandle) {
-}
-
-uint32 DXADecoderWithSound::getElapsedTime() const {
- if (_mixer->isSoundHandleActive(*_bgSoundHandle))
- return _mixer->getSoundElapsedTime(*_bgSoundHandle);
-
- return DXADecoder::getElapsedTime();
-}
-
///////////////////////////////////////////////////////////////////////////////
// Factory function for creating the appropriate cutscene player
///////////////////////////////////////////////////////////////////////////////
-MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, Audio::Mixer *snd, OSystem *system) {
+MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, OSystem *system) {
Common::String filename;
- Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle;
// For the PSX version, we'll try the PlayStation stream files
if (vm->isPsx()) {
@@ -534,7 +514,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
#ifdef USE_RGB_COLOR
// All BS1 PSX videos run the videos at 2x speed
Video::VideoDecoder *psxDecoder = new Video::PSXStreamDecoder(Video::PSXStreamDecoder::kCD2x);
- return new MoviePlayer(vm, textMan, resMan, snd, system, bgSoundHandle, psxDecoder, kVideoDecoderPSX);
+ return new MoviePlayer(vm, textMan, resMan, system, psxDecoder, kVideoDecoderPSX);
#else
GUI::MessageDialog dialog(Common::String::format(_("PSX stream cutscene '%s' cannot be played in paletted mode"), filename.c_str()), _("OK"));
dialog.runModal();
@@ -546,20 +526,20 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
filename = Common::String::format("%s.smk", sequenceList[id]);
if (Common::File::exists(filename)) {
- Video::SmackerDecoder *smkDecoder = new Video::SmackerDecoder(snd);
- return new MoviePlayer(vm, textMan, resMan, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK);
+ Video::SmackerDecoder *smkDecoder = new Video::SmackerDecoder();
+ return new MoviePlayer(vm, textMan, resMan, system, smkDecoder, kVideoDecoderSMK);
}
filename = Common::String::format("%s.dxa", sequenceList[id]);
if (Common::File::exists(filename)) {
#ifdef USE_ZLIB
- DXADecoderWithSound *dxaDecoder = new DXADecoderWithSound(snd, bgSoundHandle);
- return new MoviePlayer(vm, textMan, resMan, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA);
+ Video::VideoDecoder *dxaDecoder = new Video::DXADecoder();
+ return new MoviePlayer(vm, textMan, resMan, system, dxaDecoder, kVideoDecoderDXA);
#else
GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib support"), _("OK"));
dialog.runModal();
- return NULL;
+ return 0;
#endif
}
@@ -569,7 +549,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
if (Common::File::exists(filename)) {
GUI::MessageDialog dialog(_("MPEG2 cutscenes are no longer supported"), _("OK"));
dialog.runModal();
- return NULL;
+ return 0;
}
if (!vm->isPsx() || scumm_stricmp(sequenceList[id], "enddemo") != 0) {
@@ -578,7 +558,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
dialog.runModal();
}
- return NULL;
+ return 0;
}
} // End of namespace Sword1
diff --git a/engines/sword1/animation.h b/engines/sword1/animation.h
index f64b03dd1b..d0c61f5eb3 100644
--- a/engines/sword1/animation.h
+++ b/engines/sword1/animation.h
@@ -23,16 +23,19 @@
#ifndef SWORD1_ANIMATION_H
#define SWORD1_ANIMATION_H
-#include "video/dxa_decoder.h"
-#include "video/video_decoder.h"
-
#include "common/list.h"
-#include "audio/audiostream.h"
-
#include "sword1/screen.h"
#include "sword1/sound.h"
+namespace Graphics {
+struct Surface;
+}
+
+namespace Video {
+class VideoDecoder;
+}
+
namespace Sword1 {
enum DecoderType {
@@ -55,21 +58,9 @@ public:
}
};
-class DXADecoderWithSound : public Video::DXADecoder {
-public:
- DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle);
- ~DXADecoderWithSound() {}
-
- uint32 getElapsedTime() const;
-
-private:
- Audio::Mixer *_mixer;
- Audio::SoundHandle *_bgSoundHandle;
-};
-
class MoviePlayer {
public:
- MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, Audio::Mixer *snd, OSystem *system, Audio::SoundHandle *bgSoundHandle, Video::VideoDecoder *decoder, DecoderType decoderType);
+ MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType);
virtual ~MoviePlayer();
bool load(uint32 id);
void play();
@@ -78,7 +69,6 @@ protected:
SwordEngine *_vm;
Text *_textMan;
ResMan *_resMan;
- Audio::Mixer *_snd;
OSystem *_system;
Common::List<MovieText> _movieTexts;
int _textX, _textY, _textWidth, _textHeight;
@@ -88,8 +78,6 @@ protected:
DecoderType _decoderType;
Video::VideoDecoder *_decoder;
- Audio::SoundHandle *_bgSoundHandle;
- Audio::AudioStream *_bgSoundStream;
bool playVideo();
void performPostProcessing(byte *screen);
@@ -100,7 +88,7 @@ protected:
void convertColor(byte r, byte g, byte b, float &h, float &s, float &v);
};
-MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, Audio::Mixer *snd, OSystem *system);
+MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, OSystem *system);
} // End of namespace Sword1
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 087dcd09d8..5662e4672b 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -268,9 +268,6 @@ SaveStateDescriptor SwordMetaEngine::querySaveMetaInfos(const char *target, int
SaveStateDescriptor desc(slot, name);
- desc.setDeletableFlag(true);
- desc.setWriteProtectedFlag(false);
-
if (versionSave < 2) // These older version of the savegames used a flag to signal presence of thumbnail
in->skip(1);
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index 8e04861edf..757d768780 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -959,7 +959,7 @@ int Logic::fnPlaySequence(Object *cpt, int32 id, int32 sequenceId, int32 d, int3
// meantime, we don't want any looping sound effects still playing.
_sound->quitScreen();
- MoviePlayer *player = makeMoviePlayer(sequenceId, _vm, _textMan, _resMan, _mixer, _system);
+ MoviePlayer *player = makeMoviePlayer(sequenceId, _vm, _textMan, _resMan, _system);
if (player) {
_screen->clearScreen();
if (player->load(sequenceId))
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index ed994a97fa..5d1864d58d 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -99,13 +99,64 @@ uint8 ObjectMan::fnCheckForTextLine(uint32 textId) {
char *ObjectMan::lockText(uint32 textId) {
uint8 lang = SwordEngine::_systemVars.language;
+ char *text = lockText(textId, lang);
+ if (text == 0) {
+ if (lang != BS1_ENGLISH) {
+ text = lockText(textId, BS1_ENGLISH);
+ if (text != 0)
+ warning("Missing translation for textId %u (\"%s\")", textId, text);
+ unlockText(textId, BS1_ENGLISH);
+ }
+
+ return _missingSubTitleStr;
+ }
+ return text;
+}
+
+char *ObjectMan::lockText(uint32 textId, uint8 lang) {
char *addr = (char *)_resMan->openFetchRes(_textList[textId / ITM_PER_SEC][lang]);
if (addr == 0)
- return _missingSubTitleStr;
+ return NULL;
addr += sizeof(Header);
if ((textId & ITM_ID) >= _resMan->readUint32(addr)) {
+ // Workaround for missing sentences in some langages in the demo.
+ switch(textId) {
+ case 8455194:
+ return const_cast<char *>(_translationId8455194[lang]);
+ case 8455195:
+ return const_cast<char *>(_translationId8455195[lang]);
+ case 8455196:
+ return const_cast<char *>(_translationId8455196[lang]);
+ case 8455197:
+ return const_cast<char *>(_translationId8455197[lang]);
+ case 8455198:
+ return const_cast<char *>(_translationId8455198[lang]);
+ case 8455199:
+ return const_cast<char *>(_translationId8455199[lang]);
+ case 8455200:
+ return const_cast<char *>(_translationId8455200[lang]);
+ case 8455201:
+ return const_cast<char *>(_translationId8455201[lang]);
+ case 8455202:
+ return const_cast<char *>(_translationId8455202[lang]);
+ case 8455203:
+ return const_cast<char *>(_translationId8455203[lang]);
+ case 8455204:
+ return const_cast<char *>(_translationId8455204[lang]);
+ case 8455205:
+ return const_cast<char *>(_translationId8455205[lang]);
+ case 6488080:
+ return const_cast<char *>(_translationId6488080[lang]);
+ case 6488081:
+ return const_cast<char *>(_translationId6488081[lang]);
+ case 6488082:
+ return const_cast<char *>(_translationId6488082[lang]);
+ case 6488083:
+ return const_cast<char *>(_translationId6488083[lang]);
+ }
+
warning("ObjectMan::lockText(%d): only %d texts in file", textId & ITM_ID, _resMan->readUint32(addr));
- textId = 0; // get first line instead
+ return NULL;
}
uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1) * 4);
if (offset == 0) {
@@ -113,15 +164,19 @@ char *ObjectMan::lockText(uint32 textId) {
// We use the hardcoded text in this case.
if (textId == 2950145)
return const_cast<char *>(_translationId2950145[lang]);
-
+
warning("ObjectMan::lockText(%d): text number has no text lines", textId);
- return _missingSubTitleStr;
+ return NULL;
}
return addr + offset;
}
void ObjectMan::unlockText(uint32 textId) {
- _resMan->resClose(_textList[textId / ITM_PER_SEC][SwordEngine::_systemVars.language]);
+ unlockText(textId, SwordEngine::_systemVars.language);
+}
+
+void ObjectMan::unlockText(uint32 textId, uint8 lang) {
+ _resMan->resClose(_textList[textId / ITM_PER_SEC][lang]);
}
uint32 ObjectMan::lastTextNumber(int section) {
@@ -186,7 +241,193 @@ const char *const ObjectMan::_translationId2950145[7] = {
"Eh?", // Italian
"\277Eh?", // Spanish
"Ano?", // Czech
- " " // Portuguese
+ NULL // Portuguese
+};
+
+// The translations for the next texts are missing in the demo but are present
+// in the full game. The translations were therefore extracted from the full game.
+
+// Missing translation for textId 8455194 (in the demo).
+const char *const ObjectMan::_translationId8455194[7] = {
+ NULL, // "Who was the guy you were supposed to meet?", // English (not needed)
+ "Qui \351tait l'homme que vous deviez rencontrer?", // French
+ "Wer war der Typ, den Du treffen wolltest?", // German
+ "Chi dovevi incontrare?", // Italian
+ "\277Qui\351n era el hombre con el que ten\355as que encontrarte?", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455195 (in the demo).
+const char *const ObjectMan::_translationId8455195[7] = {
+ NULL, // "His name was Plantard. I didn't know him, but he called me last night.", // English (not needed)
+ "Son nom \351tait Plantard. Je ne le connaissais pas, mais il m'avait t\351l\351phon\351 la veille.", // French
+ "Sein Name war Plantard. Ich kannte ihn nicht, aber er hat mich letzte Nacht angerufen.", // German
+ "Si chiamava Plantard. Mi ha chiamato ieri sera, ma non lo conoscevo.", // Italian
+ "Su nombre era Plantard. Yo no lo conoc\355a pero \351l me llam\363 ayer por la noche.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455196 (in the demo).
+const char *const ObjectMan::_translationId8455196[7] = {
+ NULL, // "He said he had a story which would interest me.", // English (not needed)
+ "Il a dit qu'il avait une histoire qui devrait m'int\351resser.", // French
+ "Er sagte, er h\344tte eine Story, die mich interessieren w\374rde.", // German
+ "Mi disse che aveva una storia che mi poteva interessare.", // Italian
+ "Dijo que ten\355a una historia que me interesar\355a.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455197 (in the demo).
+const char *const ObjectMan::_translationId8455197[7] = {
+ NULL, // "He asked me to meet him at the caf\351.", // English (not needed)
+ "Il m'a demand\351 de le rencontrer au caf\351.", // French
+ "Er fragte mich, ob wir uns im Caf\351 treffen k\366nnten.", // German
+ "Mi chiese di incontrarci al bar.", // Italian
+ "Me pidi\363 que nos encontr\341ramos en el caf\351.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455198 (in the demo).
+const char *const ObjectMan::_translationId8455198[7] = {
+ NULL, // "I guess I'll never know what he wanted to tell me...", // English (not needed)
+ "Je suppose que je ne saurai jamais ce qu'il voulait me dire...", // French
+ "Ich werde wohl nie erfahren, was er mir sagen wollte...", // German
+ "Penso che non sapr\362 mai che cosa voleva dirmi...", // Italian
+ "Supongo que nunca sabr\351 qu\351 me quer\355a contar...", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455199 (in the demo).
+const char *const ObjectMan::_translationId8455199[7] = {
+ NULL, // "Not unless you have Rosso's gift for psychic interrogation.", // English (not needed)
+ "Non, \340 moins d'avoir les dons de Rosso pour les interrogatoires psychiques.", // French
+ "Es sei denn, Du h\344ttest Rosso's Gabe der parapsychologischen Befragung.", // German
+ "A meno che tu non riesca a fare interrogatori telepatici come Rosso.", // Italian
+ "A no ser que tengas el don de Rosso para la interrogaci\363n ps\355quica.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455200 (in the demo).
+const char *const ObjectMan::_translationId8455200[7] = {
+ NULL, // "How did Plantard get your name?", // English (not needed)
+ "Comment Plantard a-t-il obtenu votre nom?", // French
+ "Woher hat Plantard Deinen Namen?", // German
+ "Come ha fatto Plantard a sapere il tuo nome?", // Italian
+ "\277C\363mo consigui\363 Plantard tu nombre?", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455201 (in the demo).
+const char *const ObjectMan::_translationId8455201[7] = {
+ NULL, // "Through the newspaper - La Libert\351.", // English (not needed)
+ "Par mon journal... La Libert\351.", // French
+ "\334ber die Zeitung - La Libert\351.", // German
+ "Tramite il giornale La Libert\351.", // Italian
+ "Por el peri\363dico - La Libert\351.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455202 (in the demo).
+const char *const ObjectMan::_translationId8455202[7] = {
+ NULL, // "I'd written an article linking two unsolved murders, one in Italy, the other in Japan.", // English (not needed)
+ "J'ai \351crit un article o\371 je faisais le lien entre deux meurtres inexpliqu\351s, en Italie et au japon.", // French
+ "Ich habe einen Artikel geschrieben, in dem ich zwei ungel\366ste Morde miteinander in Verbindung bringe, einen in Italien, einen anderen in Japan.", // German
+ "Ho scritto un articolo che metteva in collegamento due omicidi insoluti in Italia e Giappone.", // Italian
+ "Yo hab\355a escrito un art\355culo conectando dos asesinatos sin resolver, uno en Italia, el otro en Jap\363n.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455203 (in the demo).
+const char *const ObjectMan::_translationId8455203[7] = {
+ NULL, // "The cases were remarkably similar...", // English (not needed)
+ "Les affaires \351taient quasiment identiques...", // French
+ "Die F\344lle sind sich bemerkenswert \344hnlich...", // German
+ "I casi erano sorprendentemente uguali...", // Italian
+ "Los casos eran incre\355blemente parecidos...", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455204 (in the demo).
+const char *const ObjectMan::_translationId8455204[7] = {
+ NULL, // "...a wealthy victim, no apparent motive, and a costumed killer.", // English (not needed)
+ "...une victime riche, pas de motif apparent, et un tueur d\351guis\351.", // French
+ "...ein wohlhabendes Opfer, kein offensichtliches Motiv, und ein verkleideter Killer.", // German
+ "...una vittima ricca, nessun motivo apparente e un assassino in costume.", // Italian
+ "...una v\355ctima rica, sin motivo aparente, y un asesino disfrazado.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 8455205 (in the demo).
+const char *const ObjectMan::_translationId8455205[7] = {
+ NULL, // "Plantard said he could supply me with more information.", // English (not needed)
+ "Plantard m'a dit qu'il pourrait me fournir des renseignements.", // French
+ "Plantard sagte, er k\366nne mir weitere Informationen beschaffen.", // German
+ "Plantard mi disse che mi avrebbe fornito ulteriori informazioni.", // Italian
+ "Plantard dijo que \351l me pod\355a proporcionar m\341s informaci\363n.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 6488080 (in the demo).
+const char *const ObjectMan::_translationId6488080[7] = {
+ NULL, // "I wasn't going to head off all over Paris until I'd investigated some more.", // English (not needed)
+ "Je ferais mieux d'enqu\351ter un peu par ici avant d'aller me promener ailleurs.", // French
+ "Ich durchquere nicht ganz Paris, bevor ich etwas mehr herausgefunden habe.", // German
+ "Non mi sarei incamminato per tutta Parigi prima di ulteriori indagini.", // Italian
+ "No iba a ponerme a recorrer Par\355s sin haber investigado un poco m\341s.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// The next three sentences are specific to the demo and only the english text is present.
+// The translations were provided by:
+// French: Thierry Crozat
+// German: Simon Sawatzki
+// Italian: Matteo Angelino
+// Spanish: Tomás Maidagan
+
+// Missing translation for textId 6488081 (in the demo).
+const char *const ObjectMan::_translationId6488081[7] = {
+ NULL, // "I wasn't sure what I was going to do when I caught up with that clown...", // English (not needed)
+ "Je ne savais pas ce que je ferais quand je rattraperais le clown...", // French
+ "Ich wu\337te nicht, worauf ich mich einlie\337, als ich dem Clown nachjagte...", // German
+ "Non sapevo cosa avrei fatto una volta raggiunto quel clown...", // Italian
+ "No sab\355a muy bien qu\351 es lo que har\355a cuando alcanzara al payaso...", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 6488082 (in the demo).
+const char *const ObjectMan::_translationId6488082[7] = {
+ NULL, // "...but before I knew it, I was drawn into a desperate race between two ruthless enemies.", // English (not needed)
+ "...mais avant de m'en rendre compte je me retrouvais happ\351 dans une course effr\351n\351e entre deux ennemis impitoyables.", // French
+ "... doch bevor ich mich versah, war ich inmitten eines Wettlaufs von zwei r\374cksichtslosen Feinden.", // German
+ "... ma prima che me ne rendessi conto, fui trascinato in una corsa disperata con due spietati nemici.", // Italian
+ "...pero sin darme cuenta, acab\351 en medio de una desesperada carrera entre dos despiadados enemigos.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
+};
+
+// Missing translation for textId 6488083 (in the demo).
+const char *const ObjectMan::_translationId6488083[7] = {
+ NULL, // "The goal: the mysterious power of the Broken Sword.", // English (not needed)
+ "Le but: les pouvoirs myst\351rieux de l'\351p\351e bris\351e.", // French
+ "Das Ziel: die geheimnisvolle Macht des zerbrochenen Schwertes.", // German
+ "Obiettivo: il misterioso potere della Spada spezzata.", // Italian
+ "El objetivo: el misterioso poder de la Espada Rota.", // Spanish
+ NULL, // Czech
+ NULL // Portuguese
};
} // End of namespace Sword1
diff --git a/engines/sword1/objectman.h b/engines/sword1/objectman.h
index ca3c7c1526..197b437c15 100644
--- a/engines/sword1/objectman.h
+++ b/engines/sword1/objectman.h
@@ -53,6 +53,9 @@ public:
void saveLiveList(uint16 *dest); // for loading/saving
void loadLiveList(uint16 *src);
private:
+ char *lockText(uint32 textId, uint8 language);
+ void unlockText(uint32 textId, uint8 language);
+
ResMan *_resMan;
static const uint32 _objectList[TOTAL_SECTIONS]; //a table of pointers to object files
static const uint32 _textList[TOTAL_SECTIONS][7]; //a table of pointers to text files
@@ -60,6 +63,22 @@ private:
uint8 *_cptData[TOTAL_SECTIONS];
static char _missingSubTitleStr[];
static const char *const _translationId2950145[7]; //translation for textId 2950145 (missing from cluster file for some langages)
+ static const char *const _translationId8455194[7]; //translation for textId 8455194 (missing in the demo)
+ static const char *const _translationId8455195[7]; //translation for textId 8455195 (missing in the demo)
+ static const char *const _translationId8455196[7]; //translation for textId 8455196 (missing in the demo)
+ static const char *const _translationId8455197[7]; //translation for textId 8455197 (missing in the demo)
+ static const char *const _translationId8455198[7]; //translation for textId 8455198 (missing in the demo)
+ static const char *const _translationId8455199[7]; //translation for textId 8455199 (missing in the demo)
+ static const char *const _translationId8455200[7]; //translation for textId 8455200 (missing in the demo)
+ static const char *const _translationId8455201[7]; //translation for textId 8455201 (missing in the demo)
+ static const char *const _translationId8455202[7]; //translation for textId 8455202 (missing in the demo)
+ static const char *const _translationId8455203[7]; //translation for textId 8455203 (missing in the demo)
+ static const char *const _translationId8455204[7]; //translation for textId 8455204 (missing in the demo)
+ static const char *const _translationId8455205[7]; //translation for textId 8455205 (missing in the demo)
+ static const char *const _translationId6488080[7]; //translation for textId 6488081 (missing in the demo)
+ static const char *const _translationId6488081[7]; //translation for textId 6488081 (missing in the demo)
+ static const char *const _translationId6488082[7]; //translation for textId 6488082 (missing in the demo)
+ static const char *const _translationId6488083[7]; //translation for textId 6488083 (missing in the demo)
};
} // End of namespace Sword1
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index 3574074b00..61bf5257ab 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -142,7 +142,7 @@ void Sound::checkSpeechFileEndianness() {
be_diff_sum += fabs((double)(be_value - prev_be_value));
prev_be_value = be_value;
}
- delete [] data;
+ delete[] data;
}
// Set the big endian flag
_bigEndianSpeech = (be_diff_sum < le_diff_sum);
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index 3bd2fdb2e6..f23ac5f182 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -156,6 +156,8 @@ uint16 Text::analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *line)
}
uint16 Text::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen) {
+ if (ch < SPACE)
+ ch = 64;
FrameHeader *chFrame = _resMan->fetchFrame(_font, ch - SPACE);
uint8 *chData = ((uint8 *)chFrame) + sizeof(FrameHeader);
uint8 *dest = sprPtr;