From 72cb7d3fdd773cd39fc3d4b1445a2b486ea42db3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 5 May 2022 23:45:21 +0900 Subject: [PATCH] [scene] Make the empty world work with lights Needed visibility and a sky surf flag, otherwise no lights were visible (why does this seem familiar?). --- libs/scene/scene.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/scene/scene.c b/libs/scene/scene.c index e9620abee..e2a49a61e 100644 --- a/libs/scene/scene.c +++ b/libs/scene/scene.c @@ -46,11 +46,14 @@ #include "scn_internal.h" +static byte empty_visdata[] = { 0x01 }; + static mleaf_t empty_leafs[] = { [1] = { .contents = CONTENTS_EMPTY, .mins = {-INFINITY, -INFINITY, -INFINITY}, .maxs = { INFINITY, INFINITY, INFINITY}, + .compressed_vis = empty_visdata, }, }; @@ -59,7 +62,7 @@ static mnode_t *empty_leaf_parents[] = { }; static int empty_leaf_flags[] = { - [1] = 0, + [1] = SURF_DRAWSKY, }; static char empty_entities[] = { 0 }; @@ -75,6 +78,7 @@ static model_t empty_world = { .nodes = (mnode_t *) &empty_leafs[1], .leafs = empty_leafs, .entities = empty_entities, + .visdata = empty_visdata, .leaf_parents = empty_leaf_parents, .leaf_flags = empty_leaf_flags, },