diff options
author | Paul Gilbert | 2016-03-29 22:57:22 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-29 22:57:22 -0400 |
commit | fe79317bdefe9594561cf45afe2ad476b1ac06ff (patch) | |
tree | 1ef25d5074e4c64ab0336187b197d4fe047b505b /engines/titanic/pet_control/pet_control.cpp | |
parent | a1e959b4986914bd42bdbd4587cdfc2bd57ca3a0 (diff) | |
download | scummvm-rg350-fe79317bdefe9594561cf45afe2ad476b1ac06ff.tar.gz scummvm-rg350-fe79317bdefe9594561cf45afe2ad476b1ac06ff.tar.bz2 scummvm-rg350-fe79317bdefe9594561cf45afe2ad476b1ac06ff.zip |
TITANIC: Beginnings of PET drawing
Diffstat (limited to 'engines/titanic/pet_control/pet_control.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 86 |
1 files changed, 76 insertions, 10 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index db053ca517..9f24b4b040 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -81,8 +81,46 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const { _sub8.save(file, indent); } -void CPetControl::proc26() { - warning("TODO: CPetControl::proc26"); +void CPetControl::draw(CScreenManager *screenManager) { + CGameManager *gameManager = getGameManager(); + Rect bounds = _oldBounds; + bounds.constrain(gameManager->_bounds); + + if (!bounds.isEmpty()) { + if (_fieldC8 >= 0) { + _invSection.proc5(_fieldC8); + _fieldC8 = -1; + } + + _sub8.drawFrame(screenManager); + + // Draw the specific area that's currently active + switch (_currentArea) { + case PET_INVENTORY: + _invSection.draw(screenManager); + break; + case PET_CONVERSATION: + _convSection.draw(screenManager); + break; + case PET_REMOTE: + _remoteSection.draw(screenManager); + break; + case PET_ROOMS: + _roomsSection.draw(screenManager); + break; + case PET_SAVE: + _saveSection.draw(screenManager); + break; + case PET_5: + _sub5.draw(screenManager); + break; + case PET_6: + _sub7.draw(screenManager); + break; + default: + break; + } + } } void CPetControl::postLoad() { @@ -127,14 +165,6 @@ bool CPetControl::fn1(int val) { return false; } -void CPetControl::fn2(int val) { - warning("TODO: CPetControl::fn2"); -} - -void CPetControl::fn3(int val) { - warning("TODO: CPetControl::fn3"); -} - void CPetControl::fn4() { warning("TODO: CPetControl::fn4"); } @@ -207,4 +237,40 @@ PetArea CPetControl::setArea(PetArea newArea) { return newArea; } +void CPetControl::fn2(int val) { + switch (_currentArea) { + case PET_INVENTORY: + _invSection.proc38(val); + break; + case PET_CONVERSATION: + _convSection.proc38(val); + break; + case PET_REMOTE: + _remoteSection.proc38(val); + break; + case PET_ROOMS: + _roomsSection.proc38(val); + break; + case PET_SAVE: + _saveSection.proc38(val); + break; + case PET_5: + _sub5.proc38(val); + break; + case PET_6: + _sub7.proc38(val); + break; + default: + break; + } +} + +void CPetControl::fn3(CTreeItem *item) { + _treeItem2 = item; + if (item) + _string2 = item->getName(); + else + _string2.clear(); +} + } // End of namespace Titanic |