From 08be41ac52f07bdc859a9a9fd2252b69a757a569 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 5 Feb 2016 22:11:02 -0500 Subject: TITANIC: Added skeleton CMainGameWindow class --- engines/titanic/main_game_window.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 engines/titanic/main_game_window.cpp (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp new file mode 100644 index 0000000000..774cde6de1 --- /dev/null +++ b/engines/titanic/main_game_window.cpp @@ -0,0 +1,36 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/main_game_window.h" + +namespace Titanic { + +CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { + _gameView = nullptr; + _gameManager = nullptr; + _project = nullptr; + _field50 = 0; + _image = nullptr; + _cursor = nullptr; +} + +} // End of namespace Titanic -- cgit v1.2.3 From ab28f8714353ab5043d86375572815ebc75fe7ed Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 5 Feb 2016 23:39:27 -0500 Subject: TITANIC: Beginnings of Image class --- engines/titanic/main_game_window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 774cde6de1..54fb6c23a4 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -20,6 +20,7 @@ * */ +#include "titanic/titanic.h" #include "titanic/main_game_window.h" namespace Titanic { @@ -31,6 +32,11 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _field50 = 0; _image = nullptr; _cursor = nullptr; + + Image image; + bool result = image.loadResource("TITANIC"); + if (!result) + return; } } // End of namespace Titanic -- cgit v1.2.3 From bc7bc8ab3487df70263721493c26c16aab9c7b81 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 7 Feb 2016 16:22:16 -0500 Subject: TITANIC: Class stubs and beginnings of CSaveableObject hierarchy --- engines/titanic/main_game_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 54fb6c23a4..9087cafb80 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -32,11 +32,13 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _field50 = 0; _image = nullptr; _cursor = nullptr; +} +bool CMainGameWindow::Create() { Image image; bool result = image.loadResource("TITANIC"); if (!result) - return; + return true; } } // End of namespace Titanic -- cgit v1.2.3 From f8c6724112d9b6161a0df8ee31d98d13b36d2b40 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 21 Feb 2016 21:35:55 -0500 Subject: TITANIC: Fleshed out CompressedFile class --- engines/titanic/main_game_window.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 9087cafb80..78e07e9af2 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -39,6 +39,9 @@ bool CMainGameWindow::Create() { bool result = image.loadResource("TITANIC"); if (!result) return true; + + // TODO: Stuff + return true; } } // End of namespace Titanic -- cgit v1.2.3 From 572fc8fc9ee65ec29c346f00cb34da482dda8d90 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 22 Feb 2016 20:43:14 -0500 Subject: TITANIC: Implemented bulk of applicationStarting --- engines/titanic/main_game_window.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 78e07e9af2..41eb825543 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -22,6 +22,8 @@ #include "titanic/titanic.h" #include "titanic/main_game_window.h" +#include "titanic/game_manager.h" +#include "titanic/game_view.h" namespace Titanic { @@ -44,4 +46,38 @@ bool CMainGameWindow::Create() { return true; } +void CMainGameWindow::applicationStarting() { + // Set up the game project, and get game slot + int saveSlot = selectSavegame(); + assert(_project); + + // Set the video mode + CScreenManager *screenManager = CScreenManager::setCurrent(); + screenManager->setMode(640, 480, 1, 1, false); + + // TODO: Clear surfaces + + // Create game view and manager + _gameView = new CTitanicGameView(this); + _gameManager = new CGameManager(_project, _gameView); + _gameView->setGameManager(_gameManager); + + // Load either a new game or selected existing save + _project->loadGame(saveSlot); + + // TODO: Cursor/image and message generation +} + +int CMainGameWindow::loadGame() { + _project = new CProjectItem(); + _project->setFilename("starship.prj"); + + return selectSavegame(); +} + +int CMainGameWindow::selectSavegame() { + // TODO: For now, hardcoded to -1 for new saves + return -1; +} + } // End of namespace Titanic -- cgit v1.2.3 From 063f8a97c842fa6745746180daffb513bda79658 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 22 Feb 2016 21:15:20 -0500 Subject: TITANIC: Fixes for game startup --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 41eb825543..c4eec39445 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -48,7 +48,7 @@ bool CMainGameWindow::Create() { void CMainGameWindow::applicationStarting() { // Set up the game project, and get game slot - int saveSlot = selectSavegame(); + int saveSlot = loadGame(); assert(_project); // Set the video mode -- cgit v1.2.3 From bad72e2ae491cb99843f3af971725231e3defb2e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 12 Mar 2016 19:23:00 -0500 Subject: TITANIC: Implement various post-load methods --- engines/titanic/main_game_window.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index c4eec39445..32647051d7 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -58,7 +58,7 @@ void CMainGameWindow::applicationStarting() { // TODO: Clear surfaces // Create game view and manager - _gameView = new CTitanicGameView(this); + _gameView = new CSTGameView(this); _gameManager = new CGameManager(_project, _gameView); _gameView->setGameManager(_gameManager); @@ -80,4 +80,12 @@ int CMainGameWindow::selectSavegame() { return -1; } +void CMainGameWindow::fn1(int v) { + warning("TODO"); +} + +void CMainGameWindow::fn2() { + warning("TODO"); +} + } // End of namespace Titanic -- cgit v1.2.3 From c92bf22f0331fbdbc7e440b43ae1973b679befb3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Mar 2016 15:07:27 -0400 Subject: TITANIC: Changed CGameStateSub to CGameLocation, properly implemented it --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 32647051d7..18f8dca984 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -80,7 +80,7 @@ int CMainGameWindow::selectSavegame() { return -1; } -void CMainGameWindow::fn1(int v) { +void CMainGameWindow::setActiveView(CViewItem *view) { warning("TODO"); } -- cgit v1.2.3 From 819b773491b728ab0be933ffdcfc333e20d582d3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Mar 2016 15:30:12 -0400 Subject: TITANIC: Add message generation at end of applicationStarting --- engines/titanic/main_game_window.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 18f8dca984..01996e6b13 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -24,6 +24,7 @@ #include "titanic/main_game_window.h" #include "titanic/game_manager.h" #include "titanic/game_view.h" +#include "titanic/messages/messages.h" namespace Titanic { @@ -65,7 +66,22 @@ void CMainGameWindow::applicationStarting() { // Load either a new game or selected existing save _project->loadGame(saveSlot); - // TODO: Cursor/image and message generation + // TODO: Cursor/image + + // Generate starting messages + CViewItem *view = _gameManager->_gameState._gameLocation.getView(); + CEnterViewMsg enterViewMsg(view); + enterViewMsg.execute(view, nullptr, MSGFLAG_SCAN); + + CNodeItem *node = view->findNode(); + CEnterNodeMsg enterNodeMsg(node); + enterNodeMsg.execute(node, nullptr, MSGFLAG_SCAN); + + CRoomItem *room = view->findRoom(); + CEnterRoomMsg enterRoomMsg(room); + enterRoomMsg.execute(room, nullptr, MSGFLAG_SCAN); + + _gameManager->initBounds(); } int CMainGameWindow::loadGame() { -- cgit v1.2.3 From 0cc014d06ba3b2588dfb7cb46366aa3d0a875d04 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Mar 2016 16:25:25 -0400 Subject: TITANIC: Implemented dumping of the project hierarchy --- engines/titanic/main_game_window.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 01996e6b13..18b033f1c9 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -67,6 +67,9 @@ void CMainGameWindow::applicationStarting() { _project->loadGame(saveSlot); // TODO: Cursor/image + //***DEBUG**** + _project->dump(0); + return; // Generate starting messages CViewItem *view = _gameManager->_gameState._gameLocation.getView(); -- cgit v1.2.3 From 75286e83212111bfb0d53ff7ea175559afd64963 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 Mar 2016 18:00:30 -0400 Subject: TITANIC: Fix loading project data --- engines/titanic/main_game_window.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 18b033f1c9..01996e6b13 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -67,9 +67,6 @@ void CMainGameWindow::applicationStarting() { _project->loadGame(saveSlot); // TODO: Cursor/image - //***DEBUG**** - _project->dump(0); - return; // Generate starting messages CViewItem *view = _gameManager->_gameState._gameLocation.getView(); -- cgit v1.2.3 From 3c29a101309b2d74cedf345c2d7314ef82fd9367 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 14 Mar 2016 23:09:57 -0400 Subject: TITANIC: Further graphics setup, beginnings of files manager --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 01996e6b13..e9fb423bd1 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -54,7 +54,7 @@ void CMainGameWindow::applicationStarting() { // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); - screenManager->setMode(640, 480, 1, 1, false); + screenManager->setMode(640, 480, 16, 1, true); // TODO: Clear surfaces -- cgit v1.2.3 From 6a26539abbf7951f4783935b336dcabfbf548055 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 15 Mar 2016 23:49:18 -0400 Subject: TITANIC: Fleshing out resource key and view loading --- engines/titanic/main_game_window.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index e9fb423bd1..bf5ec6efd1 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -96,8 +96,13 @@ int CMainGameWindow::selectSavegame() { return -1; } -void CMainGameWindow::setActiveView(CViewItem *view) { - warning("TODO"); +void CMainGameWindow::setActiveView(CViewItem *viewItem) { + _gameManager->_gameState._gameLocation.setView(viewItem); + + CResourceKey key; + if (viewItem->getResourceKey(&key)) { + // TODO + } } void CMainGameWindow::fn2() { -- cgit v1.2.3 From eaead0c6aee10f1fdd347a723bd9b816f80abff6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 16 Mar 2016 07:56:26 -0400 Subject: TITANIC: Starting to implement game view loading --- engines/titanic/main_game_window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index bf5ec6efd1..6bde296453 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -101,7 +101,8 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) { CResourceKey key; if (viewItem->getResourceKey(&key)) { - // TODO + // Create a surface based on the key + _gameView->createSurface(key); } } -- cgit v1.2.3 From 8ec499c177d88e11930b8550c47c352d65dc603a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 16 Mar 2016 19:05:16 -0400 Subject: TITANIC: Implementing setActiveView, surface clearing --- engines/titanic/main_game_window.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 6bde296453..a964f928f9 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -107,7 +107,31 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) { } void CMainGameWindow::fn2() { - warning("TODO"); + if (_gameManager) { + if (_gameView->_surface) { + CViewItem *view = _gameManager->getView(); + if (view) + setActiveView(view); + } + + CScreenManager *scrManager = CScreenManager::setCurrent(); + scrManager->clearSurface(0, &_gameManager->_bounds); + + switch (_gameManager->_gameState._mode) { + case GSMODE_1: + case GSMODE_2: + if (_gameManager->_gameState._field18) + warning("TODO: Field18_fn1(this)"); + warning("TODO: Stuff"); + + case GSMODE_5: + warning("TODO: FilesManager::fn1"); + break; + + default: + break; + } + } } } // End of namespace Titanic -- cgit v1.2.3 From 9565fbaeac8f48ea0090ebbd751a18eacc6d1230 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Mar 2016 21:34:04 -0400 Subject: TITANIC: Implement input translator event methods --- engines/titanic/main_game_window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index a964f928f9..429991dab7 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -32,7 +32,7 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _gameView = nullptr; _gameManager = nullptr; _project = nullptr; - _field50 = 0; + _inputAllowed = false; _image = nullptr; _cursor = nullptr; } @@ -134,4 +134,9 @@ void CMainGameWindow::fn2() { } } +void CMainGameWindow::mouseChanged() { + if (_gameManager->_gameState._mode != GSMODE_5) + _gameManager->update(); +} + } // End of namespace Titanic -- cgit v1.2.3 From abb9a549c86b9c83925cd41f02b27e3e88162b9b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Mar 2016 23:36:54 -0400 Subject: TITANIC: Enable event handlng --- engines/titanic/main_game_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 429991dab7..a6a5dcabf5 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -55,8 +55,10 @@ void CMainGameWindow::applicationStarting() { // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); screenManager->setMode(640, 480, 16, 1, true); + _inputAllowed = true; + + // TODO: Remove initial background and palette - // TODO: Clear surfaces // Create game view and manager _gameView = new CSTGameView(this); -- cgit v1.2.3 From d86941f8c6b497f2d3d8409c2628af88bc600dae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 19 Mar 2016 11:03:03 -0400 Subject: TITANIC: Implement preEnterView and enterView --- engines/titanic/main_game_window.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index a6a5dcabf5..0c80149173 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -70,17 +70,18 @@ void CMainGameWindow::applicationStarting() { // TODO: Cursor/image - // Generate starting messages + // Generate starting messages for entering the view, node, and room. + // Note the old fields are nullptr, since there's no previous view/node/room CViewItem *view = _gameManager->_gameState._gameLocation.getView(); - CEnterViewMsg enterViewMsg(view); + CEnterViewMsg enterViewMsg(nullptr, view); enterViewMsg.execute(view, nullptr, MSGFLAG_SCAN); CNodeItem *node = view->findNode(); - CEnterNodeMsg enterNodeMsg(node); + CEnterNodeMsg enterNodeMsg(nullptr, node); enterNodeMsg.execute(node, nullptr, MSGFLAG_SCAN); CRoomItem *room = view->findRoom(); - CEnterRoomMsg enterRoomMsg(room); + CEnterRoomMsg enterRoomMsg(nullptr, room); enterRoomMsg.execute(room, nullptr, MSGFLAG_SCAN); _gameManager->initBounds(); -- cgit v1.2.3 From 4704d72d6af60db97959c3d170a2ea524a0f0f1f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 19 Mar 2016 18:19:45 -0400 Subject: TITANIC: Implementing view item message handling --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 0c80149173..2c148c8c2e 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -128,7 +128,7 @@ void CMainGameWindow::fn2() { warning("TODO: Stuff"); case GSMODE_5: - warning("TODO: FilesManager::fn1"); + g_vm->_filesManager.fn1(); break; default: -- cgit v1.2.3 From ea54e6244e75c609e6886ba210f80fb22c479d3f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Mar 2016 00:01:40 -0400 Subject: TITANIC: Fixes/renames for files manager --- engines/titanic/main_game_window.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 2c148c8c2e..6a6a46ea65 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -55,7 +55,6 @@ void CMainGameWindow::applicationStarting() { // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); screenManager->setMode(640, 480, 16, 1, true); - _inputAllowed = true; // TODO: Remove initial background and palette @@ -67,6 +66,8 @@ void CMainGameWindow::applicationStarting() { // Load either a new game or selected existing save _project->loadGame(saveSlot); + _inputAllowed = true; + _gameManager->_gameState.setMode(GSMODE_1); // TODO: Cursor/image @@ -109,7 +110,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) { } } -void CMainGameWindow::fn2() { +void CMainGameWindow::draw() { if (_gameManager) { if (_gameView->_surface) { CViewItem *view = _gameManager->getView(); @@ -128,7 +129,7 @@ void CMainGameWindow::fn2() { warning("TODO: Stuff"); case GSMODE_5: - g_vm->_filesManager.fn1(); + g_vm->_filesManager.debug(scrManager); break; default: -- cgit v1.2.3 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/main_game_window.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') 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(); -- cgit v1.2.3 From 217360d0c5a0b8289c16b22fc46782c475fcc9f5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Mar 2016 20:53:49 -0400 Subject: TITANIC: Add new derived Rect and Point classes --- engines/titanic/main_game_window.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index c282787ade..839c2fc684 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -125,11 +125,11 @@ void CMainGameWindow::draw() { switch (_gameManager->_gameState._mode) { case GSMODE_1: case GSMODE_2: - if (_gameManager->_gameState._field18) + if (_gameManager->_gameState._petActive) drawPet(scrManager); - draw1(); - draw2(scrManager); + drawView(); + drawViewContents(scrManager); scrManager->drawCursors(); break; @@ -151,12 +151,12 @@ void CMainGameWindow::drawPet(CScreenManager *screenManager) { } } -void CMainGameWindow::draw1() { +void CMainGameWindow::drawView() { if (_gameView->_surface) - _gameView->draw1(); + _gameView->drawView(); } -void CMainGameWindow::draw2(CScreenManager *screenManager) { +void CMainGameWindow::drawViewContents(CScreenManager *screenManager) { } -- cgit v1.2.3 From b7746eff425dde0fac89684281541a609ca8e294 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Mar 2016 22:44:55 -0400 Subject: TITANIC: Implement method for rendering view contents --- engines/titanic/main_game_window.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 839c2fc684..6fa240dcec 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -157,7 +157,32 @@ void CMainGameWindow::drawView() { } void CMainGameWindow::drawViewContents(CScreenManager *screenManager) { + // Get a reference to the reference, validating that it's present + if (!screenManager) + return; + CViewItem *view = _gameManager->getView(); + if (!view) + return; + CNodeItem *node = view->findNode(); + if (!node) + return; + CRoomItem *room = node->findRoom(); + if (!room) + return; + + double xVal = 0.0, yVal = 0.0; + room->calcNodePosition(node->_nodePos, xVal, yVal); + + // Iterate through drawing all the items in the scene except any item + // that's currently being dragged + for (CTreeItem *treeItem = view; treeItem; treeItem = treeItem->scan(view)) { + if (treeItem != _gameManager->_dragItem) + treeItem->draw(screenManager); + } + // Finally draw the drag item if there is one + if (_gameManager->_dragItem) + _gameManager->_dragItem->draw(screenManager); } void CMainGameWindow::mouseChanged() { -- cgit v1.2.3 From 06bd62fed403684afe00c018647cb4febeeddcce Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 22 Mar 2016 21:54:26 -0400 Subject: TITANIC: First scene starting to be displayed --- engines/titanic/main_game_window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 6fa240dcec..e1efae84df 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -55,7 +55,7 @@ void CMainGameWindow::applicationStarting() { // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); - screenManager->setMode(640, 480, 16, 1, true); + screenManager->setMode(640, 480, 16, 0, true); // TODO: Remove initial background and palette @@ -120,7 +120,7 @@ void CMainGameWindow::draw() { } CScreenManager *scrManager = CScreenManager::setCurrent(); - scrManager->clearSurface(0, &_gameManager->_bounds); + scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds); switch (_gameManager->_gameState._mode) { case GSMODE_1: @@ -129,7 +129,7 @@ void CMainGameWindow::draw() { drawPet(scrManager); drawView(); - drawViewContents(scrManager); +// drawViewContents(scrManager); scrManager->drawCursors(); break; -- cgit v1.2.3 From 42208769f7ac199f2b436164795f5ea7ac03fed4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 22 Mar 2016 22:39:37 -0400 Subject: TITANIC: Enable drawing of view contents --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index e1efae84df..0b0bb92921 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -129,7 +129,7 @@ void CMainGameWindow::draw() { drawPet(scrManager); drawView(); -// drawViewContents(scrManager); + drawViewContents(scrManager); scrManager->drawCursors(); break; -- cgit v1.2.3 From fe79317bdefe9594561cf45afe2ad476b1ac06ff Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 29 Mar 2016 22:57:22 -0400 Subject: TITANIC: Beginnings of PET drawing --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 0b0bb92921..6abe83bd3f 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -147,7 +147,7 @@ void CMainGameWindow::drawPet(CScreenManager *screenManager) { if (_gameView && _gameView->_surface) { CPetControl *petControl = _gameManager->_project->getPetControl(); if (petControl) - petControl->proc26(); + petControl->draw(screenManager); } } -- cgit v1.2.3 From 5923ee5001af91d1ca9294b1fead56ec04ece7df Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 31 Mar 2016 22:31:13 -0400 Subject: TITANIC: Implement CPetFrame::setArea --- engines/titanic/main_game_window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 6abe83bd3f..5b8cba341a 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -68,7 +68,7 @@ void CMainGameWindow::applicationStarting() { // Load either a new game or selected existing save _project->loadGame(saveSlot); _inputAllowed = true; - _gameManager->_gameState.setMode(GSMODE_1); + _gameManager->_gameState.setMode(GSMODE_SELECTED); // TODO: Cursor/image @@ -123,7 +123,7 @@ void CMainGameWindow::draw() { scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds); switch (_gameManager->_gameState._mode) { - case GSMODE_1: + case GSMODE_SELECTED: case GSMODE_2: if (_gameManager->_gameState._petActive) drawPet(scrManager); -- cgit v1.2.3 From 8e5f7a9453deff3436fc937292a0ff825acd7454 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 10 Apr 2016 15:01:39 -0400 Subject: TITANIC: Fix stopping movies --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 5b8cba341a..a524529492 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -113,7 +113,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) { void CMainGameWindow::draw() { if (_gameManager) { - if (_gameView->_surface) { + if (!_gameView->_surface) { CViewItem *view = _gameManager->getView(); if (view) setActiveView(view); -- cgit v1.2.3 From 0820c3ffaee211270ab75a14cd1d42047354aa34 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 May 2016 21:03:21 -0400 Subject: TITANIC: Refactor CTitleEngine to use CFilesManager for PE resources --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index a524529492..73ce375881 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -134,7 +134,7 @@ void CMainGameWindow::draw() { break; case GSMODE_5: - g_vm->_filesManager.debug(scrManager); + g_vm->_filesManager->debug(scrManager); break; default: -- cgit v1.2.3 From 03b45f44dfdb86a9607aaa09a02e5c57968e275f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 22 Jul 2016 13:28:32 -0400 Subject: TITANIC: Workaround for original using destroyed objects after save load The original loads savegames by loading a new project hierarchy and then deleting and replacing the existing one. This means that objects in the original project, such as the PET control, are destroyed, leaving the remainder of the PET code that called load operating on destroyed objects. This workaround instead flags for a load to be done, and adds new code in the game manager to take care of it. This way, the remainder of the PET event handling can finish first, and it will be then safe to destroy the original game project (including PET) and load the new savegame. --- engines/titanic/main_game_window.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 73ce375881..3c549c4e89 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -36,6 +36,7 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _inputAllowed = false; _image = nullptr; _cursor = nullptr; + _pendingLoadSlot = -1; } bool CMainGameWindow::Create() { @@ -137,6 +138,12 @@ void CMainGameWindow::draw() { g_vm->_filesManager->debug(scrManager); break; + case GSMODE_PENDING_LOAD: + // Pending savegame to load + _gameManager->_gameState.setMode(GSMODE_SELECTED); + _vm->_window->_project->loadGame(_pendingLoadSlot); + break; + default: break; } @@ -190,4 +197,9 @@ void CMainGameWindow::mouseChanged() { _gameManager->update(); } +void CMainGameWindow::loadGame(int slotId) { + _pendingLoadSlot = slotId; + _gameManager->_gameState.setMode(GSMODE_PENDING_LOAD); +} + } // End of namespace Titanic -- cgit v1.2.3 From 4f08292c8c082361af7212e3951af4b1b6c45199 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 22 Jul 2016 19:20:05 -0400 Subject: TITANIC: Add support for arbitrary window event targets Also moved all standard game event methods to CMainGameWindow. This will allow for the Continue Save dialog to be added in and get events instead of the game window --- engines/titanic/main_game_window.cpp | 147 +++++++++++++++++++++++++++++++++-- 1 file changed, 139 insertions(+), 8 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 3c549c4e89..736154a502 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -20,16 +20,19 @@ * */ +#include "common/config-manager.h" #include "titanic/titanic.h" -#include "titanic/main_game_window.h" #include "titanic/game_manager.h" #include "titanic/game_view.h" +#include "titanic/main_game_window.h" #include "titanic/messages/messages.h" #include "titanic/pet_control/pet_control.h" namespace Titanic { -CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { +CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm), + _specialButtons(0), _priorLeftDownTime(0), + _priorMiddleDownTime(0), _priorRightDownTime(0) { _gameView = nullptr; _gameManager = nullptr; _project = nullptr; @@ -37,6 +40,12 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) { _image = nullptr; _cursor = nullptr; _pendingLoadSlot = -1; + + // Set the window as an event target + vm->_events->addTarget(this); +} + +CMainGameWindow::~CMainGameWindow() { } bool CMainGameWindow::Create() { @@ -53,14 +62,11 @@ void CMainGameWindow::applicationStarting() { // Set up the game project, and get game slot int saveSlot = loadGame(); assert(_project); - + // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); screenManager->setMode(640, 480, 16, 0, true); - // TODO: Remove initial background and palette - - // Create game view and manager _gameView = new CSTGameView(this); _gameManager = new CGameManager(_project, _gameView); @@ -98,7 +104,10 @@ int CMainGameWindow::loadGame() { } int CMainGameWindow::selectSavegame() { - // TODO: For now, hardcoded to -1 for new saves + // If the user selected a savegame from the launcher, return it + if (ConfMan.hasKey("save_slot")) + return ConfMan.getInt("save_slot"); + return -1; } @@ -111,7 +120,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) { _gameView->createSurface(key); } } - + void CMainGameWindow::draw() { if (_gameManager) { if (!_gameView->_surface) { @@ -202,4 +211,126 @@ void CMainGameWindow::loadGame(int slotId) { _gameManager->_gameState.setMode(GSMODE_PENDING_LOAD); } +void CMainGameWindow::onIdle() { + if (!_inputAllowed) + return; + CGameManager *gameManager = _gameManager; + if (!gameManager) + return; + + // Let the game manager perform any game updates + gameManager->update(); + + if (gameManager->_gameState._quitGame) { + // Game needs to shut down + _vm->quitGame(); + } +} + +#define HANDLE_MESSAGE(METHOD) if (_inputAllowed) { \ + _gameManager->_inputTranslator.METHOD(_specialButtons, mousePos); \ + mouseChanged(); \ + } + + +void CMainGameWindow::mouseMove(const Point &mousePos) { + HANDLE_MESSAGE(mouseMove) +} + +void CMainGameWindow::leftButtonDown(const Point &mousePos) { + _specialButtons |= MK_LBUTTON; + + if ((_vm->_events->getTicksCount() - _priorLeftDownTime) < DOUBLE_CLICK_TIME) { + _priorLeftDownTime = 0; + leftButtonDoubleClick(mousePos); + } else { + _priorLeftDownTime = _vm->_events->getTicksCount(); + HANDLE_MESSAGE(leftButtonDown) + } +} + +void CMainGameWindow::leftButtonUp(const Point &mousePos) { + _specialButtons &= ~MK_LBUTTON; + HANDLE_MESSAGE(leftButtonUp) +} + +void CMainGameWindow::leftButtonDoubleClick(const Point &mousePos) { + HANDLE_MESSAGE(leftButtonDoubleClick) +} + +void CMainGameWindow::middleButtonDown(const Point &mousePos) { + _specialButtons |= MK_MBUTTON; + + if ((_vm->_events->getTicksCount() - _priorMiddleDownTime) < DOUBLE_CLICK_TIME) { + _priorMiddleDownTime = 0; + middleButtonDoubleClick(mousePos); + } else { + _priorMiddleDownTime = _vm->_events->getTicksCount(); + HANDLE_MESSAGE(middleButtonDown) + } +} + +void CMainGameWindow::middleButtonUp(const Point &mousePos) { + _specialButtons &= ~MK_MBUTTON; + HANDLE_MESSAGE(middleButtonUp) +} + +void CMainGameWindow::middleButtonDoubleClick(const Point &mousePos) { + HANDLE_MESSAGE(middleButtonDoubleClick) +} + +void CMainGameWindow::rightButtonDown(const Point &mousePos) { + _specialButtons |= MK_RBUTTON; + + if ((_vm->_events->getTicksCount() - _priorRightDownTime) < DOUBLE_CLICK_TIME) { + _priorRightDownTime = 0; + rightButtonDoubleClick(mousePos); + } else { + _priorRightDownTime = _vm->_events->getTicksCount(); + HANDLE_MESSAGE(rightButtonDown) + } +} + +void CMainGameWindow::rightButtonUp(const Point &mousePos) { + _specialButtons &= ~MK_RBUTTON; + HANDLE_MESSAGE(rightButtonUp) +} + +void CMainGameWindow::rightButtonDoubleClick(const Point &mousePos) { + HANDLE_MESSAGE(rightButtonDoubleClick) +} + +void CMainGameWindow::charPress(char c) { + +} + +void CMainGameWindow::keyDown(Common::KeyState keyState) { + handleKbdSpecial(keyState); + + if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) { + // Attach to the debugger + _vm->_debugger->attach(); + _vm->_debugger->onFrame(); + } + + if (_inputAllowed) + _gameManager->_inputTranslator.keyDown(keyState); +} + +void CMainGameWindow::keyUp(Common::KeyState keyState) { + handleKbdSpecial(keyState); +} + +void CMainGameWindow::handleKbdSpecial(Common::KeyState keyState) { + if (keyState.flags & Common::KBD_CTRL) + _specialButtons |= MK_CONTROL; + else + _specialButtons &= ~MK_CONTROL; + + if (keyState.flags & Common::KBD_SHIFT) + _specialButtons |= MK_SHIFT; + else + _specialButtons &= ~MK_SHIFT; +} + } // End of namespace Titanic -- cgit v1.2.3 From 21e4d6686f515e70fce1ee177388b5d3bc7a4d61 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 22 Jul 2016 21:46:32 -0400 Subject: TITANIC: Beginnings of Continue Save dialog --- engines/titanic/main_game_window.cpp | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 736154a502..2ecc319257 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -22,6 +22,7 @@ #include "common/config-manager.h" #include "titanic/titanic.h" +#include "titanic/continue_save_dialog.h" #include "titanic/game_manager.h" #include "titanic/game_view.h" #include "titanic/main_game_window.h" @@ -50,23 +51,22 @@ CMainGameWindow::~CMainGameWindow() { bool CMainGameWindow::Create() { Image image; - bool result = image.loadResource("TITANIC"); - if (!result) - return true; + image.load("TITANIC"); // TODO: Stuff return true; } void CMainGameWindow::applicationStarting() { - // Set up the game project, and get game slot - int saveSlot = loadGame(); - assert(_project); - // Set the video mode CScreenManager *screenManager = CScreenManager::setCurrent(); screenManager->setMode(640, 480, 16, 0, true); + // Set up the game project, and get game slot + int saveSlot = getSavegameSlot(); + if (saveSlot == -2) + return; + // Create game view and manager _gameView = new CSTGameView(this); _gameManager = new CGameManager(_project, _gameView); @@ -96,7 +96,7 @@ void CMainGameWindow::applicationStarting() { _gameManager->initBounds(); } -int CMainGameWindow::loadGame() { +int CMainGameWindow::getSavegameSlot() { _project = new CProjectItem(); _project->setFilename("starship.prj"); @@ -108,7 +108,21 @@ int CMainGameWindow::selectSavegame() { if (ConfMan.hasKey("save_slot")) return ConfMan.getInt("save_slot"); - return -1; + CContinueSaveDialog dialog; + bool hasSavegames = false; + + // Loop through save slots to find any existing save slots + for (int idx = 0; idx < MAX_SAVES; ++idx) { + CString saveName = g_vm->getSavegameName(idx); + if (!saveName.empty()) { + dialog.addSavegame(idx, saveName); + hasSavegames = true; + } + } + + // If there are savegames, show the select dialog and get a choice. + // If there aren't, return -1 to indicate starting a new game + return hasSavegames ? dialog.show() : -1; } void CMainGameWindow::setActiveView(CViewItem *viewItem) { -- cgit v1.2.3 From d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Jul 2016 17:21:38 -0400 Subject: TITANIC: Fixes for movie notification, computer game logic cleanup --- engines/titanic/main_game_window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 2ecc319257..46d658b004 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -75,7 +75,7 @@ void CMainGameWindow::applicationStarting() { // Load either a new game or selected existing save _project->loadGame(saveSlot); _inputAllowed = true; - _gameManager->_gameState.setMode(GSMODE_SELECTED); + _gameManager->_gameState.setMode(GSMODE_INTERACTIVE); // TODO: Cursor/image @@ -147,8 +147,8 @@ void CMainGameWindow::draw() { scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds); switch (_gameManager->_gameState._mode) { - case GSMODE_SELECTED: - case GSMODE_2: + case GSMODE_INTERACTIVE: + case GSMODE_CUTSCENE: if (_gameManager->_gameState._petActive) drawPet(scrManager); @@ -163,7 +163,7 @@ void CMainGameWindow::draw() { case GSMODE_PENDING_LOAD: // Pending savegame to load - _gameManager->_gameState.setMode(GSMODE_SELECTED); + _gameManager->_gameState.setMode(GSMODE_INTERACTIVE); _vm->_window->_project->loadGame(_pendingLoadSlot); break; -- cgit v1.2.3 From 386761f340ca0c891ca0b207bdcb8ec34c373cba Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 5 Aug 2016 13:11:12 -0400 Subject: TITANIC: Added skeleton QMixer class for mixer interface --- engines/titanic/main_game_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/main_game_window.cpp') diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp index 46d658b004..486bc417d7 100644 --- a/engines/titanic/main_game_window.cpp +++ b/engines/titanic/main_game_window.cpp @@ -69,7 +69,7 @@ void CMainGameWindow::applicationStarting() { // Create game view and manager _gameView = new CSTGameView(this); - _gameManager = new CGameManager(_project, _gameView); + _gameManager = new CGameManager(_project, _gameView, g_vm->_mixer); _gameView->setGameManager(_gameManager); // Load either a new game or selected existing save -- cgit v1.2.3