aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics')
-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
4 files changed, 9 insertions, 8 deletions
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