aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush/scumm_renderer.cpp
diff options
context:
space:
mode:
authorMax Horn2003-03-13 01:49:54 +0000
committerMax Horn2003-03-13 01:49:54 +0000
commitf6b03c0aba8867201612b2036c3a05e1ecfc8773 (patch)
treeb639c286b6f63e6bb8eae50b68232c729279e4b3 /scumm/smush/scumm_renderer.cpp
parent4c6e8dc695aeb8440414f06f86f9b834ac683962 (diff)
downloadscummvm-rg350-f6b03c0aba8867201612b2036c3a05e1ecfc8773.tar.gz
scummvm-rg350-f6b03c0aba8867201612b2036c3a05e1ecfc8773.tar.bz2
scummvm-rg350-f6b03c0aba8867201612b2036c3a05e1ecfc8773.zip
char* -> byte*; if something is declared 'private' and then subclasses have to hack around that (BaseRenderer vs. ScummRenderer) that's usually a hint that it was not the right choice to make it private; don't use so many accessors for no good reasons
svn-id: r6808
Diffstat (limited to 'scumm/smush/scumm_renderer.cpp')
-rw-r--r--scumm/smush/scumm_renderer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/scumm/smush/scumm_renderer.cpp b/scumm/smush/scumm_renderer.cpp
index a3721ce0cd..998b60ed22 100644
--- a/scumm/smush/scumm_renderer.cpp
+++ b/scumm/smush/scumm_renderer.cpp
@@ -28,7 +28,6 @@
#include "scumm/scumm.h"
#include "scumm/sound.h"
#include "scumm/imuse.h"
-#include "scumm/actor.h"
class ScummMixer : public Mixer {
private:
@@ -188,9 +187,9 @@ bool ScummMixer::stop() {
debug(9, "ScummMixer::stop()");
for(int i = _mixer->_beginSlots; i < SoundMixer::NUM_CHANNELS; i++) {
if(_channels[i].id != -1) {
- delete _channels[i].chan;
- _channels[i].id = -1;
- _channels[i].chan = 0;
+ delete _channels[i].chan;
+ _channels[i].id = -1;
+ _channels[i].chan = 0;
}
}
return true;
@@ -214,7 +213,7 @@ bool ScummRenderer::initFrame(const Point &p) {
_width = p.getX();
_height = p.getY();
assert(_width && _height);
- _data = (char *)_scumm->virtscr[0].screenPtr + _scumm->virtscr[0].xstart;
+ _data = _scumm->virtscr[0].screenPtr + _scumm->virtscr[0].xstart;
return true;
}
@@ -223,7 +222,7 @@ void ScummRenderer::clean() {
_width = _height = 0;
}
-char *ScummRenderer::lockFrame(int32 frame) {
+byte *ScummRenderer::lockFrame(int32 frame) {
_frame = frame;
if(!_data) error("no allocated image buffer in lock_frame");
return _data;
@@ -241,6 +240,7 @@ Mixer *ScummRenderer::getMixer() {
}
ScummRenderer::~ScummRenderer() {
+ clean();
_scumm->_insaneState = false;
_scumm->exitCutscene();
if(_smixer) {
@@ -294,14 +294,14 @@ bool ScummRenderer::setPalette(const Palette &pal) {
}
void ScummRenderer::save(int32 frame) {
- int width = MIN(getWidth(), _scumm->_realWidth);
- int height = MIN(getHeight(), _scumm->_realHeight);
+ int width = MIN(_width, _scumm->_realWidth);
+ int height = MIN(_height, _scumm->_realHeight);
// In theory, this will always be true. In reality, there may be
// several pending updates because the computer wasn't fast enough to
// process them all. In that case, skip the frame to catch up.
if (--_pending_updates <= 0) {
- _scumm->_system->copy_rect((const byte *)data(), getWidth(), 0, 0, width, height);
+ _scumm->_system->copy_rect(_data, _width, 0, 0, width, height);
_scumm->_system->update_screen();
} else {
warning("ScummRenderer: Skipping frame %d to catch up", getFrame());