aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/animation.cpp
diff options
context:
space:
mode:
authorMax Horn2011-05-17 15:05:20 +0200
committerMax Horn2011-05-17 15:05:20 +0200
commitd84ae94b54e0aa2bdea740736dc65e35081c6f51 (patch)
tree37e9e1f49e1ddd8e03274d5fd9803770d8662f13 /engines/sword1/animation.cpp
parent2149edbe5d5c4699eaaf826c7a769ab764548eac (diff)
downloadscummvm-rg350-d84ae94b54e0aa2bdea740736dc65e35081c6f51.tar.gz
scummvm-rg350-d84ae94b54e0aa2bdea740736dc65e35081c6f51.tar.bz2
scummvm-rg350-d84ae94b54e0aa2bdea740736dc65e35081c6f51.zip
SWORD1: Const correctness, code cleanup & simplification
Diffstat (limited to 'engines/sword1/animation.cpp')
-rw-r--r--engines/sword1/animation.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index dd9a9da1be..b66cc6b5a7 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -126,7 +126,7 @@ bool MoviePlayer::load(uint32 id) {
continue;
}
- _movieTexts.push_back(new MovieText(startFrame, endFrame, ptr));
+ _movieTexts.push_back(MovieText(startFrame, endFrame, ptr));
lastEnd = endFrame;
}
f.close();
@@ -161,8 +161,7 @@ void MoviePlayer::play() {
_textMan->releaseText(2, false);
- while (!_movieTexts.empty())
- delete _movieTexts.remove_at(_movieTexts.size() - 1);
+ _movieTexts.clear();
while (_snd->isSoundHandleActive(*_bgSoundHandle))
_system->delayMillis(100);
@@ -179,8 +178,8 @@ void MoviePlayer::play() {
void MoviePlayer::performPostProcessing(byte *screen) {
if (!_movieTexts.empty()) {
- if (_decoder->getCurFrame() == _movieTexts[0]->_startFrame) {
- _textMan->makeTextSprite(2, (uint8 *)_movieTexts[0]->_text, 600, LETTER_COL);
+ if (_decoder->getCurFrame() == _movieTexts.front()._startFrame) {
+ _textMan->makeTextSprite(2, (const uint8 *)_movieTexts.front()._text.c_str(), 600, LETTER_COL);
FrameHeader *frame = _textMan->giveSpriteData(2);
_textWidth = frame->width;
@@ -188,9 +187,9 @@ void MoviePlayer::performPostProcessing(byte *screen) {
_textX = 320 - _textWidth / 2;
_textY = 420 - _textHeight;
}
- if (_decoder->getCurFrame() == _movieTexts[0]->_endFrame) {
+ if (_decoder->getCurFrame() == _movieTexts.front()._endFrame) {
_textMan->releaseText(2, false);
- delete _movieTexts.remove_at(0);
+ _movieTexts.pop_front();
}
}