1/*****************************************************************************\
2 Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3 This file is licensed under the Snes9x License.
4 For further information, consult the LICENSE file in the root directory.
5\*****************************************************************************/
6
7#ifndef _CROSSHAIRS_H_
8#define _CROSSHAIRS_H_
9
10// Read in the specified crosshair file, replacing whatever data might be in that slot.
11// Available slots are 1-31.
12// The input file must be a PNG or a text file.
13// PNG: 15x15 pixels, palettized, with 3 colors (white, black, and transparent).
14// text: 15 lines of 16 characters (counting the \n), consisting of ' ', '#', or '.'.
15
16bool S9xLoadCrosshairFile (int idx, const char *filename);
17
18// Return the specified crosshair. Woo-hoo.
19// char * to a 225-byte string, with '#' marking foreground, '.' marking background,
20// and anything else transparent.
21
22const char * S9xGetCrosshair (int idx);
23
24// In controls.cpp. Sets the crosshair for the specified device. Defaults are:
25// cross fgcolor bgcolor
26// Mouse 1: 1 White Black
27// Mouse 2: 1 Purple White
28// Superscope: 2 White Black
29// Justifier 1: 4 Blue Black
30// Justifier 2: 4 MagicPink Black
31// Macs Rifle: 2 White Black
32//
33// Available colors are: Trans, Black, 25Grey, 50Grey, 75Grey, White, Red, Orange,
34// Yellow, Green, Cyan, Sky, Blue, Violet, MagicPink, and Purple.
35// You may also prefix a 't' (e.g. tBlue) for a 50%-transparent version.
36// Use idx = -1 or fg/bg = NULL to keep the current setting.
37
38enum crosscontrols
39{
40 X_MOUSE1,
41 X_MOUSE2,
42 X_SUPERSCOPE,
43 X_JUSTIFIER1,
44 X_JUSTIFIER2,
45 X_MACSRIFLE
46};
47
48void S9xSetControllerCrosshair (enum crosscontrols ctl, int8 idx, const char *fg, const char *bg);
49void S9xGetControllerCrosshair (enum crosscontrols ctl, int8 *idx, const char **fg, const char **bg);
50
51// In gfx.cpp, much like S9xDisplayChar() except it takes the parameters
52// listed and looks up GFX.Screen.
53// The 'crosshair' arg is a 15x15 image, with '#' meaning fgcolor,
54// '.' meaning bgcolor, and anything else meaning transparent.
55// Color values should be (RGB):
56// 0 = transparent 4 = 23 23 23 8 = 31 31 0 12 = 0 0 31
57// 1 = 0 0 0 5 = 31 31 31 9 = 0 31 0 13 = 23 0 31
58// 2 = 8 8 8 6 = 31 0 0 10 = 0 31 31 14 = 31 0 31
59// 3 = 16 16 16 7 = 31 16 0 11 = 0 23 31 15 = 31 0 16
60// 16-31 are 50% transparent versions of 0-15.
61
62void S9xDrawCrosshair (const char *crosshair, uint8 fgcolor, uint8 bgcolor, int16 x, int16 y);
63
64#endif
65