2012-05-13 12:34:40 +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:26 +00:00
|
|
|
*
|
2012-05-13 12:34:40 +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:26 +00:00
|
|
|
*
|
2012-05-13 12:34:40 +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 TONY_GLOBALS
|
|
|
|
#define TONY_GLOBALS
|
|
|
|
|
|
|
|
#include "common/savefile.h"
|
2012-05-14 10:20:02 +00:00
|
|
|
#include "tony/gfxengine.h"
|
2012-05-13 12:34:40 +00:00
|
|
|
#include "tony/input.h"
|
|
|
|
#include "tony/inventory.h"
|
|
|
|
#include "tony/loc.h"
|
|
|
|
#include "tony/tonychar.h"
|
2012-05-13 13:44:08 +00:00
|
|
|
#include "tony/mpal/mpal.h"
|
|
|
|
#include "tony/mpal/mpaldll.h"
|
2012-05-13 12:34:40 +00:00
|
|
|
|
|
|
|
namespace Tony {
|
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
#define AMBIANCE_CRICKETS 1
|
|
|
|
#define AMBIANCE_CRICKETSMUFFLED 2
|
|
|
|
#define AMBIANCE_CRICKETSWIND 3
|
|
|
|
#define AMBIANCE_CRICKETSWIND1 4
|
|
|
|
#define AMBIANCE_WIND 5
|
|
|
|
#define AMBIANCE_SEA 6
|
|
|
|
#define AMBIANCE_SEAHALFVOLUME 7
|
2012-05-13 12:34:40 +00:00
|
|
|
|
|
|
|
struct CharacterStruct {
|
2012-06-08 06:44:14 +00:00
|
|
|
uint32 _code;
|
|
|
|
RMItem *_item;
|
|
|
|
byte _r, _g, _b;
|
|
|
|
int _talkPattern;
|
|
|
|
int _standPattern;
|
|
|
|
int _startTalkPattern, _endTalkPattern;
|
|
|
|
int _numTexts;
|
|
|
|
|
|
|
|
void save(Common::OutSaveFile *f) {
|
|
|
|
f->writeUint32LE(_code);
|
2012-05-13 12:34:40 +00:00
|
|
|
f->writeUint32LE(0);
|
2012-06-08 06:44:14 +00:00
|
|
|
f->writeByte(_r);
|
|
|
|
f->writeByte(_g);
|
|
|
|
f->writeByte(_b);
|
|
|
|
f->writeUint32LE(_talkPattern);
|
|
|
|
f->writeUint32LE(_standPattern);
|
|
|
|
f->writeUint32LE(_startTalkPattern);
|
|
|
|
f->writeUint32LE(_endTalkPattern);
|
|
|
|
f->writeUint32LE(_numTexts);
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
2012-11-12 00:39:20 +00:00
|
|
|
|
2012-06-08 06:44:14 +00:00
|
|
|
void load(Common::InSaveFile *f) {
|
|
|
|
_code = f->readUint32LE();
|
2012-05-13 12:34:40 +00:00
|
|
|
f->readUint32LE();
|
2012-06-08 06:44:14 +00:00
|
|
|
_item = NULL;
|
|
|
|
_r = f->readByte();
|
|
|
|
_g = f->readByte();
|
|
|
|
_b = f->readByte();
|
|
|
|
_talkPattern = f->readUint32LE();
|
|
|
|
_standPattern = f->readUint32LE();
|
|
|
|
_startTalkPattern = f->readUint32LE();
|
|
|
|
_endTalkPattern = f->readUint32LE();
|
|
|
|
_numTexts = f->readUint32LE();
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MCharacterStruct {
|
2012-06-08 06:44:14 +00:00
|
|
|
uint32 _code;
|
|
|
|
RMItem *_item;
|
|
|
|
byte _r, _g, _b;
|
|
|
|
int _x, _y;
|
|
|
|
int _numTalks[10];
|
|
|
|
int _curGroup;
|
|
|
|
int _numTexts;
|
|
|
|
bool _bInTexts;
|
|
|
|
int _curTalk;
|
|
|
|
bool _bAlwaysBack;
|
|
|
|
|
|
|
|
void save(Common::OutSaveFile *f) {
|
|
|
|
f->writeUint32LE(_code);
|
2012-05-13 12:34:40 +00:00
|
|
|
f->writeUint32LE(0);
|
2012-06-08 06:44:14 +00:00
|
|
|
f->writeByte(_r);
|
|
|
|
f->writeByte(_g);
|
|
|
|
f->writeByte(_b);
|
|
|
|
f->writeUint32LE(_x);
|
|
|
|
f->writeUint32LE(_y);
|
2012-05-13 12:34:40 +00:00
|
|
|
for (int i = 0; i < 10; ++i)
|
2012-06-08 06:44:14 +00:00
|
|
|
f->writeUint32LE(_numTalks[i]);
|
|
|
|
f->writeUint32LE(_curGroup);
|
|
|
|
f->writeUint32LE(_numTexts);
|
|
|
|
f->writeByte(_bInTexts);
|
|
|
|
f->writeUint32LE(_curTalk);
|
|
|
|
f->writeByte(_bAlwaysBack);
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
2012-11-12 00:39:20 +00:00
|
|
|
|
2012-06-08 06:44:14 +00:00
|
|
|
void load(Common::InSaveFile *f) {
|
|
|
|
_code = f->readUint32LE();
|
2012-05-13 12:34:40 +00:00
|
|
|
f->readUint32LE();
|
2012-06-08 06:44:14 +00:00
|
|
|
_item = NULL;
|
|
|
|
_r = f->readByte();
|
|
|
|
_g = f->readByte();
|
|
|
|
_b = f->readByte();
|
|
|
|
_x = f->readUint32LE();
|
|
|
|
_y = f->readUint32LE();
|
2012-05-13 12:34:40 +00:00
|
|
|
for (int i = 0; i < 10; ++i)
|
2012-06-08 06:44:14 +00:00
|
|
|
_numTalks[i] = f->readUint32LE();
|
|
|
|
_curGroup = f->readUint32LE();
|
|
|
|
_numTexts = f->readUint32LE();
|
|
|
|
_bInTexts = f->readByte();
|
|
|
|
_curTalk = f->readUint32LE();
|
|
|
|
_bAlwaysBack = f->readByte();
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ChangedHotspotStruct {
|
2012-06-08 06:44:14 +00:00
|
|
|
uint32 _dwCode;
|
|
|
|
uint32 _nX, _nY;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-08 06:44:14 +00:00
|
|
|
void save(Common::OutSaveFile *f) {
|
|
|
|
f->writeUint32LE(_dwCode);
|
|
|
|
f->writeUint32LE(_nX);
|
|
|
|
f->writeUint32LE(_nY);
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
2012-11-12 00:39:20 +00:00
|
|
|
|
2012-06-08 06:44:14 +00:00
|
|
|
void load(Common::InSaveFile *f) {
|
|
|
|
_dwCode = f->readUint32LE();
|
|
|
|
_nX = f->readUint32LE();
|
|
|
|
_nY = f->readUint32LE();
|
2012-05-13 12:34:40 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-05-20 05:28:48 +00:00
|
|
|
/**
|
|
|
|
* Description of a call to a custom function.
|
|
|
|
*/
|
2012-05-13 13:44:08 +00:00
|
|
|
typedef struct {
|
2012-06-10 20:02:31 +00:00
|
|
|
int _nCf;
|
|
|
|
int _arg1, _arg2, _arg3, _arg4;
|
2012-08-31 22:25:35 +00:00
|
|
|
} CfCall;
|
2012-05-13 13:44:08 +00:00
|
|
|
|
2012-11-12 00:39:20 +00:00
|
|
|
typedef CfCall *LpCfCall;
|
2012-05-13 13:44:08 +00:00
|
|
|
|
2012-08-28 07:19:10 +00:00
|
|
|
struct CoroutineMutex {
|
|
|
|
CoroutineMutex() : _eventId(0), _ownerPid(0), _lockCount(0) { }
|
|
|
|
|
|
|
|
uint32 _eventId;
|
|
|
|
uint32 _ownerPid;
|
|
|
|
uint32 _lockCount;
|
|
|
|
};
|
|
|
|
|
2012-05-13 13:44:08 +00:00
|
|
|
/****************************************************************************\
|
|
|
|
* Global variables
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Globals class
|
|
|
|
*/
|
2012-05-13 12:34:40 +00:00
|
|
|
class Globals {
|
|
|
|
public:
|
|
|
|
Globals();
|
|
|
|
|
2012-06-19 12:37:56 +00:00
|
|
|
Common::String _nextMusic;
|
2012-06-08 06:44:14 +00:00
|
|
|
bool _nextLoop;
|
2012-11-12 00:39:20 +00:00
|
|
|
int _nextChannel;
|
|
|
|
int _nextSync;
|
|
|
|
int _curChannel;
|
|
|
|
int _flipflop;
|
2012-06-08 06:44:14 +00:00
|
|
|
CharacterStruct _character[16];
|
|
|
|
MCharacterStruct _mCharacter[10];
|
|
|
|
ChangedHotspotStruct _changedHotspot[256];
|
|
|
|
bool _isMChar[16];
|
|
|
|
bool _bAlwaysDisplay;
|
|
|
|
RMPoint _saveTonyPos;
|
2012-11-12 00:39:20 +00:00
|
|
|
int _saveTonyLoc;
|
2012-06-08 06:44:14 +00:00
|
|
|
RMTextDialog *_curBackText;
|
|
|
|
bool _bTonyIsSpeaking;
|
2012-11-12 00:39:20 +00:00
|
|
|
int _curChangedHotspot;
|
2012-06-08 22:52:38 +00:00
|
|
|
bool _bCfgInvLocked;
|
|
|
|
bool _bCfgInvNoScroll;
|
|
|
|
bool _bCfgTimerizedText;
|
|
|
|
bool _bCfgInvUp;
|
|
|
|
bool _bCfgAnni30;
|
|
|
|
bool _bCfgAntiAlias;
|
2012-06-17 07:04:10 +00:00
|
|
|
bool _bShowSubtitles;
|
2012-06-08 22:52:38 +00:00
|
|
|
bool _bCfgTransparence;
|
|
|
|
bool _bCfgInterTips;
|
|
|
|
bool _bCfgDubbing;
|
|
|
|
bool _bCfgMusic;
|
|
|
|
bool _bCfgSFX;
|
2012-11-12 00:39:20 +00:00
|
|
|
int _nCfgTonySpeed;
|
|
|
|
int _nCfgTextSpeed;
|
|
|
|
int _nCfgDubbingVolume;
|
|
|
|
int _nCfgMusicVolume;
|
|
|
|
int _nCfgSFXVolume;
|
2012-06-08 22:52:38 +00:00
|
|
|
bool _bSkipSfxNoLoop;
|
|
|
|
bool _bIdleExited;
|
2012-06-16 09:09:08 +00:00
|
|
|
bool _bNoBullsEye;
|
2012-11-12 00:39:20 +00:00
|
|
|
int _curDialog;
|
|
|
|
int _curSoundEffect;
|
2012-06-08 22:52:38 +00:00
|
|
|
bool _bFadeOutStop;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-10 20:02:31 +00:00
|
|
|
RMTony *_tony;
|
|
|
|
RMPointer *_pointer;
|
|
|
|
RMGameBoxes *_boxes;
|
|
|
|
RMLocation *_loc;
|
|
|
|
RMInventory *_inventory;
|
|
|
|
RMInput *_input;
|
|
|
|
RMGfxEngine *_gfxEngine;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-18 06:24:33 +00:00
|
|
|
void (*EnableGUI)();
|
|
|
|
void (*DisableGUI)();
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-10 20:02:31 +00:00
|
|
|
uint32 _dwTonyNumTexts;
|
|
|
|
bool _bTonyInTexts;
|
|
|
|
bool _bStaticTalk;
|
2012-06-16 09:09:08 +00:00
|
|
|
RMTony::CharacterTalkType _nTonyNextTalkType;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-10 20:02:31 +00:00
|
|
|
RMPoint _startLocPos[256];
|
2012-08-28 07:19:10 +00:00
|
|
|
CoroutineMutex _mut[10];
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-10 20:02:31 +00:00
|
|
|
bool _bSkipIdle;
|
|
|
|
uint32 _hSkipIdle;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-10 20:02:31 +00:00
|
|
|
int _lastMusic, _lastTappeto;
|
2012-05-13 12:34:40 +00:00
|
|
|
|
2012-06-20 22:20:16 +00:00
|
|
|
int _ambiance[200];
|
2012-06-18 06:03:02 +00:00
|
|
|
RMPoint _fullScreenMessagePt;
|
|
|
|
int _fullScreenMessageLoc;
|
2012-05-13 13:44:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup MPAL variables
|
2012-06-16 23:09:18 +00:00
|
|
|
*/
|
2012-06-18 06:24:33 +00:00
|
|
|
uint32 _mpalError;
|
|
|
|
LPITEMIRQFUNCTION _lpiifCustom;
|
|
|
|
LPLPCUSTOMFUNCTION _lplpFunctions;
|
|
|
|
Common::String *_lplpFunctionStrings;
|
|
|
|
uint16 _nObjs;
|
|
|
|
uint16 _nVars;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hVars;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalVar _lpmvVars;
|
2012-06-18 06:24:33 +00:00
|
|
|
uint16 _nMsgs;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hMsgs;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalMsg _lpmmMsgs;
|
2012-06-18 06:24:33 +00:00
|
|
|
uint16 _nDialogs;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hDialogs;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalDialog _lpmdDialogs;
|
2012-06-18 06:24:33 +00:00
|
|
|
uint16 _nItems;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hItems;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalItem _lpmiItems;
|
2012-06-18 06:24:33 +00:00
|
|
|
uint16 _nLocations;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hLocations;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalLocation _lpmlLocations;
|
2012-06-18 06:24:33 +00:00
|
|
|
uint16 _nScripts;
|
2012-08-31 22:25:35 +00:00
|
|
|
MpalHandle _hScripts;
|
2012-08-31 21:08:02 +00:00
|
|
|
LpMpalScript _lpmsScripts;
|
2012-06-18 06:24:33 +00:00
|
|
|
Common::File _hMpr;
|
|
|
|
uint16 _nResources;
|
|
|
|
uint32 *_lpResources;
|
|
|
|
bool _bExecutingAction;
|
|
|
|
bool _bExecutingDialog;
|
|
|
|
uint32 _nPollingLocations[MAXPOLLINGLOCATIONS];
|
|
|
|
uint32 _hEndPollingLocations[MAXPOLLINGLOCATIONS];
|
|
|
|
uint32 _pollingThreads[MAXPOLLINGLOCATIONS];
|
|
|
|
uint32 _hAskChoice;
|
|
|
|
uint32 _hDoneChoice;
|
|
|
|
uint32 _nExecutingAction;
|
|
|
|
uint32 _nExecutingDialog;
|
|
|
|
uint32 _nExecutingChoice;
|
|
|
|
uint32 _nSelectedChoice;
|
2012-05-13 12:34:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Tony
|
|
|
|
|
|
|
|
#endif // TONY_GLOBALS
|