lev_column.c File Reference


Detailed Description

Level graphics (DAT/CLM) handling module.

Purpose:
Functions for maintaining CLM and DAT files.
Comment:
The DAT/CLM generation algorithm was completely rewritten from the Jon Skeet's version.
Author:
Tomasz Lis
Date:
21 Jan 2008 - 22 Jul 2008
Copying and copyrights:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file lev_column.c.

#include "lev_column.h"
#include "obj_column_def.h"
#include "obj_column.h"
#include "lev_data.h"
#include "globals.h"
#include "obj_slabs.h"
#include "obj_things.h"
#include "graffiti.h"

Go to the source code of this file.

Functions

void set_clm (struct LEVEL *lvl, int num, unsigned int use, int base, int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7)
 Sets a CLM entry of index num, using simplified parameters.
void set_clm_ent_idx (struct LEVEL *lvl, int num, unsigned int use, int permanent, int lintel, int height, unsigned int solid, int base, int orientation, int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7)
 Sets a CLM entry of index num, allows specifying all parameters.
int column_find_or_create (struct LEVEL *lvl, struct COLUMN_REC *clm_rec)
 Searches CLM structure for given column; if not found, creates it.
int column_get_free_index (struct LEVEL *lvl)
 Tries to find unused entry in CLM structure and returns its index.
void update_datclm_for_whole_map (struct LEVEL *lvl)
 Updates DAT, CLM and w?b entries for the whole map.
void update_datclm_for_square_radius1 (struct LEVEL *lvl, int tx, int ty)
 Updates DAT, CLM and w?b entries for given tile and around it.
void update_datclm_for_square (struct LEVEL *lvl, int tx_first, int tx_last, int ty_first, int ty_last)
 Updates DAT, CLM and w?b entries for given map tile coordinates range.
void update_datclm_for_slab (struct LEVEL *lvl, int tx, int ty)
 Updates DAT and CLM entries for given map position (whole tile).
void get_slab_surround (unsigned char *surr_slb, unsigned char *surr_own, unsigned char **surr_tng, const struct LEVEL *lvl, int tx, int ty)
 Returns slab surrounding information, needed for CLM generation.
void set_new_datclm_values (struct LEVEL *lvl, int tx, int ty, struct COLUMN_REC *clm_recs[9])
 Sets given columns as new DAT/CLM entries for given tile.
void set_new_datclm_entry (struct LEVEL *lvl, int sx, int sy, struct COLUMN_REC *clm_rec)
 Sets given column as new DAT/CLM entry for one single column.
void clm_utilize_dec (struct LEVEL *lvl, int clmidx)
 Decreases UTILIZE and USE values for column on given index.
void clm_utilize_inc (struct LEVEL *lvl, int clmidx)
 Increases UTILIZE and USE values for column on given index.
short columns_verify (struct LEVEL *lvl, char *err_msg, struct IPOINT_2D *errpt)
 Verifies column values.
void update_clm_utilize_counters (struct LEVEL *lvl)
 Sweeps through all CLM entries and recomputes their UTILIZE counters.
void update_tile_wib_entries (struct LEVEL *lvl, int tx, int ty)
 Updates WIB animation entries for all subtiles of given tile.
void update_tile_wlb_entry (struct LEVEL *lvl, int tx, int ty)
 Updates WLB entry for given tile.
void update_tile_flg_entries (struct LEVEL *lvl, int tx, int ty)
 Updates FLG entries for all subtiles of given tile.
unsigned short compute_flg_for_tile (unsigned short slab, short corner)
 Computes FLG value for given slab.
unsigned char * get_subtile_column (const struct LEVEL *lvl, int sx, int sy)
 Gets a column entry on given subtile.
short get_subtile_column_rec (const struct LEVEL *lvl, struct COLUMN_REC *clm_rec, int sx, int sy)
 Fills given column record with values from column on given subtile.
unsigned short get_subtile_column_height (struct LEVEL *lvl, int sx, int sy)
 Gets height of column on given subtile.
unsigned short get_subtile_column_solid (struct LEVEL *lvl, int sx, int sy)
 Gets solid mask of column on given subtile.
