Next: libmat, Previous: libldr, Up: C API [Contents][Index]

### 5.31 libmap

#### 5.31.1 Overview

View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/map/index.html.

#### 5.31.2 API

Function: void lw6map_body_builtin_custom (lw6map_body_t * body, int w, int h, int d, int noise_percent, const lw6map_rules_t * rules)

  body: the body to initialize

  w: the width

  h: the height

  d: the depth

  noise_percent: the noise level to fill meta layers with

  rules: the map rules

  Sets up a default body structure.

  Return value: none

Function: void lw6map_body_clear (lw6map_body_t * body)

  body: the structure to clear

  Clears a body structure.

  Return value: none.

Function: void lw6map_body_fix_checksum (lw6map_body_t * body)

  body: the structure to update

  Updates (calculates) the checksum of a map body structure.

  Return value: none.

Function: int lw6map_body_check_and_fix_holes (lw6map_body_t * body, const lw6map_rules_t * rules)

  body: the structure to update

  rules: the game rules

  This (fundamental) function ensures that all playable areas in a map are connected. If isolated zones are found out, then they are marked as walls and not used any more.

  Return value: none.

Function: int lw6map_body_coord_from_texture (lw6map_level_t * level, int * body_x, int * body_y, int texture_x, int texture_y)

  level: the level to work on

  body_x: the body (logical) x coord

  body_y: the body (logical) y coord

  texture_x: the texture x coord

  texture_y: the texture y coord

  Gets body (logical) coords from texture position.

  Return value: 1 on success, 0 on failure (out of bounds)

Function: u_int8_t lw6map_body_get_with_texture_coord (lw6map_level_t * level, int texture_x, int texture_y, int z)

  level: the level to work on

  texture_x: the texture x coord

  texture_y: the texture y coord

  z: the z position (depth related)

  Tells wether a given map position is free or not, but using texture coords.

  Return value: 1 if position is playable, 0 if not (wall)

Function: void lw6map_color_invert (lw6map_color_couple_t * color)

  color: the color to invert

  Inverts a color couple, that is, replace fg by bg and vice-versa.

  Return value: none.

Function: int lw6map_color_is_same (const lw6map_color_couple_t * color1, const lw6map_color_couple_t * color2)

  color1: 1st color to compare

  color2: 2nd color to compare

  Compares two colors.

  Return value: 1 if equal, 0 if not.

Function: char * lw6map_team_color_index_to_key (int index)

  index: index of the color between 0 & 9

  Transforms a team color index into its readable string form, which can be used in config files for instance.

  Return value: a string, must *not* be freed.

Function: int lw6map_team_color_key_to_index (const char * key)

  key: key of the color, for instance "red"

  The index of the color, between 0 & 9

  Return value: an integer.

Function: char * lw6map_team_color_index_to_label (int index)

  index: index of the color between 0 & 9

  Transforms a team color index into its readable string form, which can be used to display information to players.

  Return value: a string, must *not* be freed.

Function: void lw6map_coords_fix_xy (const lw6map_rules_t * rules, const lw6sys_whd_t * shape, int * x, int * y)

  rules: set of rules to use

  shape: shape of the map

  x: x coord (in/out param)

  y: y coord (in/out param)

  Fixes the x and y values so that it’s always inside the map. This function will read the rules and if there’s some polarity enable, will do the right thing, for instance, a fighter too much on the right might reapper on the left side of the map.

  Return value: none.

Function: void lw6map_coords_fix_z (const lw6map_rules_t * rules, const lw6sys_whd_t * shape, int * z)

  rules: set of rules to use

  shape: shape of the map

  z: z coord (in/out param)

  Fixes the z value so that it’s always inside the map. This function will read the rules and if there’s some polarity enable, will do the right thing, for instance, a fighter too low it might reapper on top.

  Return value: none.

Function: void lw6map_cursor_texture_clear (lw6map_cursor_texture_t * cursor_texture)

  cursor_texture: the cursor texture to clear

  Clears a cursor texture (set it all transparent).

  Return value: none

Function: void lw6map_cursor_texture_builtin (lw6map_cursor_texture_t * cursor_texture)

  cursor_texture: the cursor texture to clear

  Sets a cursor texture to the builtin defauts, that is a circle that is black on the outside and gets white/transparent in the middle.

  Return value: none

Function: void lw6map_cursor_texture_layer_set (lw6map_cursor_texture_layer_t * cursor_texture_layer, int x, int y, lw6sys_color_8_t color)

  cursor_texture_layer: the cursor texture_layer to change

  x: x coord

  y: y coord

  color: the color

  Sets a pixel in the cursor texture_layer.

  Return value: none

Function: lw6sys_color_8_t lw6map_cursor_texture_layer_get (lw6map_cursor_texture_layer_t * cursor_texture_layer, int x, int y)

  cursor_texture_layer: the cursor texture_layer to query

  x: x coord

  y: y coord

  Gets a pixel in the cursor texture_layer.

  Return value: the color

Function: lw6map_level_t * lw6map_dup (lw6map_level_t * source, lw6sys_progress_t * progress)

  source: the map to copy

  progress: to show advancement

  Performs a deep copy of the map, all elements are newly allocated and source can safely be destroyed after it’s been duplicated.

  Return value: a newly allocated map, may be NULL.

Function: int lw6map_exp_get_highest_team_color_allowed (int exp)

  exp: the player experience

  Gets the highest color available for a given exp.

  Return value: a color id

Function: int lw6map_exp_get_highest_weapon_allowed (int exp)

  exp: the player experience

  Gets the highest weapon available for a given exp.

  Return value: a weapon id

Function: int lw6map_exp_is_team_color_allowed (const lw6map_rules_t * rules, int team_color_id)

  rules: set of rules to use

  team_color_id: color id to test

  Tests wether a team color is allowed for a given set of rules.

  Return value: 1 if allowed, 0 if not.

Function: int lw6map_exp_is_weapon_allowed (const lw6map_rules_t * rules, int weapon_id)

  rules: set of rules to use

  weapon_id: weapon id to test

  Tests wether a weapon is allowed for a given set of rules.

  Return value: 1 if allowed, 0 if not.

Function: int lw6map_exp_get_unlocked_team_color (int exp)

  exp: exp to test

  Get the unlocked team color for a given exp, if applyable.

  Return value: -1 if nothing unlocked, else the team color

