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

texture mode, also the basic definitions of textures, used in 3D mode More...

#include "hyper.h"

Classes

struct  hr::texture_triangle
 
struct  hr::textureinfo
 
struct  hr::texture::texture_data
 
struct  hr::texture::texture_config
 
struct  hr::texture::undo
 
struct  hr::texture::magicmapper_point
 
struct  hr::texture::magic_param
 

Namespaces

 hr
 

Typedefs

typedef pair< int, int > hr::texture::point
 

Enumerations

enum  eTextureState { tsOff, tsAdjusting, tsActive }
 
enum  eMagicParameter {
  mpScale, mpProjection, mpMove, mpRotate,
  mpSlant, mpStretch, mpTexPosX, mpTexPosY,
  mpMAX
}
 
enum  eTexturePanstate {
  tpsModel, tpsMove, tpsScale, tpsAffine,
  tpsZoom, tpsProjection, tpsCell, tpsTriangle,
  tpsTune
}
 

Functions

SDL_Surface * hr::texture::convertSurface (SDL_Surface *s)
 
template<class T , class U >
void hr::texture::scale_colorarray (int origdim, int targetdim, const T &src, const U &dest)
 
int hr::texture::celltriangles (cell *c)
 
array< hyperpoint, 3 > hr::texture::findTextureTriangle (cell *c, patterns::patterninfo &si, int i)
 
int hr::texture::getTriangleID (cell *c, patterns::patterninfo &si, hyperpoint h)
 
void hr::texture::mapTexture (cell *c, textureinfo &mi, patterns::patterninfo &si, const transmatrix &T, int shift=0)
 
EX bool hr::texture::using_aura ()
 
vector< glhr::textured_vertex > hr::texture::rtver (4)
 
bool hr::texture::have_mp (eMagicParameter i)
 
ld hr::texture::magic_quality ()
 
void hr::texture::applyMagic ()
 
void hr::texture::mousemovement ()
 
void hr::texture::init_textureconfig ()
 
void hr::texture::showMagicMenu ()
 
EX void hr::texture::start_editor ()
 
EX void hr::texture::showMenu ()
 
point hr::texture::ptc (hyperpoint h)
 
array< point, 3 > hr::texture::ptc (const array< hyperpoint, 3 > &h)
 
int hr::texture::texture_distance (pair< int, int > p1, pair< int, int > p2)
 
void hr::texture::fillpixel (int x, int y, unsigned col)
 
void hr::texture::filltriangle (const array< hyperpoint, 3 > &v, const array< point, 3 > &p, color_t col, int lev)
 
void hr::texture::splitseg (const transmatrix &A, const array< ld, 2 > &angles, const array< hyperpoint, 2 > &h, const array< point, 2 > &p, color_t col, int lev)
 
void hr::texture::fillcircle (hyperpoint h, color_t col)
 
void hr::texture::actDrawPixel (cell *c, hyperpoint h, color_t col)
 
EX void hr::texture::drawPixel (cell *c, hyperpoint h, color_t col)
 
EX void hr::texture::drawPixel (hyperpoint h, color_t col)
 
EX void hr::texture::drawLine (hyperpoint h1, hyperpoint h2, color_t col, int steps IS(10))
 
EX double hr::texture::get_txp (ld x, ld y, int p)
 
int hr::texture::textureArgs ()
 

Variables

EX cpatterntype hr::texture::cgroup
 
EX texture_config hr::texture::config
 
EX bool hr::texture::saving = false
 
texture_triangle * hr::texture::edited_triangle
 
textureinfo * hr::texture::edited_tinfo
 
EX bool hr::texture::texture_aura
 
set< int > hr::texture::missing_cells_known
 
bool hr::texture::newmove = false
 
vector< magicmapper_point > hr::texture::amp
 
vector< string > hr::texture::mpnames
 
flagtype hr::texture::current_magic = 15
 
eTexturePanstate hr::texture::panstate
 
patterns::patterninfo hr::texture::si_save
 
saverlist hr::texture::texturesavers
 
eVariation hr::texture::targetvariation
 
eGeometry hr::texture::targetgeometry
 
string hr::texture::csymbol
 
string hr::texture::texturehelp
 
EX ld hr::texture::penwidth = .02
 
EX bool hr::texture::texturesym = false
 
EX cell * hr::texture::where
 
texture_data hr::texture::txp
 
auto hr::texture::texture_hook
 
int hr::texture::lastupdate
 

Detailed Description

texture mode, also the basic definitions of textures, used in 3D mode

Variable Documentation

◆ mpnames

vector<string> hr::texture::mpnames
Initial value:
= {
"affect model scale",
"affect model projection",
"affect model central point",
"affect model rotation",
"affect texture slanting",
"affect texture stretching",
"affect texture position X",
"affect texture position Y"
}

◆ texturehelp

string hr::texture::texturehelp
Initial value:
=
"This mode lets you to change the floor tesselation easily -- "
"select 'paint a new texture' and draw like in a Paint program. "
"The obtained pattern can then be easily changed to another geometry, "
"or saved.\n\n"
"Instead of drawing, it is also possible to use an arbitrary image "
"as a texture. "
"Works best with spherical/Euclidean/hyperbolic tesselations "
"(e.g., a photo of a soccerball, or one of the tesselations by M. C. "
"Escher), but it can be also used on arbitrary photos to make them periodic "
"(these probably work best with the 'large picture' setting in geometry selection). "
"Again, tesselations can have their geometry changed.\n\n"

◆ texture_hook

auto hr::texture::texture_hook
Initial value:
=
addHook(hooks_args, 100, textureArgs)
+ addHook(clearmemory, 100, [] () { config.data.pixels_to_draw.clear(); })