aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 20:54:36 +0000
committerBastien Bouclet2010-11-29 20:54:36 +0000
commit18e1f4a8c36d907df8c5498b0c0c9f264490455f (patch)
treeb2702c585a33d971c7101fc672a034ba1ebfd055 /engines
parentd8b5319f153b859c4720e35fe791ad2605a86cff (diff)
downloadscummvm-rg350-18e1f4a8c36d907df8c5498b0c0c9f264490455f.tar.gz
scummvm-rg350-18e1f4a8c36d907df8c5498b0c0c9f264490455f.tar.bz2
scummvm-rg350-18e1f4a8c36d907df8c5498b0c0c9f264490455f.zip
MOHAWK: Added helpher functions to redraw a resource. Do not redraw all the resources on mouse up.
svn-id: r54613
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/myst.cpp16
-rw-r--r--engines/mohawk/myst.h2
2 files changed, 14 insertions, 4 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index ee010e5d80..c1a6123635 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -250,12 +250,12 @@ Common::Error MohawkEngine_Myst::run() {
else if (getFeatures() & GF_DEMO)
changeToStack(kDemoStack);
else
- changeToStack(kSeleniticStack);
+ changeToStack(kIntroStack);
if (getFeatures() & GF_DEMO)
changeToCard(2000);
else
- changeToCard(1282);
+ changeToCard(1);
// Load game from launcher/command line if requested
if (ConfMan.hasKey("save_slot") && !(getFeatures() & GF_DEMO)) {
@@ -310,8 +310,6 @@ Common::Error MohawkEngine_Myst::run() {
debug(2, "Sending mouse up event to resource %d\n", _curResource);
_resources[_curResource]->handleMouseUp(&event.mouse);
}
-
- drawResourceImages();
break;
case Common::EVENT_LBUTTONDOWN:
_mouseClicked = true;
@@ -901,6 +899,16 @@ void MohawkEngine_Myst::drawResourceImages() {
_gfx->updateScreen();
}
+void MohawkEngine_Myst::redrawResource(MystResource *_resource) {
+ _resource->drawConditionalDataToScreen(_scriptParser->getVar(_resource->getType8Var()));
+}
+
+void MohawkEngine_Myst::redrawArea(uint16 var) {
+ for (uint16 i = 0; i < _resources.size(); i++)
+ if (_resources[i]->type == 8 && _resources[i]->getType8Var() == var)
+ redrawResource(_resources[i]);
+}
+
MystResource *MohawkEngine_Myst::loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent) {
MystResource *resource = 0;
uint16 type = rlstStream->readUint16LE();
diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h
index 2a8c1e6a24..9010e5be72 100644
--- a/engines/mohawk/myst.h
+++ b/engines/mohawk/myst.h
@@ -195,6 +195,8 @@ public:
bool _showResourceRects;
MystResource *loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent);
void setResourceEnabled(uint16 resourceId, bool enable);
+ void redrawArea(uint16 var);
+ void redrawResource(MystResource *_resource);
void setCacheState(bool state) { _cache.enabled = state; }
bool getCacheState(void) { return _cache.enabled; }