diff options
author | Strangerke | 2012-03-29 12:49:25 +0200 |
---|---|---|
committer | Strangerke | 2012-04-06 08:24:05 +0200 |
commit | 410f803e9124d94813bc4d29d5b7659d58c31476 (patch) | |
tree | af25dac4acadd60a1c6aade80930c4b2781d4e89 /engines | |
parent | d8b8f93c4c51ac0ea8dbc105e3dad17c36866e18 (diff) | |
download | scummvm-rg350-410f803e9124d94813bc4d29d5b7659d58c31476.tar.gz scummvm-rg350-410f803e9124d94813bc4d29d5b7659d58c31476.tar.bz2 scummvm-rg350-410f803e9124d94813bc4d29d5b7659d58c31476.zip |
MORTEVIELLE: Get rid of the hardcoded size of _cfiecBuffer
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 10 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index b8be8384de..38355ec558 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -197,7 +197,7 @@ Common::ErrorCode MortevielleEngine::initialise() { loadPalette(); loadCFIPH(); loadCFIEC(); - decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64); + decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64); _c_zzz = 1; init_nbrepm(); initMouse(); @@ -2474,12 +2474,12 @@ void MortevielleEngine::loadCFIEC() { error("Missing file - *cfiec.mor"); } - int size = ((f.size() / 128) + 1) * 128; + _cfiecBufferSize = ((f.size() / 128) + 1) * 128; if (!_reloadCFIEC) - _cfiecBuffer = (byte *)malloc(sizeof(byte) * size); + _cfiecBuffer = (byte *)malloc(sizeof(byte) * _cfiecBufferSize); - for (int i = 0; i < size; ++i) + for (int i = 0; i < _cfiecBufferSize; ++i) _cfiecBuffer[i] = f.readByte(); f.close(); @@ -3749,7 +3749,7 @@ int MortevielleEngine::testou() { break; case '\26' : if ((_c_zzz == 1) || (_c_zzz == 2)) { - decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64); + decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64); ++_c_zzz; return 61; diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index e22732600f..97bc814d61 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -273,6 +273,7 @@ private: Common::String _hintPctMessage; byte *_cfiecBuffer; + int _cfiecBufferSize; byte _touv[8]; int _nbrep[9]; int _nbrepm[9]; |