From ba7b9d60979df240ace835eafba50aa9d4d263f0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 8 Aug 2021 18:29:21 +0200 Subject: [PATCH] an option to disable sky drawing --- config.cpp | 3 ++- sky.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.cpp b/config.cpp index 81b3eaed..5b5c40ef 100644 --- a/config.cpp +++ b/config.cpp @@ -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([] { diff --git a/sky.cpp b/sky.cpp index 72b7457e..b2a817de 100644 --- a/sky.cpp +++ b/sky.cpp @@ -52,8 +52,11 @@ vector skyvertices; cell *sky_centerover; shiftmatrix sky_cview; +EX bool draw_sky = true; + void compute_skyvertices(const vector& sky) { skyvertices.clear(); + if(!draw_sky) return; int sk = get_skybrightness(); @@ -245,7 +248,7 @@ void compute_skyvertices(const vector& 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);