From 40783980c04d9a6da755460928e3fdb411b3132a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Thu, 11 Apr 2024 00:55:14 +0200 Subject: [PATCH] drop lightmap hack --- engine/joint/v4k.h | 12 ------------ engine/split/v4k_render.c | 12 ------------ engine/v4k.c | 12 ------------ 3 files changed, 36 deletions(-) diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 76bf998..4104621 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -374051,8 +374051,6 @@ float model_animate(model_t m, float curframe) { return model_animate_clip(m, curframe, 0, q->numframes-1, true); } -static bool model_lightmap_hook = 0; //@fixme: delete this - static void model_draw_call(model_t m, int shader) { if(!m.iqm) return; @@ -374063,12 +374061,6 @@ void model_draw_call(model_t m, int shader) { renderstate_apply(&m.rs); - //@fixme lightmap_bake state hook - if (model_lightmap_hook) { - glDisable(GL_CULL_FACE); - glDisable(GL_BLEND); - } - glBindVertexArray( q->vao ); struct iqmtriangle *tris = NULL; @@ -374258,8 +374250,6 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm ASSERT(lm->ready); // @fixme: use xatlas to UV pack all models, update their UV1 and upload them to GPU. - model_lightmap_hook=1; - int w = lm->w, h = lm->h; for (int i = 0; i < array_count(lm->models); i++) { model_t *m = lm->models[i]; @@ -374322,8 +374312,6 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm FREE(m->lmdata); m->lmdata = NULL; } } - - model_lightmap_hook = 0; } #line 0 diff --git a/engine/split/v4k_render.c b/engine/split/v4k_render.c index 94556a6..4a9df47 100644 --- a/engine/split/v4k_render.c +++ b/engine/split/v4k_render.c @@ -3976,8 +3976,6 @@ float model_animate(model_t m, float curframe) { return model_animate_clip(m, curframe, 0, q->numframes-1, true); } -static bool model_lightmap_hook = 0; //@fixme: delete this - static void model_draw_call(model_t m, int shader) { if(!m.iqm) return; @@ -3988,12 +3986,6 @@ void model_draw_call(model_t m, int shader) { renderstate_apply(&m.rs); - //@fixme lightmap_bake state hook - if (model_lightmap_hook) { - glDisable(GL_CULL_FACE); - glDisable(GL_BLEND); - } - glBindVertexArray( q->vao ); struct iqmtriangle *tris = NULL; @@ -4183,8 +4175,6 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm ASSERT(lm->ready); // @fixme: use xatlas to UV pack all models, update their UV1 and upload them to GPU. - model_lightmap_hook=1; - int w = lm->w, h = lm->h; for (int i = 0; i < array_count(lm->models); i++) { model_t *m = lm->models[i]; @@ -4247,7 +4237,5 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm FREE(m->lmdata); m->lmdata = NULL; } } - - model_lightmap_hook = 0; } diff --git a/engine/v4k.c b/engine/v4k.c index b2515a3..d225cd1 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -21143,8 +21143,6 @@ float model_animate(model_t m, float curframe) { return model_animate_clip(m, curframe, 0, q->numframes-1, true); } -static bool model_lightmap_hook = 0; //@fixme: delete this - static void model_draw_call(model_t m, int shader) { if(!m.iqm) return; @@ -21155,12 +21153,6 @@ void model_draw_call(model_t m, int shader) { renderstate_apply(&m.rs); - //@fixme lightmap_bake state hook - if (model_lightmap_hook) { - glDisable(GL_CULL_FACE); - glDisable(GL_BLEND); - } - glBindVertexArray( q->vao ); struct iqmtriangle *tris = NULL; @@ -21350,8 +21342,6 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm ASSERT(lm->ready); // @fixme: use xatlas to UV pack all models, update their UV1 and upload them to GPU. - model_lightmap_hook=1; - int w = lm->w, h = lm->h; for (int i = 0; i < array_count(lm->models); i++) { model_t *m = lm->models[i]; @@ -21414,8 +21404,6 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm FREE(m->lmdata); m->lmdata = NULL; } } - - model_lightmap_hook = 0; } #line 0