aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
authorwhitertandrek2018-03-27 14:52:19 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitdbc709a140fc2d01d35dcd3515c45ea9621fe18b (patch)
tree7cbbc6220793c6b0ef893329257922468ec77d41 /engines/pink
parentc37bd09354cb233404bec5aed6ded79412650cef (diff)
downloadscummvm-rg350-dbc709a140fc2d01d35dcd3515c45ea9621fe18b.tar.gz
scummvm-rg350-dbc709a140fc2d01d35dcd3515c45ea9621fe18b.tar.bz2
scummvm-rg350-dbc709a140fc2d01d35dcd3515c45ea9621fe18b.zip
PINK: fixes to get first game scene of Hokus Pokus loaded and hack for Peril intro sprite, which has wrong transparent colour index
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/director.cpp2
-rw-r--r--engines/pink/objects/handlers/handler.cpp2
-rw-r--r--engines/pink/objects/handlers/handler_mgr.cpp6
-rw-r--r--engines/pink/objects/module.cpp1
-rw-r--r--engines/pink/objects/pages/game_page.cpp3
-rw-r--r--engines/pink/pink.cpp3
6 files changed, 9 insertions, 8 deletions
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index a7ed2f83d9..18b1d38949 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -53,7 +53,7 @@ void Director::drawSprite(CelDecoder *decoder) {
for (int y = 0; y < decoder->getHeight(); ++y) {
for (int x = 0; x < decoder->getWidth(); ++x) {
byte spritePixelColourIndex = *(byte*)surface->getBasePtr(x, y);
- if (spritePixelColourIndex != colourIndex || spritePixelColourIndex == 1) {
+ if (spritePixelColourIndex != colourIndex && spritePixelColourIndex != 229) { // hack because sprite have wrong colour index
*(byte *) screen->getBasePtr(decoder->getX() + x, decoder->getY() + y) = spritePixelColourIndex;
}
}
diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp
index de296150d0..ed553a1939 100644
--- a/engines/pink/objects/handlers/handler.cpp
+++ b/engines/pink/objects/handlers/handler.cpp
@@ -29,7 +29,6 @@
#include <engines/pink/objects/actors/lead_actor.h>
#include <engines/pink/objects/pages/game_page.h>
#include <engines/pink/pink.h>
-#include <common/debug.h>
namespace Pink {
@@ -123,6 +122,7 @@ void HandlerLeftClick::toConsole() {
void HandlerUseClick::deserialize(Archive &archive) {
HandlerSequences::deserialize(archive);
+ archive >> _inventoryItem >> _recepient;
}
void HandlerUseClick::toConsole() {
diff --git a/engines/pink/objects/handlers/handler_mgr.cpp b/engines/pink/objects/handlers/handler_mgr.cpp
index da695b407c..6e7755a804 100644
--- a/engines/pink/objects/handlers/handler_mgr.cpp
+++ b/engines/pink/objects/handlers/handler_mgr.cpp
@@ -10,7 +10,7 @@
namespace Pink {
-void HandlerMgr::deserialize(Pink::Archive &archive) {
+void HandlerMgr::deserialize(Archive &archive) {
archive >> _leftClickHandlers >> _useClickHandlers >> _timerHandlers;
}
@@ -19,10 +19,10 @@ void HandlerMgr::toConsole() {
for (int i = 0; i < _leftClickHandlers.size(); ++i) {
_leftClickHandlers[i]->toConsole();
}
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (int i = 0; i < _useClickHandlers.size(); ++i) {
_useClickHandlers[i]->toConsole();
}
- for (int i = 0; i < _leftClickHandlers.size(); ++i) {
+ for (int i = 0; i < _timerHandlers.size(); ++i) {
_timerHandlers[i]->toConsole();
}
}
diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp
index f768020de0..eb6d792c72 100644
--- a/engines/pink/objects/module.cpp
+++ b/engines/pink/objects/module.cpp
@@ -81,7 +81,6 @@ PinkEngine *Module::getGame() const {
}
bool Module::checkValueOfVariable(Common::String &variable, Common::String &value) {
- //assert(_variables.contains(variable));
if (!_variables.contains(variable))
return value == "UNDEFINED";
return _variables[variable] == value;
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 8711a7ea66..5ff7f0bdc3 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -115,7 +115,8 @@ Module *GamePage::getModule() const {
}
bool GamePage::checkValueOfVariable(Common::String &variable, Common::String &value) {
- assert(_variables.contains(variable));
+ if (!_variables.contains(variable))
+ return value == "UNDEFINED";
return _variables[variable] == value;
}
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 4c5b7cef89..5ced8cb0c1 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -186,7 +186,8 @@ void PinkEngine::loadModule(int index) {
}
bool PinkEngine::checkValueOfVariable(Common::String &variable, Common::String &value) {
- assert(_variables.contains(variable));
+ if (!_variables.contains(variable))
+ return value == "UNDEFINED";
return _variables[variable] == value;
}