mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
rogueviz:: ggamma is back (better tuning possible with both alpha and gamma)
This commit is contained in:
parent
0cf61a901d
commit
3102dbd7e7
12
rogueviz.cpp
12
rogueviz.cpp
@ -34,6 +34,7 @@ namespace hr { extern renderbuffer *floor_textures; }
|
|||||||
namespace rogueviz {
|
namespace rogueviz {
|
||||||
|
|
||||||
ld fat_edges = 0;
|
ld fat_edges = 0;
|
||||||
|
ld ggamma = 1;
|
||||||
|
|
||||||
const transmatrix centralsym = {{{-1,0,0}, {0,-1,0}, {0,0,-1}}};
|
const transmatrix centralsym = {{{-1,0,0}, {0,-1,0}, {0,0,-1}}};
|
||||||
|
|
||||||
@ -1320,8 +1321,7 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
|||||||
|
|
||||||
if(kind == kSAG) {
|
if(kind == kSAG) {
|
||||||
if(ei->weight2 > maxweight) maxweight = ei->weight2;
|
if(ei->weight2 > maxweight) maxweight = ei->weight2;
|
||||||
ld gamma = log(alpha / 255.) / log(.5);
|
alpha *= pow(ei->weight2 / maxweight, ggamma);
|
||||||
alpha = int(pow(ei->weight2 / maxweight, gamma) * 255);
|
|
||||||
}
|
}
|
||||||
if(hilite || hiliteclick) alpha = (alpha + 256) / 2;
|
if(hilite || hiliteclick) alpha = (alpha + 256) / 2;
|
||||||
|
|
||||||
@ -1922,15 +1922,17 @@ int readArgs() {
|
|||||||
rog3 = true;
|
rog3 = true;
|
||||||
}
|
}
|
||||||
else if(argis("-rvedge")) {
|
else if(argis("-rvedge")) {
|
||||||
shift(); default_edgetype.color = arghex();
|
shift(); default_edgetype.color = default_edgetype.color_hi = arghex();
|
||||||
|
}
|
||||||
|
else if(argis("-rvedgehi")) {
|
||||||
|
shift(); default_edgetype.color_hi = arghex();
|
||||||
}
|
}
|
||||||
else if(argis("-rvfat")) {
|
else if(argis("-rvfat")) {
|
||||||
shift();
|
shift();
|
||||||
fat_edges = argf();
|
fat_edges = argf();
|
||||||
}
|
}
|
||||||
else if(argis("-ggamma")) {
|
else if(argis("-ggamma")) {
|
||||||
// backward compatibility
|
shift(); ggamma = argf();
|
||||||
shift(); part(default_edgetype.color, 0) = 255 * pow(.5, argf());
|
|
||||||
}
|
}
|
||||||
else if(argis("-cshift")) {
|
else if(argis("-cshift")) {
|
||||||
shift_arg_formula(collatz::cshift);
|
shift_arg_formula(collatz::cshift);
|
||||||
|
Loading…
Reference in New Issue
Block a user