void set_dat_subtile (struct LEVEL *lvl, int sx, int sy, int d)
 Sets a DAT value for one subtile.
unsigned int get_dat_subtile (const struct LEVEL *lvl, const unsigned int sx, const unsigned int sy)
 Gets a DAT value for one subtile.
void set_dat (struct LEVEL *lvl, int x, int y, int tl, int tm, int tr, int ml, int mm, int mr, int bl, int bm, int br)
 Sets a DAT value for one whole tile.
void set_dat_unif (struct LEVEL *lvl, int x, int y, int d)
 Sets same DAT value for all subtiles of a tile.
short find_dat_entry (const struct LEVEL *lvl, int *sx, int *sy, const unsigned int clm_idx)
 Searches for next subtile which uses column of given index.
short dat_verify (struct LEVEL *lvl, char *err_msg, struct IPOINT_2D *errpt)
 Verifies DAT values.
short clm_entry_is_used (const struct LEVEL *lvl, unsigned int clmidx)
 Returns if the column entry is used.
short update_dat_last_column (struct LEVEL *lvl, unsigned short slab)
 Updates last column on map.
short slab_has_custom_columns (struct LEVEL *lvl, int tx, int ty)
 Returns if the tile has any custom columns on it.
int update_custom_columns_for_slab (struct COLUMN_REC *clm_recs[9], struct LEVEL *lvl, int tx, int ty)
 Updates custom columns for a slab.
int place_cust_clms_on_slab (struct COLUMN_REC *clm_recs[9], struct LEVEL *lvl, int tx, int ty)
 Draws custom columns on given columns array.
short cust_col_add_or_update (struct LEVEL *lvl, int sx, int sy, struct DK_CUSTOM_CLM *ccol)
 Adds custom column object to level data, or updates existing custom column.
int cust_cols_num_on_tile (struct LEVEL *lvl, int tx, int ty)
 Gives number of custom columns at a tile.
struct DK_CUSTOM_CLMget_cust_col (struct LEVEL *lvl, int sx, int sy)
 Returns custom column on given subtile.
struct COLUMN_RECget_cust_col_rec (struct LEVEL *lvl, int sx, int sy)
 Returns COLUMN_REC of custom column on given subtile.
unsigned short get_cust_col_wib_entry (struct LEVEL *lvl, int sx, int sy)
 Returns WIB entry of custom column on given subtile.
short set_cust_col (struct LEVEL *lvl, int sx, int sy, struct DK_CUSTOM_CLM *ccol)
 Adds custom column object to level data, without filling the column nor updating slabs.
unsigned int get_cust_clm_count (struct LEVEL *lvl)
 Gives number of all custom columns in the whole level.
struct DK_CUSTOM_CLMcreate_cust_col (void)
 Creates a new custom column and fills its properties.
short cust_col_del (struct LEVEL *lvl, int sx, int sy)
 Removes custom column from level and frees its memory.
int cust_cols_del_for_tile (struct LEVEL *lvl, int tx, int ty)
 Removes custom columns for whole tile, deallocates memory.
char * get_texture_fullname (unsigned short inf_type)

Variables

char const INF_STANDARD_LTEXT [] = "Standard"
char const INF_ANCIENT_LTEXT [] = "Ancient"
char const INF_WINTER_LTEXT [] = "Winter"
char const INF_SNAKE_LTEXT [] = "Snake key"
char const INF_FACE_LTEXT [] = "Stone face"
char const INF_BRESTS_LTEXT [] = "Big breasts"
char const INF_RGANCNT_LTEXT [] = "Rough Ancient"
char const INF_SKULL_LTEXT [] = "Skull relief"
const char *const inf_texture_fullnames []
 Text names of standard textures.


Function Documentation

short clm_entry_is_used ( const struct LEVEL lvl,
unsigned int  clmidx 
)

Returns if the column entry is used.

If the column is unused, it can be overwritten by new one.

Parameters:
lvl Pointer to the LEVEL structure.
clmidx Index of column to check.
Returns:
Returns false if the entry is unused and not permanent. Otherwise, returns true.

Definition at line 905 of file lev_column.c.

Referenced by column_find_or_create(), and column_get_free_index().

