2009-09-03 20:59:17 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2009-09-03 21:20:13 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2009-09-03 20:59:17 +00:00
|
|
|
*/
|
|
|
|
|
2009-09-04 20:06:19 +00:00
|
|
|
#ifndef TEENAGENT_ENGINE_H
|
|
|
|
#define TEENAGENT_ENGINE_H
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
#include "engines/engine.h"
|
2009-09-04 20:08:33 +00:00
|
|
|
#include "teenagent/pack.h"
|
|
|
|
#include "teenagent/resources.h"
|
|
|
|
#include "teenagent/inventory.h"
|
2009-09-03 20:59:17 +00:00
|
|
|
#include "sound/audiostream.h"
|
|
|
|
#include "sound/mixer.h"
|
2010-03-18 15:07:11 +00:00
|
|
|
#include "common/random.h"
|
2009-09-05 08:16:35 +00:00
|
|
|
|
|
|
|
struct ADGameDescription;
|
2009-09-03 20:59:17 +00:00
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the TeenAgent engine.
|
|
|
|
*
|
2010-01-03 15:18:20 +00:00
|
|
|
* Status of this engine: Complete
|
2009-11-24 22:10:14 +00:00
|
|
|
*
|
|
|
|
* Supported games:
|
2010-01-03 15:18:20 +00:00
|
|
|
* - Teen Agent
|
2009-11-24 22:10:14 +00:00
|
|
|
*/
|
2009-09-03 20:59:17 +00:00
|
|
|
namespace TeenAgent {
|
|
|
|
|
|
|
|
struct Object;
|
|
|
|
class Scene;
|
|
|
|
class MusicPlayer;
|
2009-11-08 19:11:57 +00:00
|
|
|
class Console;
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
class TeenAgentEngine: public Engine {
|
2009-09-15 08:54:06 +00:00
|
|
|
public:
|
2009-09-15 20:21:18 +00:00
|
|
|
enum Action { kActionNone, kActionExamine, kActionUse };
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-15 07:41:05 +00:00
|
|
|
TeenAgentEngine(OSystem *system, const ADGameDescription *gd);
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
virtual Common::Error run();
|
|
|
|
virtual Common::Error loadGameState(int slot);
|
|
|
|
virtual Common::Error saveGameState(int slot, const char *desc);
|
|
|
|
virtual bool canLoadGameStateCurrently() { return true; }
|
|
|
|
virtual bool canSaveGameStateCurrently() { return !scene_busy; }
|
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
|
|
|
|
2009-09-26 15:04:09 +00:00
|
|
|
void init();
|
2009-09-03 20:59:17 +00:00
|
|
|
void deinit();
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
void examine(const Common::Point &point, Object *object);
|
|
|
|
void use(Object *object);
|
2009-11-14 11:29:37 +00:00
|
|
|
inline void cancel() { action = kActionNone; }
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
bool processCallback(uint16 addr);
|
2009-09-15 07:41:05 +00:00
|
|
|
inline Scene *getScene() { return scene; }
|
2009-09-03 20:59:17 +00:00
|
|
|
|
2010-01-03 15:18:20 +00:00
|
|
|
bool showLogo();
|
2010-04-28 19:50:28 +00:00
|
|
|
bool showCDLogo();
|
2010-01-03 15:18:20 +00:00
|
|
|
bool showMetropolis();
|
|
|
|
int skipEvents() const;
|
2010-01-02 22:30:43 +00:00
|
|
|
|
2009-09-13 09:54:53 +00:00
|
|
|
static Common::String parseMessage(uint16 addr);
|
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
//event driven:
|
2009-11-08 20:00:31 +00:00
|
|
|
void displayMessage(uint16 addr, byte color = 0xd1, uint16 position = 0);
|
|
|
|
void displayMessage(const Common::String &str, byte color = 0xd1, uint16 position = 0);
|
|
|
|
void displayAsyncMessage(uint16 addr, uint16 position, uint16 first_frame, uint16 last_frame, byte color = 0xd1);
|
2009-11-08 21:59:26 +00:00
|
|
|
void displayAsyncMessageInSlot(uint16 addr, byte slot, uint16 first_frame, uint16 last_frame, byte color = 0xd1);
|
2009-12-08 22:13:06 +00:00
|
|
|
void displayCredits(uint16 addr, uint16 timer = 0);
|
2009-10-31 18:49:47 +00:00
|
|
|
void displayCutsceneMessage(uint16 addr, uint16 position);
|
2009-09-15 08:54:06 +00:00
|
|
|
void moveTo(const Common::Point &dst, byte o, bool warp = false);
|
2009-09-05 15:04:37 +00:00
|
|
|
void moveTo(uint16 x, uint16 y, byte o, bool warp = false);
|
2009-09-15 07:41:05 +00:00
|
|
|
void moveTo(Object *obj);
|
2009-09-05 17:15:28 +00:00
|
|
|
void moveRel(int16 x, int16 y, byte o, bool warp = false);
|
2009-11-09 07:58:27 +00:00
|
|
|
void playActorAnimation(uint16 id, bool async = false, bool ignore = false);
|
2009-11-09 23:22:35 +00:00
|
|
|
void playAnimation(uint16 id, byte slot, bool async = false, bool ignore = false, bool loop = false);
|
2009-09-03 20:59:17 +00:00
|
|
|
void loadScene(byte id, const Common::Point &pos, byte o = 0);
|
|
|
|
void loadScene(byte id, uint16 x, uint16 y, byte o = 0);
|
2010-03-21 07:38:09 +00:00
|
|
|
void enableOn(bool enable = true);
|
2009-09-03 20:59:17 +00:00
|
|
|
void setOns(byte id, byte value, byte scene_id = 0);
|
|
|
|
void setLan(byte id, byte value, byte scene_id = 0);
|
2010-02-07 17:13:39 +00:00
|
|
|
void setFlag(uint16 addr, byte value);
|
2010-02-26 07:36:52 +00:00
|
|
|
byte getFlag(uint16 addr);
|
2009-09-03 20:59:17 +00:00
|
|
|
void reloadLan();
|
|
|
|
void rejectMessage();
|
|
|
|
|
|
|
|
void playMusic(byte id); //schedules play
|
2009-11-08 21:59:26 +00:00
|
|
|
void playSound(byte id, byte skip_frames);
|
2009-09-03 20:59:17 +00:00
|
|
|
void playSoundNow(byte id);
|
|
|
|
void enableObject(byte id, byte scene_id = 0);
|
|
|
|
void disableObject(byte id, byte scene_id = 0);
|
2009-09-13 12:48:57 +00:00
|
|
|
void hideActor();
|
|
|
|
void showActor();
|
2009-09-03 20:59:17 +00:00
|
|
|
void waitAnimation();
|
2009-11-07 12:00:56 +00:00
|
|
|
void waitLanAnimationFrame(byte slot, uint16 frame);
|
2009-11-08 21:59:26 +00:00
|
|
|
void setTimerCallback(uint16 addr, uint16 frames);
|
2009-11-17 22:45:41 +00:00
|
|
|
void shakeScreen();
|
2009-12-08 22:04:00 +00:00
|
|
|
void displayCredits();
|
2009-12-27 18:21:49 +00:00
|
|
|
void fadeIn();
|
|
|
|
void fadeOut();
|
2010-02-02 07:26:36 +00:00
|
|
|
void wait(uint16 frames);
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
Common::RandomSource random;
|
|
|
|
|
|
|
|
Scene *scene;
|
|
|
|
Inventory *inventory;
|
|
|
|
MusicPlayer *music;
|
2009-11-08 19:11:57 +00:00
|
|
|
Console * console;
|
2009-09-15 08:54:06 +00:00
|
|
|
|
2009-09-03 20:59:17 +00:00
|
|
|
void setMusic(byte id);
|
|
|
|
|
2009-09-15 08:54:06 +00:00
|
|
|
private:
|
2009-09-03 20:59:17 +00:00
|
|
|
void processObject();
|
2009-12-01 08:00:13 +00:00
|
|
|
bool trySelectedObject();
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
bool scene_busy;
|
|
|
|
Action action;
|
2009-09-15 07:41:05 +00:00
|
|
|
Object *dst_object;
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
Audio::AudioStream *_musicStream;
|
|
|
|
Audio::SoundHandle _musicHandle, _soundHandle;
|
2009-09-05 08:16:35 +00:00
|
|
|
const ADGameDescription *_gameDescription;
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2010-01-08 18:03:34 +00:00
|
|
|
uint _mark_delay, _game_delay;
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-09-26 15:04:09 +00:00
|
|
|
Common::Array<Common::Array<UseHotspot> > use_hotspots;
|
2009-09-03 20:59:17 +00:00
|
|
|
};
|
|
|
|
|
2009-09-04 20:08:33 +00:00
|
|
|
} // End of namespace TeenAgent
|
2009-09-03 20:59:17 +00:00
|
|
|
|
|
|
|
#endif
|