Function: int lw6map_exp_get_unlocked_weapon (int exp)

  exp: exp to test

  Get the unlocked primary weapon for a given exp, if applyable.

  Return value: -1 if nothing unlocked, else the weapon id

Function: char * lw6map_to_hexa (lw6map_level_t * level)

  Converts a map to something that is later readable by `lw6map_from_hexa` to reproduce the exact same map. Just a serializer.

  Return value: a newly allocated pointer, NULL if conversion failed.

Function: lw6map_level_t * lw6map_from_hexa (const char * hexa)

  hexa: an hexadecimal ASCII string, created by `lw6map_to_hexa`

  Constructs a map from an hexadecimal string generated by `lw6map_to_hexa`. Just an un-serializer.

  Return value: a new map, might be NULL if string isn’t correct.

Function: void lw6map_layer_builtin_custom (lw6map_layer_t * layer, int w, int h)

  layer: the layer to init

  w: width

  h: height

  Creates a default layer. This is mostly for testing purposes, the default layer is not empty, it contains a simplified map of the world.

  Return value: none

Function: void lw6map_layer_clear (lw6map_layer_t * layer)

  layer: the layer to init

  Clears a layer struct. This means freeing the pointer if it’s non NULL and setting everything to 0.

  Return value: none

Function: lw6map_level_t * lw6map_new ()

  Creates a new empty map. This object is perfectly unusable as is, since it has a 0x0 size, and many things set to "NULL". Still, it’s used internally and is the canonical way to create the object, it ensures later calls that set up default parameters, for instance, will succeed.

  Return value: a newly allocated pointer.

Function: lw6map_level_t * lw6map_builtin_defaults ()

  Creates a map, set to defaults. This is usefull mostly for testing. This builtin map has walls, paths, it’s playable.

  Return value: a newly allocated map.

Function: lw6map_level_t * lw6map_builtin_scale (int percent_factor)

  percent_factor: how big the map should be, 100 is defaults 200 is double.

  Creates a map, set to defaults. This is usefull mostly for testing. This builtin map has walls, paths, it’s playable, additionnally it’s scalable, that’s to say one can make it bigger if needed, using a percent factor.

  Return value: a newly allocated map.

Function: lw6map_level_t * lw6map_builtin_custom (int w, int h, int d, int noise_percent)

  w: the width of the map

  h: the height of the map

  d: the depth (number of layers) of the map

  noise_percent: percentage of noise to use for metalayers

  Creates a map, set to defaults. This is usefull mostly for testing. This one, unlike `lw6map_builtin_defaults` will let you give a width, height and a depth.

  Return value: a newly allocated map.

Function: void lw6map_free (lw6map_level_t * level)

  Frees a map and releases all its internal ressources.

  Return value: none.

Function: int lw6map_memory_footprint (lw6map_level_t * level)

  Reports how many bytes the map needs, in memory. Note that this is not contiguous memory, it involves a bunch of pointers, and possibly much more...

Function: char * lw6map_repr (lw6map_level_t * level)

  Returns a string describing the map. This is a very short description, use it for logs, and to debug stuff. By no means it’s a complete exhaustive description. Still, the string returned should be unique.

  Return value: a dynamically allocated string.

Function: int lw6map_is_same (const lw6map_level_t * level_a, const lw6map_level_t * level_b)

  level_a: the first level to compare

  level_b: the other level to compare

  Compares two level structs, the idea is to compare the content, not only the pointers and level ids.

  Return value: 1 if they’re the same, 0 if not.

Function: const char * lw6map_get_title (lw6map_level_t * level)

  level: level to get informations about

  Gives the map name. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

  Return value: static string, must not be freed, can’t be NULL

Function: int lw6map_get_max_nb_colors (const lw6map_level_t * level)

  level: level to get informations about

  Gives the max number of colors (AKA teams) that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

  Return value: number of colors, taken from rules

Function: int lw6map_get_max_nb_cursors (const lw6map_level_t * level)

  level: level to get informations about

  Gives the max number of cursors that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

  Return value: number of cursors, taken from rules

Function: int lw6map_get_max_nb_nodes (const lw6map_level_t * level)

  level: level to get informations about

  Gives the max number of nodes that can fit on this map. This is just a simple utility/wrapper function which is meant to be exported to Guile scripts.

  Return value: number of nodes, taken from rules

Function: int lw6map_local_info_set_music_dir (lw6map_local_info_t * local_info, const char * music_dir)

  local_info: the structure to modify

  music_dir: the new music_dir value

  Sets the music_dir value, in a ’safe’ manner, freeing any previous value and performing a string duplication.

  Return value: 1 on success, 0 on failure.

Function: void lw6map_local_info_clear (lw6map_local_info_t * local_info)

  local_info: the structure to clear

  Clears the local_info structure, before destroying a level for instance.

  Return value: none

Function: void lw6map_metadata_defaults (lw6map_metadata_t * metadata)

  metadata: struct to set to defaults

  Sets the metadata struct to defaults, this does not set fields to NULL/empty values, but rather fills it with data claiming, for instance, that this is a default map.

  Return value: none.

Function: void lw6map_metadata_clear (lw6map_metadata_t * metadata)

  metadata: struct to clear

  Clears a metadata, will expect it to be in a consistent state, that is either filled with proper values or completely zeroed.

  Return value: none.

Function: int lw6map_metadata_is_same (const lw6map_metadata_t * metadata_a, const lw6map_metadata_t * metadata_b)

  metadata_a: first item to compare

  metadata_b: second item to compare

  Tells wether both metadata items contain the same values.

  Return value: 1 if same, 0 if different.

Function: void lw6map_meta_layer_set (lw6map_meta_layer_t * meta_layer, int x, int y, u_int8_t value)

  meta_layer: the meta_layer structure

  x: x coord

  y: y coord

  value: the value to set at this place

  Simple setter for the meta_layer struct.

  Return value: none

Function: u_int8_t lw6map_meta_layer_get (lw6map_meta_layer_t * meta_layer, int x, int y)

  meta_layer: the meta_layer structure

  x: x coord

  y: y coord

  Simple getter for the meta_layer struct.

  Return value: the value at this place

