aboutsummaryrefslogtreecommitdiff
path: root/saga/scene.cpp
diff options
context:
space:
mode:
authorAndrew Kurushin2005-07-09 16:23:45 +0000
committerAndrew Kurushin2005-07-09 16:23:45 +0000
commitc2f1691bada2c0e945b206e5ed71752f0ba569b5 (patch)
tree6139934a412ce5c92aff1e4afbf3b2ee9b40769a /saga/scene.cpp
parentf7a6729a01ce8c07dddf4a7f7c0b25f8690e2c1a (diff)
downloadscummvm-rg350-c2f1691bada2c0e945b206e5ed71752f0ba569b5.tar.gz
scummvm-rg350-c2f1691bada2c0e945b206e5ed71752f0ba569b5.tar.bz2
scummvm-rg350-c2f1691bada2c0e945b206e5ed71752f0ba569b5.zip
gfx rearangement
code cleanups svn-id: r18523
Diffstat (limited to 'saga/scene.cpp')
-rw-r--r--saga/scene.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp
index d2073801aa..753a758dbf 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -284,7 +284,7 @@ void Scene::getBGInfo(BGInfo &bgInfo) {
bgInfo.bounds.setHeight(_bg.h);
}
-int Scene::getBGPal(PALENTRY **pal) {
+int Scene::getBGPal(PalEntry **pal) {
assert(_initialized);
*pal = _bg.pal;
@@ -383,7 +383,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
int i;
EVENT event;
EVENT *q_event;
- static PALENTRY current_pal[PAL_ENTRIES];
+ static PalEntry current_pal[PAL_ENTRIES];
if (_sceneLoaded) {
error("Scene::loadScene(): Error, a scene is already loaded");
@@ -852,7 +852,7 @@ int Scene::processSceneResources() {
break;
case SAGA_PALETTE:
{
- PALENTRY pal[PAL_ENTRIES];
+ PalEntry pal[PAL_ENTRIES];
byte *palPtr = resourceData;
if (resourceDataLength < 3 * PAL_ENTRIES)
@@ -875,27 +875,30 @@ int Scene::processSceneResources() {
}
void Scene::draw() {
- SURFACE *backBuffer;
- BUFFER_INFO buf_info;
- Point bgPoint(0, 0);
-
- assert(_initialized);
+ Surface *backBuffer;
+ Surface *backGroundSurface;
+ Rect rect;
backBuffer = _vm->_gfx->getBackBuffer();
- _vm->_render->getBufferInfo(&buf_info);
+ backGroundSurface = _vm->_render->getBackGroundSurface();
if (_sceneDescription.flags & kSceneFlagISO) {
_vm->_isoMap->adjustScroll(false);
_vm->_isoMap->draw(backBuffer);
} else {
-
- bufToSurface(backBuffer, buf_info.bg_buf, buf_info.bg_buf_w,
- _sceneClip.bottom < buf_info.bg_buf_h ? _vm->getSceneHeight() : buf_info.bg_buf_h, NULL, &bgPoint);
+ backGroundSurface->getRect(rect);
+ if (_sceneClip.bottom < rect.bottom) {
+ rect.bottom = _vm->getSceneHeight();
+ }
+ backBuffer->blit(rect, (const byte *)backGroundSurface->pixels);
}
}
void Scene::endScene() {
+ Surface *backBuffer;
+ Surface *backGroundSurface;
+ Rect rect;
int i;
if (!_sceneLoaded)
@@ -912,11 +915,11 @@ void Scene::endScene() {
_vm->_script->_skipSpeeches = false;
// Copy current screen to render buffer so inset rooms will get proper background
- SURFACE *back_buf = _vm->_gfx->getBackBuffer();
- BUFFER_INFO rbuf_info;
+ backBuffer= _vm->_gfx->getBackBuffer();
+ backGroundSurface = _vm->_render->getBackGroundSurface();
+ backBuffer->getRect(rect);
- _vm->_render->getBufferInfo(&rbuf_info);
- bufToBuffer(rbuf_info.bg_buf, rbuf_info.bg_buf_w, rbuf_info.bg_buf_h, (byte *)back_buf->pixels, back_buf->w, back_buf->h, NULL, NULL);
+ backGroundSurface->blit(rect, (const byte *)backBuffer->pixels);
// Free scene background
if (_bg.loaded) {
free(_bg.buf);