diff options
author | Eugene Sandulenko | 2012-04-28 01:00:14 +0300 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 12:42:08 +0200 |
commit | 28c78b956dac6ee59d066f7ff2499569fe9877c7 (patch) | |
tree | 07e37e79e5610d3f21d22a8243083b78e09f8542 /engines/wintermute/BSurfaceStorage.cpp | |
parent | 84fd9d0daca1846829b077aa18a7634df5e5ef9e (diff) | |
download | scummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.tar.gz scummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.tar.bz2 scummvm-rg350-28c78b956dac6ee59d066f7ff2499569fe9877c7.zip |
WINTERMUTE: Mass rename m_FooBar -> _fooBar
Diffstat (limited to 'engines/wintermute/BSurfaceStorage.cpp')
-rw-r--r-- | engines/wintermute/BSurfaceStorage.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/engines/wintermute/BSurfaceStorage.cpp b/engines/wintermute/BSurfaceStorage.cpp index 45f70db8f6..a460ac83a6 100644 --- a/engines/wintermute/BSurfaceStorage.cpp +++ b/engines/wintermute/BSurfaceStorage.cpp @@ -40,7 +40,7 @@ namespace WinterMute { //////////////////////////////////////////////////////////////////////
CBSurfaceStorage::CBSurfaceStorage(CBGame *inGame): CBBase(inGame) {
- m_LastCleanupTime = 0;
+ _lastCleanupTime = 0;
}
@@ -52,11 +52,11 @@ CBSurfaceStorage::~CBSurfaceStorage() { //////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::Cleanup(bool Warn) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (Warn) Game->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", m_Surfaces[i]->m_Filename, m_Surfaces[i]->m_ReferenceCount);
- delete m_Surfaces[i];
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (Warn) Game->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", _surfaces[i]->_filename, _surfaces[i]->_referenceCount);
+ delete _surfaces[i];
}
- m_Surfaces.RemoveAll();
+ _surfaces.RemoveAll();
return S_OK;
}
@@ -64,15 +64,15 @@ HRESULT CBSurfaceStorage::Cleanup(bool Warn) { //////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::InitLoop() {
- if (Game->m_SmartCache && Game->m_LiveTimer - m_LastCleanupTime >= Game->m_SurfaceGCCycleTime) {
- m_LastCleanupTime = Game->m_LiveTimer;
+ if (Game->_smartCache && Game->_liveTimer - _lastCleanupTime >= Game->_surfaceGCCycleTime) {
+ _lastCleanupTime = Game->_liveTimer;
SortSurfaces();
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (m_Surfaces[i]->m_LifeTime <= 0) break;
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (_surfaces[i]->_lifeTime <= 0) break;
- if (m_Surfaces[i]->m_LifeTime > 0 && m_Surfaces[i]->m_Valid && Game->m_LiveTimer - m_Surfaces[i]->m_LastUsedTime >= m_Surfaces[i]->m_LifeTime) {
- //Game->QuickMessageForm("Invalidating: %s", m_Surfaces[i]->m_Filename);
- m_Surfaces[i]->Invalidate();
+ if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && Game->_liveTimer - _surfaces[i]->_lastUsedTime >= _surfaces[i]->_lifeTime) {
+ //Game->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
+ _surfaces[i]->Invalidate();
}
}
}
@@ -82,12 +82,12 @@ HRESULT CBSurfaceStorage::InitLoop() { //////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (m_Surfaces[i] == surface) {
- m_Surfaces[i]->m_ReferenceCount--;
- if (m_Surfaces[i]->m_ReferenceCount <= 0) {
- delete m_Surfaces[i];
- m_Surfaces.RemoveAt(i);
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (_surfaces[i] == surface) {
+ _surfaces[i]->_referenceCount--;
+ if (_surfaces[i]->_referenceCount <= 0) {
+ delete _surfaces[i];
+ _surfaces.RemoveAt(i);
}
break;
}
@@ -98,21 +98,21 @@ HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) { //////////////////////////////////////////////////////////////////////
CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- if (scumm_stricmp(m_Surfaces[i]->m_Filename, Filename) == 0) {
- m_Surfaces[i]->m_ReferenceCount++;
- return m_Surfaces[i];
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ if (scumm_stricmp(_surfaces[i]->_filename, Filename) == 0) {
+ _surfaces[i]->_referenceCount++;
+ return _surfaces[i];
}
}
- CBFile *File = Game->m_FileManager->OpenFile(Filename);
+ CBFile *File = Game->_fileManager->OpenFile(Filename);
if (!File) {
if (Filename) Game->LOG(0, "Missing image: '%s'", Filename);
- if (Game->m_DEBUG_DebugMode)
+ if (Game->_dEBUG_DebugMode)
return AddSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
else
return AddSurface("invalid.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
- } else Game->m_FileManager->CloseFile(File);
+ } else Game->_fileManager->CloseFile(File);
CBSurface *surface;
@@ -125,8 +125,8 @@ CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck delete surface;
return NULL;
} else {
- surface->m_ReferenceCount = 1;
- m_Surfaces.Add(surface);
+ surface->_referenceCount = 1;
+ _surfaces.Add(surface);
return surface;
}
}
@@ -135,8 +135,8 @@ CBSurface *CBSurfaceStorage::AddSurface(char *Filename, bool default_ck, byte ck //////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RestoreAll() {
HRESULT ret;
- for (int i = 0; i < m_Surfaces.GetSize(); i++) {
- ret = m_Surfaces[i]->Restore();
+ for (int i = 0; i < _surfaces.GetSize(); i++) {
+ ret = _surfaces[i]->Restore();
if (ret != S_OK) {
Game->LOG(0, "CBSurfaceStorage::RestoreAll failed");
return ret;
@@ -151,11 +151,11 @@ HRESULT CBSurfaceStorage::RestoreAll() { HRESULT CBSurfaceStorage::Persist(CBPersistMgr *PersistMgr)
{
- if(!PersistMgr->m_Saving) Cleanup(false);
+ if(!PersistMgr->_saving) Cleanup(false);
PersistMgr->Transfer(TMEMBER(Game));
- //m_Surfaces.Persist(PersistMgr);
+ //_surfaces.Persist(PersistMgr);
return S_OK;
}
@@ -164,7 +164,7 @@ HRESULT CBSurfaceStorage::Persist(CBPersistMgr *PersistMgr) //////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::SortSurfaces() {
- qsort(m_Surfaces.GetData(), m_Surfaces.GetSize(), sizeof(CBSurface *), SurfaceSortCB);
+ qsort(_surfaces.GetData(), _surfaces.GetSize(), sizeof(CBSurface *), SurfaceSortCB);
return S_OK;
}
@@ -175,17 +175,17 @@ int CBSurfaceStorage::SurfaceSortCB(const void *arg1, const void *arg2) { CBSurface *s2 = *((CBSurface **)arg2);
// sort by life time
- if (s1->m_LifeTime <= 0 && s2->m_LifeTime > 0) return 1;
- else if (s1->m_LifeTime > 0 && s2->m_LifeTime <= 0) return -1;
+ if (s1->_lifeTime <= 0 && s2->_lifeTime > 0) return 1;
+ else if (s1->_lifeTime > 0 && s2->_lifeTime <= 0) return -1;
// sort by validity
- if (s1->m_Valid && !s2->m_Valid) return -1;
- else if (!s1->m_Valid && s2->m_Valid) return 1;
+ if (s1->_valid && !s2->_valid) return -1;
+ else if (!s1->_valid && s2->_valid) return 1;
// sort by time
- else if (s1->m_LastUsedTime > s2->m_LastUsedTime) return 1;
- else if (s1->m_LastUsedTime < s2->m_LastUsedTime) return -1;
+ else if (s1->_lastUsedTime > s2->_lastUsedTime) return 1;
+ else if (s1->_lastUsedTime < s2->_lastUsedTime) return -1;
else return 0;
}
|