an option to disable sky drawing

This commit is contained in:
Zeno Rogue 2021-08-08 18:29:21 +02:00
parent 7b0b41967f
commit ba7b9d6097
2 changed files with 6 additions and 2 deletions

View File

@ -2287,7 +2287,8 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
addsaver(vid.use_wall_radar, "wallradar", true);
addsaver(vid.fixed_facing, "fixed facing", 0);
addsaver(vid.fixed_facing_dir, "fixed facing dir", 90);
addsaver(vid.fixed_yz, "fixed YZ", true);
param_b(vid.fixed_yz, "fixed YZ", true);
param_b(draw_sky, "draw sky", true);
param_f(vid.depth, "depth", "3D depth", 1)
->editable(0, 5, .1, "Ground level below the plane", "", 'd')
->set_extra([] {

View File

@ -52,8 +52,11 @@ vector<glhr::colored_vertex> skyvertices;
cell *sky_centerover;
shiftmatrix sky_cview;
EX bool draw_sky = true;
void compute_skyvertices(const vector<sky_item>& sky) {
skyvertices.clear();
if(!draw_sky) return;
int sk = get_skybrightness();
@ -245,7 +248,7 @@ void compute_skyvertices(const vector<sky_item>& sky) {
}
void dqi_sky::draw() {
if(!vid.usingGL || sky.empty()) return;
if(!vid.usingGL || sky.empty() || skyvertices.empty()) return;
#if CAP_VR
transmatrix s = (vrhr::rendering() ? vrhr::master_cview : cview()).T * inverse(sky_cview.T);