2011-01-20 21:35:00 +00: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.
|
2014-02-18 01:34:22 +00:00
|
|
|
*
|
2011-01-20 21:35:00 +00:00
|
|
|
* 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.
|
2014-02-18 01:34:22 +00:00
|
|
|
*
|
2011-01-20 21:35:00 +00:00
|
|
|
* 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 MOHAWK_CSTIME_H
|
|
|
|
#define MOHAWK_CSTIME_H
|
|
|
|
|
|
|
|
#include "mohawk/mohawk.h"
|
|
|
|
#include "mohawk/console.h"
|
2012-03-10 18:50:27 +00:00
|
|
|
#include "mohawk/cstime_graphics.h"
|
2011-01-20 21:35:00 +00:00
|
|
|
|
|
|
|
#include "common/random.h"
|
|
|
|
#include "common/list.h"
|
|
|
|
|
|
|
|
namespace Mohawk {
|
|
|
|
|
|
|
|
class CSTimeCase;
|
|
|
|
class CSTimeInterface;
|
|
|
|
class CSTimeView;
|
2017-02-20 16:20:47 +00:00
|
|
|
class VideoManager;
|
2011-01-20 21:35:00 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
kCSTimeEventNothing = 0xffff,
|
|
|
|
kCSTimeEventCondition = 1,
|
|
|
|
kCSTimeEventCharPlayNIS = 2,
|
|
|
|
kCSTimeEventStartConversation = 3,
|
|
|
|
kCSTimeEventNewScene = 4,
|
|
|
|
kCSTimeEventCharStartFlapping = 5,
|
|
|
|
kCSTimeEventSetCaseVariable = 6,
|
|
|
|
kCSTimeEventSetupAmbientAnims = 7,
|
|
|
|
kCSTimeEventUnused8 = 8,
|
|
|
|
kCSTimeEventDropItemInInventory = 9,
|
|
|
|
kCSTimeEventRemoveItemFromInventory = 10,
|
|
|
|
kCSTimeEventAddNotePiece = 11,
|
|
|
|
kCSTimeEventDisableHotspot = 12,
|
|
|
|
kCSTimeEventDisableFeature = 13,
|
|
|
|
kCSTimeEventAddFeature = 14,
|
|
|
|
kCSTimeEventStartMusic = 15,
|
|
|
|
kCSTimeEventStopMusic = 16,
|
|
|
|
kCSTimeEventEnableHotspot = 17,
|
|
|
|
kCSTimeEventSetAsked = 18,
|
|
|
|
kCSTimeEventStartHelp = 19,
|
|
|
|
kCSTimeEventPlaySound = 20,
|
|
|
|
kCSTimeEventUnused21 = 21,
|
|
|
|
kCSTimeEventShowBigNote = 22,
|
|
|
|
kCSTimeEventActivateCuffs = 23,
|
2011-01-22 11:37:01 +00:00
|
|
|
kCSTimeEventHelperSetupRestPos = 24,
|
2011-01-20 21:35:00 +00:00
|
|
|
kCSTimeEventUnknown25 = 25,
|
|
|
|
kCSTimeEventUnknown26 = 26,
|
|
|
|
kCSTimeEventRemoveChar = 27,
|
|
|
|
kCSTimeEventUnknown28 = 28,
|
|
|
|
kCSTimeEventUnknown29 = 29,
|
|
|
|
kCSTimeEventUnknown30 = 30,
|
|
|
|
kCSTimeEventUnknown31 = 31,
|
|
|
|
kCSTimeEventCharSomeNIS32 = 32,
|
|
|
|
kCSTimeEventCharResetNIS = 33,
|
|
|
|
kCSTimeEventUnknown34 = 34,
|
|
|
|
kCSTimeEventCharPauseAmbients = 35,
|
|
|
|
kCSTimeEventCharUnauseAmbients = 36,
|
|
|
|
kCSTimeEventCharDisableAmbients = 37,
|
|
|
|
kCSTimeEventStopAmbientAnims = 38,
|
|
|
|
kCSTimeEventUnknown39 = 39,
|
|
|
|
kCSTimeEventWait = 40,
|
|
|
|
kCSTimeEventSpeech = 41,
|
2011-01-22 11:37:01 +00:00
|
|
|
kCSTimeEventCharSetState = 42,
|
2011-01-20 21:35:00 +00:00
|
|
|
kCSTimeEventUnknown43 = 43,
|
2011-01-22 11:37:01 +00:00
|
|
|
kCSTimeEventCharSetupRestPos = 44,
|
2011-01-20 21:35:00 +00:00
|
|
|
kCSTimeEventCharStopAmbients = 45,
|
|
|
|
kCSTimeEventCharRestartAmbients = 46,
|
|
|
|
kCSTimeEventStopEnvironmentSound = 47,
|
|
|
|
kCSTimeEventWaitForClick = 48,
|
|
|
|
kCSTimeEventSetMusic = 49,
|
|
|
|
kCSTimeEventStartEnvironmentSound = 50,
|
|
|
|
kCSTimeEventPreloadSound = 51,
|
|
|
|
kCSTimeEventPlayPreloadedSound = 52,
|
2011-01-22 11:37:01 +00:00
|
|
|
kCSTimeEventSetInsertBefore = 53,
|
2011-01-20 21:35:00 +00:00
|
|
|
kCSTimeEventSetEnvironmentSound = 54,
|
|
|
|
kCSTimeEventCharSomeNIS55 = 55,
|
|
|
|
kCSTimeEventUnknown56 = 56,
|
|
|
|
kCSTimeEventUpdateBubble = 57,
|
|
|
|
kCSTimeEventCharSurfAndFlap = 58,
|
|
|
|
kCSTimeEventInitScene = 59,
|
|
|
|
kCSTimeEventFadeDown = 60,
|
2011-01-22 11:37:01 +00:00
|
|
|
kCSTimeEventEndOfCase = 61,
|
2011-01-20 21:35:00 +00:00
|
|
|
kCSTimeEventCharPlaySimultaneousAnim = 62,
|
|
|
|
kCSTimeEventUnused63 = 63,
|
|
|
|
kCSTimeEventUnknown64 = 64,
|
|
|
|
kCSTimeEventPrepareSave = 65,
|
|
|
|
kCSTimeEventSave = 66,
|
|
|
|
kCSTimeEventQuit = 67,
|
|
|
|
kCSTimeEventPlayMovie = 68,
|
|
|
|
kCSTimeEventUnknown69 = 69, // queues Unknown48
|
|
|
|
kCSTimeEventUnknown70 = 70 // conv/QaR cleanup
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CSTimeEvent {
|
2016-06-13 19:57:24 +00:00
|
|
|
CSTimeEvent() : type(0), param1(0), param2(0) { }
|
2011-01-20 21:35:00 +00:00
|
|
|
CSTimeEvent(uint16 t, uint16 p1, uint16 p2) : type(t), param1(p1), param2(p2) { }
|
|
|
|
|
|
|
|
uint16 type;
|
|
|
|
uint16 param1;
|
|
|
|
uint16 param2;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CSTimeState {
|
|
|
|
kCSTStateStartup,
|
|
|
|
kCSTStateNewCase,
|
|
|
|
kCSTStateNewScene,
|
|
|
|
kCSTStateNormal
|
|
|
|
};
|
|
|
|
|
|
|
|
class MohawkEngine_CSTime : public MohawkEngine {
|
|
|
|
protected:
|
|
|
|
Common::Error run();
|
|
|
|
|
|
|
|
public:
|
|
|
|
MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescription *gamedesc);
|
|
|
|
virtual ~MohawkEngine_CSTime();
|
|
|
|
|
|
|
|
Common::RandomSource *_rnd;
|
|
|
|
|
2017-02-20 16:20:47 +00:00
|
|
|
VideoManager *_video;
|
2016-08-08 05:15:04 +00:00
|
|
|
Sound *_sound;
|
2011-01-20 21:35:00 +00:00
|
|
|
CSTimeGraphics *_gfx;
|
|
|
|
bool _needsUpdate;
|
|
|
|
|
|
|
|
GUI::Debugger *getDebugger() { return _console; }
|
|
|
|
CSTimeView *getView() { return _view; }
|
|
|
|
CSTimeCase *getCase() { return _case; }
|
|
|
|
CSTimeInterface *getInterface() { return _interface; }
|
|
|
|
|
|
|
|
void loadResourceFile(Common::String name);
|
|
|
|
|
|
|
|
void addEvent(const CSTimeEvent &event);
|
|
|
|
void addEventList(const Common::Array<CSTimeEvent> &list);
|
|
|
|
void insertEventAtFront(const CSTimeEvent &event);
|
|
|
|
uint16 getCurrentEventType();
|
|
|
|
void eventIdle();
|
|
|
|
void resetTimeout();
|
|
|
|
void mouseClicked();
|
|
|
|
bool NISIsRunning();
|
|
|
|
|
|
|
|
uint16 _haveInvItem[19];
|
|
|
|
uint16 _caseVariable[20];
|
|
|
|
|
|
|
|
private:
|
|
|
|
CSTimeCase *_case;
|
|
|
|
CSTimeConsole *_console;
|
|
|
|
CSTimeInterface *_interface;
|
|
|
|
CSTimeView *_view;
|
|
|
|
|
|
|
|
CSTimeState _state;
|
|
|
|
|
|
|
|
void initCase();
|
|
|
|
void nextScene();
|
|
|
|
void update();
|
|
|
|
|
|
|
|
uint16 _nextSceneId;
|
|
|
|
|
|
|
|
bool _processingEvent;
|
2011-01-22 21:22:12 +00:00
|
|
|
bool _processingNIS55;
|
2011-01-20 21:35:00 +00:00
|
|
|
bool _NISRunning;
|
|
|
|
uint32 _lastTimeout;
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
Common::List<CSTimeEvent> _events;
|
|
|
|
void triggerEvent(CSTimeEvent &event);
|
2017-02-20 16:20:47 +00:00
|
|
|
|
|
|
|
void pauseEngineIntern(bool) override;
|
2011-01-20 21:35:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Mohawk
|
|
|
|
|
|
|
|
#endif
|