Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

include/util.h File Reference


Detailed Description

Miscellaneous useful functions.

Definition in file util.h.

#include "filelink.h"

Go to the source code of this file.

Data Structures

struct  coord
 A coordinate. More...

struct  scoord
 A (signed short) coordinate. More...

struct  rect
 A rectangle. More...

struct  direction
 A heading (one of eight cardinal directions). More...

struct  range
 A numeric range. More...

struct  lrange
 A numeric range. More...

struct  draw_string_info

Defines

#define COORD(a, b)   construct_coord(a, b)
#define RECT(a, b, c, d)   construct_rect(a,b,c,d)
#define SRANGE(a, b)   construct_range((a),(b))
#define DIRECTION(a, b)   (construct_direction((a),(b)))
#define RANGE(a, b)   xrandom( ((a)<<8)+(b) )
#define distancesquare(x1, y1, x2, y2)   ( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) )
#define call_aifunc   call_usefunc
#define call_chatfunc   call_throwhitfunc
#define call_killfunc   call_throwhitfunc
#define debug_malloc   malloc_throw
#define debug_free   free
#define debug_calloc   calloc_throw
#define debug_realloc   realloc_throw

Functions

coord construct_coord (uchar x, uchar y)
rect construct_rect (uchar x, uchar y, uchar w, uchar h)
direction construct_direction (schar x, schar y)
range construct_range (uchar max, uchar min)
int min (int a, int b)
int max (int a, int b)


Define Documentation

#define call_aifunc   call_usefunc
 

Definition at line 155 of file util.h.

Referenced by monst_anger(), and monstmove().

#define call_chatfunc   call_throwhitfunc
 

Definition at line 156 of file util.h.

Referenced by monst_chat().

#define call_killfunc   call_throwhitfunc
 

Definition at line 157 of file util.h.

Referenced by monst_takedamage().

#define COORD a,
 )     construct_coord(a, b)
 

Definition at line 92 of file util.h.

Referenced by init_layout(), initialize(), main_menu(), resize_map_store(), trace_path(), and UI_TF_Init().

#define debug_calloc   calloc_throw
 

Definition at line 178 of file util.h.

Referenced by initialize().

#define debug_free   free
 

Definition at line 177 of file util.h.

Referenced by cleanup(), cleanup_items(), place_wandering_monsters(), and resize_map_store().

#define debug_malloc   malloc_throw
 

Definition at line 176 of file util.h.

Referenced by init_discoveries(), init_items(), init_shuffle_tab(), init_spells(), load_level(), resize_map_store(), restore_game(), show_help_page(), and sys_init_data_file().

#define debug_realloc   realloc_throw
 

Definition at line 179 of file util.h.

Referenced by add_item(), and gather_wandering_monsters().

#define DIRECTION a,
 )     (construct_direction((a),(b)))
 

Definition at line 95 of file util.h.

#define distancesquare x1,
y1,
x2,
y2   )     ( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) )
 

Definition at line 140 of file util.h.

Referenced by calc_light_tile(), monst_can_attack_player(), monst_detect_player(), monstcanmove(), monstmove(), monstmoveawayfromplayer(), monstmovetowardsplayer(), pet_move(), place_monster(), and webspinner_cower().

#define RANGE a,
 )     xrandom( ((a)<<8)+(b) )
 

Definition at line 138 of file util.h.

Referenced by addrandommonst(), distribute_attributes(), dll_fill_room(), draw_tile(), enchant_item(), init_shuffle_tab(), make_connections(), make_noise(), monst_takedamage(), monstmove(), monstmoverandomly(), monstname(), place_corridors(), place_doors(), place_fountain(), place_hole(), place_player_randomly(), place_room(), plr_search(), plr_walk(), potion_hit_extra_heal(), potion_hit_heal(), potion_numbness_expire(), randitem(), random_plus(), throw_item(), and webspinner_build().

#define RECT a,
b,
c,
 )     construct_rect(a,b,c,d)
 

Definition at line 93 of file util.h.

#define SRANGE a,
 )     construct_range((a),(b))
 

Definition at line 94 of file util.h.


Function Documentation

struct coord construct_coord uchar  x,
uchar  y
 

Definition at line 32 of file construct.c.

References coord::x, and coord::y.

struct direction construct_direction schar  x,
schar  y
 

Definition at line 52 of file construct.c.

References direction::x, and direction::y.

struct range construct_range uchar  max,
uchar  min
 

Definition at line 63 of file construct.c.

References range::max, and range::min.

struct rect construct_rect uchar  x,
uchar  y,
uchar  w,
uchar  h
 

Definition at line 41 of file construct.c.

References rect::extent, rect::topleft, w, coord::x, and coord::y.

int max int  a,
int  b
 

Definition at line 37 of file sysutil.c.

Referenced by follow_connection(), monst_takedamage(), plr_takedamage(), throw_item(), UI_TF_MoveCamera(), UI_TF_PlaceCamera(), and update_player().

int min int  a,
int  b
 

Definition at line 26 of file sysutil.c.

Referenced by delta_facing(), display_scores(), and place_room().


Generated on Thu May 20 13:12:12 2004 for CalcRogue by doxygen 1.3.6