File: medals.h

package info (click to toggle)
freespace2 3.7.0%2Brepack-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 22,848 kB
  • ctags: 41,897
  • sloc: cpp: 369,931; makefile: 1,060; xml: 129; sh: 112
file content (90 lines) | stat: -rw-r--r-- 2,058 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/



#ifndef FREESPACE_MEDAL_HEADER_FILE
#define FREESPACE_MEDAL_HEADER_FILE

#include "globalincs/globals.h"
#include "globalincs/pstypes.h"

struct scoring_struct;
struct player;

#define MAX_BADGES				3
#define MAX_ASSIGNABLE_MEDALS	12		// index into Medals array of the first medal which cannot be assigned

extern scoring_struct *Player_score;

// NUM_MEDALS stored in scoring.h since needed for player scoring structure

typedef struct medal_stuff {
	char	name[NAME_LENGTH];
	char	bitmap[MAX_FILENAME_LEN];
	int	num_versions;
	int	kills_needed;
	int badge_num;

	//If this is a badge (kills_needed > 1)
	char voice_base[MAX_FILENAME_LEN];
	char *promotion_text;

	medal_stuff() {
		name[0] = '\0';
		bitmap[0] = '\0';
		num_versions = 1;
		kills_needed = 0;
		badge_num = 0;
		voice_base[0] = '\0';
		promotion_text = NULL;
	}

	~medal_stuff() {
		if (promotion_text) {
			vm_free(promotion_text);
			promotion_text = NULL;
		}
	}

	medal_stuff(const medal_stuff &m) { clone(m); }
	const medal_stuff &operator=(const medal_stuff &m);

private:
	void clone(const medal_stuff &m);

} medal_stuff;

extern SCP_vector<medal_stuff> Medals;

extern void parse_medal_tbl();

// modes for this screen
#define MM_NORMAL				0		// normal - run through the state code
#define MM_POPUP				1		// called from within some other tight loop (don't use gameseq_ functions)

// main medals screen
void medal_main_init(player *pl,int mode = MM_NORMAL);

// return 0 if the screen should close (used for MM_POPUP mode)
int medal_main_do();
void medal_main_close();

void init_medal_bitmaps();
void init_snazzy_regions();
void blit_medals();
void blit_label(char *label,int *coords);
void blit_callsign();

// individual medals
void medals_translate_name(char *name, int max_len);

int medals_info_lookup(const char *name);

#endif