void clm_utilize_dec ( struct LEVEL lvl,
int  clmidx 
)

Decreases UTILIZE and USE values for column on given index.

See also:
set_new_datclm_values

clm_utilize_inc

Parameters:
lvl Pointer to the LEVEL structure.
clmidx Column index.

Definition at line 446 of file lev_column.c.

Referenced by set_new_datclm_entry().

void clm_utilize_inc ( struct LEVEL lvl,
int  clmidx 
)

Increases UTILIZE and USE values for column on given index.

See also:
set_new_datclm_values

clm_utilize_dec

Parameters:
lvl Pointer to the LEVEL structure.
clmidx Column index.

Definition at line 470 of file lev_column.c.

Referenced by set_new_datclm_entry().

int column_find_or_create ( struct LEVEL lvl,
struct COLUMN_REC clm_rec 
)

Searches CLM structure for given column; if not found, creates it.

Parameters:
lvl Pointer to the LEVEL structure.
clm_rec Pointer at searched column.
Returns:
Returns index if the column which consists of cubes identical to those from clm_rec parameter. If such column is not found, creates it and returns index of the new column. On error returns 0 (column 0 is never used, so this indicates error).

Definition at line 104 of file lev_column.c.

Referenced by set_new_datclm_entry().

int column_get_free_index ( struct LEVEL lvl  ) 

Tries to find unused entry in CLM structure and returns its index.

Parameters:
lvl Pointer to the LEVEL structure.
Returns:
Returns index of the first unused column, or -1 if there are no more unused column entries.

Definition at line 151 of file lev_column.c.

Referenced by column_find_or_create().

short columns_verify ( struct LEVEL lvl,
char *  err_msg,
struct IPOINT_2D errpt 
)

Verifies column values.

On error returns description message and map coordinates of the problem.

Parameters:
lvl Pointer to the LEVEL structure.
err_msg Error message output buffer.
errpt Coordinates of the map tile containing the error.
Returns:
Returns VERIF_ERROR, VERIF_WARN or VERIF_OK. If a problem was found, sets err_msg and errpt accordingly.

Definition at line 490 of file lev_column.c.

Referenced by level_verify().

unsigned short compute_flg_for_tile ( unsigned short  slab,
short  corner 
)

Computes FLG value for given slab.

Parameters:
slab Slab value.
corner Corner flag.
Returns:
Returns FLG value for given slab.

Definition at line 678 of file lev_column.c.

Referenced by update_tile_flg_entries().

struct DK_CUSTOM_CLM* create_cust_col ( void   )  [read]

Creates a new custom column and fills its properties.

The new object is not added to LEVEL structure.

Returns:
Returns pointer to the new DK_CUSTOM_CLM structure, or NULL on error.

Definition at line 1157 of file lev_column.c.

Referenced by execute_adikted_command().

short cust_col_add_or_update ( struct LEVEL lvl,
int  sx,
int  sy,
struct DK_CUSTOM_CLM ccol 
)

Adds custom column object to level data, or updates existing custom column.

Also updates the real level DAT/CLM entries where the column is put.

See also:
set_cust_col
Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile coordinates at which the custom columns will be put.
ccol Custom column entry to add.
Returns:
Returns true on success.

Definition at line 1029 of file lev_column.c.

Referenced by execute_adikted_command().

short cust_col_del ( struct LEVEL lvl,
int  sx,
int  sy 
)

Removes custom column from level and frees its memory.

The level graphic (DAT/CLM) is not updated.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile containing the custom column to delete.
Returns:
Returns true if there was anything to remove.

Definition at line 1179 of file lev_column.c.

Referenced by cust_col_add_or_update(), and cust_cols_del_for_tile().

int cust_cols_del_for_tile ( struct LEVEL lvl,
int  tx,
int  ty 
)

Removes custom columns for whole tile, deallocates memory.

The level graphic (DAT/CLM) is not updated.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates at which we're deleting all custom columns.
Returns:
Returns number of deleted custom columns.

Definition at line 1205 of file lev_column.c.

int cust_cols_num_on_tile ( struct LEVEL lvl,
int  tx,
int  ty 
)

