HyperRogue  11.3d
game/visualization engine based on non-Euclidean geometry
Classes | Namespaces | Macros | Typedefs | Functions | Variables
graph.cpp File Reference

Drawing cells, monsters, items, etc. More...

#include "hyper.h"

Classes

struct  hr::fallanim
 
struct  hr::flashdata
 
struct  hr::animation
 

Namespaces

 hr
 

Macros

#define ADC(V, c)   for(const transmatrix& V: current_display->all_drawn_copies[c])
 
#define WOLNIEJ   1
 
#define BTOFF   0x404040
 
#define BTON   0xC0C000
 
#define UNTRANS   (GDIM == 3 ? 0x000000FF : 0)
 
#define VFOOT   ((GDIM == 2 || prod) ? V : mmscale(V, cgi.LEG0))
 
#define VLEG   mmscale(V, cgi.LEG)
 
#define VGROIN   mmscale(V, cgi.GROIN)
 
#define VBODY   mmscale(V, cgi.BODY)
 
#define VBODY1   mmscale(V, cgi.BODY1)
 
#define VBODY2   mmscale(V, cgi.BODY2)
 
#define VBODY3   mmscale(V, cgi.BODY3)
 
#define VNECK   mmscale(V, cgi.NECK)
 
#define VHEAD   mmscale(V, cgi.HEAD)
 
#define VHEAD1   mmscale(V, cgi.HEAD1)
 
#define VHEAD2   mmscale(V, cgi.HEAD2)
 
#define VHEAD3   mmscale(V, cgi.HEAD3)
 
#define VALEGS   V
 
#define VABODY   mmscale(V, cgi.ABODY)
 
#define VAHEAD   mmscale(V, cgi.AHEAD)
 
#define VFISH   V
 
#define VBIRD   ((GDIM == 3 || (where && bird_disruption(where))) ? (WDIM == 2 ? mmscale(V, cgi.BIRD) : V) : mmscale(V, cgi.BIRD + .05 * sintick(1000, (int) (size_t(where))/1000.)))
 
#define VGHOST   mmscale(V, cgi.GHOST)
 
#define VSLIMEEYE   mscale(V, cgi.FLATEYE)
 
#define AURA   180
 
#define Dark(x)   darkena(x,0,0xFF)
 
#define MOBON   true
 
#define ANIMLAYERS   3
 
#define LAYER_BIG   0
 
#define LAYER_SMALL   1
 
#define LAYER_BOAT   2
 

Typedefs

typedef void(* hr::cfunction) ()
 

Functions

EX bool hr::in_wallopt ()
 
EX bool hr::in_perspective ()
 
EX bool hr::hide_player ()
 
EX ld hr::ptick (int period, ld phase IS(0))
 
EX ld hr::fractick (int period, ld phase IS(0))
 
EX ld hr::sintick (int period, ld phase IS(0))
 
EX transmatrix hr::spintick (int period, ld phase IS(0))
 
EX bool hr::doHighlight ()
 
ld hr::spina (cell *c, int dir)
 
EX int hr::cloakcolor (int rtr)
 
int hr::firegradient (double p)
 
EX int hr::firecolor (int phase IS(0), int mul IS(1))
 
EX int hr::watercolor (int phase)
 
EX int hr::aircolor (int phase)
 
EX int hr::fghostcolor (cell *c)
 
EX int hr::weakfirecolor (int phase)
 
color_t hr::fc (int ph, color_t col, int z)
 
EX void hr::drawLightning ()
 
EX void hr::drawSafety ()
 
void hr::drawShield (const transmatrix &V, eItem it)
 
void hr::drawSpeed (const transmatrix &V)
 
void hr::drawSafety (const transmatrix &V, int ct)
 
void hr::drawFlash (const transmatrix &V)
 
EX ld hr::cheilevel (ld v)
 
EX transmatrix hr::chei (const transmatrix V, int a, int b)
 
void hr::drawLove (const transmatrix &V, int hdir)
 
void hr::drawWinter (const transmatrix &V, ld hdir)
 
void hr::drawLightning (const transmatrix &V)
 
EX void hr::drawPlayerEffects (const transmatrix &V, cell *c, bool onplayer)
 
