aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword1/animation.cpp')
-rw-r--r--engines/sword1/animation.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index b66cc6b5a7..cb86264eeb 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -24,6 +24,7 @@
#include "common/events.h"
#include "common/keyboard.h"
#include "common/textconsole.h"
+#include "common/translation.h"
#include "sword1/sword1.h"
#include "sword1/animation.h"
#include "sword1/text.h"
@@ -85,7 +86,7 @@ MoviePlayer::~MoviePlayer() {
*/
bool MoviePlayer::load(uint32 id) {
Common::File f;
- char filename[20];
+ Common::String filename;
if (_decoderType == kVideoDecoderDXA)
_bgSoundStream = Audio::SeekableAudioStream::openStreamFile(sequenceList[id]);
@@ -93,7 +94,7 @@ bool MoviePlayer::load(uint32 id) {
_bgSoundStream = NULL;
if (SwordEngine::_systemVars.showText) {
- sprintf(filename, "%s.txt", sequenceList[id]);
+ filename = Common::String::format("%s.txt", sequenceList[id]);
if (f.open(filename)) {
Common::String line;
int lineNo = 0;
@@ -117,12 +118,12 @@ bool MoviePlayer::load(uint32 id) {
ptr++;
if (startFrame > endFrame) {
- warning("%s:%d: startFrame (%d) > endFrame (%d)", filename, lineNo, startFrame, endFrame);
+ warning("%s:%d: startFrame (%d) > endFrame (%d)", filename.c_str(), lineNo, startFrame, endFrame);
continue;
}
if (startFrame <= lastEnd) {
- warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename, lineNo, startFrame, lastEnd);
+ warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename.c_str(), lineNo, startFrame, lastEnd);
continue;
}
@@ -135,14 +136,14 @@ bool MoviePlayer::load(uint32 id) {
switch (_decoderType) {
case kVideoDecoderDXA:
- snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]);
+ filename = Common::String::format("%s.dxa", sequenceList[id]);
break;
case kVideoDecoderSMK:
- snprintf(filename, sizeof(filename), "%s.smk", sequenceList[id]);
+ filename = Common::String::format("%s.smk", sequenceList[id]);
break;
}
- return _decoder->loadFile(filename);
+ return _decoder->loadFile(filename.c_str());
}
void MoviePlayer::play() {
@@ -323,41 +324,40 @@ uint32 DXADecoderWithSound::getElapsedTime() const {
///////////////////////////////////////////////////////////////////////////////
MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::Mixer *snd, OSystem *system) {
- char filename[20];
- char buf[60];
+ Common::String filename;
Audio::SoundHandle *bgSoundHandle = new Audio::SoundHandle;
- snprintf(filename, sizeof(filename), "%s.smk", sequenceList[id]);
+ 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, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK);
}
- snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]);
+ 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, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA);
#else
- GUI::MessageDialog dialog("DXA cutscenes found but ScummVM has been built without zlib support", "OK");
+ GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib support"), _("OK"));
dialog.runModal();
return NULL;
#endif
}
// Old MPEG2 cutscenes
- snprintf(filename, sizeof(filename), "%s.mp2", sequenceList[id]);
+ filename = Common::String::format("%s.mp2", sequenceList[id]);
if (Common::File::exists(filename)) {
- GUI::MessageDialog dialog("MPEG2 cutscenes are no longer supported", "OK");
+ GUI::MessageDialog dialog(_("MPEG2 cutscenes are no longer supported"), _("OK"));
dialog.runModal();
return NULL;
}
- sprintf(buf, "Cutscene '%s' not found", sequenceList[id]);
- GUI::MessageDialog dialog(buf, "OK");
+ Common::String buf = Common::String::format(_("Cutscene '%s' not found"), sequenceList[id]);
+ GUI::MessageDialog dialog(buf, _("OK"));
dialog.runModal();
return NULL;