-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.h
60 lines (43 loc) · 1.63 KB
/
options.h
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
/***************************************************************************
This file is part of XorCurses a port/remake of the game Xor
(originally by Astral Software) to the Linux console using
ncurses.
XorCurses written by James W. Morris - [email protected]
All code licensed under GNU GPL v3.
file: options.h
purpose: initializes options and reads map names from maps.
***************************************************************************/
#ifndef _OPTIONS_H
#define _OPTIONS_H
#include "types.h"
/* dir in this context = directory
elsewhere, dir = direction...
*/
enum DATA_LOC
{
DATA_INST_LOC = 0, /* installed location */
DATA_CWD_LOC = 1, /* current working directory location */
DATA_USER_LOC = 2 /* unused - user specified loc cmdline */
};
struct xor_options
{
unsigned oldschool_play:1; /* scroll thresh of 1 and 8x8 game area.*/
unsigned scroll_thresh:2;
unsigned good_opt_dir:1;
unsigned replay_speed:4;
unsigned replay_hyper:1;
unsigned replay_step:1;
unsigned dir_opt:2; /* 0=default, 1=cwd, 2=other */
const char *data_dir; /* ie install dir where maps & help are. */
char *user_dir; /* ie /home/username */
char *map_dir;
};
extern struct xor_options *options;
su_t options_create();
void options_destroy();
su_t options_set_dir_opt(enum DATA_LOC loc);
/* options_replay_speed accepts either 1-9 or '1'-'9' */
long options_replay_speed(char n);
char *options_map_filename(su_t level);
char *options_file_path(const char *fname, const char *path);
#endif