diff options
author | uruk | 2014-05-16 01:04:01 +0200 |
---|---|---|
committer | uruk | 2014-05-16 01:04:01 +0200 |
commit | b3cdf9ca3883072d33ca59e1e274eacc57fae4c1 (patch) | |
tree | 779937cf8d258eed335062c7be325cbce8a07361 | |
parent | 45714a12f1b522f302fc06ec5c8fd1412a05e3f4 (diff) | |
download | scummvm-rg350-b3cdf9ca3883072d33ca59e1e274eacc57fae4c1.tar.gz scummvm-rg350-b3cdf9ca3883072d33ca59e1e274eacc57fae4c1.tar.bz2 scummvm-rg350-b3cdf9ca3883072d33ca59e1e274eacc57fae4c1.zip |
CGE2: Implement loadTab().
-rw-r--r-- | engines/cge2/cge2_main.cpp | 31 | ||||
-rw-r--r-- | engines/cge2/fileio.cpp | 8 | ||||
-rw-r--r-- | engines/cge2/fileio.h | 2 |
3 files changed, 39 insertions, 2 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 941f2b8ca4..ce84b23f2f 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -356,12 +356,39 @@ void CGE2Engine::runGame() { } void CGE2Engine::loadTab() { - char *n = _text->getText(240); setEye(_text->getText(240)); for (int i = 0; i < kCaveMax; i++) _eyeTab[i] == _eye; - warning("STUB: CGE2Engine::loadTab()"); + if (_resman->exist(kTabName)) { + EncryptedStream f(this, kTabName); + Common::File output; + for (int i = 0; i < kCaveMax; i++) { + for (int j = 0; j < 3; j++) { + signed b = f.readSigned(); + unsigned a = f.readUnsigned(); + uint16 round = uint16((long(a) << 16) / 100); + + if (round > 0x7FFF) + b++; + + switch (j) { + case 0: + _eyeTab[i]->_x = b; + break; + case 1: + _eyeTab[i]->_y = b; + break; + case 2: + _eyeTab[i]->_z = b; + break; + } + + } + } + } + + warning("STUB: CGE2Engine::loadTab() - Recheck this"); } void CGE2Engine::cge2_main() { diff --git a/engines/cge2/fileio.cpp b/engines/cge2/fileio.cpp index a9e9563867..5885871b29 100644 --- a/engines/cge2/fileio.cpp +++ b/engines/cge2/fileio.cpp @@ -216,6 +216,14 @@ uint32 EncryptedStream::read(byte *dataPtr, uint32 dataSize) { return _readStream->read(dataPtr, dataSize); } +unsigned EncryptedStream::readUnsigned() { + return _readStream->readUint16BE(); +} + +signed EncryptedStream::readSigned() { + return _readStream->readSint16BE(); +} + bool EncryptedStream::err() { return (_error & _readStream->err()); } diff --git a/engines/cge2/fileio.h b/engines/cge2/fileio.h index 315002268c..a35b014311 100644 --- a/engines/cge2/fileio.h +++ b/engines/cge2/fileio.h @@ -121,6 +121,8 @@ public: int32 pos(); int32 size(); uint32 read(byte *dataPtr, uint32 dataSize); + unsigned readUnsigned(); + signed readSigned(); Common::String readLine(); int getLineCount() { return _lineCount; } |