diff options
author | Paul Gilbert | 2017-02-27 08:55:56 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-27 08:55:56 -0500 |
commit | 93cd3eced23dba0099cc713a7d2323a901dbca75 (patch) | |
tree | b562ea1e5f77c169461e94e1f60dcb2ed96031f5 /engines/titanic/star_control | |
parent | 64b05a8693531b455389466bcaa16572f96ecc0a (diff) | |
download | scummvm-rg350-93cd3eced23dba0099cc713a7d2323a901dbca75.tar.gz scummvm-rg350-93cd3eced23dba0099cc713a7d2323a901dbca75.tar.bz2 scummvm-rg350-93cd3eced23dba0099cc713a7d2323a901dbca75.zip |
TITANIC: Implemented CStarControl doAction
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 117 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.h | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_points1.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 73 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.h | 24 | ||||
-rw-r--r-- | engines/titanic/star_control/surface_area.cpp | 13 |
6 files changed, 240 insertions, 7 deletions
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index 2aaf5d7640..5874d01760 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -21,11 +21,16 @@ */ #include "titanic/support/screen_manager.h" +#include "titanic/pet_control/pet_control.h" #include "titanic/star_control/star_control.h" #include "titanic/star_control/dmatrix.h" #include "titanic/star_control/error_code.h" #include "titanic/star_control/star_control_sub6.h" #include "titanic/star_control/star_control_sub12.h" +#include "titanic/game_manager.h" +#include "titanic/core/dont_save_file_item.h" +#include "titanic/core/project_item.h" +#include "titanic/core/view_item.h" namespace Titanic { @@ -36,7 +41,7 @@ BEGIN_MESSAGE_MAP(CStarControl, CGameObject) ON_MESSAGE(FrameMsg) END_MESSAGE_MAP() -CStarControl::CStarControl() : _fieldBC(0), +CStarControl::CStarControl() : _enabled(false), _starRect(20, 10, 620, 350) { CStarControlSub6::init(); CStarControlSub12::init(); @@ -72,7 +77,7 @@ void CStarControl::load(SimpleFile *file) { _view.setup(screenManager, &_starField, this); _view.reset(); - _fieldBC = 1; + _enabled = true; } CGameObject::load(file); @@ -129,7 +134,113 @@ void CStarControl::newFrame() { // TODO } -void CStarControl::doAction(int action) { +void CStarControl::doAction(StarControlAction action) { + if (!_enabled) + return; + + switch (action) { + case STAR_SHOW: { + CGameManager *gameManager = getGameManager(); + CViewItem *view = gameManager ? gameManager->getView() : nullptr; + if (view) { + detach(); + addUnder(view); + _view.fn2(); + _view.fn3(true); + _visible = true; + } + break; + } + + case STAR_HIDE: { + CProjectItem *root = getRoot(); + CDontSaveFileItem *fileItem = root ? root->getDontSaveFileItem() : nullptr; + if (fileItem) { + detach(); + addUnder(fileItem); + _visible = false; + } + break; + } + + case STAR_2: + _view.fn4(); + break; + + case STAR_RESET_POS: + _view.resetPosition(); + break; + + case STAR_4: + _view.fn5(); + break; + + case STAR_5: + _view.fn6(); + break; + + case STAR_6: + _view.fn7(); + break; + + case STAR_7: + _view.fn8(); + break; + + case STAR_8: + _view.fn9(); + break; + + case STAR_9: + _view.fn10(); + break; + + case STAR_10: + _view.fn11(); + break; + + case STAR_11: + _view.fn12(); + break; + + case STAR_12: + _view.fn13(); + break; + + case STAR_13: + _view.fn14(); + break; + + case STAR_SET_REFERENCE: { + _view.fn15(); + CPetControl *pet = getPetControl(); + if (pet) + pet->starsSetReference(); + break; + } + + case STAR_FADE_IN: + _view.fn3(true); + break; + + case STAR_FADE_OUT: + _view.fn3(false); + break; + + case STAR_17: + _view.fn16(); + break; + + case STAR_18: + _view.fn17(); + break; + + case STAR_19: + _view.petDestinationSet(); + break; + + } + // TODO } diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h index 1a07e66ab7..830d586db1 100644 --- a/engines/titanic/star_control/star_control.h +++ b/engines/titanic/star_control/star_control.h @@ -36,7 +36,7 @@ class CStarControl : public CGameObject { bool KeyCharMsg(CKeyCharMsg *msg); bool FrameMsg(CFrameMsg *msg); private: - int _fieldBC; + bool _enabled; CStarField _starField; CStarView _view; Rect _starRect; @@ -71,7 +71,7 @@ public: /** * Does an action in the star control */ - void doAction(int action); + void doAction(StarControlAction action); /** * Returns true if the starfield puzzle has been solved diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp index 8719551746..b31fb5d698 100644 --- a/engines/titanic/star_control/star_points1.cpp +++ b/engines/titanic/star_control/star_points1.cpp @@ -63,9 +63,21 @@ void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) { CStarControlSub6 sub6 = sub12->proc23(); sub12->proc25(); - + /* FVector &v0 = _data[0]; - + double vx = v0._x, vy = v0._y, vz = v0._z; + + | (vx*sub6._matrix.row1._z + vy*sub6._matrix.row2._z + vy) | + | vz*sub6._matrix.row3._x | + | surface->_width | + | vy | + | vx*sub6._matrix.row1._x | + | vz | + | vy*sub6._matrix.row2._x*sub6._matrix.row1._y*sub6._matrix.row3._z | + | vz*sub6._matrix.row2._y | + | vy*sub6._matrix.row2._z + vx*sub6._matrix.row1._z + vy*sub6._matrix.row2._z | + | vx | + */ // TODO } diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index c82f89335d..d10e0ee094 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -128,8 +128,81 @@ void CStarView::starDestinationSet() { // TODO } +void CStarView::petDestinationSet() { + // TODO +} + +void CStarView::resetPosition() { + // TODO +} + void CStarView::fn1() { // TODO } +void CStarView::fn2() { + // TODO +} + +void CStarView::fn3(bool fadeIn) { + // TODO +} + +void CStarView::fn4() { + // TODO +} + +void CStarView::fn5() { + // TODO +} + +void CStarView::fn6() { + // TODO +} + +void CStarView::fn7() { + // TODO +} + +void CStarView::fn8() { + // TODO +} + +void CStarView::fn9() { + // TODO +} + +void CStarView::fn10() { + // TODO +} + +void CStarView::fn11() { + // TODO +} + +void CStarView::fn12() { + // TODO +} + +void CStarView::fn13() { + // TODO +} + +void CStarView::fn14() { + // TODO +} + +void CStarView::fn15() { + // TODO +} + +void CStarView::fn16() { + // TODO +} + +void CStarView::fn17() { + // TODO +} + + } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h index 7ebbcb218b..5e958c8053 100644 --- a/engines/titanic/star_control/star_view.h +++ b/engines/titanic/star_control/star_view.h @@ -102,6 +102,30 @@ public: * Called when a star destination is set */ void starDestinationSet(); + + /** + * Resets back to the origin position + */ + void resetPosition(); + void petDestinationSet(); + + void fn2(); + void fn3(bool fadeIn); + void fn4(); + void fn5(); + void fn6(); + void fn7(); + void fn8(); + void fn9(); + void fn10(); + void fn11(); + void fn12(); + void fn13(); + void fn14(); + void fn15(); + void fn16(); + void fn17(); + }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/surface_area.cpp b/engines/titanic/star_control/surface_area.cpp index 5d72725636..9b46cf03b7 100644 --- a/engines/titanic/star_control/surface_area.cpp +++ b/engines/titanic/star_control/surface_area.cpp @@ -172,6 +172,19 @@ double CSurfaceArea::fn1(const FRect &rect) { SWAP(rr.top, rr.bottom); } + // TODO: initial setup + if (_mode == SA_NONE) { + switch (_bpp) { + default: + break; + } + } else { + switch (_bpp) { + default: + break; + } + } + // TODO: Lots more functionality return r.top; |