Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ui.h File Reference

#include "cmd.def"

Include dependency graph for ui.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  a_vp
struct  a_legend
struct  a_line_segment

Defines

#define BMAP_BYTE   unsigned char
#define NUMPOWERS   8
#define XFORM_UVIEW_LEGACY   0 /*! Xform uview the old way. */
#define XFORM_UVIEW_PILES   1 /*! Xform uview with piles. */
#define XFORM_UVIEW_ELLIPSIS   2 /*! Xform uview with ellipsis. */
#define XFORM_UVIEW_AS_TSPT   4 /*! Xform uview as transport. */
#define XFORM_UVIEW_AS_OCC   8 /*! Xform uview as occupant. */
#define XFORM_UVIEW_DONT_PILE_ACP   16 /*! Don't pile if dissimilar ACP. */
#define XFORM_UVIEW_DONT_PILE_HP   32 /*! Don't pile if dissimilar HP. */
#define XFORM_UVIEW_DONT_PILE_CP   64 /*! Don't pile if incomplete. */
#define XFORM_UVIEW_DONT_PILE_OCC   128 /*! Don't pile if has occ. */
#define XFORM_UVIEW_DONT_DRAW   (1 << 31) /*! Don't draw the uview. */
#define REDRAW_CHAR   '\001'
#define ESCAPE_CHAR   '\033'
#define BACKSPACE_CHAR   '\010'
#define DELETE_CHAR   0x7f
#define m_terrain_visible(vp, x, y)   ((vp)->show_all || terrain_visible(dside, (x), (y)))
#define m_seen_border(vp, x, y, b)   ((vp)->show_all || seen_border(dside, (x), (y), (b)))
#define cell_style(vp, x, y)
#define cell_overlay(vp, x, y)
#define cell_terrain(vp, x, y)
#define DEF_CMD(letter, name, FN, help)   void FN(Side *side);

Typedefs

typedef a_vp VP
typedef a_legend Legend
typedef a_line_segment LineSegment

Enumerations

enum  whattouse { dontdraw, useblocks, usepolygons, usepictures }

Functions

void collect_possible_games (void)
void add_to_possible_games (Module *module)
VPnew_vp (void)
void xform_cell (VP *vp, int x, int y, int *sxp, int *syp)
void xform_cell_top (VP *vp, int x, int y, int *sxp, int *syp)
void xform_cell_fractional (VP *vp, int x, int y, int xf, int yf, int *sxp, int *syp)
void xform_unit (VP *vp, Unit *unit, int *sxp, int *syp, int *swp, int *shp)
void xform_unit_self (VP *vp, Unit *unit, int *sxp, int *syp, int *swp, int *shp)
int xform_unit_self_view (Side *side, VP *vp, UnitView *uview, int *sxp, int *syp, int *swp, int *shp)
void xform_occupant (VP *vp, Unit *transport, Unit *unit, int sx, int sy, int sw, int sh, int *sxp, int *syp, int *swp, int *shp)
void xform_occupant_view (VP *vp, UnitView *traview, UnitView *uview, int sx, int sy, int sw, int sh, int *sxp, int *syp, int *swp, int *shp)
int xform_unit_view (Side *side, VP *vp, UnitView *uview, int *sxp, int *syp, int *swp, int *shp, int flags=XFORM_UVIEW_LEGACY, int *piles=NULL, int sxt=-1, int syt=-1, int swt=-1, int sht=-1)
void xform_cell_flat (VP *vp, int x, int y, int *sxp, int *syp)
void xform_cell_fractional_flat (VP *vp, int x, int y, int xf, int yf, int *sxp, int *syp)
void scale_vp (VP *vp, VP *vp2, int *sxp, int *syp, int *swp, int *shp)
void scale_point (VP *vp, VP *vp2, int sx, int sy, int *sx2p, int *sy2p)
int nearest_cell (VP *vp, int sx, int sy, int *xp, int *yp, int *xfp, int *yfp)
int nearest_boundary (VP *vp, int sx, int sy, int *xp, int *yp, int *dirp)
int nearest_unit (Side *side, VP *vp, int sx, int sy, Unit **unitp)
int nearest_unit_view (Side *side, VP *vp, int sx, int sy, UnitView **uviewp)
int cell_is_visible (VP *vp, int x, int y)
int cell_is_in_middle (VP *vp, int x, int y)
int set_view_size (VP *vp, int w, int h)
int set_view_position (VP *vp, int sx, int sy)
int set_view_power (VP *vp, int power)
int set_view_angle (VP *vp, int angle)
int set_view_isometric (VP *vp, int flag, int scale)
int set_view_direction (VP *vp, int dir)
int set_view_focus (VP *vp, int x, int y)
void center_on_focus (VP *vp)
void focus_on_center (VP *vp)
void free_vp (VP *vp)
int compute_x1_len (VP *vp, int vx, int vy, int y, int *x1p, int *lenp)
int any_borders_in_dir (int x, int y, int dir)
int any_coating_at (int x, int y)
int compute_transition (Side *side, VP *vp, int x, int y, int dir, int *sxp, int *syp, int *swp, int *shp, int *offsetp)
void compute_fire_line_segment (int sx1, int sy1, int sx2, int sy2, int i, int n, int *xx, int *yy, int *dx, int *dy)
void place_feature_legends (Legend *leg, int nf, Side *side, int orient, int block)
void set_meridian_interval (VP *vp, int interval)
void plot_meridians (VP *vp, void(*line_callback)(int x1, int y1, int x1f, int y1f, int x2, int y2, int x2f, int y2f), void(*text_callback)(int x1, int y1, int x1f, int y1f, char *str))
void set_contour_interval (VP *vp, int n)
void contour_lines_at (VP *vp, int x, int y, int sx, int sy, LineSegment **lines, int *numlinesp)
int unit_visible (Side *side, VP *vp, Unit *unit)
int draw_temperature_here (Side *side, int x, int y)
int draw_winds_here (Side *side, int x, int y)
void oneliner (Side *side, VP *vp, int sx, int sy)
Unitfind_unit_or_occ (Side *side, VP *vp, Unit *unit, int usx, int usy, int usw, int ush, int sx, int sy)
Unitfind_unit_at (Side *side, VP *vp, int x, int y, int sx, int sy)
UnitViewfind_uview_at_pixel (Side *side, VP *vp, UnitView *uview, int usx, int usy, int usw, int ush, int sx, int sy)
 Return unit view at a certain pixel, if there is one.

