aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-12 07:30:55 +0000
committerMartin Kiewitz2009-10-12 07:30:55 +0000
commit713f573735b483fffd5da9f7469be3f72faf97e7 (patch)
treea10ae6a5fb75e51fc46e72e523a777cf602d4762
parente85553b024cb6e7d8f4e079eb9176d000e6329c9 (diff)
downloadscummvm-rg350-713f573735b483fffd5da9f7469be3f72faf97e7.tar.gz
scummvm-rg350-713f573735b483fffd5da9f7469be3f72faf97e7.tar.bz2
scummvm-rg350-713f573735b483fffd5da9f7469be3f72faf97e7.zip
SCI/newgui: implemented kPicNotValid
svn-id: r44968
-rw-r--r--engines/sci/engine/kgraphics.cpp6
-rw-r--r--engines/sci/gui/gui.cpp9
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui32/gui32.cpp9
-rw-r--r--engines/sci/gui32/gui32.h2
5 files changed, 24 insertions, 4 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 82e4e94063..e134c22274 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -580,11 +580,9 @@ reg_t kShow(EngineState *s, int argc, reg_t *argv) {
}
reg_t kPicNotValid(EngineState *s, int argc, reg_t *argv) {
- s->r_acc = make_reg(0, s->pic_not_valid);
- if (argc)
- s->pic_not_valid = (byte)argv[0].toUint16();
+ int16 newPicNotValid = (argc > 0) ? argv[0].toUint16() : -1;
- return s->r_acc;
+ return make_reg(0, s->_gui->picNotValid(newPicNotValid));
}
reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index b1638d2480..24a1ecb03d 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -433,6 +433,15 @@ void SciGui::graphUpdateBox(Common::Rect rect) {
_gfx->BitsShow(rect);
}
+int16 SciGui::picNotValid(int16 newPicNotValid) {
+ int16 oldPicNotValid = _screen->_picNotValid;
+
+ if (newPicNotValid != -1)
+ _screen->_picNotValid = newPicNotValid;
+
+ return oldPicNotValid;
+}
+
void SciGui::paletteSet(int resourceNo, int flags) {
_palette->setFromResource(resourceNo, flags);
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 9e859201fc..0fd773a87a 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -84,6 +84,8 @@ public:
virtual void graphRestoreBox(reg_t handle);
virtual void graphUpdateBox(Common::Rect rect);
+ virtual int16 picNotValid(int16 newPicNotValid);
+
virtual void paletteSet(int resourceNo, int flags);
virtual int16 paletteFind(int r, int g, int b);
virtual void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 54fb64d148..c47a2ce141 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -961,6 +961,15 @@ void SciGui32::graphUpdateBox(Common::Rect rect) {
gfxop_update_box(s->gfx_state, area);
}
+int16 SciGui32::picNotValid(int16 newPicNotValid) {
+ int16 oldPicNotValid = s->pic_not_valid;
+
+ if (newPicNotValid != -1)
+ s->pic_not_valid = newPicNotValid;
+
+ return oldPicNotValid;
+}
+
void SciGui32::paletteSet(int resourceNo, int flags) {
//warning("STUB");
}
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index 7060dcaa95..21c496d871 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -75,6 +75,8 @@ public:
void graphRestoreBox(reg_t handle);
void graphUpdateBox(Common::Rect);
+ int16 picNotValid(int16 newPicNotValid);
+
void paletteSet(int resourceNo, int flags);
int16 paletteFind(int r, int g, int b);
void paletteSetIntensity(int fromColor, int toColor, int intensity, bool setPalette);