Function: void lw6map_meta_layer_clear (lw6map_meta_layer_t * meta_layer)

  meta_layer: the meta_layer to clear

  Clears a meta_layer struct. This means freeing the pointer if it’s non NULL and setting everything to 0.

  Return value: none

Function: int lw6map_meta_layer_builtin_custom (lw6map_meta_layer_t * meta_layer, int w, int h, int analog, int noise_percent, int seed)

  meta_layer: the object to init

  w: width

  h: height

  analog: wether to use analog mode (0-255) or boolean (0-1)

  noise_percent: the quantity of noise to initialise the layer with

  seed: a pseudo-random seed to feed the pseudo-random generator

  Builds a custom metalyer, suitable for tests or demo, letting the choice of its size and the noise to fill it with. If noise is 100 then metalayer is "full". If noise is 0, then meta layer is empty.

  Return value: 1 if OK, 0 on failure.

Function: void lw6map_param_zero (lw6map_param_t * param)

  param: struct to initialize

  Sets a param struct to zero, simply puts zero everywhere without checking what was here before

  Return value: none.

Function: void lw6map_param_defaults (lw6map_param_t * param)

  param: the param struct to modify

  Sets a param structure to its default value, note that current structured must be zeroed or correctly initialized.

  Return value: none

Function: void lw6map_param_clear (lw6map_param_t * param)

  param: the param struct to modify

  Resets a param structure to nothing. Note that current structured must be zeroed or correctly initialized. The idea is just to free member pointers before calling free.

  Return value: none

Function: void lw6map_param_copy (lw6map_param_t * dst, lw6map_param_t * src)

  dst: the destination param struct

  src: the source param struct

  Copies parameters. Both structures must be zeroed or correctly initialized.

  Return value: none

Function: int lw6map_param_set (lw6map_param_t * param, const char * key, const char * value)

  param: the param struct to modify

  key: the name of the parameter to modify

  value: the value of the parameter to modify

  Sets an entry in a param struct. All values must be submitted as strings, internally, the function will call atoi to convert to integers if needed, for instance. It will also dispatch automatically between rules, style and teams.

  Return value: 1 if parameter successfully set, 0 on error.

Function: char * lw6map_param_get (lw6map_param_t * param, const char * key)

  param: the param struct to query

  key: the name of the parameter to get

  Gets an entry from a param struct. All values returned as strings, do not use this in performance bottlenecks, this is just to export values to scripts, for instance.

  Return value: dynamically allocated string, NULL on error, might return a string containing 0 on bad keys.

Function: int lw6map_param_is_same (const lw6map_param_t * param_a, const lw6map_param_t * param_b)

  param_a: one struct to compare

  param_b: another struct to compare

  Compares the contents of two param structs.

  Return value: 1 if they contain the same thing, 0 if not

Function: void lw6map_rules_zero (lw6map_rules_t * rules)

  rules: struct to initialize

  Sets a rules struct to zero, simply puts zero everywhere without checking what was here before

  Return value: none.

Function: void lw6map_rules_defaults (lw6map_rules_t * rules)

  rules: struct to set to defaults

  Set rules to default values, as these are all integers, you can call this on any rules object.

  Return value: none.

Function: void lw6map_rules_copy (lw6map_rules_t * dst, const lw6map_rules_t * src)

  dst: destination (out param)

  src: source (in param)

  Copies the data from source to destination, simple wrapper on memcpy.

  Return value: none.

Function: void lw6map_rules_update_checksum (const lw6map_rules_t * rules, u_int32_t * checksum)

  rules: rules struct to check

  checksum: checksum to update (in/out param)

  Updates a checksum with the rules data.

  Return value: none.

Function: int32_t lw6map_rules_get_default (const char * key)

  key: key to query

  Get the default value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: integer.

Function: int32_t lw6map_rules_get_min (const char * key)

  key: key to query

  Get the min value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: integer.

Function: int32_t lw6map_rules_get_max (const char * key)

  key: key to query

  Get the min value for a given string key. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: integer.

Function: int32_t lw6map_rules_get_int (const lw6map_rules_t * rules, const char * key)

  rules: struct to use

  key: key to query

  Get the value for a given string key, as an integer. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: integer.

Function: int lw6map_rules_set_int (lw6map_rules_t * rules, const char * key, int32_t value)

  rules: struct to use

  key: key to set

  value: new integer value for key

  Set the value for a given string key, as an integer. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: 1 on success, 0 on failure (eg key not found)

Function: int lw6map_rules_get_bool (const lw6map_rules_t * rules, const char * key)

  rules: struct to use

  key: key to query

  Get the value for a given string key, as a boolean. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: boolean.

Function: int lw6map_rules_set_bool (lw6map_rules_t * rules, const char * key, int value)

  rules: struct to use

  key: key to set

  value: new boolean value for key

  Set the value for a given string key, as a boolean. Of course you could access the member, but this function internally does the conversion between readable string and actual struct offset.

  Return value: 1 on success, 0 on failure (eg key not found)

Function: void lw6map_rules_clear (lw6map_rules_t * rules)

  rules: struct to init

  Set rules to 0, this is not defaults, this is 0 (probably unusable as a real-world setting).

  Return value: none.

Function: int lw6map_rules_is_same (const lw6map_rules_t * rules_a, const lw6map_rules_t * rules_b)

  rules_a: first item to compare

  rules_b: second item to compare

  Compares two rules items. Will tell if they contain the same data.

  Return value: 1 if same, 0 if different.

Function: int lw6map_rules_sanity_check (const lw6map_rules_t * rules)

  rules: rules to check.

  Check wether the rules are within the acceptable range.

  Return value: 1 if same, 0 if different.

Function: void lw6map_style_zero (lw6map_style_t * style)

  style: struct to initialize

  Sets a style struct to zero, simply puts zero everywhere without checking what was here before

  Return value: none.

Function: void lw6map_style_defaults (lw6map_style_t * style)

  style: struct to modify

  Sets a style struct to defaults values, expects the object to be in a consistent style, that’s to say either containing real data or being zeroed.

  Return value: none.

Function: void lw6map_style_clear (lw6map_style_t * style)

  style: struct to clear

  Clears a style struct. This function won’t work on an unitialized structure, structure must be zeroed by some CALLOC or something, else automatic freeing of pointers will fail.

  Return value: none.

