diff options
author | Strangerke | 2011-09-26 23:56:20 +0200 |
---|---|---|
committer | Strangerke | 2011-09-26 23:57:08 +0200 |
commit | 35e36e4d9f4916fb3d22b9898f728e4dea3495c7 (patch) | |
tree | e25050744bcd4e4d3cc9c59825e8675f81f56e9c /engines | |
parent | 8c431e13a6021785d480375dbf3b40a4b83f278c (diff) | |
download | scummvm-rg350-35e36e4d9f4916fb3d22b9898f728e4dea3495c7.tar.gz scummvm-rg350-35e36e4d9f4916fb3d22b9898f728e4dea3495c7.tar.bz2 scummvm-rg350-35e36e4d9f4916fb3d22b9898f728e4dea3495c7.zip |
TsAGE: Implement two functions in PalettedScene, fix a bug in scene 935
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 36 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.h | 4 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.cpp | 17 |
3 files changed, 47 insertions, 10 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 7b0d27e2ba..94294103da 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -783,6 +783,42 @@ PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action return BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, step, action); } +void PalettedScene::sub15DD6(const byte *arrBufferRGB, int step, int paletteNum, Action *action) { + BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, 100, NULL); + _palette.loadPalette(paletteNum); + _palette.loadPalette(2); + BF_GLOBALS._scenePalette.addFader(_palette._palette, 256, step, action); +} + +void PalettedScene::sub15E4F(const byte *arrBufferRGB, int arg8, int paletteNum, Action *action, int fromColor1, int fromColor2, int toColor1, int toColor2, bool flag) { + byte tmpPalette[768]; + + _palette.loadPalette(paletteNum); + _palette.loadPalette(2); + if (!flag) { + for (int i = fromColor1; i <= fromColor2; i++) { + tmpPalette[(3 * i)] = BF_GLOBALS._scenePalette._palette[(3 * i)]; + tmpPalette[(3 * i) + 1] = BF_GLOBALS._scenePalette._palette[(3 * i) + 1]; + tmpPalette[(3 * i) + 2] = BF_GLOBALS._scenePalette._palette[(3 * i) + 2]; + } + } else { + for (int i = fromColor1; i <= fromColor2; i++) { + tmpPalette[(3 * i)] = _palette._palette[(3 * i)]; + tmpPalette[(3 * i) + 1] = _palette._palette[(3 * i) + 1]; + tmpPalette[(3 * i) + 2] = _palette._palette[(3 * i) + 2]; + } + } + + for (int i = toColor1; i <= toColor2; i++) { + tmpPalette[i] = _palette._palette[i] - ((_palette._palette[i] - arrBufferRGB[0]) * (100 - arg8)) / 100; + tmpPalette[i + 1] = _palette._palette[i + 1] - ((_palette._palette[i + 1] - arrBufferRGB[1]) * (100 - arg8)) / 100; + tmpPalette[i + 2] = _palette._palette[i + 2] - ((_palette._palette[i + 2] - arrBufferRGB[2]) * (100 - arg8)) / 100; + } + + BF_GLOBALS._scenePalette.addFader((const byte *)tmpPalette, 256, 100, action); +} + + /*--------------------------------------------------------------------------*/ void SceneHandlerExt::postInit(SceneObjectList *OwnerList) { diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index aa90ef834d..1b4f0b5e12 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -198,7 +198,7 @@ public: AObjectArray _timerList, _objArray2; int _field372; bool _savedPlayerEnabled; - bool _savedUiEnabled; + bool _savedUiEnabled; bool _savedCanWalk; int _field37A; @@ -234,6 +234,8 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); PaletteFader *addFader(const byte *arrBufferRGB, int step, Action *action); + void sub15DD6(const byte *arrBufferRGB, int step, int paletteNum, Action *action); + void sub15E4F(const byte *arrBufferRGB, int arg8, int paletteNum, Action *action, int fromColor1, int fromColor2, int toColor1, int toColor2, bool flag); }; class SceneHandlerExt: public SceneHandler { diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index 702f92489a..d268d3c5e5 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -909,7 +909,7 @@ void Scene920::synchronize(Serializer &s) { void Scene935::Action1::signal() { Scene935 *scene = (Scene935 *)BF_GLOBALS._sceneManager._scene; - static uint32 v50ECC = 0, v50EEE = 0, v50F2A = 0, v50F66 = 0; + static uint32 v50ECC = 0, v50EEA = 0, v50EEE = 0, v50F26 = 0, v50F2A = 0, v50F62 = 0, v50F66 = 0, v50F6A = 0; switch (_actionIndex++) { case 0: @@ -917,8 +917,8 @@ void Scene935::Action1::signal() { break; case 1: scene->_visualSpeaker.setText("Jake! Hide in the closet!"); -// for (int i = 1; i < 21; i++) -// scene->sub_15E4F(&v50EEA, 5 * i, 935, 0, 0, 0, 255, 249, 255, 1); + for (int i = 1; i < 21; i++) + scene->sub15E4F((const byte *)&v50EEA, 5 * i, 935, NULL, 0, 255, 249, 255, 1); warning("Scene935::Action1::signal(): sub_15E4F"); setDelay(3); break; @@ -935,8 +935,8 @@ void Scene935::Action1::signal() { break; case 4: scene->_visualSpeaker.setText("Jake! Hide in the closet!"); -// for (int i = 1; i < 21; i++) -// scene->sub_15E4F(&v50F26, 5 * i, 935, 0, 0, 0, 255, 249, 255, 1); + for (int i = 1; i < 21; i++) + scene->sub15E4F((const byte *)&v50F26, 5 * i, 935, NULL, 0, 255, 249, 255, 1); warning("Scene935::Action1::signal(): sub_15E4F"); setDelay(3); break; @@ -953,8 +953,8 @@ void Scene935::Action1::signal() { break; case 7: scene->_visualSpeaker.setText("Jake! Hide in the closet!"); -// for (int i = 1; i < 21; i++) -// scene->sub_15E4F(&v50F62, 5 * i, 935, 0, 0, 0, 255, 249, 255, 1); + for (int i = 1; i < 21; i++) + scene->sub15E4F((const byte *)&v50F62, 5 * i, 935, NULL, 0, 255, 249, 255, 1); warning("Scene935::Action1::signal(): sub_15E4F"); setDelay(3); break; @@ -967,8 +967,7 @@ void Scene935::Action1::signal() { break; case 10: scene->_sceneMode = 1; -// scene->sub_15DD6(&v50F6A, 5, 935, this); - warning("Scene935::Action1::signal(): sub_15DD6"); + scene->sub15DD6((const byte *)&v50F6A, 5, 935, scene); remove(); break; default: |