UnitViewfind_uview_at_pixel (Side *side, VP *vp, int x, int y, int sx, int sy)
 Return unit view at a certain pixel, if there is one.

void pick_a_focus (Side *side, int *xp, int *yp)
Unitautonext_unit (Side *side, Unit *unit)
Unitautonext_unit_inbox (Side *side, Unit *unit, VP *vp)
int could_be_next_unit (Unit *unit)
Unitfind_next_occupant (Unit *unit)
Unitembarkation_unit (Unit *unit)
int find_units_matching (Side *side, char *name, Unit **unitp)
int num_active_displays (void)
int char_to_dir (int ch, int *dir1p, int *dir2p, int *modp)
int advance_into_cell (Side *side, Unit *unit, int x, int y, Unit *other, HistEventType *reason)
int unit_could_attack (Unit *unit, int u2, Side *side2, int x, int y)
Unitgive_supplies (Unit *unit, short *amts, short *rslts)
int take_supplies (Unit *unit, short *amts, short *rslts)
int impl_move_to (Side *side, Unit *unit, int x, int y, int dist)
int impl_build (Side *side, Unit *unit, int u2, Unit *transport, int x, int y, int n)
int impl_change_type (Side *side, Unit *unit, int u2)
int favored_type (Unit *unit)
void set_unit_image (Unit *unit)
void set_unit_view_image (UnitView *uview)
ImageFamilyget_unit_type_images (Side *side, int u)
ImageFamilyget_material_type_images (Side *side, int m)
ImageFamilyget_terrain_type_images (Side *side, int t)
ImageFamilyget_unseen_images (Side *side)
ImageFamilyget_emblem_images (Side *side, Side *side2)
void record_imf_get (ImageFamily *imf)
void describe_imf (Side *side, char *classname, char *imftype, ImageFamily *imf)
void init_ui_chars (void)
void init_unit_images (Side *side)
void dump_text_view (Side *side, int use_both)
int terrain_seen_at (Side *side, int x, int y)
Unitunit_seen_at (Side *side, int x, int y)
int utype_seen_at (Side *side, int x, int y)
void execute_command (Side *side, int ch)
void execute_long_command (Side *side, char *cmdstr)
void parse_long_name_command (char *cmdstr, int *prefixp, char **namep, char **argp, char *buf)
void describe_key_commands (int arg, char *key, TextBuffer *buf)
void describe_long_commands (int arg, char *key, TextBuffer *buf)

Variables

