2012-04-29 23:27:12 +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-04-29 23:27:12 +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-04-29 23:27:12 +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.
|
|
|
|
*
|
|
|
|
*/
|
2012-05-14 05:43:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on original Tony Tough source code
|
|
|
|
*
|
|
|
|
* Copyright (c) 1997-2003 Nayma Software
|
|
|
|
*/
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
#ifndef TONY_GFXENGINE_H
|
|
|
|
#define TONY_GFXENGINE_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/system.h"
|
|
|
|
#include "common/rect.h"
|
|
|
|
#include "tony/mpal/memory.h"
|
|
|
|
#include "tony/game.h"
|
|
|
|
#include "tony/gfxcore.h"
|
|
|
|
#include "tony/input.h"
|
|
|
|
#include "tony/inventory.h"
|
|
|
|
#include "tony/tonychar.h"
|
|
|
|
#include "tony/utils.h"
|
|
|
|
|
|
|
|
namespace Tony {
|
|
|
|
|
|
|
|
class RMGfxEngine {
|
|
|
|
private:
|
2012-06-04 23:04:53 +00:00
|
|
|
RMGfxTargetBuffer _bigBuf;
|
|
|
|
RMInput _input;
|
|
|
|
RMPointer _point;
|
|
|
|
RMLocation _loc;
|
|
|
|
RMOptionScreen _opt;
|
|
|
|
RMTony _tony;
|
|
|
|
RMInventory _inv;
|
|
|
|
RMInterface _inter;
|
|
|
|
RMTextItemName _itemName;
|
|
|
|
|
|
|
|
bool _bOption;
|
|
|
|
bool _bLocationLoaded;
|
|
|
|
|
|
|
|
bool _bInput;
|
|
|
|
bool _bAlwaysDrawMouse;
|
|
|
|
|
|
|
|
int _nCurLoc;
|
|
|
|
RMTonyAction _curAction;
|
|
|
|
int _curActionObj;
|
|
|
|
|
|
|
|
int _nWipeType;
|
|
|
|
uint32 _hWipeEvent;
|
|
|
|
int _nWipeStep;
|
|
|
|
|
|
|
|
bool _bMustEnterMenu;
|
2012-04-29 23:27:12 +00:00
|
|
|
protected:
|
2012-06-04 23:04:53 +00:00
|
|
|
static void itemIrq(uint32 dwItem, int nPattern, int nStatus);
|
|
|
|
void initForNewLocation(int nLoc, RMPoint ptTonyStart, RMPoint start);
|
2012-04-29 23:27:12 +00:00
|
|
|
public:
|
2012-06-04 23:04:53 +00:00
|
|
|
bool _bWiping;
|
|
|
|
Common::Rect _rcWipeEllipse;
|
|
|
|
bool _bGUIOption;
|
|
|
|
bool _bGUIInterface;
|
|
|
|
bool _bGUIInventory;
|
2012-04-29 23:27:12 +00:00
|
|
|
public:
|
2012-05-14 19:29:27 +00:00
|
|
|
RMGfxEngine();
|
|
|
|
virtual ~RMGfxEngine();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Draw the next frame
|
2012-06-04 23:04:53 +00:00
|
|
|
void doFrame(CORO_PARAM, bool bDrawLocation);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-06-17 16:36:23 +00:00
|
|
|
// Initializes the graphics engine
|
2012-06-04 23:04:53 +00:00
|
|
|
void init();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Closes the graphics engine
|
2012-06-18 06:24:33 +00:00
|
|
|
void close();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Warns when entering or exits the options menu
|
2012-06-04 23:04:53 +00:00
|
|
|
void openOptionScreen(CORO_PARAM, int type);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Enables or disables mouse input
|
2012-06-18 06:24:33 +00:00
|
|
|
void enableInput();
|
|
|
|
void disableInput();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Enables and disables mouse draw
|
2012-06-18 06:24:33 +00:00
|
|
|
void enableMouse();
|
|
|
|
void disableMouse();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-08-31 23:05:22 +00:00
|
|
|
operator RMGfxTargetBuffer &();
|
|
|
|
RMInput &getInput();
|
|
|
|
RMPointer &getPointer();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Link to the custom function list
|
2012-06-18 06:24:33 +00:00
|
|
|
void initCustomDll();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Link to graphic task
|
2012-08-31 23:05:22 +00:00
|
|
|
void linkGraphicTask(RMGfxTask *task);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Manage a location
|
2012-06-04 23:04:53 +00:00
|
|
|
uint32 loadLocation(int nLoc, RMPoint ptTonyStart, RMPoint start);
|
|
|
|
void unloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result);
|
2012-08-12 09:47:48 +00:00
|
|
|
int getCurrentLocation() const { return _nCurLoc; }
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// State management
|
2012-06-04 23:04:53 +00:00
|
|
|
void saveState(const Common::String &fn, byte *curThumb, const Common::String &name);
|
|
|
|
void loadState(CORO_PARAM, const Common::String &fn);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Pauses sound
|
2012-06-04 23:04:53 +00:00
|
|
|
void pauseSound(bool bPause);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
// Wipe
|
2012-06-04 23:04:53 +00:00
|
|
|
void initWipe(int type);
|
2012-06-18 06:24:33 +00:00
|
|
|
void closeWipe();
|
2012-06-04 23:04:53 +00:00
|
|
|
void waitWipeEnd(CORO_PARAM);
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-08-31 23:05:22 +00:00
|
|
|
void setPerorate(bool bpal);
|
|
|
|
|
2012-06-04 23:04:53 +00:00
|
|
|
bool canLoadSave();
|
2012-04-29 23:27:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Tony
|
|
|
|
|
|
|
|
#endif
|