BURIED: Add the scene view class

This commit is contained in:
Matthew Hoops 2013-11-22 22:19:01 -05:00 committed by Eugene Sandulenko
parent 9f12e36917
commit 9c0da1c36b
21 changed files with 3187 additions and 105 deletions

View File

@ -25,12 +25,15 @@
#include "buried/buried.h"
#include "buried/biochip_right.h"
#include "buried/biochip_view.h"
#include "buried/gameui.h"
#include "buried/graphics.h"
#include "buried/invdata.h"
#include "buried/inventory_window.h"
#include "buried/livetext.h"
#include "buried/navarrow.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "buried/sound.h"
#include "buried/video_window.h"
@ -61,9 +64,8 @@ bool BioChipRightWindow::changeCurrentBioChip(int bioChipID) {
if (bioChipID != kItemBioChipTranslate)
((GameUIWindow *)_parent)->_liveTextWindow->translateBiochipClosing();
// TODO
//if (bioChipID != kItemBioChipEvidence)
// ;
if (bioChipID != kItemBioChipEvidence)
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcLocateEnabled = 0;
if (_bioChipViewWindow)
destroyBioChipViewWindow();
@ -71,7 +73,7 @@ bool BioChipRightWindow::changeCurrentBioChip(int bioChipID) {
_curBioChip = bioChipID;
_status = 0;
// TODO: Set the translate enabled flag to false
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcTranslateEnabled = 0;
invalidateWindow(false);
return true;
@ -81,14 +83,15 @@ bool BioChipRightWindow::showBioChipMainView() {
if (_bioChipViewWindow)
return false;
// TODO: Notify the view of the change
((GameUIWindow *)_parent)->_sceneViewWindow->bioChipWindowDisplayed(true);
_vm->_sound->timerCallback();
// TODO: Destroy info window
// TODO: Destroy burned letter window
((GameUIWindow *)_parent)->_inventoryWindow->destroyInfoWindow();
((GameUIWindow *)_parent)->_inventoryWindow->destroyBurnedLetterWindow();
_vm->_sound->timerCallback();
// TODO: BioChip main view window (child to scene view)
_bioChipViewWindow = new BioChipMainViewWindow(_vm, ((GameUIWindow *)_parent)->_sceneViewWindow, _curBioChip);
_bioChipViewWindow->showWindow(kWindowShow);
_vm->_sound->timerCallback();
return true;
@ -103,7 +106,7 @@ bool BioChipRightWindow::destroyBioChipViewWindow() {
_bioChipViewWindow = 0;
_vm->_sound->timerCallback();
// TODO: Signal the change to the scene view window
((GameUIWindow *)_parent)->_sceneViewWindow->bioChipWindowDisplayed(false);
if (_status == 1) {
_status = 0;
@ -121,7 +124,7 @@ void BioChipRightWindow::sceneChanged() {
void BioChipRightWindow::disableEvidenceCapture() {
if (_curBioChip == kItemBioChipEvidence) {
_status = 0;
// TODO: Disable locate flag
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcLocateEnabled = 0;
invalidateWindow(false);
}
}
@ -145,9 +148,8 @@ void BioChipRightWindow::onPaint() {
switch (_curBioChip) {
case kItemBioChipAI: {
// TODO: Check scene view for help/information comment
bool helpComment = _forceHelp || false;
bool information = _forceComment || false;
bool helpComment = _forceHelp || ((GameUIWindow *)_parent)->_sceneViewWindow->checkForAIComment(AI_COMMENT_TYPE_HELP);
bool information = _forceComment || ((GameUIWindow *)_parent)->_sceneViewWindow->checkForAIComment(AI_COMMENT_TYPE_INFORMATION);
if (helpComment) {
if (information)
@ -190,10 +192,19 @@ void BioChipRightWindow::onPaint() {
else
bitmapResID = (_status == 0) ? 12 : 13;
break;
case kItemBioChipJump:
// TODO
case kItemBioChipJump: {
Location currentLocation;
bitmapResID = 14;
if (_status != 0)
bitmapResID += 2;
if (((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation))
if (currentLocation.timeZone == 4)
bitmapResID++;
break;
}
case kItemBioChipTranslate:
bitmapResID = (_status == 0) ? 18 : 19;
break;
@ -222,7 +233,11 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
switch (_curBioChip) {
case kItemBioChipAI:
// TODO
if (upperButton.contains(point) && ((GameUIWindow *)_parent)->_sceneViewWindow->playAIComment(AI_COMMENT_TYPE_HELP))
invalidateWindow(false);
if (lowerButton.contains(point) && ((GameUIWindow *)_parent)->_sceneViewWindow->playAIComment(AI_COMMENT_TYPE_INFORMATION))
invalidateWindow(false);
break;
case kItemBioChipCloak:
if (upperButton.contains(point)) {
@ -251,10 +266,18 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
invalidateWindow(false);
// TODO: Set cloaking flag
// TODO: Disable some controls
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcCloakingEnabled = 1;
((GameUIWindow *)_parent)->_inventoryWindow->enableWindow(false);
((GameUIWindow *)_parent)->_sceneViewWindow->enableWindow(false);
((GameUIWindow *)_parent)->_navArrowWindow->enableWindow(false);
// TODO: Change live text
Location currentLocation;
((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation);
if (currentLocation.timeZone == 10)
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_CLOAK_BIOCHIP_AUTO_ACTIVATE));
else
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_CLOAK_BIOCHIP_ACTIVATE));
} else {
_status = 0;
@ -278,11 +301,11 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
invalidateWindow(false);
// TODO: Set cloaking flag
// TODO: Enable navigation
// TODO: Enable inventory controls
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcCloakingEnabled = 0;
((GameUIWindow *)_parent)->_inventoryWindow->enableWindow(true);
((GameUIWindow *)_parent)->_sceneViewWindow->enableWindow(true);
((GameUIWindow *)_parent)->_navArrowWindow->enableWindow(true);
// TODO: Change live text
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_CLOAK_BIOCHIP_DEACTIVATE));
}
}
break;
@ -290,12 +313,12 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
if (upperButton.contains(point)) {
if (_status == 1) {
_status = 0;
// TODO
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcLocateEnabled = 0;
invalidateWindow(false);
} else {
destroyBioChipViewWindow();
_status = 1;
// TODO
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcLocateEnabled = 1;
invalidateWindow(false);
}
} else if (lowerButton.contains(point)) {
@ -306,7 +329,7 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
} else {
showBioChipMainView();
_status = 2;
// TODO
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcLocateEnabled = 0;
invalidateWindow(false);
}
}
@ -349,7 +372,17 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
invalidateWindow(false);
}
} else if (lowerButton.contains(point)) {
// TODO
Location currentLocation;
if (((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation)) {
if (currentLocation.timeZone != 4) {
_status = 0;
destroyBioChipViewWindow();
((GameUIWindow *)_parent)->_inventoryWindow->destroyInfoWindow();
((GameUIWindow *)_parent)->_inventoryWindow->destroyBurnedLetterWindow();
invalidateWindow(false);
((GameUIWindow *)_parent)->_sceneViewWindow->timeSuitJump(4);
}
}
}
break;
case kItemBioChipTranslate:
@ -358,13 +391,15 @@ void BioChipRightWindow::onLButtonUp(const Common::Point &point, uint flags) {
_status = 1;
invalidateWindow(false);
// TODO: Reset global flag
// TODO: Redraw the scene window
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcTranslateEnabled = 1;
((GameUIWindow *)_parent)->_sceneViewWindow->invalidateWindow(false);
} else {
_status = 0;
invalidateWindow(false);
// TODO: Reset global flag
// TODO: Redraw the scene window
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().bcTranslateEnabled = 0;
((GameUIWindow *)_parent)->_liveTextWindow->translateBiochipClosing();
((GameUIWindow *)_parent)->_sceneViewWindow->invalidateWindow(false);
}
}
break;

View File

@ -30,6 +30,7 @@
#include "buried/graphics.h"
#include "buried/invdata.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "common/stream.h"
#include "graphics/surface.h"
@ -142,8 +143,7 @@ void InterfaceBioChipViewWindow::onPaint() {
Common::Rect absoluteRect = getAbsoluteRect();
_vm->_gfx->blit(_background, absoluteRect.left, absoluteRect.top);
// TODO
if (true)
if (((SceneViewWindow *)_parent)->getCyclingStatus())
_vm->_gfx->blit(_cycleCheck, absoluteRect.left + 13, absoluteRect.top + 144);
if (_caret)
@ -180,7 +180,15 @@ void InterfaceBioChipViewWindow::onLButtonUp(const Common::Point &point, uint fl
// TODO
break;
case REGION_FLICKER:
// TODO
if (_flicker.contains(point)) {
if (((SceneViewWindow *)(_parent->getParent()))->getCyclingStatus()) {
((SceneViewWindow *)(_parent->getParent()))->enableCycling(false);
invalidateRect(_flicker, false);
} else {
((SceneViewWindow *)(_parent->getParent()))->enableCycling(true);
invalidateRect(_flicker, false);
}
}
break;
case REGION_TRANSITION_SPEED:
_transLocation = CLIP<int>(point.x - 14, 0, 150);
@ -289,7 +297,12 @@ void FilesBioChipViewWindow::onLButtonUp(const Common::Point &point, uint flags)
_curPage = page.nextButtonPageIndex;
invalidateWindow(false);
// TODO: Score check
if (_curPage == 6)
((SceneViewWindow *)(_parent->getParent()))->getGlobalFlags().scoreResearchBCJumpsuit = 1;
else if (_curPage == 21)
((SceneViewWindow *)(_parent->getParent()))->getGlobalFlags().scoreResearchMichelle = 1;
else if (_curPage == 31)
((SceneViewWindow *)(_parent->getParent()))->getGlobalFlags().scoreResearchMichelleBkg = 1;
return;
}

View File

@ -37,6 +37,7 @@
#include "buried/frame_window.h"
#include "buried/graphics.h"
#include "buried/message.h"
#include "buried/resources.h"
#include "buried/sound.h"
#include "buried/video_window.h"
#include "buried/window.h"
@ -383,4 +384,20 @@ uint32 BuriedEngine::getVersion() {
return _mainEXE->getVersion();
}
Common::String BuriedEngine::getFilePath(int timeZone, int environment, int fileOffset) {
return getFilePath(RESID_FILENAMES_BASE + RESOFFSET_FILENAME_TIMEZONE * timeZone + RESOFFSET_FILENAME_ENVIRON * environment + fileOffset);
}
uint32 BuriedEngine::computeNavDBResourceID(int timeZone, int environment) {
return RESID_NAVDB_BASE + RESOFFSET_NAVDB_TIMEZONE * timeZone + environment;
}
uint32 BuriedEngine::computeAnimDBResourceID(int timeZone, int environment) {
return RESID_ANIMDB_BASE + RESOFFSET_ANIMDB_TIMEZONE * timeZone + environment;
}
uint32 BuriedEngine::computeAIDBResourceID(int timeZone, int environment) {
return RESID_AI_DB_BASE + RESOFFSET_AI_DB_TIMEZONE * timeZone + environment;
}
} // End of namespace Buried

View File

@ -69,6 +69,7 @@ public:
// Resources
Common::String getString(uint32 stringID);
Common::String getFilePath(uint32 stringID);
Common::String getFilePath(int timeZone, int environment, int fileOffset);
Common::SeekableReadStream *getBitmapStream(uint32 bitmapID);
Common::SeekableReadStream *getNavData(uint32 resourceID);
Common::SeekableReadStream *getSndData(uint32 resourceID);
@ -79,6 +80,9 @@ public:
Common::SeekableReadStream *getFileBCData(uint32 resourceID);
Common::SeekableReadStream *getINNData(uint32 resourceID);
uint32 getVersion();
uint32 computeNavDBResourceID(int timeZone, int environment);
uint32 computeAnimDBResourceID(int timeZone, int environment);
uint32 computeAIDBResourceID(int timeZone, int environment);
GraphicsManager *_gfx;
Database *_mainEXE;

View File

@ -0,0 +1,82 @@
/* 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/graphics.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "buried/environ/scene_base.h"
namespace Buried {
SceneBase::SceneBase(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation) : _vm(vm), _staticData(sceneStaticData) {
_frameCycleCount = _staticData.cycleStartFrame;
((SceneViewWindow *)viewWindow)->changeStillFrameMovie(_vm->getFilePath(_staticData.location.timeZone, _staticData.location.environment, SF_STILLS));
if (_staticData.cycleStartFrame >= 0)
((SceneViewWindow *)viewWindow)->changeCycleFrameMovie(_vm->getFilePath(_staticData.location.timeZone, _staticData.location.environment, SF_CYCLES));
}
int SceneBase::paint(Window *viewWindow, Graphics::Surface *preBuffer) {
const Graphics::Surface *newFrame = 0;
if (_frameCycleCount >= 0) {
newFrame = ((SceneViewWindow *)viewWindow)->getCycleFrame(_frameCycleCount);
if (!newFrame)
newFrame = ((SceneViewWindow *)viewWindow)->getStillFrame(_staticData.navFrameIndex);
} else if (_staticData.navFrameIndex >= 0) {
newFrame = ((SceneViewWindow *)viewWindow)->getStillFrame(_staticData.navFrameIndex);
}
if (newFrame) {
Common::Rect absoluteRect = viewWindow->getAbsoluteRect();
_vm->_gfx->crossBlit(preBuffer, 0, 0, 432, 189, newFrame, 0, 0);
}
return SC_REPAINT;
}
int SceneBase::timerCallback(Window *viewWindow) {
// Check if we're cycling
if (_frameCycleCount < 0)
return SC_FALSE;
// Increment and wrap cycle counter
_frameCycleCount++;
if (_frameCycleCount > (_staticData.cycleStartFrame + _staticData.cycleFrameCount - 1))
_frameCycleCount = _staticData.cycleStartFrame;
// Update the view window
viewWindow->invalidateWindow(false);
return SC_TRUE;
}
int SceneBase::specifyCursor(Window *viewWindow, const Common::Point &pointLocation) {
return (int)kCursorArrow;
}
} // End of namespace Buried

View File

@ -0,0 +1,118 @@
/* 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.
*
*/
#ifndef BURIED_SCENE_BASE_H
#define BURIED_SCENE_BASE_H
#include "common/keyboard.h"
#include "common/rect.h"
#include "buried/navdata.h"
namespace Graphics {
struct Surface;
}
namespace Buried {
// Generic result codes
enum {
SC_FALSE = 0, // Everything did not go well, error out
SC_TRUE = 1, // Everything is kosher, continue as normal
SC_END_PROCESSING = 4 // Stop processing here
};
// Post-exit specific result codes
enum {
SC_DEATH = 3 // We died, so do nothing further
};
// Paint-specific return values
enum {
SC_REPAINT = 0,
SC_DO_NOT_REPAINT = 1
};
// Movie status codes
enum {
MOVIE_START = 0,
MOVIE_STOPPED = 1,
MOVIE_PLAYING = 2,
MOVIE_ABORTED_BY_USER = 3,
MOVIE_LOOPING_RESTART = 4
};
// Inventory item related return codes
enum {
SIC_REJECT = 0,
SIC_ACCEPT = 1
};
class BuriedEngine;
class Window;
class VideoWindow;
class SceneBase { // Wow, it's not a window!
public:
SceneBase(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation);
virtual ~SceneBase() {}
virtual void preDestructor() {}
virtual int preEnterRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
virtual int postEnterRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
virtual int preExitRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
virtual int postExitRoom(Window *viewWindow, const Location &priorLocation) { return SC_TRUE; }
virtual int mouseDown(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
virtual int mouseUp(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
virtual int mouseMove(Window *viewWindow, const Common::Point &pointLocation) { return SC_TRUE; }
virtual int onCharacter(Window *viewWindow, const Common::KeyState &character) { return SC_TRUE; }
virtual int paint(Window *viewWindow, Graphics::Surface *preBuffer);
virtual int gdiPaint(Window *viewWindow) { return SC_REPAINT; }
virtual int movieCallback(Window *viewWindow, VideoWindow *movie, int animationID, int status) { return SC_TRUE; }
virtual int timerCallback(Window *viewWindow);
virtual int draggingItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags) { return 0; }
virtual int droppedItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags) { return SIC_REJECT; }
virtual int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
virtual int locateAttempted(Window *viewWindow, const Common::Point &pointLocation) { return 0; }
LocationStaticData _staticData;
int32 _frameCycleCount;
protected:
BuriedEngine *_vm;
};
} // End of namespace Buried
#endif

View File

@ -39,6 +39,7 @@
#include "buried/message.h"
#include "buried/overview.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "buried/sound.h"
#include "buried/title_sequence.h"
#include "buried/video_window.h"
@ -57,6 +58,7 @@ FrameWindow::FrameWindow(BuriedEngine *vm) : Window(vm, 0) {
_transitionSpeed = 2;
_gameInProgress = false;
_atMainMenu = true;
_reviewerMode = false;
// Retrieve the transition speed from the INI file
Common::String transitionConfigName = _vm->isDemo() ? "TransitionSpeed" : _vm->getString(IDS_INI_KEY_TRANS_SPEED);
@ -341,7 +343,7 @@ bool FrameWindow::showOverview() {
bool FrameWindow::setTimerPause(bool pause) {
if (_gameInProgress) {
// TODO
((GameUIWindow *)_mainChildWindow)->_sceneViewWindow->_paused = pause;
return true;
}

View File

@ -63,6 +63,10 @@ public:
int getTransitionSpeed() const { return _transitionSpeed; }
void setTransitionSpeed(int newSpeed);
bool isFrameCyclingDefault() const { return _cycleDefault; }
bool isFrameCachingAllowed() const { return _cacheFrames; }
bool _reviewerMode;
private:
Window *_mainChildWindow;

View File

@ -33,6 +33,7 @@
#include "buried/message.h"
#include "buried/navarrow.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "buried/sound.h"
#include "buried/video_window.h"
@ -50,10 +51,9 @@ GameUIWindow::GameUIWindow(BuriedEngine *vm, Window *parent) : Window(vm, parent
_navArrowWindow = new NavArrowWindow(_vm, this);
_liveTextWindow = new LiveTextWindow(_vm, this);
_sceneViewWindow = new SceneViewWindow(_vm, this);
_inventoryWindow = new InventoryWindow(_vm, this);
_bioChipRightWindow = new BioChipRightWindow(_vm, this);
// TODO: Other windows
}
GameUIWindow::~GameUIWindow() {
@ -61,8 +61,7 @@ GameUIWindow::~GameUIWindow() {
delete _liveTextWindow;
delete _inventoryWindow;
delete _bioChipRightWindow;
// TODO: Other windows
delete _sceneViewWindow;
}
bool GameUIWindow::startNewGame(bool walkthrough) {
@ -73,8 +72,8 @@ bool GameUIWindow::startNewGame(bool walkthrough) {
_liveTextWindow->showWindow(kWindowShow);
_inventoryWindow->showWindow(kWindowShow);
_bioChipRightWindow->showWindow(kWindowShow);
// TODO: Other windows
_sceneViewWindow->showWindow(kWindowShow);
_sceneViewWindow->startNewGame(walkthrough);
return true;
}
@ -110,21 +109,38 @@ bool GameUIWindow::startNewGameIntro(bool walkthrough) {
_liveTextWindow->showWindow(kWindowShow);
_inventoryWindow->showWindow(kWindowShow);
_bioChipRightWindow->showWindow(kWindowShow);
_sceneViewWindow->showWindow(kWindowShow);
_sceneViewWindow->startNewGameIntro(walkthrough);
return true;
}
bool GameUIWindow::startNewGame(const Location &startingLocation) {
_doNotDraw = false;
showWindow(kWindowShow);
_navArrowWindow->showWindow(kWindowShow);
_liveTextWindow->showWindow(kWindowShow);
_sceneViewWindow->showWindow(kWindowShow);
_inventoryWindow->showWindow(kWindowShow);
_bioChipRightWindow->showWindow(kWindowShow);
_sceneViewWindow->startNewGame(startingLocation);
invalidateWindow(false);
// TODO: Other windows
return true;
}
bool GameUIWindow::startNewGame(const Common::String &fileName) {
_doNotDraw = false;
showWindow(kWindowShow);
invalidateWindow(false);
_navArrowWindow->showWindow(kWindowShow);
_liveTextWindow->showWindow(kWindowShow);
_sceneViewWindow->showWindow(kWindowShow);
_inventoryWindow->showWindow(kWindowShow);
_bioChipRightWindow->showWindow(kWindowShow);
// TODO: Other windows
_sceneViewWindow->startNewGame(fileName);
return true;
}
@ -296,8 +312,8 @@ void GameUIWindow::onEnable(bool enable) {
_inventoryWindow->enableWindow(enable);
_navArrowWindow->enableWindow(enable);
_liveTextWindow->enableWindow(enable);
_sceneViewWindow->enableWindow(enable);
_bioChipRightWindow->enableWindow(enable);
// TODO: Other windows
// If we're re-enabling, clear out the message queue of any mouse messages
if (enable)
@ -319,8 +335,7 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) {
_navArrowWindow->sendMessage(new KeyUpMessage(key, flags));
break;
case Common::KEYCODE_s:
if (key.flags & Common::KBD_CTRL) {
// TODO: Check for cloaking enabled
if ((key.flags & Common::KBD_CTRL) && _sceneViewWindow->getGlobalFlags().bcCloakingEnabled != 1) {
_bioChipRightWindow->changeCurrentBioChip(kItemBioChipInterface);
_bioChipRightWindow->invalidateWindow(false);
_bioChipRightWindow->sendMessage(new LButtonUpMessage(Common::Point(50, 130), 0));
@ -330,8 +345,7 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) {
// Fall through
case Common::KEYCODE_o:
case Common::KEYCODE_l:
if (key.flags & Common::KBD_CTRL) {
// TODO: Check for cloaking enabled
if ((key.flags & Common::KBD_CTRL) && _sceneViewWindow->getGlobalFlags().bcCloakingEnabled != 1) {
_bioChipRightWindow->changeCurrentBioChip(kItemBioChipInterface);
_bioChipRightWindow->invalidateWindow(false);
_bioChipRightWindow->sendMessage(new LButtonUpMessage(Common::Point(50, 130), 0));
@ -340,7 +354,8 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) {
}
// Fall through
default:
// TODO: Send to the scene view window
if (_sceneViewWindow)
_sceneViewWindow->sendMessage(new KeyUpMessage(key, flags));
break;
}
}

View File

@ -26,6 +26,7 @@
#ifndef BURIED_GAMEUI_H
#define BURIED_GAMEUI_H
#include "buried/navdata.h"
#include "buried/window.h"
namespace Graphics {
@ -38,6 +39,7 @@ class BioChipRightWindow;
class InventoryWindow;
class LiveTextWindow;
class NavArrowWindow;
class SceneViewWindow;
class GameUIWindow : public Window {
public:
@ -46,7 +48,7 @@ public:
bool startNewGame(bool walkthrough = false);
bool startNewGameIntro(bool walkthrough = false);
// startNewGame(location struct)
bool startNewGame(const Location &startingLocation);
bool startNewGame(const Common::String &fileName);
// startNewGame(continue data, location struct);
bool loadGame();
@ -62,7 +64,7 @@ public:
NavArrowWindow *_navArrowWindow;
LiveTextWindow *_liveTextWindow;
// TODO: SceneViewWindow
SceneViewWindow *_sceneViewWindow;
InventoryWindow *_inventoryWindow;
BioChipRightWindow *_bioChipRightWindow;

View File

@ -60,8 +60,8 @@ enum Cursor {
kCursorPrevPage = 107,
kCursorMoveUp = 108,
kCursorMoveDown = 109,
kCursorLocateCursorA = 110,
kCursorLocateCursorB = 111,
kCursorLocateA = 110,
kCursorLocateB = 111,
kCursorArrowUp = 112,
kCursorArrowLeft = 113,
kCursorArrowDown = 114,

View File

@ -25,10 +25,13 @@
#include "buried/avi_frames.h"
#include "buried/buried.h"
#include "buried/gameui.h"
#include "buried/graphics.h"
#include "buried/invdata.h"
#include "buried/inventory_info.h"
#include "buried/inventory_window.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "buried/video_window.h"
#include "graphics/font.h"
@ -75,9 +78,8 @@ bool InventoryInfoWindow::changeCurrentItem(int newItemID) {
_videoWindow->playToFrame(_spinStart + _spinLength);
if (_currentItemID == kItemLensFilter) {
// TODO: Set scoring flag
}
if (_currentItemID == kItemLensFilter)
((GameUIWindow *)(_parent->getParent()))->_sceneViewWindow->getGlobalFlags().scoreResearchLensFilter = 1;
return true;
}
@ -111,7 +113,7 @@ bool InventoryInfoWindow::onEraseBackground() {
}
void InventoryInfoWindow::onLButtonUp(const Common::Point &point, uint flags) {
// TODO: Destroy window
((GameUIWindow *)(_parent->getParent()))->_inventoryWindow->destroyInfoWindow();
}
void InventoryInfoWindow::onTimer(uint timer) {
@ -145,7 +147,7 @@ BurnedLetterViewWindow::BurnedLetterViewWindow(BuriedEngine *vm, Window *parent,
_rebuildPage = true;
// TODO: Scoring for reading the letter
((GameUIWindow *)(_parent->getParent()))->_sceneViewWindow->getGlobalFlags().readBurnedLetter = 1;
}
BurnedLetterViewWindow::~BurnedLetterViewWindow() {
@ -172,7 +174,7 @@ void BurnedLetterViewWindow::onPaint() {
byte transValue = _vm->isDemo() ? 2 : 0;
_vm->_gfx->opaqueTransparentBlit(_vm->_gfx->getScreen(), absoluteRect.left, absoluteRect.top, absoluteRect.width(), absoluteRect.height(), _preBuffer, 0, 0, 0, transValue, transValue, transValue);
if (_curLineIndex >= 0 && false) { // TODO: Translation
if (_curLineIndex >= 0 && ((SceneViewWindow *)_parent)->getGlobalFlags().bcTranslateEnabled == 1) {
int numLines = _viewLineCount[_curView];
uint32 boxColor = _vm->_gfx->getColor(255, 0, 0);
Common::Rect box(1, (187 / numLines) * _curLineIndex, 430, (187 / numLines) * (_curLineIndex + 1) - 1);
@ -231,15 +233,32 @@ void BurnedLetterViewWindow::onLButtonUp(const Common::Point &point, uint flags)
_vm->_gfx->setCursor(oldCursor);
}
if (_putDown.contains(point)) {
// TODO: Destroy the window
}
if (_putDown.contains(point))
((GameUIWindow *)(_parent->getParent()))->_inventoryWindow->destroyBurnedLetterWindow();
}
void BurnedLetterViewWindow::onMouseMove(const Common::Point &point, uint flags) {
_curMousePos = point;
// TODO: Translation
if (((SceneViewWindow *)_parent)->getGlobalFlags().bcTranslateEnabled == 1) {
int lineCount = _viewLineCount[_curView];
int textLineNumber = 0;
for (int i = 0; i < _curView; i++)
textLineNumber += _viewLineCount[i];
int lineIndex = ((point.y - 2) / (187 / lineCount));
if (lineIndex > (lineCount - 1))
lineIndex = lineCount - 1;
if (_curLineIndex != lineIndex) {
_curLineIndex = lineIndex;
invalidateWindow(false);
Common::String translatedText = _vm->getString(_translatedTextResourceID + textLineNumber + _curLineIndex);
((SceneViewWindow *)_parent)->displayTranslationText(translatedText);
return;
}
}
// Since translation was not enabled, check the current line flag
if (_curLineIndex != -1) {

View File

@ -32,6 +32,7 @@
#include "buried/inventory_window.h"
#include "buried/message.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "common/algorithm.h"
#include "graphics/font.h"
@ -164,7 +165,40 @@ bool InventoryWindow::addItem(int itemID) {
rebuildPreBuffer();
invalidateWindow(false);
// TODO: Scoring flags
// Update scoring flags
GlobalFlags &globalFlags = ((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags();
switch (itemID) {
case kItemBioChipTranslate:
globalFlags.scoreGotTranslateBioChip = 1;
break;
case kItemBioChipAI:
globalFlags.scoreDownloadedArthur = 1;
break;
case kItemCopperKey:
globalFlags.scoreGotKeyFromSmithy = 1;
break;
case kItemSiegeCycle:
globalFlags.scoreMadeSiegeCycle = 1;
globalFlags.genHadSiegeCycle = 1;
break;
case kItemJadeBlock:
globalFlags.scoreGotWealthGodPiece = 1;
break;
case kItemLimestoneBlock:
globalFlags.scoreGotRainGodPiece = 1;
break;
case kItemObsidianBlock:
globalFlags.scoreGotWarGodPiece = 1;
break;
case kItemDriveAssembly:
globalFlags.genHadDriveAssembly = 1;
break;
case kItemWheelAssembly:
globalFlags.genHadWheelAssembly = 1;
break;
}
return true;
}
@ -237,7 +271,14 @@ bool InventoryWindow::displayBurnedLetterWindow() {
if (_letterViewWindow)
return true;
// TODO
Location currentLocation;
LocationStaticData currentSceneStaticData;
((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation);
((GameUIWindow *)_parent)->_sceneViewWindow->getSceneStaticData(currentLocation, currentSceneStaticData);
_letterViewWindow = new BurnedLetterViewWindow(_vm, ((GameUIWindow *)_parent)->_sceneViewWindow, currentSceneStaticData);
((GameUIWindow *)_parent)->_sceneViewWindow->burnedLetterWindowDisplayed(true);
_letterViewWindow->setWindowPos(kWindowPosTop, 0, 0, 0, 0, kWindowPosShowWindow | kWindowPosNoMove | kWindowPosNoSize);
return true;
}
@ -249,7 +290,7 @@ bool InventoryWindow::destroyBurnedLetterWindow() {
delete _letterViewWindow;
_letterViewWindow = 0;
// TODO: Notify the scene view window
((GameUIWindow *)_parent)->_sceneViewWindow->burnedLetterWindowDisplayed(false);
return true;
}
@ -336,14 +377,35 @@ void InventoryWindow::onLButtonDown(const Common::Point &point, uint flags) {
return;
}
if (true) { // TODO: Check for auxilary window
if (!((GameUIWindow *)_parent)->_sceneViewWindow->isAuxWindowDisplayed()) {
if (itemID == kItemBurnedLetter) {
displayBurnedLetterWindow();
return;
}
if (itemID == kItemLensFilter) {
// TODO
if (((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().generalWalkthroughMode == 1) {
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_ATTACHED));
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated = 1;
return;
}
if (((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated == 0) {
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated = 1;
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_ATTACHED));
} else {
// Deny removing the filter in the alien space ship
Location currentLocation;
((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation);
if (currentLocation.timeZone == 7) {
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_DENY_REMOVAL));
} else {
((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated = 0;
((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_REMOVED));
}
}
return;
}
@ -391,7 +453,7 @@ void InventoryWindow::onLButtonDown(const Common::Point &point, uint flags) {
// TODO: SetCapture();
onSetCursor(kMessageTypeLButtonDown);
// TODO: Change sprite status
((GameUIWindow *)_parent)->_sceneViewWindow->changeSpriteStatus(true);
onMouseMove(point, 0);
}
}
@ -449,7 +511,9 @@ void InventoryWindow::onLButtonUp(const Common::Point &point, uint flags) {
if (_infoWindow) {
destroyInfoWindow();
} else {
// TODO: Create window
_infoWindow = new InventoryInfoWindow(_vm, ((GameUIWindow *)_parent)->_sceneViewWindow, _itemArray[_curItem]);
((GameUIWindow *)_parent)->_sceneViewWindow->infoWindowDisplayed(true);
_infoWindow->setWindowPos(kWindowPosTop, 0, 0, 0, 0, kWindowPosShowWindow | kWindowPosNoMove | kWindowPosNoSize);
_magSelected = true;
redraw = true;
}
@ -564,7 +628,7 @@ bool InventoryWindow::destroyInfoWindow() {
delete _infoWindow;
_infoWindow = 0;
// TODO: Notify the scene view
((GameUIWindow *)_parent)->_sceneViewWindow->infoWindowDisplayed(false);
_magSelected = false;
rebuildPreBuffer();

View File

@ -30,6 +30,10 @@
#include "buried/sprtdata.h"
#include "buried/window.h"
namespace Graphics {
class Font;
}
namespace Buried {
class AVIFrames;

View File

@ -19,13 +19,15 @@ MODULE_OBJS = \
main_menu.o \
navarrow.o \
overview.o \
scene_view.o \
sound.o \
title_sequence.o \
video_window.o \
window.o \
demo/demo_menu.o \
demo/features.o \
demo/movie_scene.o
demo/movie_scene.o \
environ/scene_base.o
# This module can be built as a plugin

View File

@ -24,10 +24,13 @@
*/
#include "buried/buried.h"
#include "buried/gameui.h"
#include "buried/graphics.h"
#include "buried/inventory_window.h"
#include "buried/navarrow.h"
#include "buried/navdata.h"
#include "buried/resources.h"
#include "buried/scene_view.h"
#include "common/keyboard.h"
#include "graphics/surface.h"
@ -135,8 +138,8 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
Common::Rect downButton(42, 71, 78, 124);
Common::Rect forwardButton(39, 49, 101, 91);
// TODO: Destroy info window
// TODO: Destroy burned letter window
((GameUIWindow *)_parent)->_inventoryWindow->destroyInfoWindow();
((GameUIWindow *)_parent)->_inventoryWindow->destroyBurnedLetterWindow();
// clone2727: This logic was broken in the original. retVal wasn't initialized.
bool retVal = false;
@ -145,16 +148,16 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
if (forwardButton.contains(point)) {
// If we only clicked on the forward arrow, then take care of it here
if (!rightButton.contains(point) && !downButton.contains(point)) {
// TODO
if (_arrowStatus[4] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
} else {
if (rightButton.contains(point)) {
Graphics::Surface *centerArrow = _vm->_gfx->getBitmap(_arrowBitmaps[4][_arrowStatus[4]]);
if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255)) {
// TODO
} else {
// TODO
}
if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255))
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
else
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
centerArrow->free();
delete centerArrow;
@ -163,32 +166,27 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
if (downButton.contains(point)) {
Graphics::Surface *centerArrow = _vm->_gfx->getBitmap(_arrowBitmaps[4][_arrowStatus[4]]);
if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255)) {
// TODO
} else {
// TODO
}
if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255))
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
else
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
centerArrow->free();
delete centerArrow;
}
}
} else {
if (upButton.contains(point)) {
// TODO
}
if (upButton.contains(point) && _arrowStatus[0] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(0);
if (leftButton.contains(point)) {
// TODO
}
if (leftButton.contains(point) && _arrowStatus[1] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(1);
if (rightButton.contains(point)) {
// TODO
}
if (rightButton.contains(point) && _arrowStatus[2] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
if (downButton.contains(point)) {
// TODO
}
if (downButton.contains(point) && _arrowStatus[3] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
}
if (retVal) {
@ -201,22 +199,27 @@ void NavArrowWindow::onKeyUp(const Common::KeyState &key, uint flags) {
switch (key.keycode) {
case Common::KEYCODE_KP4:
case Common::KEYCODE_LEFT:
// TODO
if (_arrowStatus[1] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(1);
break;
case Common::KEYCODE_KP6:
case Common::KEYCODE_RIGHT:
// TODO
if (_arrowStatus[2] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
break;
case Common::KEYCODE_KP2:
case Common::KEYCODE_DOWN:
// TODO
if (_arrowStatus[3] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
break;
case Common::KEYCODE_KP8:
case Common::KEYCODE_UP:
// TODO
if (_arrowStatus[0] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(0);
break;
case Common::KEYCODE_KP5:
// TODO
if (_arrowStatus[4] == BUTTON_ENABLED)
((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
break;
default:
break;

View File

@ -50,7 +50,6 @@ public:
void onLButtonDown(const Common::Point &point, uint flags);
void onKeyUp(const Common::KeyState &key, uint flags);
private:
enum {
BUTTON_DISABLED = 0,
BUTTON_ENABLED = 1,
@ -65,6 +64,7 @@ private:
NAV_BUTTON_FORWARD = 4
};
private:
static const int NUM_ARROWS = 5;
static const int NUM_ARROW_BITMAPS = 3;

View File

@ -31,6 +31,9 @@
namespace Buried {
struct Location {
Location() : timeZone(-1), environment(-1), node(-1), facing(-1), orientation(-1), depth(-1) {}
Location(int16 tz, int16 e, int16 n, int16 f, int16 o, int16 d) : timeZone(tz), environment(e), node(n), facing(f), orientation(o), depth(d) {}
int16 timeZone;
int16 environment;
int16 node;

View File

@ -354,6 +354,10 @@ namespace Buried {
#define IDS_COMPL_FINAL_SCORE_TEMPL 9035
#define IDS_DEATH_FINAL_SCORE_TEMPL 9035
// 1.04+:
#define IDS_PLAY_MODE_WALKTHROUGH_TEXT 9085
#define IDS_PLAY_MODE_NORMAL_TEXT 9086
#define IDES_FILENAME_BASE 17408
#define IDES_STRING_BASE 21504

File diff suppressed because it is too large Load Diff

202
engines/buried/scene_view.h Normal file
View File

@ -0,0 +1,202 @@
/* 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.
*
*/
#ifndef BURIED_SCENE_VIEW_H
#define BURIED_SCENE_VIEW_H
#include "buried/aidata.h"
#include "buried/animdata.h"
#include "buried/global_flags.h"
#include "buried/sprtdata.h"
#include "buried/window.h"
namespace Graphics {
struct Surface;
}
namespace Buried {
class AVIFrames;
class SceneBase;
class VideoWindow;
class SceneViewWindow : public Window {
public:
SceneViewWindow(BuriedEngine *vm, Window *parent);
~SceneViewWindow();
bool _paused;
bool _disableArthur;
bool startNewGame(bool walkthrough = false);
bool startNewGameIntro(bool walkthrough = false);
bool startNewGame(const Location &startingLocation);
bool startNewGame(const Common::String &restoreFile);
bool showDeathScene(int deathSceneIndex);
bool showCompletionScene();
bool getSceneStaticData(const Location &location, LocationStaticData &sceneStaticData);
GlobalFlags &getGlobalFlags() { return _globalFlags; }
bool getCurrentSceneLocation(Location &curLocation);
bool jumpToScene(const Location &newLocation);
bool jumpToSceneRestore(const Location &newLocation);
bool moveInDirection(int direction);
bool moveToDestination(const DestinationScene &destinationData);
bool timeSuitJump(int destination);
bool playTransition(const DestinationScene &destinationData, int navFrame);
bool videoTransition(const Location &location, DestinationScene destinationData, int navFrame);
bool walkTransition(const Location &location, const DestinationScene &destinationData, int navFrame);
bool pushTransition(Graphics::Surface *curBackground, Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
bool pushNewTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
bool slideInTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
bool slideOutTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
bool changeStillFrameMovie(const Common::String &fileName = "");
bool changeCycleFrameMovie(const Common::String &fileName = "");
Graphics::Surface *getStillFrameCopy(int frameIndex);
const Graphics::Surface *getStillFrame(int frameIndex);
Graphics::Surface *getCycleFrameCopy(int frameIndex);
const Graphics::Surface *getCycleFrame(int frameIndex);
bool enableCycleFrameCache(bool enable);
bool flushCycleFrameCache();
bool enableCycling(bool enable);
bool getCyclingStatus() { return _cycleEnabled; }
bool closeCycleFrameMovie();
int getGlobalFlag(int offset);
byte getGlobalFlagByte(int offset);
bool setGlobalFlag(int offset, int value);
bool setGlobalFlagByte(int offset, byte value);
bool setGlobalFlagDWord(int offset, uint32 value);
uint32 getGlobalFlagDWord(int offset);
bool addNumberToGlobalFlagTable(int offset, int curItemCountOffset, int maxItems, byte numberToAdd);
byte getNumberFromGlobalFlagTable(int offset, int tableIndex);
bool isNumberInGlobalFlagTable(int offset, int curItemCountOffset, byte numberToCheck);
bool playSynchronousAnimation(int animationID);
bool playSynchronousAnimationExtern(int animationID);
bool playPlacedSynchronousAnimation(int animationID, int left, int top);
bool playClippedSynchronousAnimation(int animationID, int left, int top, int right, int bottom);
bool startAsynchronousAnimation(int animationID, bool loopAnimation);
bool startAsynchronousAnimation(int fileNameID, int startPosition, int playStartPosition, int frameCount, bool loopAnimation);
bool startAsynchronousAnimationExtern(int fileNameID, int startPosition, int playStartPosition, int frameCount, bool loopAnimation);
bool stopAsynchronousAnimation();
bool isAsynchronousAnimationStillPlaying();
int getAsynchronousAnimationCurrentPosition();
bool asynchronousAnimationTimerCallback();
bool startPlacedAsynchronousAnimation(int left, int top, int width, int height, int animationID, bool loopAnimation);
bool startPlacedAsynchronousAnimation(int left, int top, int width, int height, int fileNameID, int startPosition, int playStartPosition, int frameCount, bool loopAnimation);
bool startPlacedAsynchronousAnimationExtern(int left, int top, int width, int height, int fileNameID, int startPosition, int playStartPosition, int frameCount, bool loopAnimation);
bool retrieveAICommentEntry(const Location &commentLocation, int commentType, const Common::Array<AIComment> &commentDatabase, int &lastFoundEntry, AIComment &currentCommentData);
bool checkAICommentDependencies(const Location &commentLocation, const AIComment &commentData);
bool playAICommentFromData(const AIComment &commentData);
bool playAIComment(int commentType);
bool playAIComment(const Location &commentLocation, int commentType);
bool checkForAIComment(int commentType);
bool checkForAIComment(const Location &commentLocation, int commentType);
bool infoWindowDisplayed(bool flag);
bool bioChipWindowDisplayed(bool flag);
bool burnedLetterWindowDisplayed(bool flag);
bool isAuxWindowDisplayed();
void onPaint();
void onTimer(uint timer);
bool onSetCursor(uint message);
void onEnable(bool enable);
void onLButtonDown(const Common::Point &point, uint flags);
void onLButtonUp(const Common::Point &point, uint flags);
void onMouseMove(const Common::Point &point, uint flags);
void onKeyUp(const Common::KeyState &key, uint flags);
bool isScenePresent() { return _currentScene != 0; }
int draggingItem(int itemID, const Common::Point &pointLocation, int itemFlags);
int droppedItem(int itemID, const Common::Point &pointLocation, int itemFlags);
bool updatePrebufferWithSprite(Sprite &spriteData);
bool changeSpriteStatus(bool status);
bool resetCursor();
bool displayLiveText(const Common::String &text = "", bool notifyUser = true);
bool displayTranslationText(const Common::String &text);
bool resetNavigationArrows();
bool startEnvironmentAmbient(int oldTimeZone = -1, int oldEnvironment = -1, int timeZone = -1, int environment = -1, bool fade = true);
bool checkCustomAICommentDependencies(const Location &commentLocation, const AIComment &commentData);
private:
Graphics::Surface *_preBuffer;
SceneBase *_currentScene;
Common::Array<LocationStaticData> _currentNavigationDatabase;
GlobalFlags _globalFlags;
VideoWindow *_walkMovie;
Common::String _walkMovieFileName;
AVIFrames *_stillFrames;
AVIFrames *_cycleFrames;
Common::Point _curMousePos;
int _curCursor;
Sprite _currentSprite;
int _currentAmbient;
bool _useScenePaint;
bool _useSprite;
bool _cycleEnabled;
uint _timer;
uint _soundTimer;
bool _infoWindowDisplayed;
bool _bioChipWindowDisplayed;
bool _burnedLetterDisplayed;
VideoWindow *_asyncMovie;
Common::String _asyncMovieFileName;
int _asyncMovieStartFrame;
int _asyncMovieFrameCount;
bool _loopAsyncMovie;
Common::String _lastAICommentFileName;
bool _useWaitCursor;
int _oldCursorForWait;
bool initializeTimeZoneAndEnvironment(Window *viewWindow, int timeZone, int environment);
SceneBase *constructSceneObject(Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation);
Common::Array<AnimEvent> getAnimationDatabase(int timeZone, int environment);
Common::Array<AIComment> getAICommentDatabase(int timeZone, int environment);
};
} // End of namespace Buried
#endif