Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
style.h File Reference

Go to the source code of this file.

Data Structures

struct  nation_style
 
struct  music_style
 

Macros

#define styles_iterate(_p)
 
#define styles_iterate_end
 
#define styles_re_active_iterate(_p)
 
#define styles_re_active_iterate_end
 
#define music_styles_iterate(_p)
 
#define music_styles_iterate_end
 
#define music_styles_re_active_iterate(_p)    music_styles_iterate(_p)
 
#define music_styles_re_active_iterate_end    music_styles_iterate_end;
 

Functions

void styles_alloc (int count)
 
void styles_free (void)
 
int style_count (void)
 
int style_number (const struct nation_style *pstyle)
 
int style_index (const struct nation_style *pstyle)
 
struct nation_stylestyle_by_number (int id)
 
const charstyle_name_translation (const struct nation_style *pstyle)
 
const charstyle_rule_name (const struct nation_style *pstyle)
 
struct nation_stylestyle_by_rule_name (const char *name)
 
void music_styles_alloc (int count)
 
void music_styles_free (void)
 
int music_style_number (const struct music_style *pms)
 
struct music_stylemusic_style_by_number (int id)
 
struct music_styleplayer_music_style (struct player *plr)
 
int style_of_city (const struct city *pcity)
 
int basic_city_style_for_style (struct nation_style *pstyle)
 
int city_style (struct city *pcity)
 

Macro Definition Documentation

◆ music_styles_iterate

#define music_styles_iterate (   _p)
Value:
{ \
int _i_; \
if (_p != NULL) {
char * incite_cost
Definition comments.c:75
struct civ_game game
Definition game.c:62
struct packet_ruleset_control control
Definition game.h:83
struct music_style * music_style_by_number(int id)
Definition style.c:171

Definition at line 72 of file style.h.

◆ music_styles_iterate_end

#define music_styles_iterate_end
Value:
} \
} \
}

Definition at line 79 of file style.h.

◆ music_styles_re_active_iterate

#define music_styles_re_active_iterate (   _p)     music_styles_iterate(_p)

Definition at line 85 of file style.h.

◆ music_styles_re_active_iterate_end

#define music_styles_re_active_iterate_end    music_styles_iterate_end;

Definition at line 88 of file style.h.

◆ styles_iterate

#define styles_iterate (   _p)
Value:
{ \
int _i_; \
struct nation_style * style_by_number(int id)
Definition style.c:88

Definition at line 46 of file style.h.

◆ styles_iterate_end

#define styles_iterate_end
Value:
} \
}

Definition at line 52 of file style.h.

◆ styles_re_active_iterate

#define styles_re_active_iterate (   _p)
Value:
if (!_p->ruledit_disabled) {
#define styles_iterate(_p)
Definition style.h:46

Definition at line 56 of file style.h.

◆ styles_re_active_iterate_end

#define styles_re_active_iterate_end
Value:
} \
#define styles_iterate_end
Definition style.h:52

Definition at line 60 of file style.h.

Function Documentation

◆ basic_city_style_for_style()

int basic_city_style_for_style ( struct nation_style pstyle)

Return basic city style representing nation style.

Definition at line 210 of file style.c.

Referenced by create_races_dialog(), popup_races_dialog(), races_dialog::races_dialog(), sanity_check_ruleset_data(), and select_nation().

◆ city_style()

int city_style ( struct city pcity)

Return citystyle of the city.

Definition at line 241 of file style.c.

Referenced by city_style_refresh(), get_sample_city_surface(), sg_load_player_city(), and sg_load_player_city().

◆ music_style_by_number()

struct music_style * music_style_by_number ( int  id)

Return music style of given id.

Definition at line 171 of file style.c.

Referenced by handle_ruleset_music(), load_ruleset_styles(), and start_style_music().

◆ music_style_number()

int music_style_number ( const struct music_style pms)

Return the music style id.

Definition at line 161 of file style.c.

Referenced by package_player_common().

◆ music_styles_alloc()

void music_styles_alloc ( int  count)

Initialise music styles structures.

Definition at line 133 of file style.c.

Referenced by handle_ruleset_control(), and load_ruleset_styles().

◆ music_styles_free()

void music_styles_free ( void  )

Free the memory associated with music styles

Definition at line 148 of file style.c.

Referenced by game_ruleset_free().

◆ player_music_style()

struct music_style * player_music_style ( struct player plr)

Return music style for player

Definition at line 185 of file style.c.

Referenced by package_player_common().

◆ style_by_number()

struct nation_style * style_by_number ( int  id)

◆ style_by_rule_name()

struct nation_style * style_by_rule_name ( const char name)

Returns style matching rule name or NULL if there is no style with such name.

Definition at line 117 of file style.c.

Referenced by load_ruleset_nations(), playernation_command(), sg_load_player_main(), sg_load_player_main(), and universal_value_from_str().

◆ style_count()

int style_count ( void  )

Return the number of styles.

Definition at line 60 of file style.c.

◆ style_index()

int style_index ( const struct nation_style pstyle)

Return the style index.

Definition at line 78 of file style.c.

Referenced by load_style_names(), and send_ruleset_styles().

◆ style_name_translation()

const char * style_name_translation ( const struct nation_style pstyle)

Return the (translated) name of the style. You don't have to free the return pointer.

Definition at line 99 of file style.c.

Referenced by races_dialog::races_dialog(), req_text_insert(), universal_name_translation(), and worklist_item_postpone_req_vec().

◆ style_number()

int style_number ( const struct nation_style pstyle)

◆ style_of_city()

int style_of_city ( const struct city pcity)

Evaluate which style should be used to draw a city.

Definition at line 202 of file style.c.

Referenced by get_citizen_sprite(), get_city_sprite(), popup_city_cma_dialog(), and real_city_dialog_popup().

◆ style_rule_name()

const char * style_rule_name ( const struct nation_style pstyle)

Return the (untranslated) rule name of the style. You don't have to free the return pointer.

Definition at line 108 of file style.c.

Referenced by sanity_check_ruleset_data(), save_nation(), sg_load_player_main(), sg_load_player_main(), sg_save_player_main(), style_by_rule_name(), universal_kind_values(), and universal_rule_name().

◆ styles_alloc()

void styles_alloc ( int  count)

Initialise styles structures.

Definition at line 36 of file style.c.

Referenced by handle_ruleset_control(), and load_style_names().

◆ styles_free()

void styles_free ( void  )

Free the memory associated with styles

Definition at line 51 of file style.c.

Referenced by game_ruleset_free().