Sidedside
short mags []
short hws []
short hhs []
short hcs []
short halfsides []
short uws []
short uhs []
short iws []
short ihs []
short ics []
short ix1 []
short ix2 []
short bwid []
short bwid2 []
short cwid []
short bsx [NUMPOWERS][7]
short bsy [NUMPOWERS][7]
short lsx [NUMPOWERS][6]
short lsy [NUMPOWERS][6]
short ibsx [NUMPOWERS][7]
short ibsy [NUMPOWERS][7]
short ilsx [NUMPOWERS][6]
short ilsy [NUMPOWERS][6]
short qx [NUMPOWERS][7]
short qy [NUMPOWERS][7]
char * dirchars
int min_w_for_unit_image
int min_h_for_unit_image
int * numuimages
ImageFamily ** uimages
ImageFamilyunseen_image
ImageFamilygeneric_transition
ImageFamilygeneric_fuzz
char * terrchars
char * unitchars
char unseen_char_1
char unseen_char_2
Module ** possible_games
int numgames
void(* imf_describe_hook )(Side *side, Image *img)
int big_unit_images
char * cmdargstr
char tmpkey
HelpNodekey_commands_help_node
HelpNodelong_commands_help_node
HelpNodemap_help_node


Define Documentation

#define BACKSPACE_CHAR   '\010'
 

#define BMAP_BYTE   unsigned char
 

#define cell_overlay vp,
x,
 ) 
 

Value:

((dside->designer && !(vp)->show_all) \
   ? ((terrain_view(dside, x, y) == UNSEEN) ? -2 : 0)  \
   : (!dside->see_all && (vp)->draw_cover  \
      ? (cover(dside, x, y) == 0  \
         ? -1  \
         : ((vp)->draw_lighting ? (night_at(x, y) ? -2 : 0) : 0))  \
      : ((vp)->draw_lighting  \
          ? (night_at(x, y) ? -2 : 0)  \
          : 0)))

#define cell_style vp,
x,
 ) 
 

Value:

((m_terrain_visible(vp, x, y) || unseen_image != NULL || !in_area(x, y))  \
   ? (vp->power >= 3 ? usepolygons : useblocks)  \
   : dontdraw);

#define cell_terrain vp,
x,
 ) 
 

Value:

((!in_area(x, y)) ? BACKTTYPE :  \
   (((vp)->show_all || dside->designer) \
   ? terrain_at(x, y)  \
   : (m_terrain_visible(vp, x, y)  \
          ? vterrain(terrain_view(dside, x, y))  \
          : NONTTYPE)))

#define DEF_CMD letter,
name,
FN,
help   )     void FN(Side *side);
 

#define DELETE_CHAR   0x7f
 

#define ESCAPE_CHAR   '\033'
 

#define m_seen_border vp,
x,
y,
 )     ((vp)->show_all || seen_border(dside, (x), (y), (b)))
 

#define m_terrain_visible vp,
x,
 )     ((vp)->show_all || terrain_visible(dside, (x), (y)))
 

#define NUMPOWERS   8
 

#define REDRAW_CHAR   '\001'
 

#define XFORM_UVIEW_AS_OCC   8 /*! Xform uview as occupant. */
 

#define XFORM_UVIEW_AS_TSPT   4 /*! Xform uview as transport. */
 

#define XFORM_UVIEW_DONT_DRAW   (1 << 31) /*! Don't draw the uview. */
 

#define XFORM_UVIEW_DONT_PILE_ACP   16 /*! Don't pile if dissimilar ACP. */
 

#define XFORM_UVIEW_DONT_PILE_CP   64 /*! Don't pile if incomplete. */
 

#define XFORM_UVIEW_DONT_PILE_HP   32 /*! Don't pile if dissimilar HP. */
 

#define XFORM_UVIEW_DONT_PILE_OCC   128 /*! Don't pile if has occ. */
 

#define XFORM_UVIEW_ELLIPSIS   2 /*! Xform uview with ellipsis. */
 

#define XFORM_UVIEW_LEGACY   0 /*! Xform uview the old way. */
 

#define XFORM_UVIEW_PILES   1 /*! Xform uview with piles. */
 


Typedef Documentation

typedef struct a_legend Legend
 

typedef struct a_line_segment LineSegment
 

typedef struct a_vp VP
 


Enumeration Type Documentation

enum whattouse
 

Enumeration values:
dontdraw 
useblocks 
usepolygons 
usepictures 


Function Documentation

void add_to_possible_games Module module  ) 
 

int advance_into_cell Side side,
Unit unit,
int  x,
int  y,
Unit other,
HistEventType reason
 

