diff options
author | uruk | 2013-07-09 10:13:53 +0200 |
---|---|---|
committer | uruk | 2013-07-09 10:13:53 +0200 |
commit | 8a44a94bb66cf9fc6b0979245198526a4e7cf6cc (patch) | |
tree | 8ac649b847a0dcbab2604a8816d1c751e667d125 /engines | |
parent | 755d07a8dea913cbbd0137aae089379c42a5af99 (diff) | |
download | scummvm-rg350-8a44a94bb66cf9fc6b0979245198526a4e7cf6cc.tar.gz scummvm-rg350-8a44a94bb66cf9fc6b0979245198526a4e7cf6cc.tar.bz2 scummvm-rg350-8a44a94bb66cf9fc6b0979245198526a4e7cf6cc.zip |
AVALANCHE: Celer: implement show_one_at().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/celer2.cpp | 47 | ||||
-rw-r--r-- | engines/avalanche/celer2.h | 2 |
2 files changed, 42 insertions, 7 deletions
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index eae8dcaab9..b6257d77e5 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -457,16 +457,12 @@ void Celer::show_one(byte which) { ch.natural = f.readByte(); ch.memorise = f.readByte(); - p = new byte[ch.size]; - - for (int32 i = 0; i < ch.size; i++) - p[i] = f.readByte(); + f.read(p, ch.size); display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p); delete[] p; - f.close(); } @@ -479,12 +475,51 @@ void Celer::show_one(byte which) { -void Celer::display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) { +void Celer::display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) { warning("STUB: Celer::display_it1()"); } void Celer::show_one_at(byte which, int16 xxx, int16 yyy) { + chunkblocktype ch; + byte *p; + + //setactivepage(3); warning("STUB: Celer::show_one_at()"); + + if (memos[which].x > on_disk) { + display_it_at(memos[which].xl, memos[which].yl, memos[which].flavour, memory[which], xxx, yyy); + } else { + if (!f.open(filename)) { /* Filename was set in load_chunks() */ + warning("AVALANCHE: Celer: File not found: %s", filename.c_str()); + return; + } + + f.seek(offsets[which]); + ch.flavour = flavourtype(f.readByte()); + ch.x = f.readSint16LE(); + ch.y = f.readSint16LE(); + ch.xl = f.readSint16LE(); + ch.yl = f.readSint16LE(); + ch.size = f.readSint32LE(); + ch.natural = f.readByte(); + ch.memorise = f.readByte(); + + { + p = new byte[ch.size]; + f.read(p, ch.size); + + display_it_at(ch.xl, ch.yl, ch.flavour, p, xxx, yyy); + + delete[] p; + f.close(); + } + } + + //setactivepage(1 - cp); + warning("STUB: Celer::show_one_at()"); + + for (byte fv = 0; fv < 2; fv ++) + _vm->_trip.getset[fv].remember(r); } diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h index 19f1871cf7..88baa3df5e 100644 --- a/engines/avalanche/celer2.h +++ b/engines/avalanche/celer2.h @@ -92,7 +92,7 @@ private: void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p); - void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy); + void display_it_at(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy); }; } // End of namespace Avalanche. |