File: cursor.h

package info (click to toggle)
ale-clone 1.15pre16.3-1
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 2,432 kB
  • ctags: 3,217
  • sloc: ansic: 37,483; sh: 1,105; makefile: 343
file content (111 lines) | stat: -rw-r--r-- 2,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
**	A clone of a famous game.
*/
/**@name cursor.h	-	The cursors header file. */
/*
**	(c) Copyright 1998,1999 by Lutz Sammer
**
**	$Id: cursor.h,v 1.7 1999/06/19 22:21:49 root Exp $
*/

#ifndef __CURSOR_H__
#define __CURSOR_H__

//@{

/*----------------------------------------------------------------------------
--	Definitions
----------------------------------------------------------------------------*/

    /// cursor type typedef
typedef struct _cursor_type_ CursorType;

    /// private type which specifies current cursor type
struct _cursor_type_ {
	/// resource filename one for each race
    const char*	File[PlayerMaxRaces];

// FIXME: this must be extra for each file (different sizes for the races)
// FIXME: or must define that each image has the same size
	/// hot point x
    int		HotX;
	/// hot point y
    int		HotY;
	/// width of cursor
    int		Width;
	/// height of cursor
    int		Height;

	/// sprite image of cursor : FILLED
    RleSprite*	RleSprite;
};

    /// cursor type (enumerated)
enum CursorType_e {
    CursorTypePoint = 0,
    CursorTypeGlass,
    CursorTypeCross,
    CursorTypeYellowHair,
    CursorTypeGreenHair,
    CursorTypeRedHair,
    CursorTypeMove,
    CursorTypeArrowE,
    CursorTypeArrowN,
    CursorTypeArrowNE,
    CursorTypeArrowNW,
    CursorTypeArrowS,
    CursorTypeArrowSE,
    CursorTypeArrowSW,
    CursorTypeArrowW,
    CursorMax
};

/*----------------------------------------------------------------------------
--	Variables
----------------------------------------------------------------------------*/

    /// cursor types description
extern CursorType Cursors[CursorMax];

extern int OldCursorX;			// last cursor data
extern int OldCursorY;
extern int OldCursorW;
extern int OldCursorH;

extern int CursorAction;		// action for selection
extern UnitType* CursorBuilding;	// building cursor

    /// current cursor type (shape)
extern CursorType* CloneCursor;
extern int CursorX;			// cursor position
extern int CursorY;
extern int CursorStartX;		// rectangle started
extern int CursorStartY;

/*----------------------------------------------------------------------------
--	Functions
----------------------------------------------------------------------------*/

    /// initialize all cursor
extern void LoadCursors(void);

    /** Draw cursor on screen in position x,y..
    **	@param type	cursor type pointer
    **	@param x	x coordinate on the screen
    **	@param y	y coordinate on the screen
    **	@param frame	sprite animation frame
    */
extern void DrawCursor(CursorType* type,int x,int y,int frame);

    /// hide the cursor
extern void HideCursor(void);

    /// draw any cursor 
extern void DrawAnyCursor(void);

    /// hide any cursor 
extern int HideAnyCursor(void);

//@}

#endif	// !__CURSOR_H__