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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
#ifndef SCI_GRAPHICS_CURSOR_H
|
|
|
|
#define SCI_GRAPHICS_CURSOR_H
|
2009-10-07 12:47:53 +00:00
|
|
|
|
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
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
class View;
|
|
|
|
class SciPalette;
|
2009-10-30 17:13:25 +00:00
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
typedef Common::HashMap<int, View *> CursorCache;
|
2009-10-30 17:13:25 +00:00
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
class Cursor {
|
2009-10-07 12:47:53 +00:00
|
|
|
public:
|
2010-01-05 01:37:57 +00:00
|
|
|
Cursor(ResourceManager *resMan, SciPalette *palette, Screen *screen);
|
|
|
|
~Cursor();
|
2009-10-07 12:47:53 +00:00
|
|
|
|
2009-10-07 14:53:15 +00:00
|
|
|
void show();
|
|
|
|
void hide();
|
2009-11-30 19:34:45 +00:00
|
|
|
bool isVisible();
|
2009-10-07 14:53:15 +00:00
|
|
|
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;
|
2010-01-05 01:37:57 +00:00
|
|
|
Screen *_screen;
|
|
|
|
SciPalette *_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-11-30 19:34:45 +00:00
|
|
|
|
|
|
|
bool _isVisible;
|
2009-10-07 12:47:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Sci
|
|
|
|
|
|
|
|
#endif
|