aboutsummaryrefslogtreecommitdiff
path: root/engines/prince
diff options
context:
space:
mode:
authorlukaslw2014-07-23 01:24:57 +0200
committerlukaslw2014-07-23 01:24:57 +0200
commit2ffc9e15239140f256a8b6a3c6fffdc134ffde12 (patch)
tree6f6ec059f82376aba0271e3977eb0a4fdfc26ccf /engines/prince
parentb6d81011e3b33235cf74e568455e97065cc9d198 (diff)
downloadscummvm-rg350-2ffc9e15239140f256a8b6a3c6fffdc134ffde12.tar.gz
scummvm-rg350-2ffc9e15239140f256a8b6a3c6fffdc134ffde12.tar.bz2
scummvm-rg350-2ffc9e15239140f256a8b6a3c6fffdc134ffde12.zip
PRINCE: Map location update
Diffstat (limited to 'engines/prince')
-rw-r--r--engines/prince/debugger.cpp10
-rw-r--r--engines/prince/graphics.cpp4
-rw-r--r--engines/prince/graphics.h1
-rw-r--r--engines/prince/object.cpp7
-rw-r--r--engines/prince/prince.cpp12
5 files changed, 24 insertions, 10 deletions
diff --git a/engines/prince/debugger.cpp b/engines/prince/debugger.cpp
index 445d5ecfc4..cf74b7b423 100644
--- a/engines/prince/debugger.cpp
+++ b/engines/prince/debugger.cpp
@@ -160,9 +160,13 @@ bool Debugger::Cmd_AddItem(int argc, const char **argv) {
DebugPrintf("Usage: %s <itemId>\n", argv[0]);
return true;
}
-
- int itemId = strToInt(argv[1]);
- _vm->addInv(0, itemId, true);
+ if (!strcmp(argv[1], "map")) {
+ _vm->addInv(0, 29, true);
+ _vm->_flags->setFlagValue(Flags::MapaUsable, 1);
+ } else {
+ int itemId = strToInt(argv[1]);
+ _vm->addInv(0, itemId, true);
+ }
return true;
}
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index d89b9bc048..9b8c874642 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -39,6 +39,8 @@ GraphicsMan::GraphicsMan(PrinceEngine *vm)
_frontScreen->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
_screenForInventory = new Graphics::Surface();
_screenForInventory->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
+ _mapScreen = new Graphics::Surface();
+ _mapScreen->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
_shadowTable70 = new byte[256];
_shadowTable50 = new byte[256];
}
@@ -48,6 +50,8 @@ GraphicsMan::~GraphicsMan() {
delete _frontScreen;
_screenForInventory->free();
delete _screenForInventory;
+ _mapScreen->free();
+ delete _mapScreen;
delete[] _shadowTable70;
delete[] _shadowTable50;
}
diff --git a/engines/prince/graphics.h b/engines/prince/graphics.h
index 266177e229..e5d0ea99ad 100644
--- a/engines/prince/graphics.h
+++ b/engines/prince/graphics.h
@@ -57,6 +57,7 @@ public:
Graphics::Surface *_frontScreen;
Graphics::Surface *_screenForInventory;
+ Graphics::Surface *_mapScreen;
const Graphics::Surface *_roomBackground;
byte *_shadowTable70;
diff --git a/engines/prince/object.cpp b/engines/prince/object.cpp
index b7ff18c46c..df241a0daf 100644
--- a/engines/prince/object.cpp
+++ b/engines/prince/object.cpp
@@ -67,12 +67,9 @@ bool Object::loadFromStream(Common::SeekableReadStream &stream) {
const Common::String obStreamName = Common::String::format("OB%02d", stream.readUint16LE());
Common::SeekableReadStream *obStream = SearchMan.createReadStreamForMember(obStreamName);
- if (!obStream) {
- //error("Can't load %s", obStreamName.c_str());
- return false;
+ if (obStream) {
+ loadSurface(*obStream);
}
-
- loadSurface(*obStream);
delete obStream;
_mask = stream.readUint16LE();
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index a1d1f2d30c..50766037fd 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1467,7 +1467,10 @@ void PrinceEngine::clearBackAnimList() {
}
void PrinceEngine::grabMap() {
- //TODO
+ _graph->_frontScreen->copyFrom(*_roomBmp->getSurface());
+ showObjects();
+ runDrawNodes();
+ _graph->_mapScreen->copyFrom(*_graph->_frontScreen);
}
void PrinceEngine::initZoomIn(int slot) {
@@ -1571,7 +1574,12 @@ void PrinceEngine::freeDrawNodes() {
void PrinceEngine::drawScreen() {
if (!_showInventoryFlag || _inventoryBackgroundRemember) {
- const Graphics::Surface *roomSurface = _roomBmp->getSurface();
+ const Graphics::Surface *roomSurface;
+ if (_locationNr != 50) {
+ roomSurface = _roomBmp->getSurface();
+ } else {
+ roomSurface = _graph->_mapScreen;
+ }
Graphics::Surface visiblePart;
if (roomSurface) {
visiblePart = roomSurface->getSubArea(Common::Rect(_picWindowX, 0, roomSurface->w, roomSurface->h));