diff options
| author | Strangerke | 2013-02-11 08:04:20 +0100 |
|---|---|---|
| committer | Strangerke | 2013-02-11 08:04:20 +0100 |
| commit | c41a5fd1126dc88d7aef6efcafa6cd9f0a4cc4ee (patch) | |
| tree | bead6ad99200fb486c3b7cadb1d04b2b2235e3fe | |
| parent | 89c1793865dfdfbe7661b89b9510f1e9e789bee2 (diff) | |
| download | scummvm-rg350-c41a5fd1126dc88d7aef6efcafa6cd9f0a4cc4ee.tar.gz scummvm-rg350-c41a5fd1126dc88d7aef6efcafa6cd9f0a4cc4ee.tar.bz2 scummvm-rg350-c41a5fd1126dc88d7aef6efcafa6cd9f0a4cc4ee.zip | |
HOPKINS: Some more renaming and refactoring in Globals
| -rw-r--r-- | engines/hopkins/globals.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index d4bbc89824..bd20b82ec9 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -422,27 +422,22 @@ void Globals::CACHE_ADD(int idx) { // Load Cache void Globals::loadCache(const Common::String &file) { - byte *v2 = g_PTRNUL; - byte *spriteData; - byte *ptr; - Common::String v16; - Common::File f; - resetCache(); - ptr = _vm->_fileManager.loadFile(file); - v16 = Common::String((const char *)ptr); + byte *ptr = _vm->_fileManager.loadFile(file); + Common::String filename = Common::String((const char *)ptr); - if (!f.exists(v16)) + Common::File f; + if (!f.exists(filename)) return; - spriteData = _vm->_fileManager.loadFile(v16); + byte *spriteData = _vm->_fileManager.loadFile(filename); CACHE_BANQUE[1] = spriteData; - int v15 = 60; + int curBufIdx = 60; for (int i = 0; i <= 21; i++) { - Cache[i]._spriteIndex = (int16)READ_LE_UINT16((uint16 *)ptr + v15); - Cache[i]._x = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 1); - Cache[i]._y = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 2); - Cache[i].field14 = (int16)READ_LE_UINT16((uint16 *)ptr + v15 + 4); + Cache[i]._spriteIndex = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx); + Cache[i]._x = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 1); + Cache[i]._y = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 2); + Cache[i].field14 = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 4); if (spriteData == g_PTRNUL) { Cache[i]._useCount = 0; } else { @@ -454,11 +449,10 @@ void Globals::loadCache(const Common::String &file) { if ( !Cache[i]._x && !Cache[i]._y && !Cache[i]._spriteIndex) Cache[i]._useCount = 0; - v15 += 5; + curBufIdx += 5; } CACHE_ON(); - v2 = ptr; - freeMemory(v2); + freeMemory(ptr); } } // End of namespace Hopkins |
