diff options
Diffstat (limited to 'engines/mortevielle')
-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]; |