Gives number of custom columns at a tile.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates at which the custom columns count.
Returns:
Returns num of custom columns at tile.

Definition at line 1057 of file lev_column.c.

Referenced by slab_has_custom_columns(), and update_custom_columns_for_slab().

short dat_verify ( struct LEVEL lvl,
char *  err_msg,
struct IPOINT_2D errpt 
)

Verifies DAT values.

On error returns description message and map coordinates of the problem.

Parameters:
lvl Pointer to the LEVEL structure.
err_msg Error message output buffer.
errpt Coordinates of the map tile containing the error.
Returns:
Returns VERIF_ERROR, VERIF_WARN or VERIF_OK. If a problem was found, sets err_msg and errpt accordingly.

Definition at line 878 of file lev_column.c.

Referenced by level_verify().

short find_dat_entry ( const struct LEVEL lvl,
int *  sx,
int *  sy,
const unsigned int  clm_idx 
)

Searches for next subtile which uses column of given index.

Starts searching at a subtile after (sx,sy). Finds the next subtile containing given clm_index and returns it in (sx,sy). On error/cannot find, sets (sx,sy) to (-1,-1). If (-1,-1) is given at start, searches from (0,0).

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile position to start search. Position of the subtile found is also returned here.
clm_idx Column index that we want to find.
Returns:
Returns true if a column was found.

Definition at line 852 of file lev_column.c.

Referenced by columns_verify().

unsigned int get_cust_clm_count ( struct LEVEL lvl  ) 

Gives number of all custom columns in the whole level.

Parameters:
lvl Pointer to the LEVEL structure.
Returns:
Returns total amount of custom columns.

Definition at line 1146 of file lev_column.c.

Referenced by get_level_objstats_textln().

struct DK_CUSTOM_CLM* get_cust_col ( struct LEVEL lvl,
int  sx,
int  sy 
) [read]

Returns custom column on given subtile.

If no cust.column there, returns NULL.

See also:
get_cust_col_rec
Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile containing the column we want.
Returns:
Returns the custom column entry, or NULL.

Definition at line 1078 of file lev_column.c.

Referenced by add_custom_clms_to_script(), cust_col_add_or_update(), cust_cols_num_on_tile(), get_cust_col_rec(), get_cust_col_wib_entry(), and update_tile_wib_entries().

struct COLUMN_REC* get_cust_col_rec ( struct LEVEL lvl,
int  sx,
int  sy 
) [read]

Returns COLUMN_REC of custom column on given subtile.

If no cust.column there, returns NULL.

See also:
get_cust_col
Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile containing the column we want.
Returns:
Returns the COLUMN_REC entry, or NULL.

Definition at line 1096 of file lev_column.c.

Referenced by place_cust_clms_on_slab().

unsigned short get_cust_col_wib_entry ( struct LEVEL lvl,
int  sx,
int  sy 
)

Returns WIB entry of custom column on given subtile.

If no cust.column there, returns COLUMN_WIB_SKEW.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile containing the column we want WIB entry for.
Returns:
Returns the WIB entry, or COLUMN_WIB_SKEW.

Definition at line 1110 of file lev_column.c.

Referenced by update_tile_wib_entries().

unsigned int get_dat_subtile ( const struct LEVEL lvl,
const unsigned int  sx,
const unsigned int  sy 
)

Gets a DAT value for one subtile.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile position we want to probe.
Returns:
Function returns a column index.

Definition at line 798 of file lev_column.c.

Referenced by dat_verify(), find_dat_entry(), get_subtile_column(), set_new_datclm_entry(), and update_clm_utilize_counters().

void get_slab_surround ( unsigned char *  surr_slb,
unsigned char *  surr_own,
unsigned char **  surr_tng,
const struct LEVEL lvl,
int  tx,
int  ty 
)

Returns slab surrounding information, needed for CLM generation.

See also:
update_datclm_for_slab
Parameters:
surr_slb The slab surrounding array.
surr_own The owner surrounding array.
surr_tng The thing surrounding array.
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 319 of file lev_column.c.

Referenced by create_things_slb_room(), create_things_slb_room_simple(), update_dat_last_column(), and update_datclm_for_slab().

