mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-30 15:39:54 +00:00
ray:: use get_darkval
This commit is contained in:
parent
64330fab93
commit
74ff8c7192
@ -534,7 +534,7 @@ EX void cast() {
|
|||||||
forCellIdEx(c1, i, c) {
|
forCellIdEx(c1, i, c) {
|
||||||
int u = (id/per_row*length) + (id%per_row * S7) + i;
|
int u = (id/per_row*length) + (id%per_row * S7) + i;
|
||||||
if(!ids.count(c1)) {
|
if(!ids.count(c1)) {
|
||||||
wallcolor[u] = glhr::acolor(color_out_of_range);
|
wallcolor[u] = glhr::acolor(color_out_of_range | 0xFF);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto code = enc(ids[c1], 0);
|
auto code = enc(ids[c1], 0);
|
||||||
@ -545,7 +545,10 @@ EX void cast() {
|
|||||||
dd.cw.at = c1;
|
dd.cw.at = c1;
|
||||||
dd.setcolors();
|
dd.setcolors();
|
||||||
color_t wcol = darkena(dd.wcol, 0, 0xFF);
|
color_t wcol = darkena(dd.wcol, 0, 0xFF);
|
||||||
|
int dv = get_darkval(c1, c->c.spin(i));
|
||||||
|
float p = 1 - dv / 16.;
|
||||||
wallcolor[u] = glhr::acolor(wcol);
|
wallcolor[u] = glhr::acolor(wcol);
|
||||||
|
for(int a: {0,1,2}) wallcolor[u][a] *= p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wallcolor[u] = glhr::acolor(0);
|
wallcolor[u] = glhr::acolor(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user