File: minimap.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 (59 lines) | stat: -rw-r--r-- 1,750 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
/*
**	A clone of a famous game.
*/
/**@name minimap.h	-	The minimap headerfile. */
/*
**	(c) Copyright 1998 by Lutz Sammer
**
**	$Id: minimap.h,v 1.6 1999/06/19 22:21:51 root Exp $
*/

#ifndef __MINIMAP_H__
#define __MINIMAP_H__

//@{

/*----------------------------------------------------------------------------
--	Minimap
----------------------------------------------------------------------------*/

#define MINIMAP_FAC	(16*3)		/// integer scale factor

/**
**	Convert minimap cursor X position to map coordinate.
*/
#define Minimap2MapX(x)	\
    ((((x)-MINIMAP_X-MinimapX)*MINIMAP_FAC)/MinimapScale)

/**
**	Convert minimap cursor Y position to map coordinate.
*/
#define Minimap2MapY(y)	\
    ((((y)-MINIMAP_Y-MinimapY)*MINIMAP_FAC)/MinimapScale)

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

extern int MinimapScale;		/// Minimap scale to fit into window
extern int MinimapX;			/// Minimap drawing position x offset.
extern int MinimapY;			/// Minimap drawing position y offset.

extern int MinimapWithTerrain;		/// display minimap with terrain
extern int MinimapFriendly;		/// switch colors of friendly units
extern int MinimapShowSelected;		/// highlight selected units

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

extern void UpdateMinimapXY(int tx,int ty);	///
extern void UpdateMinimap(void);
extern void CreateMinimap(void);
extern void DrawMinimap(int vx,int vy);
extern void HideMinimapCursor(void);
extern void DrawMinimapCursor(int vx,int vy);

//@}

#endif	// !__MINIMAP_H__