From fbc46ed5b41633c1a8dc6e54591fe4dd028dbc04 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Mar 2016 17:29:58 -0400 Subject: TITANIC: Starting on frame rendering --- engines/titanic/game_view.cpp | 11 +++++++++++ engines/titanic/game_view.h | 2 ++ engines/titanic/main_game_window.cpp | 26 ++++++++++++++++++++++++-- engines/titanic/main_game_window.h | 9 +++++++++ engines/titanic/pet_control/pet_control.cpp | 4 ++++ engines/titanic/pet_control/pet_control.h | 2 ++ engines/titanic/screen_manager.cpp | 5 ++++- engines/titanic/screen_manager.h | 23 ++++++++++++++++++++--- 8 files changed, 76 insertions(+), 6 deletions(-) diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp index d04c3e1cfc..88ad095f7b 100644 --- a/engines/titanic/game_view.cpp +++ b/engines/titanic/game_view.cpp @@ -57,6 +57,17 @@ void CGameView::createSurface(const CResourceKey &key) { _surface->_field3C = true; } +void CGameView::draw1() { + CScreenManager::setCurrent(); + Common::Rect rect1 = _gameManager->_bounds; + Common::Rect rect2(0, 0, 600, 340); + rect2.translate(20, 10); + + + + warning("TODO: CGameView_Draw1"); +} + /*------------------------------------------------------------------------*/ CSTGameView::CSTGameView(CMainGameWindow *gameWindow) : diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h index a3e1fe7720..14412032dc 100644 --- a/engines/titanic/game_view.h +++ b/engines/titanic/game_view.h @@ -63,6 +63,8 @@ public: * Creates a surface from a specified resource */ void createSurface(const CResourceKey &key); + + void draw1(); }; class CSTGameView: public CGameView { diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 6a6a46ea65..c282787ade 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -25,6 +25,7 @@ #include "titanic/game_manager.h" #include "titanic/game_view.h" #include "titanic/messages/messages.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { @@ -125,8 +126,12 @@ void CMainGameWindow::draw() { case GSMODE_1: case GSMODE_2: if (_gameManager->_gameState._field18) - warning("TODO: Field18_fn1(this)"); - warning("TODO: Stuff"); + drawPet(scrManager); + + draw1(); + draw2(scrManager); + scrManager->drawCursors(); + break; case GSMODE_5: g_vm->_filesManager.debug(scrManager); @@ -138,6 +143,23 @@ void CMainGameWindow::draw() { } } +void CMainGameWindow::drawPet(CScreenManager *screenManager) { + if (_gameView && _gameView->_surface) { + CPetControl *petControl = _gameManager->_project->getPetControl(); + if (petControl) + petControl->proc26(); + } +} + +void CMainGameWindow::draw1() { + if (_gameView->_surface) + _gameView->draw1(); +} + +void CMainGameWindow::draw2(CScreenManager *screenManager) { + +} + void CMainGameWindow::mouseChanged() { if (_gameManager->_gameState._mode != GSMODE_5) _gameManager->update(); diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h index 8f6fb81228..549637b5dd 100644 --- a/engines/titanic/main_game_window.h +++ b/engines/titanic/main_game_window.h @@ -49,6 +49,15 @@ private: * to use */ int selectSavegame(); + + /** + * Used for drawing the PET fullscreen? maybe + */ + void drawPet(CScreenManager *screenManager); + + void draw1(); + + void draw2(CScreenManager *screenManager); public: CGameView *_gameView; CGameManager *_gameManager; diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index f5498887e3..5886ce4169 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -80,6 +80,10 @@ void CPetControl::saveSubObjects(SimpleFile *file, int indent) const { _sub8.save(file, indent); } +void CPetControl::proc26() { + warning("TODO: CPetControl::proc26"); +} + void CPetControl::postLoad() { warning("TODO: CPetControl::postLoad"); } diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index f1e4bb2a10..df529aed6a 100644 --- a/engines/titanic/pet_control/pet_control.h +++ b/engines/titanic/pet_control/pet_control.h @@ -78,6 +78,8 @@ public: */ virtual void load(SimpleFile *file); + virtual void proc26(); + /** * Called after loading a game has finished */ diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp index fe15d9aec0..f87ad66b9a 100644 --- a/engines/titanic/screen_manager.cpp +++ b/engines/titanic/screen_manager.cpp @@ -105,7 +105,10 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac loadCursors(); } -void OSScreenManager::proc5() {} +void OSScreenManager::drawCursors() { + warning("OSScreenManager::drawCursors"); +} + void OSScreenManager::proc6() {} void OSScreenManager::proc7() {} diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h index a5fa562bc8..8fe51c57b0 100644 --- a/engines/titanic/screen_manager.h +++ b/engines/titanic/screen_manager.h @@ -68,8 +68,17 @@ public: virtual void setWindowHandle(int v); virtual bool resetWindowHandle(int v); + + /** + * Sets the video mode + */ virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0; - virtual void proc5() = 0; + + /** + * Handles drawing the cursors + */ + virtual void drawCursors() = 0; + virtual void proc6() = 0; virtual void proc7() = 0; virtual CVideoSurface *getSurface(int surfaceNum) const = 0; @@ -136,8 +145,16 @@ public: OSScreenManager(TitanicEngine *vm); virtual ~OSScreenManager(); - virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2); - virtual void proc5(); + /** + * Sets the video mode + */ + virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0; + + /** + * Handles drawing the cursors + */ + virtual void drawCursors(); + virtual void proc6(); virtual void proc7(); virtual CVideoSurface *getSurface(int surfaceNum) const; -- cgit v1.2.3