|
|
/* $Id$ */
|
|
|
|
|
|
/** @file company_manager_face.h Functionality related to the company manager's face */
|
|
|
|
|
|
#ifndef COMPANY_MANAGER_FACE_H
|
|
|
#define COMPANY_MANAGER_FACE_H
|
|
|
|
|
|
#include "core/random_func.hpp"
|
|
|
#include "core/bitmath_func.hpp"
|
|
|
#include "table/sprites.h"
|
|
|
#include "company_type.h"
|
|
|
|
|
|
/** The gender/race combinations that we have faces for */
|
|
|
enum GenderEthnicity {
|
|
|
GENDER_FEMALE = 0, ///< This bit set means a female, otherwise male
|
|
|
ETHNICITY_BLACK = 1, ///< This bit set means black, otherwise white
|
|
|
|
|
|
GE_WM = 0, ///< A male of Caucasian origin (white)
|
|
|
GE_WF = 1 << GENDER_FEMALE, ///< A female of Caucasian origin (white)
|
|
|
GE_BM = 1 << ETHNICITY_BLACK, ///< A male of African origin (black)
|
|
|
GE_BF = 1 << ETHNICITY_BLACK | 1 << GENDER_FEMALE, ///< A female of African origin (black)
|
|
|
GE_END,
|
|
|
};
|
|
@@ -219,16 +221,15 @@ static inline void RandomCompanyManagerF
|
|
|
* @param ge the gender and ethnicity of the face
|
|
|
* @pre _cmf_info[cmfv].valid_values[ge] != 0
|
|
|
* @return sprite to draw
|
|
|
*/
|
|
|
static inline SpriteID GetCompanyManagerFaceSprite(CompanyManagerFace cmf, CompanyManagerFaceVariable cmfv, GenderEthnicity ge)
|
|
|
{
|
|
|
assert(_cmf_info[cmfv].valid_values[ge] != 0);
|
|
|
|
|
|
return _cmf_info[cmfv].first_sprite[ge] + GB(cmf, _cmf_info[cmfv].offset, _cmf_info[cmfv].length);
|
|
|
}
|
|
|
|
|
|
void DrawCompanyManagerFace(CompanyManagerFace face, int color, int x, int y);
|
|
|
CompanyManagerFace ConvertFromOldCompanyManagerFace(uint32 face);
|
|
|
bool IsValidCompanyManagerFace(CompanyManagerFace cmf);
|
|
|
|
|
|
#endif /* COMPANY_MANAGER_FACE_H */
|