unsigned char* get_subtile_column ( const struct LEVEL lvl,
int  sx,
int  sy 
)

Gets a column entry on given subtile.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile coordinates.
Returns:
Returns column entry for given subtile. On error returns NULL.

Definition at line 716 of file lev_column.c.

Referenced by draw_map_on_buffer(), draw_map_on_buffer_fast(), get_subtile_column_height(), get_subtile_column_rec(), get_subtile_column_solid(), and update_things_subpos_and_height_for_slab().

unsigned short get_subtile_column_height ( struct LEVEL lvl,
int  sx,
int  sy 
)

Gets height of column on given subtile.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile coordinates.
Returns:
Returns height of column at given subtile.

Definition at line 754 of file lev_column.c.

Referenced by actnpts_verify(), and level_verify_logic().

short get_subtile_column_rec ( const struct LEVEL lvl,
struct COLUMN_REC clm_rec,
int  sx,
int  sy 
)

Fills given column record with values from column on given subtile.

Parameters:
lvl Pointer to the LEVEL structure.
clm_rec Destination column record to fill with data from given subtile.
sx,sy Map subtile coordinates.
Returns:
Returns true on success. On error returns false and fills clm_rec with rock.

Definition at line 734 of file lev_column.c.

Referenced by update_tile_wib_entries().

unsigned short get_subtile_column_solid ( struct LEVEL lvl,
int  sx,
int  sy 
)

Gets solid mask of column on given subtile.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile coordinates.
Returns:
Returns solid mask of column at given subtile.

Definition at line 769 of file lev_column.c.

char* get_texture_fullname ( unsigned short  inf_type  ) 

Definition at line 1223 of file lev_column.c.

int place_cust_clms_on_slab ( struct COLUMN_REC clm_recs[9],
struct LEVEL lvl,
int  tx,
int  ty 
)

Draws custom columns on given columns array.

Draws only the cust_col, no graffiti.

Parameters:
clm_recs Column records to update.
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates at which the columns will be put.
Returns:
Returns num of changed entries.

Definition at line 998 of file lev_column.c.

Referenced by update_custom_columns_for_slab().

void set_clm ( struct LEVEL lvl,
int  num,
unsigned int  use,
int  base,
int  c0,
int  c1,
int  c2,
int  c3,
int  c4,
int  c5,
int  c6,
int  c7 
)

Sets a CLM entry of index num, using simplified parameters.

Parameters:
lvl Pointer to the LEVEL structure.
num Column index in the LEVEL structure.
use Value of use parameter.
base Index of base cube.
c0,c1,c2,c3,c4,c5,c6,c7 Indices of cubes making the column.

Definition at line 55 of file lev_column.c.

void set_clm_ent_idx ( struct LEVEL lvl,
int  num,
unsigned int  use,
int  permanent,
int  lintel,
int  height,
unsigned int  solid,
int  base,
int  orientation,
int  c0,
int  c1,
int  c2,
int  c3,
int  c4,
int  c5,
int  c6,
int  c7 
)

Sets a CLM entry of index num, allows specifying all parameters.

Parameters:
lvl Pointer to the LEVEL structure.
num Column index in the LEVEL structure.
use Value of use parameter.
permanent Value of permanent parameter.
lintel Value of lintel parameter.
height The column height.
solid The column solid mask.
base Index of base cube.
orientation Column orientation.
c0,c1,c2,c3,c4,c5,c6,c7 Indices of cubes making the column.

Definition at line 80 of file lev_column.c.

Referenced by add_permanent_columns().

short set_cust_col ( struct LEVEL lvl,
int  sx,
int  sy,
struct DK_CUSTOM_CLM ccol 
)

Adds custom column object to level data, without filling the column nor updating slabs.

Adds the given column pointer without making a copy of it.

See also:
cust_col_add_or_update
Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile containing the column we want WIB entry for.
ccol Custom column entry to add.
Returns:
Returns true on success.

Definition at line 1127 of file lev_column.c.

Referenced by cust_col_add_or_update().

void set_dat ( struct LEVEL lvl,
int  x,
int  y,
int  tl,
int  tm,
int  tr,
int  ml,
int  mm,
int  mr,
int  bl,
int  bm,
int  br 
)