int any_borders_in_dir int  x,
int  y,
int  dir
 

int any_coating_at int  x,
int  y
 

Unit* autonext_unit Side side,
Unit unit
 

Unit* autonext_unit_inbox Side side,
Unit unit,
VP vp
 

int cell_is_in_middle VP vp,
int  x,
int  y
 

int cell_is_visible VP vp,
int  x,
int  y
 

void center_on_focus VP vp  ) 
 

int char_to_dir int  ch,
int *  dir1p,
int *  dir2p,
int *  modp
 

void collect_possible_games void   ) 
 

void compute_fire_line_segment int  sx1,
int  sy1,
int  sx2,
int  sy2,
int  i,
int  n,
int *  xx,
int *  yy,
int *  dx,
int *  dy
 

int compute_transition Side side,
VP vp,
int  x,
int  y,
int  dir,
int *  sxp,
int *  syp,
int *  swp,
int *  shp,
int *  offsetp
 

int compute_x1_len VP vp,
int  vx,
int  vy,
int  y,
int *  x1p,
int *  lenp
 

void contour_lines_at VP vp,
int  x,
int  y,
int  sx,
int  sy,
LineSegment **  lines,
int *  numlinesp
 

int could_be_next_unit Unit unit  ) 
 

void describe_imf Side side,
char *  classname,
char *  imftype,
ImageFamily imf
 

void describe_key_commands int  arg,
char *  key,
TextBuffer buf
 

void describe_long_commands int  arg,
char *  key,
TextBuffer buf
 

int draw_temperature_here Side side,
int  x,
int  y
 

int draw_winds_here Side side,
int  x,
int  y
 

void dump_text_view Side side,
int  use_both
 

Unit* embarkation_unit Unit unit  ) 
 

void execute_command Side side,
int  ch
 

void execute_long_command Side side,
char *  cmdstr
 

int favored_type Unit unit  ) 
 

Unit* find_next_occupant Unit unit  ) 
 

Unit* find_unit_at Side side,
VP vp,
int  x,
int  y,
int  sx,
int  sy
 

Unit* find_unit_or_occ Side side,
VP vp,
Unit unit,
int  usx,
int  usy,
int  usw,
int  ush,
int  sx,
int  sy
 

int find_units_matching Side side,
char *  name,
Unit **  unitp
 

UnitView* find_uview_at_pixel Side side,
VP vp,
int  x,
int  y,
int  sx,
int  sy
 

Return unit view at a certain pixel, if there is one.

UnitView* find_uview_at_pixel Side side,
VP vp,
UnitView uview,
int  usx,
int  usy,
int  usw,
int  ush,
int  sx,
int  sy
 

Return unit view at a certain pixel, if there is one.

void focus_on_center VP vp  ) 
 

void free_vp VP vp  ) 
 

ImageFamily* get_emblem_images Side side,
Side side2
 

ImageFamily* get_material_type_images Side side,
int  m
 

ImageFamily* get_terrain_type_images Side side,
int  t
 

ImageFamily* get_unit_type_images Side side,
int  u
 

ImageFamily* get_unseen_images Side side  ) 
 

Unit* give_supplies Unit unit,
short *  amts,
short *  rslts
 

int impl_build Side side,
Unit unit,
int  u2,
Unit transport,
int  x,
int  y,
int  n
 

int impl_change_type Side side,
Unit unit,
int  u2
 

int impl_move_to Side side,
Unit unit,
int  x,
int  y,
int  dist
 

void init_ui_chars void   ) 
 

void init_unit_images Side side  ) 
 

int nearest_boundary VP vp,
int  sx,
int  sy,
int *  xp,
int *  yp,
int *  dirp
 

int nearest_cell VP vp,
int  sx,
int  sy,
int *  xp,
int *  yp,
int *  xfp,
int *  yfp
 

int nearest_unit Side side,
VP vp,
int  sx,
int  sy,
Unit **  unitp
 

int nearest_unit_view Side side,
VP vp,
int  sx,
int  sy,
UnitView **  uviewp
 

VP* new_vp void   ) 
 

int num_active_displays void   ) 
 

void oneliner Side side,
VP vp,
int  sx,
int  sy
 

void parse_long_name_command char *  cmdstr,
int *  prefixp,
char **  namep,
char **  argp,
char *  buf
 

void pick_a_focus Side side,
int *  xp,
int *  yp
 

void place_feature_legends Legend leg,
int  nf,
Side side,
int  orient,
int  block
 

