diff options
author | Torbjörn Andersson | 2004-12-29 16:10:53 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-12-29 16:10:53 +0000 |
commit | a5656fa83e17d74a7e695fcb0bd5fcabba3ca4f2 (patch) | |
tree | 62552d7e6dc981e2f14eaa585f533ce259611aeb /saga/sfuncs.cpp | |
parent | fd0efdc6546d9cddf2ae64d6fbebd33bed7f9085 (diff) | |
download | scummvm-rg350-a5656fa83e17d74a7e695fcb0bd5fcabba3ca4f2.tar.gz scummvm-rg350-a5656fa83e17d74a7e695fcb0bd5fcabba3ca4f2.tar.bz2 scummvm-rg350-a5656fa83e17d74a7e695fcb0bd5fcabba3ca4f2.zip |
Implemented the "placard" functions, because they're such a nice visual
feedback that something right is happening.
svn-id: r16371
Diffstat (limited to 'saga/sfuncs.cpp')
-rw-r--r-- | saga/sfuncs.cpp | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 500742acc3..bdbad2a562 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -29,9 +29,11 @@ #include "saga/actor.h" #include "saga/animation.h" #include "saga/console.h" +#include "saga/font.h" #include "saga/interface.h" #include "saga/music.h" #include "saga/objectdata.h" +#include "saga/render.h" #include "saga/sound.h" #include "saga/sndres.h" @@ -920,13 +922,58 @@ int Script::SF_simulSpeech2(SCRIPTFUNC_PARAMS) { // Script function #48 (0x30) int Script::SF_placard(SCRIPTFUNC_PARAMS) { - debug(1, "stub: SF_placard()"); + GAME_DISPLAYINFO disp_info; + SURFACE *back_buf = _vm->_gfx->getBackBuffer(); + PALENTRY cur_pal[PAL_ENTRIES]; + PALENTRY *pal; + + _vm->getDisplayInfo(&disp_info); + + _vm->_gfx->showCursor(false); + _vm->_gfx->getCurrentPal(cur_pal); + _vm->_gfx->palToBlackWait(back_buf, cur_pal, PALETTE_FADE_DURATION); + + _vm->_interface->setStatusText(""); + + Rect rect(disp_info.logical_w, disp_info.scene_h); + drawRect(back_buf, &rect, 138); + + // TODO: Draw the text at the correct spot. This is (probably) just a + // close approximation. + _vm->textDraw(MEDIUM_FONT_ID, back_buf, getString(thread->pop()), + disp_info.logical_w / 2, disp_info.scene_h / 2, + _vm->_gfx->getWhite(), _vm->_gfx->getBlack(), + FONT_OUTLINE | FONT_CENTERED); + + _vm->_render->setFlag(RF_PLACARD); + _vm->_render->drawScene(); + + _vm->_scene->getBGPal(&pal); + _vm->_gfx->blackToPalWait(back_buf, pal, PALETTE_FADE_DURATION); + return SUCCESS; } // Script function #49 (0x31) int Script::SF_placardOff(SCRIPTFUNC_PARAMS) { - debug(1, "stub: SF_placardOff()"); + SURFACE *back_buf = _vm->_gfx->getBackBuffer(); + PALENTRY cur_pal[PAL_ENTRIES]; + PALENTRY *pal; + + // Fade down + _vm->_gfx->showCursor(false); + _vm->_gfx->getCurrentPal(cur_pal); + _vm->_gfx->palToBlackWait(back_buf, cur_pal, PALETTE_FADE_DURATION); + + _vm->_render->clearFlag(RF_PLACARD); + _vm->_render->drawScene(); + + // Fade up + _vm->_scene->getBGPal(&pal); + + _vm->_gfx->showCursor(true); + _vm->_gfx->blackToPalWait(back_buf, pal, PALETTE_FADE_DURATION); + return SUCCESS; } |