Function: void lw6map_style_copy (lw6map_style_t * dst, lw6map_style_t * src)

  dst: destination

  src: source

  Copies style data from source to destination. Like with clear, `dst` must be either initialized or totally zeroed, else function will fail (core dump)

  Return value: none.

Function: int lw6map_style_set (lw6map_style_t * style, const char * key, const char * value)

  style: style struct to modify (out param)

  key: key to use

  value: value to use

  Sets a style entry, takes string values and will identify the struct offset and convert the value to whatever C type is needed.

  Return value: 1 on success, 0 on failure (key not found)

Function: char * lw6map_style_get (lw6map_style_t * style, const char * key)

  style: style struct to query

  key: key to use

  Get a style entry, takes a string key and will identify the struct offset. The return value is converted to string, typically the cannonical representation suitable to write in an XML config file.

  Return value: dynamically allocated string.

Function: char * lw6map_style_get_default (const char * key)

  key: key to query

  Get the default value for a style entry. This is quite a cost-expensive function given what it does, indeed it will convert anything to a string, and also perform key lookup to fetch the value.

  Return value: dynamically allocated string.

Function: int lw6map_color_set_is_same (const lw6map_color_set_t * color_set_a, const lw6map_color_set_t * color_set_b)

  color_set_a: first item to compare

  color_set_b: second item to compare

  Compares two color sets, telling if they contain the same data.

  Return value: 1 if same, 0 if different.

Function: int lw6map_style_is_same (const lw6map_style_t * style_a, const lw6map_style_t * style_b)

  style_a: first item to compare

  style_b: second item to compare

  Compares two style structures, telling if they contain the same data.

  Return value: 1 if same, 0 if different.

Function: void lw6map_teams_zero (lw6map_teams_t * teams)

  teams: data to initialize

  Zeros the teams struct, this is not the same as setting to defaults.

  Return value: none.

Function: void lw6map_teams_defaults (lw6map_teams_t * teams)

  teams: data to initialize

  Set the teams struct to its defaults.

  Return value: none.

Function: void lw6map_teams_clear (lw6map_teams_t * teams)

  teams: data to initialize

  Clears the teams struct, this is not the same as setting to defaults. This one supposes the struct has been properly initialized, at least zeroed before usage, it might contain pointers which should be freed.

  Return value: none.

Function: void lw6map_teams_copy (lw6map_teams_t * dst, lw6map_teams_t * src)

  dst: destination

  src: source

  Copies the contents of the teams struct. It’s a real duplicate, any string is reallocated.

  Return value: none.

Function: int lw6map_teams_set (lw6map_teams_t * teams, const char * key, const char * value)

  teams: the teams to modify

  key: the key to modify

  value: the value to affect to the key, as a string

  Sets one single parameter in a teams structure. Value must always be passed as a string, will be converted to the right type automatically when storing it in the structure.

  Return value: 1 if success, 0 if failed. Note that while 0 really means there’s a problem, some affectations can fail and return 1, needs to be worked on.

Function: char * lw6map_teams_get (lw6map_teams_t * teams, const char * key)

  teams: the teams to modify

  key: the key to modify

  Gets one single parameter in a teams structure. Value is converted as a string.

  Return value: dynamically allocated string, NULL on error.

Function: char * lw6map_teams_get_default (const char * key)

  key: the key we want informations about.

  Gets the default value for a given teams key.

  Return value: dynamically allocated string, NULL on error.

Function: int lw6map_teams_is_same (const lw6map_teams_t * teams_a, const lw6map_teams_t * teams_b)

  teams_a: one struct to compare

  teams_b: another struct to compare

  Compares the contents of two teams structs.

  Return value: 1 if they contain the same thing, 0 if not

Function: int lw6map_test_register (int mode)

  mode: test mode (bitmask)

  Registers all tests for the libmap module.

  Return value: 1 if test is successfull, 0 on error.

Function: int lw6map_test_run (int mode)

  mode: test mode (bitmask)

  Runs the `map` module test suite, testing most (if not all...) functions.

  Return value: 1 if test is successfull, 0 on error.

Function: int lw6map_texture_from_body (lw6map_texture_t * texture, lw6map_body_t * body, lw6map_color_couple_t * color)

  texture: texture to load (out param)

  body: body to pick data from

  color: colors to use

  Will create a default bicolor texture from the body data, this is in case we don’t want to use the texture or there is none. Result is not beautifull but might be very comfortable to play.

  Return value: 1 on success, 0 on failure.

Function: void lw6map_texture_clear (lw6map_texture_t * texture)

  texture: data to clear

  Clears a texture object, expects it to be in a consitent state, either filled with real data of zeroed.

  Return value: none.

Function: int lw6map_texture_coord_from_body (lw6map_level_t * level, int * texture_x, int * texture_y, int body_x, int body_y)

  level: map to work on

  texture_x: texture x coordinate (out param)

  texture_y: texture y coordinate (out param)

  body_x: body x coordinate (in param)

  body_y: body y coordinate (in param)

  Translates from body coordinate space to texture coordinate space.

  Return value: 1 on success, 0 if failure.

Function: lw6sys_color_8_t lw6map_texture_get_with_body_coord (lw6map_level_t * level, int body_x, int body_y)

  level: map to use

  body_x: x coordinate in body space

  body_y: y coordinate in body space

  Get the color of a given point in the texture, using the body coordinate space.

  Return value: RGBA 8-bit color.

Function: int lw6map_texture_has_alpha (lw6map_texture_t * texture)

  texture: texture object to test

  Finds out if the texture is fully opaque or not. If it has an alpha layer (typically, PNG file) but this one is filled at 100% everywhere, then it will consider opaque. This is a slow function but the result is cached in the has_alpha member, so as the function is called at map loading, use the cached value instead.

  Return value: 1 if has used alpha layer, 0 if opaque.

Function: char * lw6map_weapon_index_to_key (int index)

  index: index of the weapon between 0 & 19

  Transforms a team weapon index into its readable string form, which can be used in config files for instance.

  Return value: a string, must *not* be freed.

Function: int lw6map_weapon_key_to_index (const char * key)

  key: key of the weapon, for instance "red"

  The index of the weapon, between 0 & 19

  Return value: an integer.

