mirror of
https://gitlab.com/xonotic/xonotic
synced 2025-04-11 03:31:22 +00:00
do not write zero alpha values
This commit is contained in:
parent
443b4bfa9f
commit
aa9677f5b9
@ -270,6 +270,8 @@ void hmap_to_nmap(unsigned char *map, int w, int h, int src_chan, double scale)
|
|||||||
imgspace1[(w*y+x)][0] = (v - 128.0) / 127.0;
|
imgspace1[(w*y+x)][0] = (v - 128.0) / 127.0;
|
||||||
imgspace1[(w*y+x)][1] = 0;
|
imgspace1[(w*y+x)][1] = 0;
|
||||||
#endif
|
#endif
|
||||||
|
if(v < 1)
|
||||||
|
v = 1; /* do not write alpha zero */
|
||||||
map[(w*y+x)*4+3] = floor(v + 0.5);
|
map[(w*y+x)*4+3] = floor(v + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,6 +382,8 @@ void hmap_to_nmap_local(unsigned char *map, int w, int h, int src_chan, double s
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
img_reduced[(w*y+x)] = (v - 128.0) / 127.0;
|
img_reduced[(w*y+x)] = (v - 128.0) / 127.0;
|
||||||
|
if(v < 1)
|
||||||
|
v = 1; /* do not write alpha zero */
|
||||||
map[(w*y+x)*4+3] = floor(v + 0.5);
|
map[(w*y+x)*4+3] = floor(v + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user