2009-10-07 12:47:53 +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.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCI_GUI_CURSOR_H
|
|
|
|
#define SCI_GUI_CURSOR_H
|
|
|
|
|
2009-10-30 17:13:25 +00:00
|
|
|
#include "common/hashmap.h"
|
|
|
|
|
2009-10-07 12:47:53 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-10-07 14:53:15 +00:00
|
|
|
#define SCI_CURSOR_SCI0_HEIGHTWIDTH 16
|
|
|
|
#define SCI_CURSOR_SCI0_RESOURCESIZE 68
|
|
|
|
|
|
|
|
#define SCI_CURSOR_SCI0_TRANSPARENCYCOLOR 1
|
|
|
|
|
2009-10-30 17:13:25 +00:00
|
|
|
#define MAX_CACHED_CURSORS 10
|
|
|
|
|
2009-10-07 12:47:53 +00:00
|
|
|
class SciGuiView;
|
|
|
|
class SciGuiPalette;
|
2009-10-30 17:13:25 +00:00
|
|
|
|
|
|
|
typedef Common::HashMap<int, SciGuiView *> CursorCache;
|
|
|
|
|
2009-10-07 12:47:53 +00:00
|
|
|
class SciGuiCursor {
|
|
|
|
public:
|
2009-10-29 14:16:20 +00:00
|
|
|
SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciGuiScreen *screen);
|
2009-10-07 12:47:53 +00:00
|
|
|
~SciGuiCursor();
|
|
|
|
|
2009-10-07 14:53:15 +00:00
|
|
|
void show();
|
|
|
|
void hide();
|
|
|
|
void setShape(GuiResourceId resourceId);
|
2009-10-13 17:09:32 +00:00
|
|
|
void setView(GuiResourceId viewNum, int loopNum, int celNum, Common::Point *hotspot);
|
2009-10-07 12:47:53 +00:00
|
|
|
void setPosition(Common::Point pos);
|
2009-10-07 21:29:47 +00:00
|
|
|
Common::Point getPosition();
|
|
|
|
void refreshPosition();
|
2009-10-07 12:47:53 +00:00
|
|
|
|
2009-10-07 21:29:47 +00:00
|
|
|
/**
|
|
|
|
* Limits the mouse movement to a given rectangle.
|
|
|
|
*
|
|
|
|
* @param[in] rect The rectangle
|
|
|
|
*/
|
|
|
|
void setMoveZone(Common::Rect zone) { _moveZone = zone; }
|
2009-10-07 12:47:53 +00:00
|
|
|
|
2009-10-07 21:29:47 +00:00
|
|
|
private:
|
2009-10-30 17:13:25 +00:00
|
|
|
void purgeCache();
|
|
|
|
|
2009-10-07 21:29:47 +00:00
|
|
|
ResourceManager *_resMan;
|
2009-10-07 12:47:53 +00:00
|
|
|
SciGuiScreen *_screen;
|
|
|
|
SciGuiPalette *_palette;
|
2009-10-07 14:53:15 +00:00
|
|
|
|
2009-10-31 14:38:25 +00:00
|
|
|
bool _upscaledHires;
|
|
|
|
|
2009-10-07 21:29:47 +00:00
|
|
|
Common::Rect _moveZone; // Rectangle in which the pointer can move
|
2009-10-30 17:13:25 +00:00
|
|
|
|
|
|
|
CursorCache _cachedCursors;
|
2009-10-07 12:47:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Sci
|
|
|
|
|
|
|
|
#endif
|