Function: char * lw6map_weapon_index_to_label (int index)

  index: index of the weapon between 0 & 19

  Transforms a team weapon index into its readable string form, which can be used to display information to players.

  Return value: a string, must *not* be freed.

Struct: lw6map_body_s

  Logical layers for the map. This is the big collection of bytes arrays containing most of the information, anything loaded from images (JPEG, PNG) from disk and having some logical (and not pure eye candy) meaning.

Member of lw6map_body_s: checksum

  Type: `int`

  Definition: `int lw6map_body_s::checksum`

  Checksum for this map body, we could recalculate it dynamically but it’s cached here for convenience and speed.

Member of lw6map_body_s: shape

  Type: `lw6sys_whd_t`

  Definition: `lw6sys_whd_t lw6map_body_s::shape`

  Shape of the map, all layers need to be compatible with this.

Member of lw6map_body_s: layers

  Type: `lw6map_layer_t`

  Definition: `lw6map_layer_t lw6map_body_s::layers[LW6MAP_MAX_BODY_DEPTH]`

  Layers, layer 0 is the top layer, the one stored in map.png, other layers are layerN.png. Not all layers are defined, just depends on body shape.

Member of lw6map_body_s: glue

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::glue`

  Informations stored in glue.png.

Member of lw6map_body_s: boost

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::boost`

  Informations stored in boost.png.

Member of lw6map_body_s: danger

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::danger`

  Informations stored in danger.png.

Member of lw6map_body_s: medicine

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::medicine`

  Informations stored in medicine.png.

Member of lw6map_body_s: one_way_north

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::one_way_north`

  Informations stored in one-way-north.png.

Member of lw6map_body_s: one_way_east

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::one_way_east`

  Informations stored in one-way-east.png.

Member of lw6map_body_s: one_way_south

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::one_way_south`

  Informations stored in one-way-south.png.

Member of lw6map_body_s: one_way_west

  Type: `lw6map_meta_layer_t`

  Definition: `lw6map_meta_layer_t lw6map_body_s::one_way_west`

  Informations stored in one-way-west.png.

Struct: lw6map_bot_info_s

  Bot information, contains the relevant generic parameters for a bot.

Member of lw6map_bot_info_s: color

  Type: `int`

  Definition: `int lw6map_bot_info_s::color`

  Team/color the bot is associated to.

Member of lw6map_bot_info_s: ai

  Type: `char *`

  Definition: `char* lw6map_bot_info_s::ai`

  AI engine used by bot, the name of the backend to load.

Struct: lw6map_color_couple_s

  This structure simply binds 2 colors together, one being foreground and the other background. There’s a good reason to bind those together, indeed foreground and background need to be different enough so that text written in fg over bg is readable, and they need to go together well.

Member of lw6map_color_couple_s: fg

  Type: `lw6sys_color_8_t`

  Definition: `lw6sys_color_8_t lw6map_color_couple_s::fg`

  Foreground color.

Member of lw6map_color_couple_s: bg

  Type: `lw6sys_color_8_t`

  Definition: `lw6sys_color_8_t lw6map_color_couple_s::bg`

  Background color.

Struct: lw6map_color_set_s

  Holds the complete color set for the game, including all color couples used for background, hud, menu, view, as well as team colors.

Member of lw6map_color_set_s: color_base

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::color_base`

  Base color couple.

Member of lw6map_color_set_s: color_alternate

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::color_alternate`

  Alternate color couple.

Member of lw6map_color_set_s: background_color_root

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::background_color_root`

  Background color couple for root image.

Member of lw6map_color_set_s: background_color_stuff

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::background_color_stuff`

  Background color couple for drawn stuff.

Member of lw6map_color_set_s: hud_color_frame

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::hud_color_frame`

  Hud color couple for frames.

Member of lw6map_color_set_s: hud_color_text

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::hud_color_text`

  Hud color couple for text.

Member of lw6map_color_set_s: menu_color_default

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::menu_color_default`

  Menu default color couple.

Member of lw6map_color_set_s: menu_color_selected

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::menu_color_selected`

  Menu color couple for selected items.

Member of lw6map_color_set_s: menu_color_disabled

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::menu_color_disabled`

  Menu color couple for disabled items.

Member of lw6map_color_set_s: view_color_cursor

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::view_color_cursor`

  Map view color couple for cursor.

Member of lw6map_color_set_s: view_color_map

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::view_color_map`

  Map view color couple for map.

