File: levels.h

package info (click to toggle)
gnurobbo 0.68+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,212 kB
  • sloc: ansic: 21,128; sh: 301; makefile: 185; awk: 98
file content (68 lines) | stat: -rw-r--r-- 2,577 bytes parent folder | download | duplicates (4)
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
/*  GNU Robbo
 *  Copyright (C) 2002-2010 The GNU Robbo Team (see AUTHORS).
 *
 *  GNU Robbo 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, or (at your option)
 *  any later version.
 *
 *  GNU Robbo is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the impled 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 GNU CC; see the file COPYING. If not, write to the
 *  Free Software Foundation, 59 Temple Place - Suite 330,
 *  Boston, MA 02111-1307, USA.
 *
 */

/* Defines */
#define MAX_LEVEL_PACKS 84
#define LOCAL_DATA_DIR ".gnurobbo"
#if defined(PLATFORM_FREMANTLE)
	#define LOCAL_DATA_DIR "MyDocs/.gnurobbo/"
#endif
#define LEVELS_DIR "levels"
#define DEFAULT_USER_LEVEL_PACK "mylevels.dat"
#define DEFAULT_LEVEL_PACK "original.dat"
#define DEFAULT_LEVEL_START 1	/* Start level for Robbo */
#define DEFAULT_LEVEL_COLOUR 0x608050

/* Variables */
struct {
	int w;
	int h;
	char author[60];		/* The text displayed on the authorline above the viewport */
	int now_is_blinking;	/* When TRUE this will change the level background colour to white */
	Uint32 colour;			/* The colour if found or the default_level_colour if found in the level pack */
	Uint32 colour_override;	/* The colour if found or the default_level_colour if found in the skinrc */
	char notes[1024];		/* This is displayed nowhere now, but contains information about notes */
} level;

struct pack {
	char filename[256];		/* e.g. /usr/local/share/gnurobbo/levels/original.dat or ~/.gnurobbo/levels/mylevels.dat */
	char name[20];			/* e.g. Original */
	int last_level;			/* e.g. 53 */
	int level_reached;		/* e.g. 14 */
	int level_selected;		/* e.g. 3 is currently selected by the user */
	int selected;			/* e.g. This pack is currently selected by the user */
};
struct pack level_packs[MAX_LEVEL_PACKS];

int found_pack_count;		/* How many packs were physically found */
int level_pack_count;		/* How many packs are in the list (historical entries from the rc are added to the end) */
int selected_pack;			/* Which pack in the list is currently selected */

/* Function prototypes */
int level_init(void);
void create_userpack(void);
int find_all_dat_files(void);
void read_level_packs(void);
void sort_level_packs(void);
int load_level_data(int level_number);