From 498e0f4d6f088a77ad450ed782befc4a799cdf24 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 26 Jan 2004 22:44:47 +0000 Subject: o Implemented TRS handling o Now you can succesfully reach the cave so FT is completable, but it crashes now in some particularly situations, so you should avoid them. svn-id: r12630 --- scumm/smush/smush_player.cpp | 16 ++++++++++++++++ scumm/smush/smush_player.h | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'scumm/smush') diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 74f7ad6d43..fa9dd24a15 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -589,6 +589,10 @@ void SmushPlayer::handleTextResource(Chunk &b) { } } +const char *SmushPlayer::getString(int id) { + return _strings->get(id); +} + bool SmushPlayer::readString(const char *file, const char *directory) { const char *i = strrchr(file, '.'); if (i == NULL) { @@ -822,9 +826,13 @@ void SmushPlayer::setupAnim(const char *file, const char *directory) { if (_vm->_gameId == GID_FT) { if (!(_vm->_features & GF_DEMO)) { _sf[0] = new SmushFont(true, false); + _sf[1] = new SmushFont(true, false); _sf[2] = new SmushFont(true, false); + _sf[3] = new SmushFont(true, false); _sf[0]->loadFont("scummfnt.nut", directory); + _sf[1]->loadFont("techfnt.nut", directory); _sf[2]->loadFont("titlfnt.nut", directory); + _sf[3]->loadFont("specfnt.nut", directory); } } else if (_vm->_gameId == GID_DIG) { if (!(_vm->_features & GF_DEMO)) { @@ -884,6 +892,14 @@ void SmushPlayer::setPalette(const byte *palette) { _vm->_system->set_palette(palette_colors, 0, 256); } +void SmushPlayer::setPaletteValue(int n, byte r, byte g, byte b) { + _pal[n * 3 + 0] = r; + _pal[n * 3 + 1] = g; + _pal[n * 3 + 2] = b; + + _vm->_system->set_palette(_pal, n, 1); +} + void SmushPlayer::updateScreen() { #ifdef DUMP_SMUSH_FRAMES char fileName[100]; diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index dcc592c84a..e3048c80d8 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -45,7 +45,6 @@ private: int16 _deltaPal[0x300]; byte _pal[0x300]; StringResource *_strings; - SmushFont *_sf[5]; Codec37Decoder _codec37; Codec47Decoder _codec47; FileChunk *_base; @@ -65,7 +64,6 @@ private: int _speed; bool _outputSound; - int _width, _height; byte *_dst; bool _updateNeeded; bool _insanity; @@ -78,9 +76,14 @@ public: void play(const char *filename, const char *directory); protected: + SmushFont *_sf[5]; + int _width, _height; + void insanity(bool); void setPalette(const byte *palette); + void setPaletteValue(int n, byte r, byte g, byte b); void seekSan(const char *file, const char *directory, int32 pos, int32 contFrame); + const char *getString(int id); private: void updatePalette(void); -- cgit v1.2.3