Member of lw6map_color_set_s: system_color

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_color_set_s::system_color`

  System color couple (log messages).

Member of lw6map_color_set_s: team_color_dead

  Type: `lw6sys_color_8_t`

  Definition: `lw6sys_color_8_t lw6map_color_set_s::team_color_dead`

  Color to use for dead fighters.

Member of lw6map_color_set_s: team_colors

  Type: `lw6sys_color_8_t`

  Definition: `lw6sys_color_8_t lw6map_color_set_s::team_colors[LW6MAP_NB_TEAM_COLORS]`

  Team colors.

Struct: lw6map_cursor_texture_layer_s

  Contains a cursor texture layer, this is basically a fixed (64x64) sized array of colors.

Member of lw6map_cursor_texture_layer_s: data

  Type: `lw6sys_color_8_t`

  Definition: `lw6sys_color_8_t lw6map_cursor_texture_layer_s::data[LW6MAP_CURSOR_TEXTURE_SIZE][LW6MAP_CURSOR_TEXTURE_SIZE]`

  Color for each pixel.

Struct: lw6map_cursor_texture_s

  A cursor texture. It’s divided between a texture that will be colorized depending on the map and another texture which will be colorized depending on the team playing the cursor.

Member of lw6map_cursor_texture_s: fg_bg_layer

  Type: `lw6map_cursor_texture_layer_t`

  Definition: `lw6map_cursor_texture_layer_t lw6map_cursor_texture_s::fg_bg_layer`

  Layer to be colorized using foreground and background colors.

Member of lw6map_cursor_texture_s: color_layer

  Type: `lw6map_cursor_texture_layer_t`

  Definition: `lw6map_cursor_texture_layer_t lw6map_cursor_texture_s::color_layer`

  Layer to be colorized using team colors.

Struct: lw6map_layer_s

  A layer contains the actual data for a layer.

Member of lw6map_layer_s: shape

  Type: `lw6sys_whd_t`

  Definition: `lw6sys_whd_t lw6map_layer_s::shape`

  Shape of the layer. Z should be 1, logically.

Member of lw6map_layer_s: data

  Type: `u_int8_t *`

  Definition: `u_int8_t* lw6map_layer_s::data`

  Raw (byte) data.

Struct: lw6map_level_s

  This structure contains everything about a level, once it’s loaded from disk. It’s immutable, it cannot be changed once it’s loaded, and does not have any algorithm aware struct, this is just plain raw data, file data transformed into C struct.

Member of lw6map_level_s: id

  Type: `u_int32_t`

  Definition: `u_int32_t lw6map_level_s::id`

  The id of the object, this is non-zero and unique within one run session, incremented at each object creation.

Member of lw6map_level_s: metadata

  Type: `lw6map_metadata_t`

  Definition: `lw6map_metadata_t lw6map_level_s::metadata`

  Metadata (title, copyright, description, ...)

Member of lw6map_level_s: local_info

  Type: `lw6map_local_info_t`

  Definition: `lw6map_local_info_t lw6map_level_s::local_info`

  Informations that depend on the host loading the map.

Member of lw6map_level_s: body

  Type: `lw6map_body_t`

  Definition: `lw6map_body_t lw6map_level_s::body`

  All layers (bytes array) forming the map.

Member of lw6map_level_s: texture

  Type: `lw6map_texture_t`

  Definition: `lw6map_texture_t lw6map_level_s::texture`

  Texture used by the map.

Member of lw6map_level_s: cursor_texture

  Type: `lw6map_cursor_texture_t`

  Definition: `lw6map_cursor_texture_t lw6map_level_s::cursor_texture`

  Cursor texture.

Member of lw6map_level_s: param

  Type: `lw6map_param_t`

  Definition: `lw6map_param_t lw6map_level_s::param`

  All map parameters.

Struct: lw6map_local_info_s

  Local info is for fields which can be exploited locally, but make no sense if transfered to another computer, over the network for instance. This is typically something which will be updated by the ldr module or some other external code, but it’s not directly linked to the content of the map itself.

Member of lw6map_local_info_s: music_dir

  Type: `char *`

  Definition: `char* lw6map_local_info_s::music_dir`

  Directory where music files can be loaded.

Struct: lw6map_metadata_s

  Content of metadata.xml stored into a C struct.

Member of lw6map_metadata_s: title

  Type: `char *`

  Definition: `char* lw6map_metadata_s::title`

  Title of the map.

Member of lw6map_metadata_s: author

  Type: `char *`

  Definition: `char* lw6map_metadata_s::author`

  Author of the map.

Member of lw6map_metadata_s: description

  Type: `char *`

  Definition: `char* lw6map_metadata_s::description`

  Description of the map.

Member of lw6map_metadata_s: license

  Type: `char *`

  Definition: `char* lw6map_metadata_s::license`

  License of the map (short, like GPLv2+ or GPLv3+).

Member of lw6map_metadata_s: vanilla_exp

  Type: `int`

  Definition: `int lw6map_metadata_s::vanilla_exp`

  Exp as stored in the XML file of the map.

Struct: lw6map_meta_layer_s

  A meta layer is a special layer which contains, for instance, informations such as where there’s a special trick like glue.

Member of lw6map_meta_layer_s: shape

  Type: `lw6sys_whd_t`

  Definition: `lw6sys_whd_t lw6map_meta_layer_s::shape`

  Shape of the metalayer.

Member of lw6map_meta_layer_s: data

  Type: `u_int8_t *`

  Definition: `u_int8_t* lw6map_meta_layer_s::data`

  Raw (byte) data.

Struct: lw6map_param_s

  All parameters in a map, indludes rules, style and teams.

Member of lw6map_param_s: rules

  Type: `lw6map_rules_t`

  Definition: `lw6map_rules_t lw6map_param_s::rules`

  Content of rules.xml.

Member of lw6map_param_s: style

  Type: `lw6map_style_t`

  Definition: `lw6map_style_t lw6map_param_s::style`

  Content of style.xml.

Member of lw6map_param_s: teams

  Type: `lw6map_teams_t`

  Definition: `lw6map_teams_t lw6map_param_s::teams`

  Content of teams.xml.

Struct: lw6map_rules_s

  Content of rules.xml stored into a C struct. This structure is used a lot, it needs to be like this for we don’t want to parse (even a hash) each time we want a param so we need it in a real C struct. In this structure, it’s important, fundamental, that floats are never ever used in map rules. In fact, we need maps to be 100,00 (lots of zeroes) predictable, given some identical user actions. Using floats could lead us to very slight differences (floats are never accurate, especially when you run calculus on different hardwares) which could, with time, become very important. Sort of a "butterfly effect". So well, we use int. Int32 to be exact.

Member of lw6map_rules_s: total_time

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::total_time`

  total_time parameter, stored as an integer.

Member of lw6map_rules_s: respawn_team

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::respawn_team`

  respawn_team parameter, stored as an integer.

Member of lw6map_rules_s: respawn_position_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::respawn_position_mode`

  respawn_position_mode parameter, stored as an integer.

Member of lw6map_rules_s: respawn_delay

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::respawn_delay`

  respawn_delay parameter, stored as an integer.

Member of lw6map_rules_s: moves_per_round

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::moves_per_round`

  moves_per_round parameter, stored as an integer.

Member of lw6map_rules_s: spreads_per_round

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::spreads_per_round`

  spreads_per_round parameter, stored as an integer.

Member of lw6map_rules_s: rounds_per_sec

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::rounds_per_sec`

  rounds_per_sec parameter, stored as an integer.

Member of lw6map_rules_s: fighter_attack

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::fighter_attack`

  fighter_attack parameter, stored as an integer.

Member of lw6map_rules_s: fighter_defense

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::fighter_defense`

  fighter_defense parameter, stored as an integer.

Member of lw6map_rules_s: fighter_new_health

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::fighter_new_health`

  fighter_new_health parameter, stored as an integer.

Member of lw6map_rules_s: fighter_regenerate

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::fighter_regenerate`

  fighter_regenerate parameter, stored as an integer.