void hr::drawStunStars (const transmatrix &V, int t)
 
void hr::tortoise::draw (const transmatrix &V, int bits, int small, int stuntime)
 
EX int hr::tortoise::getMatchColor (int bits)
 
double hr::footfun (double d)
 
void hr::animallegs (const transmatrix &V, eMonster mo, color_t col, double footphase)
 
EX void hr::ShadowV (const transmatrix &V, const hpcshape &bp, PPR prio IS(PPR::MONSTER_SHADOW))
 
transmatrix hr::otherbodyparts (const transmatrix &V, color_t col, eMonster who, double footphase)
 
EX bool hr::drawstar (cell *c)
 
EX bool hr::drawing_usershape_on (cell *c, mapeditor::eShapegroup sg)
 
EX color_t hr::kind_outline (eItem it)
 
EX transmatrix hr::face_the_player (const transmatrix V)
 
EX hpcshape & hr::orbshape (eOrbshape s)
 
EX color_t hr::orb_auxiliary_color (eItem it)
 
EX bool hr::drawItemType (eItem it, cell *c, const transmatrix &V, color_t icol, int pticks, bool hidden)
 
void hr::humanoid_eyes (const transmatrix &V, color_t ecol, color_t hcol=skincolor)
 
EX void hr::drawTerraWarrior (const transmatrix &V, int t, int hp, double footphase)
 
EX void hr::drawPlayer (eMonster m, cell *where, const transmatrix &V, color_t col, double footphase, bool stop IS(false))
 
EX int hr::wingphase (int period, int phase IS(0))
 
transmatrix hr::wingmatrix (int period, int phase=0)
 
void hr::drawMimic (eMonster m, cell *where, const transmatrix &V, color_t col, double footphase)
 
EX bool hr::drawMonsterType (eMonster m, cell *where, const transmatrix &V1, color_t col, double footphase, color_t asciicol)
 
bool hr::drawMonsterTypeDH (eMonster m, cell *where, const transmatrix &V, color_t col, bool dh, ld footphase, color_t asciicol)
 
EX bool hr::applyAnimation (cell *c, transmatrix &V, double &footphase, int layer)
 
double hr::chainAngle (cell *c, transmatrix &V, cell *c2, double dft, const transmatrix &Vwhere)
 
bool hr::chainAnimation (cell *c, cell *c2, transmatrix &V, const transmatrix &Vwhere, ld &length)
 
EX int hr::cellcolor (cell *c)
 
int hr::taildist (cell *c)
 
void hr::add_segment (int d, const function< void()> &s)
 
void hr::drawWormSegments ()
 
EX bool hr::drawMonster (const transmatrix &Vparam, int ct, cell *c, color_t col, color_t asciicol)
 
EX int hr::haveaura ()
 
EX void hr::clearaura ()
 
void hr::apply_joukowsky_aura (hyperpoint &h)
 
EX void hr::addauraspecial (hyperpoint h, color_t col, int dir)
 
EX void hr::addaura (hyperpoint h, color_t col, int fd)
 
void hr::sumaura (int v)
 
void hr::drawaura ()
 
bool hr::bugsNearby (cell *c, int dist=2)
 
EX int hr::countMinesAround (cell *c)
 
EX transmatrix hr::applyPatterndir (cell *c, const patterns::patterninfo &si)
 
EX transmatrix hr::applyDowndir (cell *c, const cellfunction &cf)
 
void hr::draw_movement_arrows (cell *c, const transmatrix &V, int df)
 
EX int hr::celldistAltPlus (cell *c)
 
bool hr::drawstaratvec (double dx, double dy)
 
EX color_t hr::reptilecolor (cell *c)
 
ld hr::wavefun (ld x)
 
EX void hr::init_floorcolors ()
 
EX color_t hr::magma_color (int id)
 
bool hr::noAdjacentChasms (cell *c)
 
EX bool hr::has_nice_dual ()
 
EX bool hr::is_nice_dual (cell *c)
 
EX bool hr::use_swapped_duals ()
 
EX void hr::floorShadow (cell *c, const transmatrix &V, color_t col)
 
EX bool hr::use_warp_graphics ()
 
