1 /*  GNU Robbo
2  *  Copyright (C) 2002-2010 The GNU Robbo Team (see AUTHORS).
3  *
4  *  GNU Robbo is free software - you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2, or (at your option)
7  *  any later version.
8  *
9  *  GNU Robbo is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the impled warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with GNU CC; see the file COPYING. If not, write to the
16  *  Free Software Foundation, 59 Temple Place - Suite 330,
17  *  Boston, MA 02111-1307, USA.
18  *
19  */
20 
21 /* Defines */
22 #define MAX_LEVEL_PACKS 84
23 #define LOCAL_DATA_DIR ".gnurobbo"
24 #if defined(PLATFORM_FREMANTLE)
25 	#define LOCAL_DATA_DIR "MyDocs/.gnurobbo/"
26 #endif
27 #define LEVELS_DIR "levels"
28 #define DEFAULT_USER_LEVEL_PACK "mylevels.dat"
29 #define DEFAULT_LEVEL_PACK "original.dat"
30 #define DEFAULT_LEVEL_START 1	/* Start level for Robbo */
31 #define DEFAULT_LEVEL_COLOUR 0x608050
32 
33 /* Variables */
34 struct {
35 	int w;
36 	int h;
37 	char author[60];		/* The text displayed on the authorline above the viewport */
38 	int now_is_blinking;	/* When TRUE this will change the level background colour to white */
39 	Uint32 colour;			/* The colour if found or the default_level_colour if found in the level pack */
40 	Uint32 colour_override;	/* The colour if found or the default_level_colour if found in the skinrc */
41 	char notes[1024];		/* This is displayed nowhere now, but contains information about notes */
42 } level;
43 
44 struct pack {
45 	char filename[256];		/* e.g. /usr/local/share/gnurobbo/levels/original.dat or ~/.gnurobbo/levels/mylevels.dat */
46 	char name[20];			/* e.g. Original */
47 	int last_level;			/* e.g. 53 */
48 	int level_reached;		/* e.g. 14 */
49 	int level_selected;		/* e.g. 3 is currently selected by the user */
50 	int selected;			/* e.g. This pack is currently selected by the user */
51 };
52 struct pack level_packs[MAX_LEVEL_PACKS];
53 
54 int found_pack_count;		/* How many packs were physically found */
55 int level_pack_count;		/* How many packs are in the list (historical entries from the rc are added to the end) */
56 int selected_pack;			/* Which pack in the list is currently selected */
57 
58 /* Function prototypes */
59 int level_init(void);
60 void create_userpack(void);
61 int find_all_dat_files(void);
62 void read_level_packs(void);
63 void sort_level_packs(void);
64 int load_level_data(int level_number);
65 
66 
67 
68 
69