[Scummvm-git-logs] scummvm master -> 9caa6e318c6e6e6607b878ef2451d9986964f5d8
sev-
sev at scummvm.org
Sat Aug 1 23:29:50 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9caa6e318c FULLPIPE: Removed SharedPtr usage
Commit: 9caa6e318c6e6e6607b878ef2451d9986964f5d8
https://github.com/scummvm/scummvm/commit/9caa6e318c6e6e6607b878ef2451d9986964f5d8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-02T01:29:29+02:00
Commit Message:
FULLPIPE: Removed SharedPtr usage
Changed paths:
engines/fullpipe/gfx.cpp
engines/fullpipe/gfx.h
engines/fullpipe/init.cpp
engines/fullpipe/inventory.cpp
engines/fullpipe/modal.cpp
engines/fullpipe/utils.cpp
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 51ce848bf5..a8620c348a 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -112,9 +112,9 @@ bool PictureObject::load(MfcArchive &file, bool bigPicture) {
GameObject::load(file);
if (bigPicture)
- _picture = Common::SharedPtr<Picture>(new BigPicture());
+ _picture = new BigPicture();
else
- _picture = Common::SharedPtr<Picture>(new Picture());
+ _picture = new Picture();
_picture->load(file);
@@ -713,8 +713,7 @@ Bitmap::Bitmap(const Bitmap &src) {
Bitmap::~Bitmap() {
// TODO: This is a hack because Graphics::Surface has terrible resource
// management
- if (_surface.unique())
- _surface->free();
+ //_surface->free();
}
void Bitmap::load(Common::ReadStream *s) {
@@ -744,7 +743,7 @@ bool Bitmap::isPixelHitAtPos(int x, int y) {
}
void Bitmap::decode(byte *pixels, const Palette &palette) {
- _surface = TransSurfacePtr(new Graphics::TransparentSurface, Graphics::SurfaceDeleter());
+ _surface = new Graphics::TransparentSurface, Graphics::SurfaceDeleter();
_surface->create(_width, _height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
if (_type == MKTAG('R', 'B', '\0', '\0'))
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index 57a8d475d7..bfc966d92a 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -38,8 +38,6 @@ struct PicAniInfo;
typedef Common::Point Dims;
-typedef Common::SharedPtr<Graphics::TransparentSurface> TransSurfacePtr;
-
struct Bitmap {
int _x;
int _y;
@@ -49,7 +47,7 @@ struct Bitmap {
int _dataSize;
int _flags;
int _flipping;
- TransSurfacePtr _surface;
+ Graphics::TransparentSurface *_surface;
Bitmap();
Bitmap(const Bitmap &src);
@@ -184,7 +182,7 @@ public:
bool isPixelHitAtPos(int x, int y);
void setOXY2();
- Common::SharedPtr<Picture> _picture;
+ Picture *_picture;
private:
Common::Array<GameObject> _pictureObject2List;
diff --git a/engines/fullpipe/init.cpp b/engines/fullpipe/init.cpp
index d49d956097..db95cd88b8 100644
--- a/engines/fullpipe/init.cpp
+++ b/engines/fullpipe/init.cpp
@@ -144,7 +144,7 @@ void FullpipeEngine::setLevelStates() {
void FullpipeEngine::addCursor(CursorInfo *cursorInfo, Scene *inv, int pictureId, int hotspotX, int hotspotY, int itemPictureOffsX, int itemPictureOffsY) {
cursorInfo->pictureId = pictureId;
- cursorInfo->picture = inv->getPictureObjectById(pictureId, 0)->_picture.get();
+ cursorInfo->picture = inv->getPictureObjectById(pictureId, 0)->_picture;
cursorInfo->hotspotX = hotspotX;
cursorInfo->hotspotY = hotspotY;
cursorInfo->itemPictureOffsX = itemPictureOffsX;
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index bf3ff1ebf4..e05c9d1fe8 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -425,7 +425,7 @@ int Inventory2::selectItem(int itemId) {
if (_scene) {
int idx = getInventoryPoolItemIndexById(itemId);
- Picture *pic = _scene->getPictureObjectById(_itemsPool[idx].pictureObjectId1, 0)->_picture.get();
+ Picture *pic = _scene->getPictureObjectById(_itemsPool[idx].pictureObjectId1, 0)->_picture;
g_fp->getGameLoaderInputController()->setCursorItemPicture(pic);
}
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 91ce891dbb..f97b89ccf3 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -1809,9 +1809,9 @@ void ModalHelp::launch() {
if (_mainMenuScene) {
if (g_fp->isDemo() && g_fp->getLanguage() == Common::RU_RUS)
- _bg = _mainMenuScene->getPictureObjectById(364, 0)->_picture.get();
+ _bg = _mainMenuScene->getPictureObjectById(364, 0)->_picture;
else
- _bg = _mainMenuScene->getPictureObjectById(PIC_HLP_BGR, 0)->_picture.get();
+ _bg = _mainMenuScene->getPictureObjectById(PIC_HLP_BGR, 0)->_picture;
_isRunning = 1;
}
}
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index aba629de83..ea01ddd64f 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -151,7 +151,7 @@ void MemoryObject::loadFile(const Common::String &filename) {
if (g_fp->_currArchive != _libHandle && _libHandle)
g_fp->_currArchive = _libHandle;
- Common::ScopedPtr<Common::SeekableReadStream> s(g_fp->_currArchive->createReadStreamForMember(filename));
+ Common::SeekableReadStream *s = g_fp->_currArchive->createReadStreamForMember(filename);
if (s) {
assert(s->size() > 0);
More information about the Scummvm-git-logs
mailing list