EX void hr::escherSidewall (cell *c, int sidepar, const transmatrix &V, color_t col)
 
EX bool hr::placeSidewall (cell *c, int i, int sidepar, const transmatrix &V, color_t col)
 
bool hr::openorsafe (cell *c)
 
EX int hr::gridcolor (cell *c1, cell *c2)
 
EX void hr::pushdown (cell *c, int &q, const transmatrix &V, double down, bool rezoom, bool repriority)
 
EX int hr::shallow (cell *c)
 
bool hr::allemptynear (cell *c)
 
EX int hr::getfd (cell *c)
 
EX int hr::colorhash (color_t i)
 
EX bool hr::isWall3 (cell *c, color_t &wcol)
 
EX bool hr::isWall3 (cell *c)
 
EX bool hr::isSulphuric (eWall w)
 
color_t hr::lcolor (cell *c)
 
EX color_t hr::transcolor (cell *c, cell *c2, color_t wcol)
 
EX int hr::get_darkval (cell *c, int d)
 
EX ld hr::mousedist (transmatrix T)
 
void hr::make_clipping_planes ()
 
EX void hr::gridline (const transmatrix &V1, const hyperpoint h1, const transmatrix &V2, const hyperpoint h2, color_t col, int prec)
 
EX void hr::gridline (const transmatrix &V, const hyperpoint h1, const hyperpoint h2, color_t col, int prec)
 
EX int hr::wall_offset (cell *c)
 
EX void hr::queue_transparent_wall (const transmatrix &V, hpcshape &sh, color_t color)
 
EX int hr::ceiling_category (cell *c)
 
EX void hr::set_detail_level (const transmatrix &V)
 
EX void hr::drawBubble (cell *c, color_t col, string s, ld size)
 
EX void hr::drawFlash (cell *c)
 
EX void hr::drawBigFlash (cell *c)
 
EX void hr::drawParticleSpeed (cell *c, color_t col, int speed)
 
EX void hr::drawParticle (cell *c, color_t col, int maxspeed IS(100))
 
EX void hr::drawDirectionalParticle (cell *c, int dir, color_t col, int maxspeed IS(100))
 
EX void hr::drawParticles (cell *c, color_t col, int qty, int maxspeed IS(100))
 
EX void hr::drawFireParticles (cell *c, int qty, int maxspeed IS(100))
 
EX void hr::fallingFloorAnimation (cell *c, eWall w IS(waNone), eMonster m IS(moNone))
 
EX void hr::fallingMonsterAnimation (cell *c, eMonster m, int id IS(multi::cpid))
 
EX void hr::queuecircleat1 (cell *c, const transmatrix &V, double rad, color_t col)
 
EX void hr::queuecircleat (cell *c, double rad, color_t col)
 
EX cell * hr::forwardcell ()
 
EX void hr::drawMarkers ()
 
void hr::drawFlashes ()
 
EX void hr::draw_flash (struct flashdata &f, const transmatrix &V, bool &kill)
 
EX bool hr::allowIncreasedSight ()
 
EX bool hr::allowChangeRange ()
 
EX ld hr::wall_radar (cell *c, transmatrix T, transmatrix LPe, ld max)
 
EX void hr::make_actual_view ()
 
EX transmatrix hr::cview ()
 
EX void hr::precise_mouseover ()
 
EX void hr::drawthemap ()
 
EX void hr::drawmovestar (double dx, double dy)
 
EX void hr::calcparam ()
 
EX void hr::drawfullmap ()
 
EX void hr::gamescreen (int _darken)
 
EX void hr::normalscreen ()
 
template<class T >
void hr::pushScreen (const T &x)
 
void hr::popScreen ()
 
void hr::popScreenAll ()
 
EX cfunction hr::current_screen_cfunction ()
 
EX void hr::drawscreen ()
 
EX void hr::restartGraph ()
 
EX void hr::clearAnimations ()
 
EX int hr::revhint (cell *c, int hint)
 
EX transmatrix hr::adj (const movei &m)
 
EX transmatrix hr::iadj (const movei &m)
 
EX void hr::animateMovement (const movei &m, int layer)
 
EX void hr::animateAttack (const movei &m, int layer)
 
