diff options
author | Paweł Kołodziejski | 2003-03-12 21:44:18 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2003-03-12 21:44:18 +0000 |
commit | 08cd9d994a31403bbc00c8e3fc086a61501dad87 (patch) | |
tree | e5c997feb863625403c8a54f7609cbdd4e8ec836 /scumm/smush | |
parent | cdb699fa43845d392bbbc204eddd8269f5bd498e (diff) | |
download | scummvm-rg350-08cd9d994a31403bbc00c8e3fc086a61501dad87.tar.gz scummvm-rg350-08cd9d994a31403bbc00c8e3fc086a61501dad87.tar.bz2 scummvm-rg350-08cd9d994a31403bbc00c8e3fc086a61501dad87.zip |
removed additional back buffer in smush
svn-id: r6802
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/brenderer.h | 6 | ||||
-rw-r--r-- | scumm/smush/scumm_renderer.cpp | 30 | ||||
-rw-r--r-- | scumm/smush/scumm_renderer.h | 10 |
3 files changed, 33 insertions, 13 deletions
diff --git a/scumm/smush/brenderer.h b/scumm/smush/brenderer.h index 52dbc07706..288e673d18 100644 --- a/scumm/smush/brenderer.h +++ b/scumm/smush/brenderer.h @@ -47,9 +47,9 @@ protected: protected: const char *getFilename() const { return _fname; }; //!< accessor for animation filename int32 getNbframes() const { return _nbframes; }; //!< accessor for number of frames - int32 getWidth() const { return _width; }; //!< accessor for current width - int32 getHeight() const { return _height; }; //!< accessor for current height - const char *data() const { return _data; }; //!< accessor for current frame buffer + virtual int32 getWidth() const { return _width; }; //!< accessor for current width + virtual int32 getHeight() const { return _height; }; //!< accessor for current height + virtual const char *data() const { return _data; }; //!< accessor for current frame buffer void clean(); //!< memory cleanup (deletes frame buffer) void setFrame(int32 f) { _frame = f; }; //!< allows to change the frame number public: diff --git a/scumm/smush/scumm_renderer.cpp b/scumm/smush/scumm_renderer.cpp index ed5f3f0284..a3721ce0cd 100644 --- a/scumm/smush/scumm_renderer.cpp +++ b/scumm/smush/scumm_renderer.cpp @@ -209,6 +209,26 @@ static void smush_handler(void *engine) { s_renderer->update(); } +bool ScummRenderer::initFrame(const Point &p) { + clean(); + _width = p.getX(); + _height = p.getY(); + assert(_width && _height); + _data = (char *)_scumm->virtscr[0].screenPtr + _scumm->virtscr[0].xstart; + return true; +} + +void ScummRenderer::clean() { + _data = 0; + _width = _height = 0; +} + +char *ScummRenderer::lockFrame(int32 frame) { + _frame = frame; + if(!_data) error("no allocated image buffer in lock_frame"); + return _data; +} + Mixer *ScummRenderer::getMixer() { if(_smixer == 0) { _smixer = new ScummMixer(_scumm->_mixer); @@ -233,17 +253,7 @@ ScummRenderer::~ScummRenderer() { } _scumm->_sound->pauseBundleMusic(false); - _scumm->_fullRedraw = 1; -#if 0 - // FIXME - enabling this breaks the COMI demo. OTOH I am not aware - // what disabling this breaks... if anybody knows of any regressions - // turning this off causes, please tell me. - _scumm->redrawBGAreas(); - for (int32 i = 0; i < _scumm->NUM_ACTORS; i++) - _scumm->derefActor(i)->needRedraw = true; - _scumm->processActors(); -#endif } bool ScummRenderer::wait(int32 ms) { diff --git a/scumm/smush/scumm_renderer.h b/scumm/smush/scumm_renderer.h index e8779fd966..c4a7274854 100644 --- a/scumm/smush/scumm_renderer.h +++ b/scumm/smush/scumm_renderer.h @@ -46,12 +46,22 @@ private: ScummMixer *_smixer; uint32 _insaneSpeed; volatile int _pending_updates; + int32 _width; //!< The current frame's width + int32 _height; //!< The current frame's height + int32 _frame; //!< The current frame number + char *_data; //!< The current frame buffer public: ScummRenderer(Scumm *scumm, uint32 speed); virtual ~ScummRenderer(); + virtual int32 getWidth() const { return _width; }; //!< accessor for current width + virtual int32 getHeight() const { return _height; }; //!< accessor for current height + virtual const char *data() const { return _data; }; //!< accessor for current frame buffer virtual bool wait(int32 ms); bool update(); protected: + virtual bool initFrame(const Point &size); + virtual char *lockFrame(int32 frame); + virtual void clean(); virtual bool startDecode(const char *fname, int32 version, int32 nbframes); virtual bool setPalette(const Palette & pal); virtual void save(int32 frame = -1); |