[Scummvm-git-logs] scummvm master -> 0aa55ce452f5f1bfbc938a8ce629e8756532cd98
sluicebox
22204938+sluicebox at users.noreply.github.com
Tue Aug 24 23:06:06 UTC 2021
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:
0aa55ce452 SCI32: Avoid global constructors in CelObj
Commit: 0aa55ce452f5f1bfbc938a8ce629e8756532cd98
https://github.com/scummvm/scummvm/commit/0aa55ce452f5f1bfbc938a8ce629e8756532cd98
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2021-08-24T18:01:42-05:00
Commit Message:
SCI32: Avoid global constructors in CelObj
Fixes the last clang warning in the SCI engine
Changed paths:
engines/sci/graphics/celobj32.cpp
engines/sci/graphics/celobj32.h
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index ba6653a48e..c5247d1812 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -38,7 +38,7 @@
namespace Sci {
#pragma mark CelScaler
-Common::ScopedPtr<CelScaler> CelObj::_scaler;
+CelScaler *CelObj::_scaler = nullptr;
void CelScaler::activateScaleTables(const Ratio &scaleX, const Ratio &scaleY) {
for (int i = 0; i < ARRAYSIZE(_scaleTables); ++i) {
@@ -90,13 +90,15 @@ void CelObj::init() {
CelObj::deinit();
_drawBlackLines = false;
_nextCacheId = 1;
- _scaler.reset(new CelScaler());
- _cache.reset(new CelCache(100));
+ _scaler = new CelScaler();
+ _cache = new CelCache(100);
}
void CelObj::deinit() {
- _scaler.reset();
- _cache.reset();
+ delete _scaler;
+ _scaler = nullptr;
+ delete _cache;
+ _cache = nullptr;
}
#pragma mark -
@@ -686,7 +688,7 @@ void CelObj::submitPalette() const {
#pragma mark CelObj - Caching
int CelObj::_nextCacheId = 1;
-Common::ScopedPtr<CelCache> CelObj::_cache;
+CelCache *CelObj::_cache = nullptr;
int CelObj::searchCache(const CelInfo32 &celInfo, int *const nextInsertIndex) const {
*nextInsertIndex = -1;
diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h
index fe0e6bd8ea..5aeef39adb 100644
--- a/engines/sci/graphics/celobj32.h
+++ b/engines/sci/graphics/celobj32.h
@@ -264,7 +264,7 @@ protected:
bool _drawMirrored;
public:
- static Common::ScopedPtr<CelScaler> _scaler;
+ static CelScaler *_scaler;
/**
* The basic identifying information for this cel. This information
@@ -464,7 +464,7 @@ protected:
* A cache of cel objects used to avoid reinitialisation overhead for cels
* with the same CelInfo32.
*/
- static Common::ScopedPtr<CelCache> _cache;
+ static CelCache *_cache;
/**
* Searches the cel cache for a CelObj matching the provided CelInfo32. If
More information about the Scummvm-git-logs
mailing list