diff options
author | Eugene Sandulenko | 2014-01-15 15:25:00 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-15 15:39:29 +0200 |
commit | 4a792953796819d37ce86320a407ea86dca584dc (patch) | |
tree | 6a61cd9b169247b55c2a14ea766fa6292977c5b0 | |
parent | db4c5eb2c0e13d7c4081674f3d3487ef5b9205a3 (diff) | |
download | scummvm-rg350-4a792953796819d37ce86320a407ea86dca584dc.tar.gz scummvm-rg350-4a792953796819d37ce86320a407ea86dca584dc.tar.bz2 scummvm-rg350-4a792953796819d37ce86320a407ea86dca584dc.zip |
FULLPIPE: Implement ModalMap::initMap()
-rw-r--r-- | engines/fullpipe/constants.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 51 |
2 files changed, 52 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 25f69b5515..1a6ecbbec8 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -100,6 +100,8 @@ namespace Fullpipe { #define PIC_MAP_A12 5274 #define PIC_MAP_A13 5275 #define PIC_MAP_A14 5276 +#define PIC_MAP_I01 5295 +#define PIC_MAP_I02 5296 #define PIC_MAP_P01 5277 #define PIC_MAP_P02 5278 #define PIC_MAP_P03 5279 diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index cf4a937f4e..4806f23553 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -371,7 +371,56 @@ bool ModalMap::handleMessage(ExCommand *cmd) { } void ModalMap::initMap() { - warning("STUB: ModalMap::initMap()"); + _isRunning = 1; + + _mapScene = g_fp->accessScene(SC_MAP); + + if (!_mapScene) + error("ModalMap::initMap(): error accessing scene SC_MAP"); + + PictureObject *pic; + + for (int i = 0; i < 200; i++) { + if (!g_fp->_mapTable[i] >> 16) + break; + + pic = _mapScene->getPictureObjectById(g_fp->_mapTable[i] >> 16, 0); + + if ((g_fp->_mapTable[i] & 0xffff) == 1) + pic->_flags |= 4; + else + pic->_flags &= 0xfffb; + } + + pic = getScenePicture(); + + Common::Point point; + Common::Point point2; + + if (pic) { + pic->getDimensions(&point); + + _rect2.left = point.x / 2 + pic->_ox - 400; + _rect2.top = point.y / 2 + pic->_oy - 300; + _rect2.right = _rect2.left + 800; + _rect2.bottom = _rect2.top + 600; + + _mapScene->updateScrolling2(); + + _pic = _mapScene->getPictureObjectById(PIC_MAP_I02, 0); + _pic->getDimensions(&point2); + + _pic->setOXY(pic->_ox + point.x / 2 - point2.x / 2, point.y - point2.y / 2 + pic->_oy - 24); + _pic->_flags |= 4; + + _pic = _mapScene->getPictureObjectById(PIC_MAP_I01, 0); + _pic->getDimensions(&point2); + + _pic->setOXY(pic->_ox + point.x / 2 - point2.x / 2, point.y - point2.y / 2 + pic->_oy - 25); + _pic->_flags |= 4; + } + + g_fp->setArcadeOverlay(PIC_CSR_MAP); } PictureObject *ModalMap::getScenePicture() { |