1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

texture aura option

This commit is contained in:
Zeno Rogue 2018-08-03 10:47:20 +02:00
parent 270015cf7f
commit 7c16a9a32a
4 changed files with 15 additions and 3 deletions

View File

@ -273,6 +273,8 @@ void initConfig() {
addsaver(vid.linequality, "line quality", 0);
addsaver(texture::texture_aura, "texture-aura", false);
#if CAP_SHMUP
shmup::initConfig();
#endif

View File

@ -4639,7 +4639,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
queuepolyat(V, shDisk, 0xC0404040, PPR_SWORDMARK);
}
addaura(tC0(V), zcol, fd);
if(!texture::using_aura()) addaura(tC0(V), zcol, fd);
int ad = airdist(c);
if(ad == 1 || ad == 2) {

View File

@ -2903,6 +2903,9 @@ namespace texture {
extern bool texturesym;
extern cpatterntype cgroup;
extern bool texture_aura;
bool using_aura();
}
#endif

View File

@ -342,6 +342,12 @@ int texture_config::recolor(int col) {
return col;
}
bool texture_aura;
bool using_aura() {
return texture_aura && config.tstate == texture::tsActive;
}
bool texture_config::apply(cell *c, const transmatrix &V, int col) {
if(config.tstate == tsOff) return false;
@ -368,8 +374,7 @@ bool texture_config::apply(cell *c, const transmatrix &V, int col) {
lastptd().u.poly.outline = grid_color;
}
if(texture::saving) {
// create a nicer aura for saved texture
if(using_aura()) {
for(int i=0; i<isize(mi.tvertices); i += 3) {
ld p[3];
while(true) {
@ -1101,6 +1106,8 @@ void showMenu() {
dialog::addColorItem(XLAT("mesh color"), config.mesh_color, 'm');
dialog::addSelItem(XLAT("color alpha"), its(config.color_alpha), 'c');
dialog::addSelItem(XLAT("precision"), its(config.gsplits), 'P');
dialog::addBoolItem(XLAT("aura from texture"), texture_aura, 'a');
dialog::add_action([] () { texture_aura = !texture_aura; });
#if CAP_EDIT
dialog::addItem(XLAT("edit the texture"), 'e');
#endif