From ca9fedb6c11613d0ebbc457f805e6e879344c1c5 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 8 Dec 2013 21:27:16 -0500 Subject: [PATCH] BURIED: Add base for Agent 3's lair --- engines/buried/environ/agent3_lair.cpp | 67 ++++++++++++++++++++++++ engines/buried/environ/scene_factory.cpp | 7 ++- engines/buried/module.mk | 1 + engines/buried/scene_view.h | 5 ++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 engines/buried/environ/agent3_lair.cpp diff --git a/engines/buried/environ/agent3_lair.cpp b/engines/buried/environ/agent3_lair.cpp new file mode 100644 index 00000000000..f8b6f20d037 --- /dev/null +++ b/engines/buried/environ/agent3_lair.cpp @@ -0,0 +1,67 @@ +/* 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. + * + * Additional copyright for this file: + * Copyright (C) 1995 Presto Studios, Inc. + * + * 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 "buried/buried.h" +#include "buried/gameui.h" +#include "buried/graphics.h" +#include "buried/inventory_window.h" +#include "buried/resources.h" +#include "buried/scene_view.h" +#include "buried/sound.h" +#include "buried/environ/scene_base.h" +#include "buried/environ/scene_common.h" + +namespace Buried { + +bool SceneViewWindow::initializeAgent3LairTimeZoneAndEnvironment(Window *viewWindow, int environment) { + if (environment == -1) + ((SceneViewWindow *)viewWindow)->getGlobalFlags().alNMWrongAlienPrefixCode = 0; + + return true; +} + +bool SceneViewWindow::startAgent3LairAmbient(int oldTimeZone, int oldEnvironment, int environment, bool fade) { + _vm->_sound->setAmbientSound(_vm->getFilePath(3, environment, SF_AMBIENT), fade, 64); + return true; +} + +SceneBase *SceneViewWindow::constructAgent3LairSceneObject(Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation) { + // TODO + + switch (sceneStaticData.classID) { + case 1: + return new GenericItemAcquire(_vm, viewWindow, sceneStaticData, priorLocation, 177, 96, 231, 184, kItemGeneratorCore, 15, offsetof(GlobalFlags, alRDTakenLiveCore)); + case 20: + return new ClickChangeScene(_vm, viewWindow, sceneStaticData, priorLocation, 36, 15, 396, 189, kCursorFinger, 3, 2, 0, 1, 1, 1, TRANSITION_VIDEO, 0, -1, -1); + case 25: + return new ClickChangeScene(_vm, viewWindow, sceneStaticData, priorLocation, 150, 24, 280, 124, kCursorFinger, 3, 2, 4, 0, 1, 1, TRANSITION_VIDEO, 6, -1, -1); + } + + warning("TODO: Agent 3 lair scene object %d", sceneStaticData.classID); + + return new SceneBase(_vm, viewWindow, sceneStaticData, priorLocation); +} + +} // End of namespace Buried diff --git a/engines/buried/environ/scene_factory.cpp b/engines/buried/environ/scene_factory.cpp index f4355c9bb80..ea9cefd55da 100644 --- a/engines/buried/environ/scene_factory.cpp +++ b/engines/buried/environ/scene_factory.cpp @@ -97,6 +97,8 @@ bool SceneViewWindow::startEnvironmentAmbient(int oldTimeZone, int oldEnvironmen return startCastleAmbient(oldTimeZone, oldEnvironment, environment, fade); case 2: return startMayanAmbient(oldTimeZone, oldEnvironment, environment, fade); + case 3: + return startAgent3LairAmbient(oldTimeZone, oldEnvironment, environment, fade); case 4: return startFutureApartmentAmbient(oldTimeZone, oldEnvironment, environment, fade); case 5: @@ -117,7 +119,6 @@ SceneBase *SceneViewWindow::constructSceneObject(Window *viewWindow, const Locat switch (sceneStaticData.location.timeZone) { case 0: // Miscellaneous scenes - case 3: // Agent 3's Lair case 7: // Alien // TODO warning("Could not create scene object for time zone %d", sceneStaticData.location.timeZone); @@ -126,6 +127,8 @@ SceneBase *SceneViewWindow::constructSceneObject(Window *viewWindow, const Locat return constructCastleSceneObject(viewWindow, sceneStaticData, priorLocation); case 2: // Mayan return constructMayanSceneObject(viewWindow, sceneStaticData, priorLocation); + case 3: // Agent 3's Lair + return constructAgent3LairSceneObject(viewWindow, sceneStaticData, priorLocation); case 4: // Future Apartment return constructFutureApartmentSceneObject(viewWindow, sceneStaticData, priorLocation); case 5: // Da Vinci @@ -146,6 +149,8 @@ bool SceneViewWindow::initializeTimeZoneAndEnvironment(Window *viewWindow, int t return initializeCastleTimeZoneAndEnvironment(viewWindow, environment); case 2: return initializeMayanTimeZoneAndEnvironment(viewWindow, environment); + case 3: + return initializeAgent3LairTimeZoneAndEnvironment(viewWindow, environment); case 4: // Nothing to do return true; diff --git a/engines/buried/module.mk b/engines/buried/module.mk index 9024b643fd1..9bc2ede3ceb 100644 --- a/engines/buried/module.mk +++ b/engines/buried/module.mk @@ -29,6 +29,7 @@ MODULE_OBJS = \ demo/demo_menu.o \ demo/features.o \ demo/movie_scene.o \ + environ/agent3_lair.o \ environ/ai_lab.o \ environ/castle.o \ environ/da_vinci.o \ diff --git a/engines/buried/scene_view.h b/engines/buried/scene_view.h index 31d54925219..ccda1489653 100644 --- a/engines/buried/scene_view.h +++ b/engines/buried/scene_view.h @@ -224,6 +224,11 @@ private: bool initializeMayanTimeZoneAndEnvironment(Window *viewWindow, int environment); bool startMayanAmbient(int oldTimeZone, int oldEnvironment, int environment, bool fade); SceneBase *constructMayanSceneObject(Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation); + + // Agent 3's Lair + bool initializeAgent3LairTimeZoneAndEnvironment(Window *viewWindow, int environment); + bool startAgent3LairAmbient(int oldTimeZone, int oldEnvironment, int environment, bool fade); + SceneBase *constructAgent3LairSceneObject(Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation); }; } // End of namespace Buried