From 754dda92ffe44f4e01226768efa6e5ee53022284 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 9 Jan 2012 21:13:40 +0900 Subject: [PATCH] Get the lightmap texture properly. --- include/QF/GLSL/qf_lightmap.h | 1 + include/QF/GLSL/qf_textures.h | 1 + libs/video/renderer/glsl/glsl_lightmap.c | 6 ++++++ libs/video/renderer/glsl/glsl_textures.c | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/include/QF/GLSL/qf_lightmap.h b/include/QF/GLSL/qf_lightmap.h index cb45987aa..d3f6cdd42 100644 --- a/include/QF/GLSL/qf_lightmap.h +++ b/include/QF/GLSL/qf_lightmap.h @@ -42,5 +42,6 @@ void gl_lightmap_init (void); void R_BuildLightmaps (struct model_s **models, int num_models); void R_CalcLightmaps (void); extern void (*R_BuildLightMap) (msurface_t *surf); +int R_LightmapTexture (void); #endif//__QF_GLSL_lightmap_h diff --git a/include/QF/GLSL/qf_textures.h b/include/QF/GLSL/qf_textures.h index 9a594c114..abb7e81c9 100644 --- a/include/QF/GLSL/qf_textures.h +++ b/include/QF/GLSL/qf_textures.h @@ -52,6 +52,7 @@ void GL_TextureInit (void); scrap_t *GL_CreateScrap (int size, int format); void GL_DestroyScrap (scrap_t *scrap); +int GL_ScrapTexture (scrap_t *scrap); subpic_t *GL_ScrapSubpic (scrap_t *scrap, int width, int height); //XXX slow! void GL_SubpicDelete (subpic_t *subpic); //XXX slow! void GL_SubpicUpdate (subpic_t *subpic, byte *data); diff --git a/libs/video/renderer/glsl/glsl_lightmap.c b/libs/video/renderer/glsl/glsl_lightmap.c index e33add75e..ca7dac035 100644 --- a/libs/video/renderer/glsl/glsl_lightmap.c +++ b/libs/video/renderer/glsl/glsl_lightmap.c @@ -238,3 +238,9 @@ R_BuildLightmaps (model_t **models, int num_models) } } } + +int +R_LightmapTexture (void) +{ + return GL_ScrapTexture (light_scrap); +} diff --git a/libs/video/renderer/glsl/glsl_textures.c b/libs/video/renderer/glsl/glsl_textures.c index a52c86842..858971f83 100644 --- a/libs/video/renderer/glsl/glsl_textures.c +++ b/libs/video/renderer/glsl/glsl_textures.c @@ -311,6 +311,12 @@ GL_DestroyScrap (scrap_t *scrap) free (scrap); } +int +GL_ScrapTexture (scrap_t *scrap) +{ + return scrap->tnum; +} + subpic_t * GL_ScrapSubpic (scrap_t *scrap, int width, int height) {