1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +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(vid.linequality, "line quality", 0);
addsaver(texture::texture_aura, "texture-aura", false);
#if CAP_SHMUP #if CAP_SHMUP
shmup::initConfig(); shmup::initConfig();
#endif #endif

View File

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

View File

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

View File

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