2004-04-09 12:36:06 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-09 16:06:29 +00:00
|
|
|
* Copyright (C) 2004-2005 The ScummVM project
|
2004-04-09 12:36:06 +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
|
2005-01-09 16:06:29 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2004-04-09 12:36:06 +00:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KYRA_H
|
|
|
|
#define KYRA_H
|
|
|
|
|
|
|
|
#include "base/engine.h"
|
|
|
|
#include "common/util.h"
|
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
namespace Kyra {
|
|
|
|
|
2004-10-15 06:06:47 +00:00
|
|
|
enum {
|
2005-08-19 22:12:09 +00:00
|
|
|
GF_FLOPPY = 1 << 0,
|
|
|
|
GF_TALKIE = 1 << 1,
|
|
|
|
GF_KYRA1 = 1 << 2,
|
|
|
|
GF_KYRA2 = 1 << 3,
|
|
|
|
GF_KYRA3 = 1 << 4,
|
|
|
|
GF_AUDIOCD = 1 << 5 // FM-Towns versions seems to use audio CD
|
2004-11-11 13:37:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2005-08-19 22:12:09 +00:00
|
|
|
KYRA1 = 0,
|
2004-11-11 13:37:35 +00:00
|
|
|
KYRA1CD = 1,
|
2005-08-19 22:12:09 +00:00
|
|
|
KYRA2 = 2,
|
2004-11-11 13:37:35 +00:00
|
|
|
KYRA2CD = 3,
|
2005-08-19 22:12:09 +00:00
|
|
|
KYRA3 = 4
|
2004-10-15 06:06:47 +00:00
|
|
|
};
|
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
struct TalkCoords {
|
|
|
|
uint16 y, x, w;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SeqLoop {
|
|
|
|
const uint8 *ptr;
|
|
|
|
uint16 count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct WSAMovieV1;
|
|
|
|
|
2004-11-14 20:11:22 +00:00
|
|
|
class MusicPlayer;
|
2005-08-19 22:12:09 +00:00
|
|
|
class Resource;
|
|
|
|
class Screen;
|
2004-04-09 12:36:06 +00:00
|
|
|
|
|
|
|
class KyraEngine : public Engine {
|
2004-10-15 06:06:47 +00:00
|
|
|
public:
|
2004-04-09 12:36:06 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
KyraEngine(GameDetector *detector, OSystem *system);
|
|
|
|
~KyraEngine();
|
|
|
|
|
|
|
|
void errorString(const char *buf_input, char *buf_output);
|
2004-10-15 06:06:47 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
Resource *resource() { return _res; }
|
|
|
|
Screen *screen() { return _screen; }
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
uint8 game() const { return _game; }
|
2004-10-15 06:06:47 +00:00
|
|
|
|
2004-04-09 12:36:06 +00:00
|
|
|
protected:
|
2005-08-19 22:12:09 +00:00
|
|
|
|
2004-11-23 00:03:25 +00:00
|
|
|
int go();
|
2004-11-24 00:14:21 +00:00
|
|
|
int init(GameDetector &detector);
|
2004-04-09 12:36:06 +00:00
|
|
|
|
2005-08-19 22:12:09 +00:00
|
|
|
void setTalkCoords(uint16 y);
|
|
|
|
void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
|
|
|
|
void restoreTalkTextMessageBkgd(int srcPage, int dstPage);
|
|
|
|
void printTalkTextMessage(const char *text, int x, int y, uint8 color, int srcPage, int dstPage);
|
|
|
|
void waitTicks(int ticks);
|
|
|
|
|
|
|
|
void seq_intro();
|
|
|
|
void seq_introLogos();
|
|
|
|
uint8 *seq_setPanPages(int pageNum, int shape);
|
|
|
|
void seq_makeHandShapes();
|
|
|
|
void seq_freeHandShapes();
|
|
|
|
void seq_copyView();
|
|
|
|
bool seq_skipSequence() const;
|
|
|
|
bool seq_playSpecialSequence(const uint8 *seqData, bool skipSeq);
|
|
|
|
|
|
|
|
WSAMovieV1 *wsa_open(const char *filename, int offscreenDecode, uint8 *palBuf);
|
|
|
|
void wsa_close(WSAMovieV1 *wsa);
|
|
|
|
uint16 wsa_getNumFrames(WSAMovieV1 *wsa) const;
|
|
|
|
void wsa_play(WSAMovieV1 *wsa, int frameNum, int x, int y, int pageNum);
|
|
|
|
void wsa_processFrame(WSAMovieV1 *wsa, int frameNum, uint8 *dst);
|
|
|
|
|
|
|
|
uint8 _game;
|
|
|
|
bool _fastMode;
|
|
|
|
bool _quitFlag;
|
|
|
|
bool _skipIntroFlag;
|
|
|
|
TalkCoords _talkCoords;
|
|
|
|
|
|
|
|
int _seq_copyViewOffs;
|
|
|
|
uint8 *_seq_handShapes[3];
|
|
|
|
uint8 *_seq_specialSequenceTempBuffer;
|
|
|
|
|
|
|
|
MusicPlayer *_midi;
|
|
|
|
Resource *_res;
|
|
|
|
Screen *_screen;
|
|
|
|
|
|
|
|
static const uint8 _seq_introData_Forest[];
|
|
|
|
static const uint8 _seq_introData_KallakWriting[];
|
|
|
|
static const uint8 _seq_introData_KyrandiaLogo[];
|
|
|
|
static const uint8 _seq_introData_KallakMalcom[];
|
|
|
|
static const uint8 _seq_introData_MalcomTree[];
|
|
|
|
static const uint8 _seq_introData_WestwoodLogo[];
|
|
|
|
static const uint8 _seq_codeSizeTable[];
|
|
|
|
static const char *_seq_WSATable[];
|
|
|
|
static const char *_seq_CPSTable[];
|
|
|
|
static const char *_seq_COLTable[];
|
|
|
|
static const char *_seq_textsTableEN[];
|
2004-04-09 12:36:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Kyra
|
|
|
|
|
|
|
|
#endif
|