2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2006-02-22 22:40:53 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* 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.
|
2006-02-22 22:40:53 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CINE_H
|
|
|
|
#define CINE_H
|
|
|
|
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2006-02-22 22:40:53 +00:00
|
|
|
#include "common/scummsys.h"
|
2007-05-30 18:43:28 +00:00
|
|
|
#include "common/file.h"
|
2006-03-16 20:29:07 +00:00
|
|
|
#include "common/util.h"
|
2007-12-07 20:45:51 +00:00
|
|
|
#include "common/str.h"
|
|
|
|
#include "common/hashmap.h"
|
|
|
|
#include "common/hash-str.h"
|
2010-03-18 15:07:11 +00:00
|
|
|
#include "common/random.h"
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2006-02-25 00:26:14 +00:00
|
|
|
#include "cine/texte.h"
|
|
|
|
#include "cine/rel.h"
|
|
|
|
#include "cine/script.h"
|
|
|
|
#include "cine/part.h"
|
|
|
|
#include "cine/prc.h"
|
|
|
|
#include "cine/msg.h"
|
|
|
|
#include "cine/bg.h"
|
|
|
|
#include "cine/pal.h"
|
|
|
|
#include "cine/gfx.h"
|
|
|
|
#include "cine/anim.h"
|
|
|
|
|
2006-04-12 03:45:54 +00:00
|
|
|
//#define DUMP_SCRIPTS
|
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the Cine engine.
|
|
|
|
*
|
2009-12-01 22:21:16 +00:00
|
|
|
* Status of this engine:
|
|
|
|
*
|
|
|
|
* This enigne has 2 generations Cinematique evo.1 and Cinematique evo.2
|
|
|
|
* first generation is fairly complete, and second one is under development
|
|
|
|
*
|
|
|
|
* Cinematique evo.1 status:
|
|
|
|
* The engine supports Future Wars and is basically complete with support of
|
|
|
|
* all known game variants. Based on Yaz0r's engine.
|
|
|
|
*
|
|
|
|
* Cinematique evo.2 status:
|
|
|
|
* This generation supports Operation Stealth, originally developed by Yaz0r for
|
|
|
|
* French variant of the game which heared to be completable.
|
|
|
|
* Later the work was renewed as part of GSoC'08, by Kari Salminen, but it has not
|
|
|
|
* yet been finished. The game is not completable.
|
2010-01-25 01:39:44 +00:00
|
|
|
*
|
2009-11-24 22:10:14 +00:00
|
|
|
*
|
|
|
|
* Supported games:
|
2009-12-01 22:21:16 +00:00
|
|
|
*
|
|
|
|
* Cinematique evo.1
|
|
|
|
* - Future Wars
|
|
|
|
*
|
|
|
|
* Cinematique evo.2
|
|
|
|
* - Operation Stealth
|
|
|
|
*
|
2009-11-24 22:10:14 +00:00
|
|
|
*/
|
2006-02-22 22:40:53 +00:00
|
|
|
namespace Cine {
|
|
|
|
|
2006-10-15 01:06:44 +00:00
|
|
|
enum CineGameType {
|
|
|
|
GType_FW = 1,
|
|
|
|
GType_OS
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CineGameFeatures {
|
|
|
|
GF_CD = 1 << 0,
|
2006-11-11 15:37:03 +00:00
|
|
|
GF_DEMO = 1 << 1,
|
2008-08-08 18:28:13 +00:00
|
|
|
GF_ALT_FONT = 1 << 2,
|
|
|
|
GF_CRYPTED_BOOT_PRC = 1 << 3
|
2006-10-15 01:06:44 +00:00
|
|
|
};
|
|
|
|
|
2007-01-21 20:24:38 +00:00
|
|
|
struct CINEGameDescription;
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2008-06-11 06:00:56 +00:00
|
|
|
typedef Common::HashMap<Common::String, const char *> StringPtrHashMap;
|
2007-12-07 20:45:51 +00:00
|
|
|
|
2006-02-25 00:26:14 +00:00
|
|
|
class CineEngine : public Engine {
|
2006-02-22 22:40:53 +00:00
|
|
|
|
|
|
|
protected:
|
2008-11-04 16:11:40 +00:00
|
|
|
// Engine APIs
|
2009-03-01 04:42:46 +00:00
|
|
|
virtual Common::Error run();
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
|
|
|
|
2006-02-22 22:40:53 +00:00
|
|
|
void shutdown();
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2006-10-15 01:06:44 +00:00
|
|
|
bool initGame();
|
2006-02-22 22:40:53 +00:00
|
|
|
|
|
|
|
public:
|
2007-11-03 21:06:58 +00:00
|
|
|
CineEngine(OSystem *syst, const CINEGameDescription *gameDesc);
|
2006-02-22 22:40:53 +00:00
|
|
|
virtual ~CineEngine();
|
2006-10-15 01:06:44 +00:00
|
|
|
|
2007-01-21 20:24:38 +00:00
|
|
|
int getGameType() const;
|
|
|
|
uint32 getFeatures() const;
|
|
|
|
Common::Language getLanguage() const;
|
|
|
|
Common::Platform getPlatform() const;
|
2006-10-15 01:06:44 +00:00
|
|
|
|
2009-11-02 21:54:57 +00:00
|
|
|
bool loadSaveDirectory();
|
|
|
|
void makeSystemMenu();
|
2008-08-07 21:46:56 +00:00
|
|
|
int modifyGameSpeed(int speedChange);
|
|
|
|
int getTimerDelay() const;
|
2008-11-12 23:21:05 +00:00
|
|
|
Common::Error loadGameState(int slot);
|
|
|
|
Common::Error saveGameState(int slot, const char *desc);
|
|
|
|
bool canLoadGameStateCurrently();
|
|
|
|
bool canSaveGameStateCurrently();
|
2006-11-14 09:29:41 +00:00
|
|
|
|
2006-10-15 01:06:44 +00:00
|
|
|
const CINEGameDescription *_gameDescription;
|
2007-05-30 18:43:28 +00:00
|
|
|
Common::File _partFileHandle;
|
2006-11-25 09:28:00 +00:00
|
|
|
|
2007-09-19 13:55:05 +00:00
|
|
|
Common::RandomSource _rnd;
|
|
|
|
|
2010-03-18 15:54:40 +00:00
|
|
|
Common::StringArray _volumeResourceFiles;
|
2007-12-07 20:45:51 +00:00
|
|
|
StringPtrHashMap _volumeEntriesMap;
|
2008-07-17 07:13:41 +00:00
|
|
|
TextHandler _textHandler;
|
2007-12-07 20:45:51 +00:00
|
|
|
|
2010-05-19 12:34:10 +00:00
|
|
|
bool _restartRequested;
|
|
|
|
|
2006-11-25 09:28:00 +00:00
|
|
|
private:
|
2009-11-02 21:54:57 +00:00
|
|
|
void initialize();
|
2008-07-27 14:33:37 +00:00
|
|
|
void resetEngine();
|
|
|
|
bool loadPlainSaveFW(Common::SeekableReadStream &in, CineSaveGameFormat saveGameFormat);
|
2008-07-28 08:44:49 +00:00
|
|
|
bool loadTempSaveOS(Common::SeekableReadStream &in);
|
2006-11-25 09:28:00 +00:00
|
|
|
bool makeLoad(char *saveName);
|
2008-07-27 22:50:36 +00:00
|
|
|
void makeSaveFW(Common::OutSaveFile &out);
|
|
|
|
void makeSaveOS(Common::OutSaveFile &out);
|
|
|
|
void makeSave(char *saveFileName);
|
2006-11-25 09:28:00 +00:00
|
|
|
void mainLoop(int bootScriptIdx);
|
2007-12-07 20:45:51 +00:00
|
|
|
void readVolCnf();
|
2006-11-25 09:28:00 +00:00
|
|
|
|
|
|
|
bool _preLoad;
|
2008-08-07 21:46:56 +00:00
|
|
|
int _timerDelayMultiplier;
|
2006-02-22 22:40:53 +00:00
|
|
|
};
|
|
|
|
|
2006-10-15 01:06:44 +00:00
|
|
|
extern CineEngine *g_cine;
|
|
|
|
|
2006-02-22 22:40:53 +00:00
|
|
|
#define BOOT_PRC_NAME "AUTO00.PRC"
|
2008-07-14 23:10:51 +00:00
|
|
|
#define COPY_PROT_FAIL_PRC_NAME "L201.ANI"
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2006-02-24 22:34:22 +00:00
|
|
|
enum {
|
2009-06-27 12:26:26 +00:00
|
|
|
// Both FW and OS
|
2006-02-24 22:34:22 +00:00
|
|
|
VAR_MOUSE_X_POS = 249,
|
2007-12-07 20:45:51 +00:00
|
|
|
VAR_MOUSE_Y_POS = 250,
|
2009-06-27 12:26:26 +00:00
|
|
|
// FW only
|
|
|
|
VAR_MOUSE_X_MODE = 253,
|
|
|
|
VAR_MOUSE_Y_MODE = 251,
|
2007-12-07 20:45:51 +00:00
|
|
|
// OS only
|
2009-06-27 12:26:26 +00:00
|
|
|
VAR_MOUSE_X_POS_2ND = 251, // Many times used in conjunction with VAR_MOUSE_X_POS
|
|
|
|
VAR_MOUSE_Y_POS_2ND = 252, // Many times used in conjunction with VAR_MOUSE_Y_POS
|
2007-12-07 20:45:51 +00:00
|
|
|
VAR_BYPASS_PROTECTION = 255,
|
|
|
|
VAR_LOW_MEMORY = 0
|
2006-02-24 22:34:22 +00:00
|
|
|
};
|
|
|
|
|
2006-03-16 20:29:07 +00:00
|
|
|
enum {
|
|
|
|
MOUSE_CURSOR_NORMAL = 0,
|
|
|
|
MOUSE_CURSOR_DISK,
|
|
|
|
MOUSE_CURSOR_CROSS
|
|
|
|
};
|
2006-02-22 22:40:53 +00:00
|
|
|
|
2006-04-12 01:48:15 +00:00
|
|
|
enum {
|
2007-12-07 20:45:51 +00:00
|
|
|
kCineDebugScript = 1 << 0,
|
2007-12-09 13:41:59 +00:00
|
|
|
kCineDebugPart = 1 << 1,
|
|
|
|
kCineDebugSound = 1 << 2
|
2006-04-12 01:48:15 +00:00
|
|
|
};
|
|
|
|
|
2006-04-12 03:12:56 +00:00
|
|
|
enum {
|
|
|
|
kCmpEQ = (1 << 0),
|
|
|
|
kCmpGT = (1 << 1),
|
|
|
|
kCmpLT = (1 << 2)
|
|
|
|
};
|
2006-04-12 01:48:15 +00:00
|
|
|
|
|
|
|
|
2006-02-25 00:26:14 +00:00
|
|
|
} // End of namespace Cine
|
|
|
|
|
2006-02-22 22:40:53 +00:00
|
|
|
#endif
|