EX void hr::indAnimateMovement (const movei &m, int layer)
 
EX void hr::commitAnimations (int layer)
 
EX void hr::drawBug (const cellwalker &cw, color_t col)
 
EX bool hr::inscreenrange (cell *c)
 

Variables

EX int hr::last_firelimit
 
EX int hr::firelimit
 
EX int hr::inmirrorcount = 0
 
EX bool hr::wallopt
 
EX bool hr::spatial_graphics
 
EX bool hr::wmspatial
 
EX bool hr::wmescher
 
EX bool hr::wmplain
 
EX bool hr::wmblack
 
EX bool hr::wmascii
 
EX bool hr::wmascii3
 
EX bool hr::mmspatial
 
EX bool hr::mmhigh
 
EX bool hr::mmmon
 
EX bool hr::mmitem
 
EX int hr::detaillevel = 0
 
EX bool hr::first_cell_to_draw = true
 
EX hookset< bool(int sym, int uni)> * hr::hooks_handleKey
 
EX hookset< bool(cell *c, const transmatrix &V)> * hr::hooks_drawcell
 
EX purehookset hr::hooks_frame
 
EX purehookset hr::hooks_markers
 
EX ld hr::animation_factor = 1
 
EX int hr::animation_lcm = 0
 
int hr::colorbar
 
EX bool hr::inHighQual
 
EX bool hr::auraNOGL
 
int hr::axestate
 
EX int hr::ticks
 
EX int hr::frameid
 
EX bool hr::camelotcheat
 
EX bool hr::nomap
 
EX eItem hr::orbToTarget
 
EX eMonster hr::monsterToSummon
 
EX int hr::sightrange_bonus = 0
 
EX string hr::mouseovers
 
EX int hr::darken = 0
 
map< cell *, fallanim > hr::fallanims
 
int hr::dlit
 
EX int hr::lightat
 
EX int hr::safetyat
 
EX bool hr::ivoryz
 
EX bool hr::noshadow
 
color_t hr::skincolor = 0xD0C080FF
 
EX transmatrix hr::playerV
 
int hr::last_wormsegment = -1
 
vector< vector< function< void()> > > hr::wormsegments
 
EX bool hr::dont_face_pc = false
 
array< array< int, 4 >, AURA+1 > hr::aurac
 
int hr::haveaura_cached
 
vector< pair< int, int > > hr::auraspecials
 
int hr::auramemo
 
vector< glhr::colored_vertex > hr::auravertices
 
EX colortable hr::minecolors
 
EX colortable hr::distcolors
 
const char * hr::minetexts [8]
 
EX colortable hr::nestcolors = { 0x800000, 0x008000, 0x000080, 0x404040, 0x700070, 0x007070, 0x707000, 0x606060 }
 
EX color_t hr::stdgridcolor = 0x202020FF
 
EX bool hr::bright
 
EX bool hr::just_gmatrix
 
vector< hyperpoint > hr::clipping_planes
 
EX int hr::noclipped
 
EX ld hr::precise_width = .5
 
int hr::grid_depth = 0
 
EX bool hr::fat_edges = false
 
vector< flashdata > hr::flashes
 
always_false hr::static_bubbles
 
EX purehookset hr::hooks_drawmap
 
EX transmatrix hr::actual_view_transform
 
EX transmatrix hr::Viewbase
 
EX bool hr::no_wall_rendering
 
EX bool hr::dronemode
 
purehookset hr::hooks_calcparam
 
EX int hr::corner_centering
 
EX bool hr::permaside
 
function< void()> hr::wrap_drawfullmap = drawfullmap
 
bool hr::force_sphere_outline = false
 
EX bool hr::nohelp
 
EX vector< function< void()> > hr::screens = { normalscreen }
 
EX int hr::cmode
 
auto hr::graphcm
 
EX array< map< cell *, animation >, ANIMLAYERS > hr::animations
 
vector< pair< cell *, animation > > hr::animstack
 
auto hr::hooksw = addHook(hooks_swapdim, 100, [] { clearAnimations(); gmatrix.clear(); gmatrix0.clear(); current_display->all_drawn_copies.clear(); })
 

Detailed Description

Drawing cells, monsters, items, etc.