author | rubidium |
Tue, 30 Sep 2008 20:51:04 +0000 | |
changeset 10208 | 72c00af5c95d |
parent 10207 | src/player_face.h@c291a21b304e |
permissions | -rw-r--r-- |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
2 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
3 |
/** @file company_manager_face.h Functionality related to the company manager's face */ |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
4 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
5 |
#ifndef COMPANY_MANAGER_FACE_H |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
6 |
#define COMPANY_MANAGER_FACE_H |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
7 |
|
8131
160939e24ed3
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
rubidium
parents:
7928
diff
changeset
|
8 |
#include "core/random_func.hpp" |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
9 |
#include "core/bitmath_func.hpp" |
8131
160939e24ed3
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
rubidium
parents:
7928
diff
changeset
|
10 |
|
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
11 |
/** The gender/race combinations that we have faces for */ |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
12 |
enum GenderEthnicity { |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
13 |
GENDER_FEMALE = 0, ///< This bit set means a female, otherwise male |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
14 |
ETHNICITY_BLACK = 1, ///< This bit set means black, otherwise white |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
15 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
16 |
GE_WM = 0, ///< A male of Caucasian origin (white) |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
17 |
GE_WF = 1 << GENDER_FEMALE, ///< A female of Caucasian origin (white) |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
18 |
GE_BM = 1 << ETHNICITY_BLACK, ///< A male of African origin (black) |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
19 |
GE_BF = 1 << ETHNICITY_BLACK | 1 << GENDER_FEMALE, ///< A female of African origin (black) |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
20 |
GE_END, |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
21 |
}; |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
22 |
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity); ///< See GenderRace as a bitset |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
23 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
24 |
/** Bitgroups of the CompanyManagerFace variable */ |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
25 |
enum CompanyManagerFaceVariable { |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
26 |
CMFV_GENDER, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
27 |
CMFV_ETHNICITY, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
28 |
CMFV_GEN_ETHN, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
29 |
CMFV_HAS_MOUSTACHE, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
30 |
CMFV_HAS_TIE_EARRING, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
31 |
CMFV_HAS_GLASSES, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
32 |
CMFV_EYE_COLOUR, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
33 |
CMFV_CHEEKS, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
34 |
CMFV_CHIN, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
35 |
CMFV_EYEBROWS, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
36 |
CMFV_MOUSTACHE, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
37 |
CMFV_LIPS, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
38 |
CMFV_NOSE, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
39 |
CMFV_HAIR, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
40 |
CMFV_JACKET, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
41 |
CMFV_COLLAR, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
42 |
CMFV_TIE_EARRING, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
43 |
CMFV_GLASSES, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
44 |
CMFV_END |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
45 |
}; |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
46 |
DECLARE_POSTFIX_INCREMENT(CompanyManagerFaceVariable); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
47 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
48 |
/** Information about the valid values of CompanyManagerFace bitgroups as well as the sprites to draw */ |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
49 |
struct CompanyManagerFaceBitsInfo { |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
50 |
byte offset; ///< Offset in bits into the CompanyManagerFace |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
51 |
byte length; ///< Number of bits used in the CompanyManagerFace |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
52 |
byte valid_values[GE_END]; ///< The number of valid values per gender/ethnicity |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
53 |
SpriteID first_sprite[GE_END]; ///< The first sprite per gender/ethnicity |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
54 |
}; |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
55 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
56 |
/** Lookup table for indices into the CompanyManagerFace, valid ranges and sprites */ |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
57 |
static const CompanyManagerFaceBitsInfo _cmf_info[] = { |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
58 |
/* Index off len WM WF BM BF WM WF BM BF */ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
59 |
/* CMFV_GENDER */ { 0, 1, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< 0 = male, 1 = female |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
60 |
/* CMFV_ETHNICITY */ { 1, 2, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< 0 = (Western-)Caucasian, 1 = African(-American)/Black |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
61 |
/* CMFV_GEN_ETHN */ { 0, 3, { 4, 4, 4, 4 }, { 0, 0, 0, 0 } }, ///< Shortcut to get/set gender _and_ ethnicity |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
62 |
/* CMFV_HAS_MOUSTACHE */ { 3, 1, { 2, 0, 2, 0 }, { 0, 0, 0, 0 } }, ///< Females do not have a moustache |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
63 |
/* CMFV_HAS_TIE_EARRING */ { 3, 1, { 0, 2, 0, 2 }, { 0, 0, 0, 0 } }, ///< Draw the earring for females or not. For males the tie is always drawn. |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
64 |
/* CMFV_HAS_GLASSES */ { 4, 1, { 2, 2, 2, 2 }, { 0, 0, 0, 0 } }, ///< Whether to draw glasses or not |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
65 |
/* CMFV_EYE_COLOUR */ { 5, 2, { 3, 3, 1, 1 }, { 0, 0, 0, 0 } }, ///< Palette modification |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
66 |
/* CMFV_CHEEKS */ { 0, 0, { 1, 1, 1, 1 }, { 0x325, 0x326, 0x390, 0x3B0 } }, ///< Cheeks are only indexed by their gender/ethnicity |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
67 |
/* CMFV_CHIN */ { 7, 2, { 4, 1, 2, 2 }, { 0x327, 0x327, 0x391, 0x3B1 } }, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
68 |
/* CMFV_EYEBROWS */ { 9, 4, { 12, 16, 11, 16 }, { 0x32B, 0x337, 0x39A, 0x3B8 } }, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
69 |
/* CMFV_MOUSTACHE */ { 13, 2, { 3, 0, 3, 0 }, { 0x367, 0, 0x397, 0 } }, ///< Depends on CMFV_HAS_MOUSTACHE |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
70 |
/* CMFV_LIPS */ { 13, 4, { 12, 10, 9, 9 }, { 0x35B, 0x351, 0x3A5, 0x3C8 } }, ///< Depends on !CMFV_HAS_MOUSTACHE |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
71 |
/* CMFV_NOSE */ { 17, 3, { 8, 4, 4, 5 }, { 0x349, 0x34C, 0x393, 0x3B3 } }, ///< Depends on !CMFV_HAS_MOUSTACHE |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
72 |
/* CMFV_HAIR */ { 20, 4, { 9, 5, 5, 4 }, { 0x382, 0x38B, 0x3D4, 0x3D9 } }, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
73 |
/* CMFV_JACKET */ { 24, 2, { 3, 3, 3, 3 }, { 0x36B, 0x378, 0x36B, 0x378 } }, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
74 |
/* CMFV_COLLAR */ { 26, 2, { 4, 4, 4, 4 }, { 0x36E, 0x37B, 0x36E, 0x37B } }, |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
75 |
/* CMFV_TIE_EARRING */ { 28, 3, { 6, 3, 6, 3 }, { 0x372, 0x37F, 0x372, 0x3D1 } }, ///< Depends on CMFV_HAS_TIE_EARRING |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
76 |
/* CMFV_GLASSES */ { 31, 1, { 2, 2, 2, 2 }, { 0x347, 0x347, 0x3AE, 0x3AE } } ///< Depends on CMFV_HAS_GLASSES |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
77 |
}; |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
78 |
assert_compile(lengthof(_cmf_info) == CMFV_END); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
79 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
80 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
81 |
* Gets the company manager's face bits for the given company manager's face variable |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
82 |
* @param cmf the face to extract the bits from |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
83 |
* @param cmfv the face variable to get the data of |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
84 |
* @param ge the gender and ethnicity of the face |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
85 |
* @pre _cmf_info[cmfv].valid_values[ge] != 0 |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
86 |
* @return the requested bits |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
87 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
88 |
static inline uint GetCompanyManagerFaceBits(CompanyManagerFace cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge) |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
89 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
90 |
assert(_cmf_info[cmfv].valid_values[ge] != 0); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
91 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
92 |
return GB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
93 |
} |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
94 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
95 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
96 |
* Sets the company manager's face bits for the given company manager's face variable |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
97 |
* @param cmf the face to write the bits to |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
98 |
* @param cmfv the face variable to write the data of |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
99 |
* @param ge the gender and ethnicity of the face |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
100 |
* @param val the new value |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
101 |
* @pre val < _cmf_info[cmfv].valid_values[ge] |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
102 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
103 |
static inline void SetCompanyManagerFaceBits(CompanyManagerFace &cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge, uint val) |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
104 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
105 |
assert(val < _cmf_info[cmfv].valid_values[ge]); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
106 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
107 |
SB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length, val); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
108 |
} |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
109 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
110 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
111 |
* Increase/Decrease the company manager's face variable by the given amount. |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
112 |
* If the new value greater than the max value for this variable it will be set to 0. |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
113 |
* Or is it negativ (< 0) it will be set to max value. |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
114 |
* |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
115 |
* @param cmf the company manager face to write the bits to |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
116 |
* @param cmfv the company manager face variable to write the data of |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
117 |
* @param ge the gender and ethnicity of the company manager's face |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
118 |
* @param amount the amount which change the value |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
119 |
* |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
120 |
* @pre 0 <= val < _cmf_info[cmfv].valid_values[ge] |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
121 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
122 |
static inline void IncreaseCompanyManagerFaceBits(CompanyManagerFace &cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge, int8 amount) |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
123 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
124 |
int8 val = GetCompanyManagerFaceBits(cmf, cmfv, ge) + amount; // the new value for the cmfv |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
125 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
126 |
/* scales the new value to the correct scope */ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
127 |
if (val >= _cmf_info[cmfv].valid_values[ge]) { |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
128 |
val = 0; |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
129 |
} else if (val < 0) { |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
130 |
val = _cmf_info[cmfv].valid_values[ge] - 1; |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
131 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
132 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
133 |
SetCompanyManagerFaceBits(cmf, cmfv, ge, val); // save the new value |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
134 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
135 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
136 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
137 |
* Checks whether the company manager's face bits have a valid range |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
138 |
* @param cmf the face to extract the bits from |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
139 |
* @param cmfv the face variable to get the data of |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
140 |
* @param ge the gender and ethnicity of the face |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
141 |
* @return true if and only if the bits are valid |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
142 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
143 |
static inline bool AreCompanyManagerFaceBitsValid(CompanyManagerFace cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge) |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
144 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
145 |
return GB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length) < _cmf_info[cmfv].valid_values[ge]; |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
146 |
} |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
147 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
148 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
149 |
* Scales a company manager's face bits variable to the correct scope |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
150 |
* @param cmfv the face variable to write the data of |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
151 |
* @param ge the gender and ethnicity of the face |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
152 |
* @param val the to value to scale |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
153 |
* @pre val < (1U << _cmf_info[cmfv].length), i.e. val has a value of 0..2^(bits used for this variable)-1 |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
154 |
* @return the scaled value |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
155 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
156 |
static inline uint ScaleCompanyManagerFaceValue(CompanyManagerFaceVariable cmfv, GenderEthnicity ge, uint val) |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
157 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
158 |
assert(val < (1U << _cmf_info[cmfv].length)); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
159 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
160 |
return (val * _cmf_info[cmfv].valid_values[ge]) >> _cmf_info[cmfv].length; |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
161 |
} |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
162 |
|
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
163 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
164 |
* Scales all company manager's face bits to the correct scope |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
165 |
* |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
166 |
* @param cmf the company manager's face to write the bits to |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
167 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
168 |
static inline void ScaleAllCompanyManagerFaceBits(CompanyManagerFace &cmf) |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
169 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
170 |
IncreaseCompanyManagerFaceBits(cmf, CMFV_ETHNICITY, GE_WM, 0); // scales the ethnicity |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
171 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
172 |
GenderEthnicity ge = (GenderEthnicity)GB(cmf, _cmf_info[CMFV_GEN_ETHN].offset, _cmf_info[CMFV_GEN_ETHN].length); // gender & ethnicity of the face |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
173 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
174 |
/* Is a male face with moustache. Need to reduce CPU load in the loop. */ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
175 |
bool is_moust_male = !HasBit(ge, GENDER_FEMALE) && GetCompanyManagerFaceBits(cmf, CMFV_HAS_MOUSTACHE, ge) != 0; |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
176 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
177 |
for (CompanyManagerFaceVariable cmfv = CMFV_EYE_COLOUR; cmfv < CMFV_END; cmfv++) { // scales all other variables |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
178 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
179 |
/* The moustache variable will be scaled only if it is a male face with has a moustache */ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
180 |
if (cmfv != CMFV_MOUSTACHE || is_moust_male) { |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
181 |
IncreaseCompanyManagerFaceBits(cmf, cmfv, ge, 0); |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
182 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
183 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
184 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
185 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
186 |
/** |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
187 |
* Make a random new face. |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
188 |
* If it is for the advanced company manager's face window then the new face have the same gender |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
189 |
* and ethnicity as the old one, else the gender is equal and the ethnicity is random. |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
190 |
* |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
191 |
* @param cmf the company manager's face to write the bits to |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
192 |
* @param ge the gender and ethnicity of the old company manager's face |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
193 |
* @param adv if it for the advanced company manager's face window |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
194 |
* |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
195 |
* @pre scale 'ge' to a valid gender/ethnicity combination |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
196 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
197 |
static inline void RandomCompanyManagerFaceBits(CompanyManagerFace &cmf, GenderEthnicity ge, bool adv) |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
198 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
199 |
cmf = InteractiveRandom(); // random all company manager's face bits |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
200 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
201 |
/* scale ge: 0 == GE_WM, 1 == GE_WF, 2 == GE_BM, 3 == GE_BF (and maybe in future: ...) */ |
7741
10282edeb81f
(svn r11278) -Fix [FS#1342] (r11269): modulo result can be negative for signed int
glx
parents:
7734
diff
changeset
|
202 |
ge = (GenderEthnicity)((uint)ge % GE_END); |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
203 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
204 |
/* set the gender (and ethnicity) for the new company manager's face */ |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
205 |
if (adv) { |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
206 |
SetCompanyManagerFaceBits(cmf, CMFV_GEN_ETHN, ge, ge); |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
207 |
} else { |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
208 |
SetCompanyManagerFaceBits(cmf, CMFV_GENDER, ge, HasBit(ge, GENDER_FEMALE)); |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
209 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
210 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
211 |
/* scales all company manager's face bits to the correct scope */ |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
212 |
ScaleAllCompanyManagerFaceBits(cmf); |
7734
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
213 |
} |
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
214 |
|
627817106768
(svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents:
6345
diff
changeset
|
215 |
/** |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
216 |
* Gets the sprite to draw for the given company manager's face variable |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
217 |
* @param cmf the face to extract the data from |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
218 |
* @param cmfv the face variable to get the sprite of |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
219 |
* @param ge the gender and ethnicity of the face |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
220 |
* @pre _cmf_info[cmfv].valid_values[ge] != 0 |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
221 |
* @return sprite to draw |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
222 |
*/ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
223 |
static inline SpriteID GetCompanyManagerFaceSprite(CompanyManagerFace cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge) |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
224 |
{ |
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
225 |
assert(_cmf_info[cmfv].valid_values[ge] != 0); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
226 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
227 |
return _cmf_info[cmfv].first_sprite[ge] + GB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
228 |
} |
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
229 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
230 |
void DrawCompanyManagerFace(CompanyManagerFace face, int color, int x, int y); |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
231 |
CompanyManagerFace ConvertFromOldCompanyManagerFace(uint32 face); |
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
232 |
bool IsValidCompanyManagerFace(CompanyManagerFace cmf); |
6190
01a2b579b668
(svn r8969) -Codechange: rework of the player face bits.
rubidium
parents:
diff
changeset
|
233 |
|
10207
c291a21b304e
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents:
9652
diff
changeset
|
234 |
#endif /* COMPANY_MANAGER_FACE_H */ |