2011-05-14 18:19:35 +10:00
|
|
|
/* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-08-13 19:49:54 +10:00
|
|
|
#include "tsage/blue_force/blueforce_logic.h"
|
|
|
|
#include "tsage/blue_force/blueforce_scenes0.h"
|
|
|
|
#include "tsage/blue_force/blueforce_scenes1.h"
|
2011-05-14 18:19:35 +10:00
|
|
|
#include "tsage/scenes.h"
|
|
|
|
#include "tsage/tsage.h"
|
|
|
|
#include "tsage/staticres.h"
|
|
|
|
|
2011-08-15 19:26:15 +10:00
|
|
|
namespace tSage {
|
|
|
|
|
|
|
|
namespace BlueForce {
|
2011-05-14 18:19:35 +10:00
|
|
|
|
|
|
|
void BlueForceGame::start() {
|
|
|
|
// Start the game
|
2011-08-14 12:25:55 +10:00
|
|
|
_globals->_sceneManager.changeScene(109);
|
2011-06-20 00:59:48 +02:00
|
|
|
|
2011-05-14 18:19:35 +10:00
|
|
|
_globals->_events.setCursor(CURSOR_WALK);
|
|
|
|
}
|
|
|
|
|
|
|
|
Scene *BlueForceGame::createScene(int sceneNumber) {
|
2011-05-15 09:10:01 +02:00
|
|
|
switch (sceneNumber) {
|
2011-08-11 22:05:44 +10:00
|
|
|
/* Scene Group #0 */
|
2011-05-15 09:10:01 +02:00
|
|
|
case 20:
|
2011-08-07 23:14:09 +10:00
|
|
|
// Tsunami Title Screen
|
2011-08-14 20:18:32 +10:00
|
|
|
return new Scene20();
|
2011-05-15 09:10:01 +02:00
|
|
|
case 50:
|
|
|
|
case 60:
|
|
|
|
error("Scene group 0 not implemented");
|
2011-08-11 22:05:44 +10:00
|
|
|
/* Scene Group #1 */
|
2011-05-15 09:10:01 +02:00
|
|
|
case 100:
|
2011-08-11 22:05:44 +10:00
|
|
|
// Tsnunami Title Screen #2
|
2011-08-14 20:18:32 +10:00
|
|
|
return new Scene100();
|
2011-05-15 09:10:01 +02:00
|
|
|
case 109:
|
2011-08-14 12:25:55 +10:00
|
|
|
// Introduction Bar Room
|
2011-08-14 20:18:32 +10:00
|
|
|
return new Scene109();
|
2011-05-15 09:10:01 +02:00
|
|
|
case 110:
|
|
|
|
case 114:
|
|
|
|
case 115:
|
|
|
|
case 125:
|
|
|
|
case 140:
|
|
|
|
case 150:
|
|
|
|
case 160:
|
|
|
|
case 180:
|
|
|
|
case 190:
|
|
|
|
error("Scene group 1 not implemented");
|
|
|
|
case 200:
|
|
|
|
case 210:
|
|
|
|
case 220:
|
|
|
|
case 225:
|
|
|
|
case 265:
|
|
|
|
case 270:
|
|
|
|
case 271:
|
|
|
|
case 280:
|
|
|
|
error("Scene group 2 not implemented");
|
|
|
|
case 300:
|
|
|
|
case 315:
|
|
|
|
case 325:
|
|
|
|
case 330:
|
|
|
|
case 340:
|
|
|
|
case 342:
|
|
|
|
case 350:
|
|
|
|
case 355:
|
|
|
|
case 360:
|
|
|
|
case 370:
|
|
|
|
case 380:
|
|
|
|
case 385:
|
|
|
|
case 390:
|
|
|
|
error("Scene group 3 not implemented");
|
|
|
|
case 410:
|
|
|
|
case 415:
|
|
|
|
case 440:
|
|
|
|
case 450:
|
|
|
|
error("Scene group 4 not implemented");
|
|
|
|
case 550:
|
|
|
|
case 551:
|
|
|
|
case 560:
|
|
|
|
case 570:
|
|
|
|
case 580:
|
|
|
|
case 590:
|
|
|
|
error("Scene group 5 not implemented");
|
|
|
|
case 600:
|
|
|
|
case 620:
|
|
|
|
case 666:
|
|
|
|
case 690:
|
|
|
|
error("Scene group 6 not implemented");
|
|
|
|
case 710:
|
|
|
|
error("Scene group 7 not implemented");
|
|
|
|
case 800:
|
|
|
|
case 810:
|
|
|
|
case 820:
|
|
|
|
case 830:
|
|
|
|
case 840:
|
|
|
|
case 850:
|
|
|
|
case 860:
|
|
|
|
case 870:
|
|
|
|
case 880:
|
|
|
|
error("Scene group 8 not implemented");
|
|
|
|
case 900:
|
|
|
|
case 910:
|
|
|
|
case 920:
|
|
|
|
case 930:
|
|
|
|
case 935:
|
|
|
|
case 940:
|
|
|
|
error("Scene group 9 not implemented");
|
|
|
|
default:
|
|
|
|
error("Unknown scene number - %d", sceneNumber);
|
|
|
|
break;
|
|
|
|
}
|
2011-05-14 18:19:35 +10:00
|
|
|
}
|
|
|
|
|
2011-08-14 12:25:55 +10:00
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
ObjArray::ObjArray(): EventHandler() {
|
|
|
|
_inUse = false;
|
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ObjArray::clear() {
|
|
|
|
for (int i = 0; i < OBJ_ARRAY_SIZE; ++i)
|
|
|
|
_objList[i] = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ObjArray::synchronize(Serializer &s) {
|
|
|
|
EventHandler::synchronize(s);
|
|
|
|
for (int i = 0; i < OBJ_ARRAY_SIZE; ++i)
|
|
|
|
SYNC_POINTER(_objList[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ObjArray::process(Event &event) {
|
|
|
|
if (_inUse)
|
|
|
|
error("Array error");
|
|
|
|
_inUse = true;
|
|
|
|
|
|
|
|
for (int i = 0; i < OBJ_ARRAY_SIZE; ++i) {
|
|
|
|
if (_objList[i])
|
|
|
|
_objList[i]->process(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
_inUse = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ObjArray::dispatch() {
|
|
|
|
if (_inUse)
|
|
|
|
error("Array error");
|
|
|
|
_inUse = true;
|
|
|
|
|
|
|
|
for (int i = 0; i < OBJ_ARRAY_SIZE; ++i) {
|
|
|
|
if (_objList[i])
|
|
|
|
_objList[i]->dispatch();
|
|
|
|
}
|
|
|
|
|
|
|
|
_inUse = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
SceneExt::SceneExt(): Scene() {
|
|
|
|
warning("TODO: dword_503AA/dword_503AE/dword_53030");
|
|
|
|
|
|
|
|
_field372 = 0;
|
|
|
|
_field37C = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneExt::postInit(SceneObjectList *OwnerList) {
|
|
|
|
Scene::postInit(OwnerList);
|
|
|
|
if (BF_GLOBALS._v4CEA2) {
|
|
|
|
// Blank out the bottom portion of the screen
|
|
|
|
BF_GLOBALS._v51C24 = BF_INTERFACE_Y;
|
|
|
|
|
|
|
|
Rect r(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
|
|
BF_GLOBALS.gfxManager().getSurface().fillRect(r, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneExt::process(Event &event) {
|
|
|
|
_objArray2.process(event);
|
|
|
|
if (!event.handled)
|
|
|
|
Scene::process(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneExt::dispatch() {
|
|
|
|
_objArray1.dispatch();
|
|
|
|
|
|
|
|
if (_field37A) {
|
|
|
|
if ((--_field37A == 0) && BF_GLOBALS._v4CEA2) {
|
|
|
|
if (BF_GLOBALS._v4E238 && (BF_GLOBALS._v4CF9E == 1)) {
|
|
|
|
warning("sub_1B052");
|
|
|
|
}
|
|
|
|
|
|
|
|
_field37A = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Scene::dispatch();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SceneExt::loadScene(int sceneNum) {
|
|
|
|
Scene::loadScene(sceneNum);
|
|
|
|
warning("TODO: word_51C38/word_51C3C");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
GameScene::GameScene() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameScene::postInit(SceneObjectList *OwnerList) {
|
|
|
|
_field794 = 0;
|
|
|
|
_field412 = 1;
|
|
|
|
SceneExt::postInit(OwnerList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameScene::remove() {
|
|
|
|
SceneExt::remove();
|
|
|
|
if (_field794 == 1) {
|
|
|
|
for (SynchronizedList<SceneObject *>::iterator i = BF_GLOBALS._sceneObjects->begin();
|
|
|
|
i != BF_GLOBALS._sceneObjects->end(); ++i)
|
|
|
|
(*i)->remove();
|
|
|
|
|
|
|
|
BF_GLOBALS._sceneObjects->draw();
|
|
|
|
BF_GLOBALS._scenePalette.loadPalette(2);
|
|
|
|
BF_GLOBALS._v51C44 = 1;
|
|
|
|
BF_GLOBALS._v51C42 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
BF_GLOBALS._scenePalette._field412 = 1;
|
|
|
|
}
|
|
|
|
|
2011-08-15 19:26:15 +10:00
|
|
|
} // End of namespace BlueForce
|
2011-08-14 12:25:55 +10:00
|
|
|
|
2011-08-15 19:26:15 +10:00
|
|
|
} // End of namespace tSage
|