void plot_meridians VP vp,
void(*  line_callback)(int x1, int y1, int x1f, int y1f, int x2, int y2, int x2f, int y2f),
void(*  text_callback)(int x1, int y1, int x1f, int y1f, char *str)
 

void record_imf_get ImageFamily imf  ) 
 

void scale_point VP vp,
VP vp2,
int  sx,
int  sy,
int *  sx2p,
int *  sy2p
 

void scale_vp VP vp,
VP vp2,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

void set_contour_interval VP vp,
int  n
 

void set_meridian_interval VP vp,
int  interval
 

void set_unit_image Unit unit  ) 
 

void set_unit_view_image UnitView uview  ) 
 

int set_view_angle VP vp,
int  angle
 

int set_view_direction VP vp,
int  dir
 

int set_view_focus VP vp,
int  x,
int  y
 

int set_view_isometric VP vp,
int  flag,
int  scale
 

int set_view_position VP vp,
int  sx,
int  sy
 

int set_view_power VP vp,
int  power
 

int set_view_size VP vp,
int  w,
int  h
 

int take_supplies Unit unit,
short *  amts,
short *  rslts
 

int terrain_seen_at Side side,
int  x,
int  y
 

int unit_could_attack Unit unit,
int  u2,
Side side2,
int  x,
int  y
 

Unit* unit_seen_at Side side,
int  x,
int  y
 

int unit_visible Side side,
VP vp,
Unit unit
 

int utype_seen_at Side side,
int  x,
int  y
 

void xform_cell VP vp,
int  x,
int  y,
int *  sxp,
int *  syp
 

void xform_cell_flat VP vp,
int  x,
int  y,
int *  sxp,
int *  syp
 

void xform_cell_fractional VP vp,
int  x,
int  y,
int  xf,
int  yf,
int *  sxp,
int *  syp
 

void xform_cell_fractional_flat VP vp,
int  x,
int  y,
int  xf,
int  yf,
int *  sxp,
int *  syp
 

void xform_cell_top VP vp,
int  x,
int  y,
int *  sxp,
int *  syp
 

void xform_occupant VP vp,
Unit transport,
Unit unit,
int  sx,
int  sy,
int  sw,
int  sh,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

void xform_occupant_view VP vp,
UnitView traview,
UnitView uview,
int  sx,
int  sy,
int  sw,
int  sh,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

void xform_unit VP vp,
Unit unit,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

void xform_unit_self VP vp,
Unit unit,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

int xform_unit_self_view Side side,
VP vp,
UnitView uview,
int *  sxp,
int *  syp,
int *  swp,
int *  shp
 

int xform_unit_view Side side,
VP vp,
UnitView uview,
int *  sxp,
int *  syp,
int *  swp,
int *  shp,
int  flags = XFORM_UVIEW_LEGACY,
int *  piles = NULL,
int  sxt = -1,
int  syt = -1,
int  swt = -1,
int  sht = -1
 


Variable Documentation

int big_unit_images
 

short bsx[NUMPOWERS][7]
 

short bsy[NUMPOWERS][7]
 

short bwid[]
 

short bwid2[]
 

char* cmdargstr
 

short cwid[]
 

char* dirchars
 

Side* dside
 

ImageFamily* generic_fuzz
 

ImageFamily* generic_transition
 

short halfsides[]
 

short hcs[]
 

short hhs[]
 

short hws[]
 

short ibsx[NUMPOWERS][7]
 

short ibsy[NUMPOWERS][7]
 

short ics[]
 

short ihs[]
 

short ilsx[NUMPOWERS][6]
 

short ilsy[NUMPOWERS][6]
 

void(* imf_describe_hook)(Side *side, Image *img)
 

short iws[]
 

short ix1[]
 

short ix2[]
 

HelpNode* key_commands_help_node
 

HelpNode* long_commands_help_node
 

short lsx[NUMPOWERS][6]
 

short lsy[NUMPOWERS][6]
 

short mags[]
 

HelpNode* map_help_node
 

int min_h_for_unit_image
 

int min_w_for_unit_image
 

int numgames
 

int* numuimages
 

Module** possible_games
 

short qx[NUMPOWERS][7]
 

short qy[NUMPOWERS][7]
 

char* terrchars
 

char tmpkey
 

short uhs[]
 

ImageFamily** uimages
 

char* unitchars
 

char unseen_char_1
 

char unseen_char_2
 

ImageFamily* unseen_image
 

short uws[]
 


Generated on Sat Sep 17 10:29:41 2005 for XconqKernel by doxygen 1.3.6