aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2011-08-28 11:39:05 +1000
committerTravis Howell2011-08-28 11:39:05 +1000
commitfb41b96e96e450f11bfe4860b440052b83410e83 (patch)
treedcafe0e955dc43cd4103c71f0b2cca22c2447608 /engines
parentb3457144ed6a4002ea8b51ac93ba14047950c262 (diff)
downloadscummvm-rg350-fb41b96e96e450f11bfe4860b440052b83410e83.tar.gz
scummvm-rg350-fb41b96e96e450f11bfe4860b440052b83410e83.tar.bz2
scummvm-rg350-fb41b96e96e450f11bfe4860b440052b83410e83.zip
SCUMM: setOffHeap uses resource status in HE90+ games.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/resource.cpp52
-rw-r--r--engines/scumm/resource.h6
2 files changed, 30 insertions, 28 deletions
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index 8c34ed3626..f445a44ded 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -939,18 +939,6 @@ void ResourceManager::unlock(ResType type, ResId idx) {
_types[type][idx].unlock();
}
-void ResourceManager::setOffHeap(ResType type, ResId idx) {
- if (!validateResource("setOffHeap", type, idx))
- return;
- _types[type][idx].setOffHeap();
-}
-
-void ResourceManager::setOnHeap(ResType type, ResId idx) {
- if (!validateResource("setOnHeap", type, idx))
- return;
- _types[type][idx].setOnHeap();
-}
-
bool ResourceManager::isLocked(ResType type, ResId idx) const {
if (!validateResource("isLocked", type, idx))
return false;
@@ -969,18 +957,6 @@ bool ResourceManager::Resource::isLocked() const {
return (_flags & RF_LOCK) != 0;
}
-void ResourceManager::Resource::setOffHeap() {
- _flags |= RF_OFFHEAP;
-}
-
-void ResourceManager::Resource::setOnHeap() {
- _flags &= ~RF_OFFHEAP;
-}
-
-bool ResourceManager::Resource::isOffHeap() const {
- return (_flags & RF_OFFHEAP) != 0;
-}
-
bool ScummEngine::isResourceInUse(ResType type, ResId idx) const {
if (!_res->validateResource("isResourceInUse", type, idx))
return false;
@@ -1018,18 +994,42 @@ void ResourceManager::setModified(ResType type, ResId idx) {
_types[type][idx].setModified();
}
+void ResourceManager::setOffHeap(ResType type, ResId idx) {
+ if (!validateResource("setOffHeap", type, idx))
+ return;
+ _types[type][idx].setOffHeap();
+}
+
+void ResourceManager::setOnHeap(ResType type, ResId idx) {
+ if (!validateResource("setOnHeap", type, idx))
+ return;
+ _types[type][idx].setOnHeap();
+}
+
bool ResourceManager::isModified(ResType type, ResId idx) const {
if (!validateResource("isModified", type, idx))
return false;
return _types[type][idx].isModified();
}
+bool ResourceManager::Resource::isModified() const {
+ return (_status & RS_MODIFIED) != 0;
+}
+
+bool ResourceManager::Resource::isOffHeap() const {
+ return (_status & RF_OFFHEAP) != 0;
+}
+
void ResourceManager::Resource::setModified() {
_status |= RS_MODIFIED;
}
-bool ResourceManager::Resource::isModified() const {
- return (_status & RS_MODIFIED) != 0;
+void ResourceManager::Resource::setOffHeap() {
+ _status |= RF_OFFHEAP;
+}
+
+void ResourceManager::Resource::setOnHeap() {
+ _status &= ~RF_OFFHEAP;
}
void ResourceManager::expireResources(uint32 size) {
diff --git a/engines/scumm/resource.h b/engines/scumm/resource.h
index ddecca43a2..aa7f809b76 100644
--- a/engines/scumm/resource.h
+++ b/engines/scumm/resource.h
@@ -134,10 +134,11 @@ public:
inline void setResourceCounter(byte counter);
inline byte getResourceCounter() const;
- // HE specific
void lock();
void unlock();
bool isLocked() const;
+
+ // HE specific
void setModified();
bool isModified() const;
void setOffHeap();
@@ -191,10 +192,11 @@ public:
bool isResourceLoaded(ResType type, ResId idx) const;
- // HE Specific
void lock(ResType type, ResId idx);
void unlock(ResType type, ResId idx);
bool isLocked(ResType type, ResId idx) const;
+
+ // HE Specific
void setModified(ResType type, ResId idx);
bool isModified(ResType type, ResId idx) const;
void setOffHeap(ResType type, ResId idx);