Member of lw6map_rules_s: side_attack_factor

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::side_attack_factor`

  side_attack_factor parameter, stored as an integer.

Member of lw6map_rules_s: side_defense_factor

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::side_defense_factor`

  side_defense_factor parameter, stored as an integer.

Member of lw6map_rules_s: nb_move_tries

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::nb_move_tries`

  nb_move_tries parameter, stored as an integer.

Member of lw6map_rules_s: nb_attack_tries

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::nb_attack_tries`

  nb_attack_tries parameter, stored as an integer.

Member of lw6map_rules_s: nb_defense_tries

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::nb_defense_tries`

  nb_defense_tries parameter, stored as an integer.

Member of lw6map_rules_s: vertical_move

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::vertical_move`

  vertical_move parameter, stored as an integer.

Member of lw6map_rules_s: spread_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::spread_mode`

  spread_mode parameter, stored as an integer.

Member of lw6map_rules_s: single_army_size

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::single_army_size`

  single_army_size parameter, stored as an integer.

Member of lw6map_rules_s: total_armies_size

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::total_armies_size`

  total_armies_size parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_teams

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_nb_teams`

  max_nb_teams parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_cursors

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_nb_cursors`

  max_nb_cursors parameter, stored as an integer.

Member of lw6map_rules_s: max_nb_nodes

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_nb_nodes`

  max_nb_nodes parameter, stored as an integer.

Member of lw6map_rules_s: exp

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::exp`

  exp parameter, stored as an integer.

Member of lw6map_rules_s: highest_team_color_allowed

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::highest_team_color_allowed`

  highest_team_color_allowed parameter, stored as an integer.

Member of lw6map_rules_s: highest_weapon_allowed

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::highest_weapon_allowed`

  highest_weapon_allowed parameter, stored as an integer.

Member of lw6map_rules_s: x_polarity

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::x_polarity`

  x_polarity parameter, stored as an integer.

Member of lw6map_rules_s: y_polarity

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::y_polarity`

  y_polarity parameter, stored as an integer.

Member of lw6map_rules_s: z_polarity

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::z_polarity`

  z_polarity parameter, stored as an integer.

Member of lw6map_rules_s: max_zone_size

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_zone_size`

  max_zone_size parameter, stored as an integer.

Member of lw6map_rules_s: round_delta

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::round_delta`

  round_delta parameter, stored as an integer.

Member of lw6map_rules_s: max_round_delta

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_round_delta`

  max_round_delta parameter, stored as an integer.

Member of lw6map_rules_s: max_cursor_pot

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_cursor_pot`

  max_cursor_pot parameter, stored as an integer.

Member of lw6map_rules_s: cursor_pot_init

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::cursor_pot_init`

  cursor_pot_init parameter, stored as an integer.

Member of lw6map_rules_s: max_cursor_pot_offset

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::max_cursor_pot_offset`

  max_cursor_pot_offset parameter, stored as an integer.

Member of lw6map_rules_s: start_x

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::start_x[LW6MAP_MAX_NB_TEAMS]`

  start_x parameters, stored as a per team integer.

Member of lw6map_rules_s: start_y

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::start_y[LW6MAP_MAX_NB_TEAMS]`

  start_y parameters, stored as a per team integer.

Member of lw6map_rules_s: start_position_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::start_position_mode`

  start_position_mode parameter, stored as an integer.

Member of lw6map_rules_s: color_conflict_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::color_conflict_mode`

  color_conflict_mode parameter, stored as an integer.

Member of lw6map_rules_s: spread_thread

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::spread_thread`

  spread_thread parameter, stored as an integer.

Member of lw6map_rules_s: glue_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::glue_power`

  glue_power parameter, stored as an integer.

Member of lw6map_rules_s: boost_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::boost_power`

  boost_power parameter, stored as an integer.

Member of lw6map_rules_s: danger_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::danger_power`

  danger_power parameter, stored as an integer.

Member of lw6map_rules_s: medicine_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::medicine_power`

  medicine_power parameter, stored as an integer.

Member of lw6map_rules_s: frags_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::frags_mode`

  frags_mode parameter, stored as an integer.

Member of lw6map_rules_s: frags_to_distribute

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::frags_to_distribute`

  frags_to_distribute parameter, stored as an integer.

Member of lw6map_rules_s: frags_fade_out

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::frags_fade_out`

  frags_fade_out parameter, stored as an integer.

Member of lw6map_rules_s: use_team_profiles

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::use_team_profiles`

  use_team_profiles parameter, stored as an integer.

Member of lw6map_rules_s: team_profile_aggressive

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_aggressive[LW6MAP_MAX_NB_TEAMS]`

  team_profile_aggressive parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_vulnerable

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_vulnerable[LW6MAP_MAX_NB_TEAMS]`

  team_profile_vulnerable parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_mobile

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_mobile[LW6MAP_MAX_NB_TEAMS]`

  team_profile_mobile parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_fast

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_fast[LW6MAP_MAX_NB_TEAMS]`

  team_profile_fast parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_handicap

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_handicap[LW6MAP_MAX_NB_TEAMS]`

  team_profile_handicap parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_id

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_weapon_id[LW6MAP_MAX_NB_TEAMS]`

  team_profile_weapon_id parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_alternate_id

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_weapon_alternate_id[LW6MAP_MAX_NB_TEAMS]`

  team_profile_weapon_alternate_id parameters, stored as a per team integer.

Member of lw6map_rules_s: team_profile_weapon_mode

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::team_profile_weapon_mode[LW6MAP_MAX_NB_TEAMS]`

  team_profile_weapon_mode parameters, stored as a per team integer.

Member of lw6map_rules_s: weapon_duration

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::weapon_duration`

  weapon_duration parameter, stored as an integer.

Member of lw6map_rules_s: weapon_charge_delay

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::weapon_charge_delay`

  weapon_charge_delay parameter, stored as an integer.

Member of lw6map_rules_s: weapon_charge_max

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::weapon_charge_max`

  weapon_charge_max parameter, stored as an integer.

