From 0f535e79f59c24545f40d52cf0cf25a3818cfffd Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 25 Jul 2016 13:40:51 -0500 Subject: SCI32: Add 6-argument signature of kAddPicAt This is used by Torin in room 50900. --- engines/sci/graphics/frameout.cpp | 4 ++-- engines/sci/graphics/frameout.h | 2 +- engines/sci/graphics/plane32.cpp | 9 +++++---- engines/sci/graphics/plane32.h | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'engines/sci/graphics') 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 -- cgit v1.2.3