Sets a DAT value for one whole tile.

Parameters:
lvl Pointer to the LEVEL structure.
x,y Map tile position to fill.
tl,tm,tr Top columns indices for the tile.
ml,mm,mr Middle columns indices for the tile.
bl,bm,br Bottom columns indices for the tile.
Warning:
This function does not change the USE variable of any column.

Definition at line 815 of file lev_column.c.

Referenced by set_dat_unif().

void set_dat_subtile ( struct LEVEL lvl,
int  sx,
int  sy,
int  d 
)

Sets a DAT value for one subtile.

Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile position to fill.
d Column index that we want put on this subtile.
Warning:
This function does not change the USE variable of any column.

Definition at line 785 of file lev_column.c.

Referenced by level_clear_datclm(), set_dat(), and set_new_datclm_entry().

void set_dat_unif ( struct LEVEL lvl,
int  x,
int  y,
int  d 
)

Sets same DAT value for all subtiles of a tile.

Parameters:
lvl Pointer to the LEVEL structure.
x,y Map tile position to fill.
d Column index to put on all subtiles.
Warning:
This function does not change the USE variable of any column.

Definition at line 836 of file lev_column.c.

void set_new_datclm_entry ( struct LEVEL lvl,
int  sx,
int  sy,
struct COLUMN_REC clm_rec 
)

Sets given column as new DAT/CLM entry for one single column.

Retrieves index for given column (possibly adds new column to LEVEL structure) then uses it to update the (sx,sy) subtile. Properly updates USE/UTILIZE information for both old and new columns.

See also:
set_new_datclm_values
Parameters:
lvl Pointer to the LEVEL structure.
sx,sy Map subtile coordinates.
clm_rec New column record for given subtile.

Definition at line 424 of file lev_column.c.

Referenced by set_new_datclm_values(), and update_dat_last_column().

void set_new_datclm_values ( struct LEVEL lvl,
int  tx,
int  ty,
struct COLUMN_REC clm_recs[9] 
)

Sets given columns as new DAT/CLM entries for given tile.

Retrieves indices for given columns (possibly adds new columns to LEVEL structure) then uses them to update the (tx,ty) tile. Properly updates USE/UTILIZE information for both old and new columns.

See also:
set_new_datclm_entry
Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.
clm_recs New column records for all subtiles of given tile.

Definition at line 403 of file lev_column.c.

Referenced by update_datclm_for_slab().

short slab_has_custom_columns ( struct LEVEL lvl,
int  tx,
int  ty 
)

Returns if the tile has any custom columns on it.

Returns true if there is at least one custom column on the tile. This includes any Graffiti.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates to check.
Returns:
Returns false if there are no custom columns on given tile. Otherwise, returns true.

Definition at line 963 of file lev_column.c.

Referenced by update_datclm_for_slab().

void update_clm_utilize_counters ( struct LEVEL lvl  ) 

Sweeps through all CLM entries and recomputes their UTILIZE counters.

Makes no changes to the USE property in columns. Should be called after loading DAT file. It doesn't really use CLM structure, so may be called before loading CLM - needs only DAT file.

Parameters:
lvl Pointer to the LEVEL structure.

Definition at line 524 of file lev_column.c.

Referenced by update_datclm_for_whole_map(), and update_level_stats().

int update_custom_columns_for_slab ( struct COLUMN_REC clm_recs[9],
struct LEVEL lvl,
int  tx,
int  ty 
)

Updates custom columns for a slab.

Parameters:
clm_recs Column records to update.
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates at which the columns will be put.
Returns:
Returns number of changed columns.
Note:
Also updates graffiti.

Definition at line 980 of file lev_column.c.

Referenced by update_datclm_for_slab().

short update_dat_last_column ( struct LEVEL lvl,
unsigned short  slab 
)

Updates last column on map.

The last column does not have corresponding slab entry, so it requires special treatment. This function sets all the columns on right and bottom egde to a look of given slab.

Parameters:
lvl Pointer to the LEVEL structure.
slab Slab entry which should be used for making columns.
Returns:
On success, returns ERR_NONE.

Definition at line 923 of file lev_column.c.