Member of lw6map_rules_s: weapon_tune_berzerk_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::weapon_tune_berzerk_power`

  weapon_tune_berzerk_power parameter, stored as an integer.

Member of lw6map_rules_s: weapon_tune_turbo_power

  Type: `int32_t`

  Definition: `int32_t lw6map_rules_s::weapon_tune_turbo_power`

  weapon_tune_turbo_power parameter, stored as an integer.

Struct: lw6map_style_s

  Content of style.xml stored into a C struct.

Member of lw6map_style_s: keep_ratio

  Type: `int`

  Definition: `int lw6map_style_s::keep_ratio`

  Boolean, wether to keep the map ratio or not.

Member of lw6map_style_s: zoom

  Type: `float`

  Definition: `float lw6map_style_s::zoom`

  Default zoom.

Member of lw6map_style_s: zoom_min

  Type: `float`

  Definition: `float lw6map_style_s::zoom_min`

  Min zoom.

Member of lw6map_style_s: zoom_max

  Type: `float`

  Definition: `float lw6map_style_s::zoom_max`

  Max zoom.

Member of lw6map_style_s: x_wrap

  Type: `int`

  Definition: `int lw6map_style_s::x_wrap`

  Wether to wrap on X axis.

Member of lw6map_style_s: y_wrap

  Type: `int`

  Definition: `int lw6map_style_s::y_wrap`

  Wether to wrap on Y axis.

Member of lw6map_style_s: background_style

  Type: `char *`

  Definition: `char* lw6map_style_s::background_style`

  Background style to use (for instance, bubbles).

Member of lw6map_style_s: hud_style

  Type: `char *`

  Definition: `char* lw6map_style_s::hud_style`

  Hud style to use (for instance, floating).

Member of lw6map_style_s: menu_style

  Type: `char *`

  Definition: `char* lw6map_style_s::menu_style`

  Menu style to use (for instance, cylinder).

Member of lw6map_style_s: view_style

  Type: `char *`

  Definition: `char* lw6map_style_s::view_style`

  View style to use (for instance, flat).

Member of lw6map_style_s: animation_density

  Type: `float`

  Definition: `float lw6map_style_s::animation_density`

  How dense animations should be (many or few sprites).

Member of lw6map_style_s: animation_speed

  Type: `float`

  Definition: `float lw6map_style_s::animation_speed`

  How fast animations should be (sprites speed).

Member of lw6map_style_s: cursor_size

  Type: `float`

  Definition: `float lw6map_style_s::cursor_size`

  Cursor size.

Member of lw6map_style_s: colorize_cursor

  Type: `int`

  Definition: `int lw6map_style_s::colorize_cursor`

  Wether to colorize cursors or not.

Member of lw6map_style_s: blink_cursor

  Type: `int`

  Definition: `int lw6map_style_s::blink_cursor`

  Wether to make cursors blink or not.

Member of lw6map_style_s: hidden_layer_alpha

  Type: `float`

  Definition: `float lw6map_style_s::hidden_layer_alpha`

  Alpha value used to represent fighters hidden behind a layer.

Member of lw6map_style_s: colorize

  Type: `int`

  Definition: `int lw6map_style_s::colorize`

  Wether to use colorization or not.

Member of lw6map_style_s: pixelize

  Type: `int`

  Definition: `int lw6map_style_s::pixelize`

  Wether to pixelize the map and fighters or not.

Member of lw6map_style_s: color_set

  Type: `lw6map_color_set_t`

  Definition: `lw6map_color_set_t lw6map_style_s::color_set`

  All colors used by the game.

Member of lw6map_style_s: music_file

  Type: `char *`

  Definition: `char* lw6map_style_s::music_file`

  Music file to play.

Member of lw6map_style_s: music_filter

  Type: `char *`

  Definition: `char* lw6map_style_s::music_filter`

  Music files to keep.

Member of lw6map_style_s: music_exclude

  Type: `char *`

  Definition: `char* lw6map_style_s::music_exclude`

  Music files to exclude.

Member of lw6map_style_s: waves

  Type: `int`

  Definition: `int lw6map_style_s::waves`

  Wether to turn on the wave effect or not.

Struct: lw6map_teams_s

  Content of teams.xml stored into a C struct.

Member of lw6map_teams_s: player_color

  Type: `int`

  Definition: `int lw6map_teams_s::player_color[LW6MAP_TEAMS_NB_PLAYERS]`

  Players colors.

Member of lw6map_teams_s: nb_bots

  Type: `int`

  Definition: `int lw6map_teams_s::nb_bots`

  Number of bots.

Member of lw6map_teams_s: bot_speed

  Type: `float`

  Definition: `float lw6map_teams_s::bot_speed`

  Bots speed.

Member of lw6map_teams_s: bot_iq

  Type: `int`

  Definition: `int lw6map_teams_s::bot_iq`

  Bots IQ (how strong they are)

Member of lw6map_teams_s: bot

  Type: `lw6map_bot_info_t`

  Definition: `lw6map_bot_info_t lw6map_teams_s::bot[LW6MAP_TEAMS_MAX_NB_BOTS]`

  Per-bot parameters, including their color and the ai engine they use.

Struct: lw6map_texture_s

  Texture information, this is a bit different from a layer, since this is RGBA data, plus some meta-informations such as guessed colors.

Member of lw6map_texture_s: w

  Type: `int`

  Definition: `int lw6map_texture_s::w`

  Texture width.

Member of lw6map_texture_s: h

  Type: `int`

  Definition: `int lw6map_texture_s::h`

  Texture height.

Member of lw6map_texture_s: has_alpha

  Type: `int`

  Definition: `int lw6map_texture_s::has_alpha`

  True if texture has an alpha channel. If it has an alpha channel on disk (for instance, it’s a PNG) and if in practice it has nothing else than full opaque 255 alpha values, then this will be set to 0 anyway, the idea is to detect textures that really need the engine to handle transparency.

Member of lw6map_texture_s: data

  Type: `lw6sys_color_8_t *`

  Definition: `lw6sys_color_8_t* lw6map_texture_s::data`

  Color for each pixel.

Member of lw6map_texture_s: guessed_color_base

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_texture_s::guessed_color_base`

  Base guessed color couple. This is typically the best or more representative color couple (fg and bg) the program was able to automatically extract from the map.

Member of lw6map_texture_s: guessed_color_alternate

  Type: `lw6map_color_couple_t`

  Definition: `lw6map_color_couple_t lw6map_texture_s::guessed_color_alternate`

  An alternate color couple which still comes from the map but is a bit different from the base one.

Next: libmat, Previous: libldr, Up: C API [Contents][Index]