aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-07-25 13:40:51 -0500
committerColin Snover2016-08-01 10:37:14 -0500
commit0f535e79f59c24545f40d52cf0cf25a3818cfffd (patch)
tree9587fc745e617b982b534b668907cce5bb05eec4
parent156c68fe58eb9f8d923d1f9dc1c3dac8436c9d82 (diff)
downloadscummvm-rg350-0f535e79f59c24545f40d52cf0cf25a3818cfffd.tar.gz
scummvm-rg350-0f535e79f59c24545f40d52cf0cf25a3818cfffd.tar.bz2
scummvm-rg350-0f535e79f59c24545f40d52cf0cf25a3818cfffd.zip
SCI32: Add 6-argument signature of kAddPicAt
This is used by Torin in room 50900.
-rw-r--r--engines/sci/engine/kernel_tables.h2
-rw-r--r--engines/sci/engine/kgraphics32.cpp3
-rw-r--r--engines/sci/graphics/frameout.cpp4
-rw-r--r--engines/sci/graphics/frameout.h2
-rw-r--r--engines/sci/graphics/plane32.cpp9
-rw-r--r--engines/sci/graphics/plane32.h2
6 files changed, 12 insertions, 10 deletions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 7d622d16d1..e0e4dcc233 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -823,7 +823,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(Robot), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_CALL(Save), SIG_EVERYWHERE, "i(.*)", kSave_subops, NULL },
{ MAP_CALL(Text), SIG_SINCE_SCI21MID, SIGFOR_ALL, "i(.*)", kText_subops, NULL },
- { MAP_CALL(AddPicAt), SIG_EVERYWHERE, "oiii", NULL, NULL },
+ { MAP_CALL(AddPicAt), SIG_EVERYWHERE, "oiii(i)(i)", NULL, NULL },
{ MAP_CALL(GetWindowsOption), SIG_EVERYWHERE, "i", NULL, NULL },
{ MAP_CALL(WinHelp), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_CALL(GetConfig), SIG_EVERYWHERE, "ro", NULL, NULL },
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 40c048bdeb..44085da6e7 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -124,8 +124,9 @@ reg_t kAddPicAt(EngineState *s, int argc, reg_t *argv) {
int16 x = argv[2].toSint16();
int16 y = argv[3].toSint16();
bool mirrorX = argc > 4 ? argv[4].toSint16() : false;
+ bool deleteDuplicate = argc > 5 ? argv[5].toSint16() : true;
- g_sci->_gfxFrameout->kernelAddPicAt(planeObj, pictureId, x, y, mirrorX);
+ g_sci->_gfxFrameout->kernelAddPicAt(planeObj, pictureId, x, y, mirrorX, deleteDuplicate);
return s->r_acc;
}
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index a264516bf7..7ea159f45d 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -485,12 +485,12 @@ void GfxFrameout::updatePlane(Plane &plane) {
#pragma mark -
#pragma mark Pics
-void GfxFrameout::kernelAddPicAt(const reg_t planeObject, const GuiResourceId pictureId, const int16 x, const int16 y, const bool mirrorX) {
+void GfxFrameout::kernelAddPicAt(const reg_t planeObject, const GuiResourceId pictureId, const int16 x, const int16 y, const bool mirrorX, const bool deleteDuplicate) {
Plane *plane = _planes.findByObject(planeObject);
if (plane == nullptr) {
error("kAddPicAt: Plane %04x:%04x not found", PRINT_REG(planeObject));
}
- plane->addPic(pictureId, Common::Point(x, y), mirrorX);
+ plane->addPic(pictureId, Common::Point(x, y), mirrorX, deleteDuplicate);
}
#pragma mark -
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 035555af6f..1724ad94b6 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -167,7 +167,7 @@ public:
#pragma mark -
#pragma mark Pics
public:
- void kernelAddPicAt(const reg_t planeObject, const GuiResourceId pictureId, const int16 pictureX, const int16 pictureY, const bool mirrorX);
+ void kernelAddPicAt(const reg_t planeObject, const GuiResourceId pictureId, const int16 pictureX, const int16 pictureY, const bool mirrorX, const bool deleteDuplicate);
#pragma mark -
#pragma mark Rendering
diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp
index cb6ec74e8f..1cd88d667b 100644
--- a/engines/sci/graphics/plane32.cpp
+++ b/engines/sci/graphics/plane32.cpp
@@ -194,11 +194,12 @@ void Plane::addPicInternal(const GuiResourceId pictureId, const Common::Point *p
_type = transparent ? kPlaneTypeTransparentPicture : kPlaneTypePicture;
}
-GuiResourceId Plane::addPic(const GuiResourceId pictureId, const Common::Point &position, const bool mirrorX) {
- GuiResourceId oldPictureId = _pictureId;
- deletePic(pictureId);
+GuiResourceId Plane::addPic(const GuiResourceId pictureId, const Common::Point &position, const bool mirrorX, const bool deleteDuplicate) {
+ if (deleteDuplicate) {
+ deletePic(pictureId);
+ }
addPicInternal(pictureId, &position, mirrorX);
- return oldPictureId;
+ return _pictureId;
}
void Plane::changePic() {
diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h
index f55d97b6ed..964d20ca12 100644
--- a/engines/sci/graphics/plane32.h
+++ b/engines/sci/graphics/plane32.h
@@ -347,7 +347,7 @@ public:
* new picture resource to the plane at the given
* position.
*/
- GuiResourceId addPic(const GuiResourceId pictureId, const Common::Point &position, const bool mirrorX);
+ GuiResourceId addPic(const GuiResourceId pictureId, const Common::Point &position, const bool mirrorX, const bool deleteDuplicate = true);
/**
* If the plane is a picture plane, re-adds all cels