Referenced by update_datclm_for_whole_map().

void update_datclm_for_slab ( struct LEVEL lvl,
int  tx,
int  ty 
)

Updates DAT and CLM entries for given map position (whole tile).

You will probably also need to update W?B entries.

See also:
update_datclm_for_square
Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 283 of file lev_column.c.

Referenced by cust_col_add_or_update(), update_datclm_for_square(), update_datclm_for_square_radius1(), and update_datclm_for_whole_map().

void update_datclm_for_square ( struct LEVEL lvl,
int  tx_first,
int  tx_last,
int  ty_first,
int  ty_last 
)

Updates DAT, CLM and w?b entries for given map tile coordinates range.

Updates all tiles inside given rectangle.

See also:
update_datclm_for_square_radius1
Parameters:
lvl Pointer to the LEVEL structure.
tx_first,ty_first Top left map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.
tx_last,ty_last Bottom right map tile coordinates, in range tx/y_first-MAP_MAXINDEX_X/Y.

Definition at line 247 of file lev_column.c.

Referenced by graffiti_clear_from_columns(), graffiti_update_columns(), user_set_owner_rect(), user_set_slab_rect(), and user_set_slabown_rect().

void update_datclm_for_square_radius1 ( struct LEVEL lvl,
int  tx,
int  ty 
)

Updates DAT, CLM and w?b entries for given tile and around it.

Updates map tile at given coordinates, and also enties in all neightbour squares.

See also:
update_datclm_for_square
Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 211 of file lev_column.c.

Referenced by user_set_slab(), and user_set_tile_owner().

void update_datclm_for_whole_map ( struct LEVEL lvl  ) 

Updates DAT, CLM and w?b entries for the whole map.

All tiles and subtiles are reset. Additionally, USE values in columns are recomputed to avoid mistakes.

Parameters:
lvl Pointer to the LEVEL structure.

Definition at line 171 of file lev_column.c.

Referenced by generate_random_map(), and start_new_map().

void update_tile_flg_entries ( struct LEVEL lvl,
int  tx,
int  ty 
)

Updates FLG entries for all subtiles of given tile.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 627 of file lev_column.c.

Referenced by cust_col_add_or_update(), update_datclm_for_square(), update_datclm_for_square_radius1(), and update_datclm_for_whole_map().

void update_tile_wib_entries ( struct LEVEL lvl,
int  tx,
int  ty 
)

Updates WIB animation entries for all subtiles of given tile.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 548 of file lev_column.c.

Referenced by cust_col_add_or_update(), update_datclm_for_square(), update_datclm_for_square_radius1(), and update_datclm_for_whole_map().

void update_tile_wlb_entry ( struct LEVEL lvl,
int  tx,
int  ty 
)

Updates WLB entry for given tile.

Parameters:
lvl Pointer to the LEVEL structure.
tx,ty Map tile coordinates, in range 0-MAP_MAXINDEX_X/Y.

Definition at line 589 of file lev_column.c.

Referenced by cust_col_add_or_update(), update_datclm_for_square(), update_datclm_for_square_radius1(), and update_datclm_for_whole_map().


Variable Documentation

char const INF_ANCIENT_LTEXT[] = "Ancient"

Definition at line 30 of file lev_column.c.

char const INF_BRESTS_LTEXT[] = "Big breasts"

Definition at line 34 of file lev_column.c.

char const INF_FACE_LTEXT[] = "Stone face"

Definition at line 33 of file lev_column.c.

char const INF_RGANCNT_LTEXT[] = "Rough Ancient"

Definition at line 35 of file lev_column.c.

char const INF_SKULL_LTEXT[] = "Skull relief"

Definition at line 36 of file lev_column.c.

char const INF_SNAKE_LTEXT[] = "Snake key"

Definition at line 32 of file lev_column.c.

char const INF_STANDARD_LTEXT[] = "Standard"

Definition at line 29 of file lev_column.c.

const char* const inf_texture_fullnames[]

char const INF_WINTER_LTEXT[] = "Winter"

Definition at line 31 of file lev_column.c.


Generated on Tue Sep 2 18:51:48 2008 for libAdikted by  doxygen 1.5.6