From ac662557dc246b04ad1b9fa755a40ed0ec05d386 Mon Sep 17 00:00:00 2001 From: rodri Date: Mon, 15 Jul 2024 20:06:47 +0000 Subject: fix stack overflow, skybox fov sensibility and scene duplication. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit putting the duplicate camera in a local variable turned out to be a bad idea. bring the dynamic version back. the skybox rendering was affected by the camera fov, which made it look like it was not really at infinity, so set it always to 90°. --- scene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene.c') diff --git a/scene.c b/scene.c index 95c6203..8a05bc9 100644 --- a/scene.c +++ b/scene.c @@ -322,8 +322,7 @@ dupmodel(Model *m) return nil; nm = newmodel(); - if(m->tex != nil) - nm->tex = duptexture(m->tex); + nm->tex = duptexture(m->tex); if(m->nmaterials > 0){ nm->nmaterials = m->nmaterials; nm->materials = emalloc(nm->nmaterials*sizeof(*nm->materials)); @@ -456,6 +455,7 @@ dupscene(Scene *s) if(s->nents > 0) for(e = s->ents.next; e != &s->ents; e = e->next) ns->addent(ns, dupentity(e)); + ns->skybox = dupcubemap(s->skybox); return ns; } -- cgit v1.2.3