aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/detection.cpp8
-rw-r--r--engines/saga/input.cpp1
-rw-r--r--engines/saga/interface.cpp6
-rw-r--r--engines/saga/music.cpp3
-rw-r--r--engines/saga/palanim.h1
-rw-r--r--engines/saga/puzzle.cpp18
-rw-r--r--engines/saga/render.cpp2
-rw-r--r--engines/saga/saga.h1
-rw-r--r--engines/saga/saveload.cpp7
-rw-r--r--engines/saga/shorten.cpp1
-rw-r--r--engines/saga/shorten.h1
-rw-r--r--engines/saga/sthread.cpp1
12 files changed, 16 insertions, 34 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 2f1b61eed8..091ec8d427 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -256,13 +256,7 @@ SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int s
desc.setWriteProtectedFlag(false);
if (version >= 6) {
- Graphics::Surface *thumbnail = new Graphics::Surface();
- assert(thumbnail);
- if (!Graphics::loadThumbnail(*in, *thumbnail)) {
- delete thumbnail;
- thumbnail = 0;
- }
-
+ Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*in);
desc.setThumbnail(thumbnail);
uint32 saveDate = in->readUint32BE();
diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp
index 69a353da9f..8576a3e536 100644
--- a/engines/saga/input.cpp
+++ b/engines/saga/input.cpp
@@ -158,4 +158,3 @@ Point SagaEngine::mousePos() const {
}
} // End of namespace Saga
-
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 08c5ddc6f9..fe37ed8995 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -320,7 +320,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_disableAbortSpeeches = false;
// set save game reminder alarm
- _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this, "sagaSaveReminder");
}
Interface::~Interface() {
@@ -335,7 +335,7 @@ void Interface::updateSaveReminder() {
_saveReminderState = _saveReminderState % _vm->getDisplayInfo().saveReminderNumSprites + 1;
drawStatusBar();
_vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
- _vm->getTimerManager()->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this);
+ _vm->getTimerManager()->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this, "sagaSaveReminder");
}
}
@@ -1390,7 +1390,7 @@ void Interface::setSave(PanelButton *panelButton) {
void Interface::resetSaveReminder() {
_vm->getTimerManager()->removeTimerProc(&saveReminderCallback);
- _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this, "sagaSaveReminder");
setSaveReminderState(1);
}
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 49d3f91d77..13850a0b6d 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -213,7 +213,7 @@ void Music::setVolume(int volume, int time) {
return;
}
- _vm->getTimerManager()->installTimerProc(&musicVolumeGaugeCallback, time * 3000L, this);
+ _vm->getTimerManager()->installTimerProc(&musicVolumeGaugeCallback, time * 3000L, this, "sagaMusicVolume");
}
bool Music::isPlaying() {
@@ -386,4 +386,3 @@ void Music::stop() {
}
} // End of namespace Saga
-
diff --git a/engines/saga/palanim.h b/engines/saga/palanim.h
index 9959d08e2f..920cbec65a 100644
--- a/engines/saga/palanim.h
+++ b/engines/saga/palanim.h
@@ -53,4 +53,3 @@ class PalAnim {
} // End of namespace Saga
#endif
-
diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp
index d5d83c706f..63d9a88fee 100644
--- a/engines/saga/puzzle.cpp
+++ b/engines/saga/puzzle.cpp
@@ -140,7 +140,7 @@ void Puzzle::initPieceInfo(int i, int16 curX, int16 curY, byte offX, byte offY,
void Puzzle::execute() {
_active = true;
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint");
initPieces();
@@ -408,12 +408,12 @@ void Puzzle::solicitHint() {
switch (_hintRqState) {
case kRQSpeaking:
if (_vm->_actor->isSpeaking()) {
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50 * 1000000, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50 * 1000000, this, "sagaPuzzleHint");
break;
}
_hintRqState = _hintNextRqState;
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 100*1000000/3, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 100*1000000/3, this, "sagaPuzzleHint");
break;
case kRQNoHint:
@@ -436,11 +436,11 @@ void Puzzle::solicitHint() {
// Roll to see if Sakka scolds
if (_vm->_rnd.getRandomNumber(1)) {
_hintRqState = kRQSakkaDenies;
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 200*1000000, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 200*1000000, this, "sagaPuzzleHint");
} else {
_hintRqState = kRQSpeaking;
_hintNextRqState = kRQHintRequested;
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this, "sagaPuzzleHint");
}
break;
@@ -453,7 +453,7 @@ void Puzzle::solicitHint() {
_hintRqState = kRQSpeaking;
_hintNextRqState = kRQHintRequestedStage2;
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this, "sagaPuzzleHint");
_vm->_interface->converseClear();
_vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0);
@@ -480,7 +480,7 @@ void Puzzle::solicitHint() {
_vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0);
_vm->_interface->converseDisplayText();
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint");
_hintRqState = kRQSkipEverything;
break;
@@ -504,7 +504,7 @@ void Puzzle::handleReply(int reply) {
_vm->_actor->abortSpeech();
_hintRqState = kRQNoHint;
_vm->getTimerManager()->removeTimerProc(&hintTimerCallback);
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this, "sagaPuzzleHint");
clearHint();
break;
}
@@ -566,7 +566,7 @@ void Puzzle::giveHint() {
_vm->_interface->converseDisplayText();
_vm->getTimerManager()->removeTimerProc(&hintTimerCallback);
- _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this);
+ _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint");
}
void Puzzle::clearHint() {
diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp
index 757374a3a3..a9ef23381e 100644
--- a/engines/saga/render.cpp
+++ b/engines/saga/render.cpp
@@ -50,7 +50,7 @@ Render::Render(SagaEngine *vm, OSystem *system) {
#ifdef SAGA_DEBUG
// Initialize FPS timer callback
- _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this);
+ _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this, "sagaFPS");
#endif
_backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, Graphics::PixelFormat::createFormatCLUT8());
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 336883680a..fb01b1ac5d 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -29,7 +29,6 @@
#include "common/random.h"
#include "common/memstream.h"
#include "common/textconsole.h"
-#include "audio/mididrv.h"
#include "saga/gfx.h"
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 8d7b718c09..9e0789fdaf 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -295,12 +295,7 @@ void SagaEngine::load(const char *fileName) {
if (_saveHeader.version >= 6) {
// We don't need the thumbnail here, so just read it and discard it
- Graphics::Surface *thumbnail = new Graphics::Surface();
- assert(thumbnail);
- Graphics::loadThumbnail(*in, *thumbnail);
- thumbnail->free();
- delete thumbnail;
- thumbnail = 0;
+ Graphics::skipThumbnail(*in);
in->readUint32BE(); // save date
in->readUint16BE(); // save time
diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp
index 39af7aa3db..5efc8d1f67 100644
--- a/engines/saga/shorten.cpp
+++ b/engines/saga/shorten.cpp
@@ -541,4 +541,3 @@ Audio::AudioStream *makeShortenStream(Common::SeekableReadStream &stream) {
} // End of namespace Audio
#endif // defined(SOUND_SHORTEN_H)
-
diff --git a/engines/saga/shorten.h b/engines/saga/shorten.h
index f2114bedeb..77feafa54d 100644
--- a/engines/saga/shorten.h
+++ b/engines/saga/shorten.h
@@ -57,4 +57,3 @@ Audio::AudioStream *makeShortenStream(Common::ReadStream &stream);
#endif
#endif // engine and dynamic plugins guard
-
diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp
index ec81d8d733..afd528f4b5 100644
--- a/engines/saga/sthread.cpp
+++ b/engines/saga/sthread.cpp
@@ -236,4 +236,3 @@ bool Script::runThread(ScriptThread &thread) {
}
} // End of namespace Saga
-