From 56c39c34bae9d3d59861da56f6031c9bb3d68f7b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 14 Mar 2022 14:31:23 +0900 Subject: [PATCH] [renderer] Remove namehack.h Finally. I never liked it (felt bad adding it in the first place), and it has caused confusion with function and global variable names, but it did let me get the render plugins working. --- include/QF/GL/qf_alias.h | 44 +++++++++ include/QF/GL/qf_draw.h | 27 ++++++ include/QF/GL/qf_lightmap.h | 4 +- include/QF/GL/qf_particles.h | 45 +++++++++ include/QF/GL/qf_rlight.h | 3 +- include/QF/GL/qf_rmain.h | 12 ++- include/QF/GL/qf_rsurf.h | 12 ++- include/QF/GL/qf_sky.h | 8 +- include/QF/GL/qf_sprite.h | 37 +++++++ include/QF/GLSL/qf_bsp.h | 2 + include/QF/GLSL/qf_draw.h | 32 +++++- include/QF/GLSL/qf_main.h | 37 +++++++ include/QF/GLSL/qf_particles.h | 10 +- include/QF/GLSL/qf_sprite.h | 3 + include/QF/Makemodule.am | 5 +- libs/video/renderer/Makemodule.am | 2 - libs/video/renderer/gl/gl_draw.c | 3 - libs/video/renderer/gl/gl_dyn_lights.c | 3 - libs/video/renderer/gl/gl_dyn_part.c | 5 +- libs/video/renderer/gl/gl_dyn_textures.c | 3 - libs/video/renderer/gl/gl_graph.c | 4 +- libs/video/renderer/gl/gl_lightmap.c | 3 - libs/video/renderer/gl/gl_mod_alias.c | 4 +- libs/video/renderer/gl/gl_mod_iqm.c | 3 - libs/video/renderer/gl/gl_mod_sprite.c | 4 +- libs/video/renderer/gl/gl_rmain.c | 13 +-- libs/video/renderer/gl/gl_rmisc.c | 66 +++++++------ libs/video/renderer/gl/gl_rsurf.c | 16 ++- libs/video/renderer/gl/gl_sky.c | 3 - libs/video/renderer/gl/gl_sky_clip.c | 3 - libs/video/renderer/gl/gl_textures.c | 3 - libs/video/renderer/gl/gl_warp.c | 3 - libs/video/renderer/gl/namehack.h | 110 --------------------- libs/video/renderer/glsl/glsl_alias.c | 3 - libs/video/renderer/glsl/glsl_bsp.c | 9 +- libs/video/renderer/glsl/glsl_draw.c | 3 - libs/video/renderer/glsl/glsl_iqm.c | 3 - libs/video/renderer/glsl/glsl_lightmap.c | 3 - libs/video/renderer/glsl/glsl_main.c | 52 +++++----- libs/video/renderer/glsl/glsl_particles.c | 3 - libs/video/renderer/glsl/glsl_sprite.c | 7 +- libs/video/renderer/glsl/glsl_textures.c | 3 - libs/video/renderer/glsl/namehack.h | 113 ---------------------- libs/video/renderer/vid_render_gl.c | 6 +- libs/video/renderer/vid_render_glsl.c | 6 +- 45 files changed, 347 insertions(+), 396 deletions(-) create mode 100644 include/QF/GL/qf_alias.h create mode 100644 include/QF/GL/qf_particles.h create mode 100644 include/QF/GL/qf_sprite.h create mode 100644 include/QF/GLSL/qf_main.h delete mode 100644 libs/video/renderer/gl/namehack.h delete mode 100644 libs/video/renderer/glsl/namehack.h diff --git a/include/QF/GL/qf_alias.h b/include/QF/GL/qf_alias.h new file mode 100644 index 000000000..644f58a74 --- /dev/null +++ b/include/QF/GL/qf_alias.h @@ -0,0 +1,44 @@ +/* + qf_alias.h + + GL specific alias model stuff + + Copyright (C) 2012 Bill Currie + + Author: Bill Currie + Date: 2012/1/1 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ +#ifndef __QF_GL_qf_alias_h +#define __QF_GL_qf_alias_h + +#include "QF/GL/types.h" + +typedef struct aliasvrt_s { + GLshort st[2]; + GLshort normal[3]; + GLushort vertex[3]; +} aliasvrt_t; + +struct entity_s; +void gl_R_DrawAliasModel (struct entity_s *ent); + +#endif//__QF_GL_qf_alias_h diff --git a/include/QF/GL/qf_draw.h b/include/QF/GL/qf_draw.h index 5644e6a74..65f1a03da 100644 --- a/include/QF/GL/qf_draw.h +++ b/include/QF/GL/qf_draw.h @@ -28,8 +28,35 @@ #ifndef __gl_draw_h #define __gl_draw_h +struct qpic_s; + +void gl_Draw_Init (void); +void gl_Draw_Shutdown (void); +void gl_Draw_Character (int x, int y, unsigned ch); +void gl_Draw_String (int x, int y, const char *str); +void gl_Draw_nString (int x, int y, const char *str, int count); +void gl_Draw_AltString (int x, int y, const char *str); +void gl_Draw_ConsoleBackground (int lines, byte alpha); +void gl_Draw_Crosshair (void); +void gl_Draw_CrosshairAt (int ch, int x, int y); +void gl_Draw_TileClear (int x, int y, int w, int h); +void gl_Draw_Fill (int x, int y, int w, int h, int c); +void gl_Draw_TextBox (int x, int y, int width, int lines, byte alpha); +void gl_Draw_FadeScreen (void); +void gl_Draw_BlendScreen (quat_t color); +struct qpic_s *gl_Draw_CachePic (const char *path, qboolean alpha); +void gl_Draw_UncachePic (const char *path); +struct qpic_s *gl_Draw_MakePic (int width, int height, const byte *data); +void gl_Draw_DestroyPic (struct qpic_s *pic); +struct qpic_s *gl_Draw_PicFromWad (const char *name); +void gl_Draw_Pic (int x, int y, struct qpic_s *pic); +void gl_Draw_Picf (float x, float y, struct qpic_s *pic); +void gl_Draw_SubPic(int x, int y, struct qpic_s *pic, + int srcx, int srcy, int width, int height); + void GL_Set2D (void); void GL_Set2DScaled (void); +void GL_End2D (void); void GL_DrawReset (void); void GL_FlushText (void); diff --git a/include/QF/GL/qf_lightmap.h b/include/QF/GL/qf_lightmap.h index 6125ea57e..102f26313 100644 --- a/include/QF/GL/qf_lightmap.h +++ b/include/QF/GL/qf_lightmap.h @@ -48,8 +48,8 @@ extern glRect_t gl_lightmap_rectchange[MAX_LIGHTMAPS]; void GL_BuildSurfaceDisplayList (msurface_t *fa); void gl_lightmap_init (void); void GL_BuildLightmaps (struct model_s **models, int num_models); -void R_BlendLightmaps (void); -void R_CalcLightmaps (void); +void gl_R_BlendLightmaps (void); +void gl_R_CalcLightmaps (void); struct transform_s; extern void (*gl_R_BuildLightMap) (const struct transform_s *transform, mod_brush_t *brush, msurface_t *surf); diff --git a/include/QF/GL/qf_particles.h b/include/QF/GL/qf_particles.h new file mode 100644 index 000000000..f053e0523 --- /dev/null +++ b/include/QF/GL/qf_particles.h @@ -0,0 +1,45 @@ +/* + qf_particles.h + + GL specific particles stuff + + Copyright (C) 2012 Bill Currie + + Author: Bill Currie + Date: 2012/1/15 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ +#ifndef __QF_GL_qf_particles_h +#define __QF_GL_qf_particles_h + +#include "QF/GL/types.h" + +typedef struct { + float texcoord[2]; + float vertex[3]; + byte color[4]; +} partvert_t; + +void gl_R_DrawParticles (void); +void gl_R_Particles_Init_Cvars (void); +void gl_R_InitParticles (void); + +#endif//__QF_GL_qf_particles_h diff --git a/include/QF/GL/qf_rlight.h b/include/QF/GL/qf_rlight.h index 0fdeaf2d8..66e719f78 100644 --- a/include/QF/GL/qf_rlight.h +++ b/include/QF/GL/qf_rlight.h @@ -29,6 +29,7 @@ #define __QF_GL_rlight_h extern float gl_bubble_sintable[], gl_bubble_costable[]; -void R_RenderDlights (void); +void gl_R_RenderDlights (void); +void gl_R_InitBubble (void); #endif // __QF_GL_rlight_h diff --git a/include/QF/GL/qf_rmain.h b/include/QF/GL/qf_rmain.h index 4625b94dc..651a9fff2 100644 --- a/include/QF/GL/qf_rmain.h +++ b/include/QF/GL/qf_rmain.h @@ -35,7 +35,6 @@ struct entity_s; extern qboolean gl_envmap; extern int c_brush_polys, c_alias_polys; -extern float r_world_matrix[16]; extern float gl_modelalpha; //extern vec3_t shadecolor; @@ -43,6 +42,15 @@ extern float gl_modelalpha; extern void gl_multitexture_f (struct cvar_s *var); void glrmain_init (void); -void R_RotateForEntity (struct entity_s *e); +void gl_R_RotateForEntity (struct entity_s *e); + +struct model_s; +void gl_R_NewMap (struct model_s *worldmodel, struct model_s **models, + int num_models); +void gl_R_RenderView (void); +void gl_R_ClearState (void); +void gl_R_ViewChanged (void); +void gl_R_LineGraph (int x, int y, int *h_vals, int count, int height); +int gl_R_InitGraphTextures (int base); #endif // __QF_GL_rmain_h diff --git a/include/QF/GL/qf_rsurf.h b/include/QF/GL/qf_rsurf.h index e799747ee..5a7e4c698 100644 --- a/include/QF/GL/qf_rsurf.h +++ b/include/QF/GL/qf_rsurf.h @@ -41,13 +41,21 @@ extern int gl_mirrortexturenum; // quake texturenum, not gltexturenum struct model_s; struct entity_s; struct msurface_s; +struct mod_brush_s; void gl_lightmap_init (void); void GL_BuildLightmaps (struct model_s **models, int num_models); -void R_DrawBrushModel (struct entity_s *e); -void R_DrawWorld (void); +void gl_R_DrawBrushModel (struct entity_s *e); +void gl_R_DrawWorld (void); +void gl_R_DrawWaterSurfaces (void); void GL_EmitWaterPolys (struct msurface_s *fa); +void gl_R_LoadSkys (const char *sky); + +struct texture_s; +void gl_R_AddTexture (struct texture_s *tx); +void gl_R_ClearTextures (void); +void gl_R_InitSurfaceChains (struct mod_brush_s *brush); #endif // __QF_GL_rsurf_h diff --git a/include/QF/GL/qf_sky.h b/include/QF/GL/qf_sky.h index 2524016b9..f2f030bb4 100644 --- a/include/QF/GL/qf_sky.h +++ b/include/QF/GL/qf_sky.h @@ -36,7 +36,11 @@ extern qboolean gl_skyloaded; extern vec5_t gl_skyvec[6][4]; -void R_DrawSky (void); -void R_DrawSkyChain (const instsurf_t *s); +struct texture_s; + +void gl_R_InitSky (struct texture_s *mt); +void gl_R_DrawSky (void); +void gl_R_DrawSkyChain (const instsurf_t *s); +void gl_R_LoadSkys (const char *skyname); #endif // __QF_GL_sky_h diff --git a/include/QF/GL/qf_sprite.h b/include/QF/GL/qf_sprite.h new file mode 100644 index 000000000..38498d127 --- /dev/null +++ b/include/QF/GL/qf_sprite.h @@ -0,0 +1,37 @@ +/* + qf_sprite.h + + GL specific sprite model stuff + + Copyright (C) 2021 Bill Currie + + Author: Bill Currie + Date: 2021/7/22 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ +#ifndef __QF_GL_qf_sprite_h +#define __QF_GL_qf_sprite_h + +struct entity_s; +void gl_R_InitSprites (void); +extern void (*gl_R_DrawSpriteModel) (struct entity_s *ent); + +#endif//__QF_GL_qf_sprite_h diff --git a/include/QF/GLSL/qf_bsp.h b/include/QF/GLSL/qf_bsp.h index 7e74aa9f7..482484b6a 100644 --- a/include/QF/GLSL/qf_bsp.h +++ b/include/QF/GLSL/qf_bsp.h @@ -68,8 +68,10 @@ struct model_s; void glsl_R_ClearElements (void); void glsl_R_DrawWorld (void); void glsl_R_DrawSky (void); +void glsl_R_DrawWaterSurfaces (void); void glsl_R_RegisterTextures (struct model_s **models, int num_models); void glsl_R_BuildDisplayLists (struct model_s **models, int num_models); void glsl_R_InitBsp (void); +void glsl_R_LoadSkys (const char *sky); #endif//__QF_GLSL_qf_bsp_h diff --git a/include/QF/GLSL/qf_draw.h b/include/QF/GLSL/qf_draw.h index aa708a96a..653e2bc5f 100644 --- a/include/QF/GLSL/qf_draw.h +++ b/include/QF/GLSL/qf_draw.h @@ -25,8 +25,34 @@ */ -#ifndef __gl_draw_h -#define __gl_draw_h +#ifndef __QF_GLSL_qf_draw_h +#define __QF_GLSL_qf_draw_h + +struct qpic_s; + +void glsl_Draw_Init (void); +void glsl_Draw_Shutdown (void); +void glsl_Draw_Character (int x, int y, unsigned ch); +void glsl_Draw_String (int x, int y, const char *str); +void glsl_Draw_nString (int x, int y, const char *str, int count); +void glsl_Draw_AltString (int x, int y, const char *str); +void glsl_Draw_ConsoleBackground (int lines, byte alpha); +void glsl_Draw_Crosshair (void); +void glsl_Draw_CrosshairAt (int ch, int x, int y); +void glsl_Draw_TileClear (int x, int y, int w, int h); +void glsl_Draw_Fill (int x, int y, int w, int h, int c); +void glsl_Draw_TextBox (int x, int y, int width, int lines, byte alpha); +void glsl_Draw_FadeScreen (void); +void glsl_Draw_BlendScreen (quat_t color); +struct qpic_s *glsl_Draw_CachePic (const char *path, qboolean alpha); +void glsl_Draw_UncachePic (const char *path); +struct qpic_s *glsl_Draw_MakePic (int width, int height, const byte *data); +void glsl_Draw_DestroyPic (struct qpic_s *pic); +struct qpic_s *glsl_Draw_PicFromWad (const char *name); +void glsl_Draw_Pic (int x, int y, struct qpic_s *pic); +void glsl_Draw_Picf (float x, float y, struct qpic_s *pic); +void glsl_Draw_SubPic(int x, int y, struct qpic_s *pic, + int srcx, int srcy, int width, int height); void GLSL_Set2D (void); void GLSL_Set2DScaled (void); @@ -34,4 +60,4 @@ void GLSL_End2D (void); void GLSL_DrawReset (void); void GLSL_FlushText (void); -#endif//__gl_draw_h +#endif//__QF_GLSL_qf_draw_h diff --git a/include/QF/GLSL/qf_main.h b/include/QF/GLSL/qf_main.h new file mode 100644 index 000000000..c41601802 --- /dev/null +++ b/include/QF/GLSL/qf_main.h @@ -0,0 +1,37 @@ +/* + qf_main.h + + glsl main stuff from the renderer. + + Copyright (C) 2021 Bill Currie + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +#ifndef __QF_GLSL_qf_main_h +#define __QF_GLSL_qf_main_h + +void glsl_R_NewMap (model_t *worldmodel, model_t **models, int num_models); +void glsl_R_RenderView (void); +void glsl_R_ClearState (void); +void glsl_R_ViewChanged (void); +void glsl_R_LineGraph (int x, int y, int *h_vals, int count, int height); + +#endif//__QF_GLSL_qf_main_h diff --git a/include/QF/GLSL/qf_particles.h b/include/QF/GLSL/qf_particles.h index 0c42d218e..67fa52049 100644 --- a/include/QF/GLSL/qf_particles.h +++ b/include/QF/GLSL/qf_particles.h @@ -27,8 +27,8 @@ Boston, MA 02111-1307, USA */ -#ifndef __QF_GLSL_qf_bsp_h -#define __QF_GLSL_qf_bsp_h +#ifndef __QF_GLSL_qf_particles_h +#define __QF_GLSL_qf_particles_h #include "QF/GLSL/types.h" @@ -38,4 +38,8 @@ typedef struct { byte color[4]; } partvert_t; -#endif//__QF_GLSL_qf_bsp_h +void glsl_R_DrawParticles (void); +void glsl_R_Particles_Init_Cvars (void); +void glsl_R_InitParticles (void); + +#endif//__QF_GLSL_qf_particles_h diff --git a/include/QF/GLSL/qf_sprite.h b/include/QF/GLSL/qf_sprite.h index af7817b1b..12f14a858 100644 --- a/include/QF/GLSL/qf_sprite.h +++ b/include/QF/GLSL/qf_sprite.h @@ -32,5 +32,8 @@ struct entity_s; void glsl_R_DrawSprite (struct entity_s *ent); +void glsl_R_SpriteBegin (void); +void glsl_R_SpriteEnd (void); +void glsl_R_InitSprites (void); #endif//__QF_GLSL_qf_sprite_h diff --git a/include/QF/Makemodule.am b/include/QF/Makemodule.am index 86f135c59..c842cb050 100644 --- a/include/QF/Makemodule.am +++ b/include/QF/Makemodule.am @@ -80,15 +80,17 @@ include_qf_gl = \ include/QF/GL/defines.h \ include/QF/GL/extensions.h \ include/QF/GL/funcs.h \ + include/QF/GL/qf_alias.h \ include/QF/GL/qf_draw.h \ - include/QF/GL/qf_explosions.h \ include/QF/GL/qf_funcs_list.h \ include/QF/GL/qf_iqm.h \ include/QF/GL/qf_lightmap.h \ + include/QF/GL/qf_particles.h \ include/QF/GL/qf_rlight.h \ include/QF/GL/qf_rmain.h \ include/QF/GL/qf_rsurf.h \ include/QF/GL/qf_sky.h \ + include/QF/GL/qf_sprite.h \ include/QF/GL/qf_textures.h \ include/QF/GL/qf_vid.h \ include/QF/GL/types.h @@ -102,6 +104,7 @@ include_qf_glsl = \ include/QF/GLSL/qf_funcs_list.h \ include/QF/GLSL/qf_iqm.h \ include/QF/GLSL/qf_lightmap.h \ + include/QF/GLSL/qf_main.h \ include/QF/GLSL/qf_particles.h \ include/QF/GLSL/qf_sprite.h \ include/QF/GLSL/qf_textures.h \ diff --git a/libs/video/renderer/Makemodule.am b/libs/video/renderer/Makemodule.am index 710117e1f..1b6bd2ab0 100644 --- a/libs/video/renderer/Makemodule.am +++ b/libs/video/renderer/Makemodule.am @@ -84,7 +84,6 @@ libs_video_renderer_librender_gl_la_SOURCES = \ libs/video/renderer/gl/gl_sky_clip.c \ libs/video/renderer/gl/gl_textures.c \ libs/video/renderer/gl/gl_warp.c \ - libs/video/renderer/gl/namehack.h \ libs/video/renderer/gl/qfgl_ext.c \ libs/video/renderer/gl/vid_common_gl.c \ libs/video/renderer/gl/vtxarray.c @@ -119,7 +118,6 @@ libs_video_renderer_librender_glsl_la_SOURCES = \ libs/video/renderer/glsl/glsl_shader.c \ libs/video/renderer/glsl/glsl_sprite.c \ libs/video/renderer/glsl/glsl_textures.c \ - libs/video/renderer/glsl/namehack.h \ libs/video/renderer/glsl/qfglsl.c \ libs/video/renderer/glsl/quakeforge.glsl \ libs/video/renderer/glsl/vid_common_glsl.c diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index 7a7bc9048..6d64779d8 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_dyn_lights.c b/libs/video/renderer/gl/gl_dyn_lights.c index 2d006c5cd..6af2287b2 100644 --- a/libs/video/renderer/gl/gl_dyn_lights.c +++ b/libs/video/renderer/gl/gl_dyn_lights.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index a236179dc..097533de0 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -53,7 +50,7 @@ #include "QF/GL/defines.h" #include "QF/GL/funcs.h" -#include "QF/GL/qf_explosions.h" +#include "QF/GL/qf_particles.h" #include "QF/GL/qf_textures.h" #include "QF/GL/qf_vid.h" diff --git a/libs/video/renderer/gl/gl_dyn_textures.c b/libs/video/renderer/gl/gl_dyn_textures.c index 093a1b905..28e7d8ef4 100644 --- a/libs/video/renderer/gl/gl_dyn_textures.c +++ b/libs/video/renderer/gl/gl_dyn_textures.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_graph.c b/libs/video/renderer/gl/gl_graph.c index 821620811..12c5e3774 100644 --- a/libs/video/renderer/gl/gl_graph.c +++ b/libs/video/renderer/gl/gl_graph.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -47,6 +44,7 @@ #include "QF/sys.h" #include "QF/GL/defines.h" #include "QF/GL/funcs.h" +#include "QF/GL/qf_rmain.h" #include "QF/GL/qf_textures.h" #include "r_internal.h" diff --git a/libs/video/renderer/gl/gl_lightmap.c b/libs/video/renderer/gl/gl_lightmap.c index 52cbb00b8..4f2d4a3c8 100644 --- a/libs/video/renderer/gl/gl_lightmap.c +++ b/libs/video/renderer/gl/gl_lightmap.c @@ -29,9 +29,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_mod_alias.c b/libs/video/renderer/gl/gl_mod_alias.c index 7934b1332..32ff19857 100644 --- a/libs/video/renderer/gl/gl_mod_alias.c +++ b/libs/video/renderer/gl/gl_mod_alias.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -55,6 +52,7 @@ #include "QF/GL/defines.h" #include "QF/GL/funcs.h" +#include "QF/GL/qf_alias.h" #include "QF/GL/qf_rlight.h" #include "QF/GL/qf_rmain.h" #include "QF/GL/qf_rsurf.h" diff --git a/libs/video/renderer/gl/gl_mod_iqm.c b/libs/video/renderer/gl/gl_mod_iqm.c index f66c2c7ca..f33828c29 100644 --- a/libs/video/renderer/gl/gl_mod_iqm.c +++ b/libs/video/renderer/gl/gl_mod_iqm.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_mod_sprite.c b/libs/video/renderer/gl/gl_mod_sprite.c index 1c37cd2ce..0f710a0b4 100644 --- a/libs/video/renderer/gl/gl_mod_sprite.c +++ b/libs/video/renderer/gl/gl_mod_sprite.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -46,6 +43,7 @@ #include "QF/GL/defines.h" #include "QF/GL/funcs.h" +#include "QF/GL/qf_sprite.h" #include "compat.h" #include "r_internal.h" diff --git a/libs/video/renderer/gl/gl_rmain.c b/libs/video/renderer/gl/gl_rmain.c index 3a393fa6f..e8caaf3d6 100644 --- a/libs/video/renderer/gl/gl_rmain.c +++ b/libs/video/renderer/gl/gl_rmain.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -56,11 +53,14 @@ #include "QF/GL/defines.h" #include "QF/GL/funcs.h" +#include "QF/GL/qf_alias.h" #include "QF/GL/qf_draw.h" #include "QF/GL/qf_iqm.h" +#include "QF/GL/qf_particles.h" #include "QF/GL/qf_rlight.h" #include "QF/GL/qf_rmain.h" #include "QF/GL/qf_rsurf.h" +#include "QF/GL/qf_sprite.h" #include "QF/GL/qf_vid.h" #include "compat.h" @@ -89,9 +89,6 @@ static unsigned int GLErr_StackOverflow; static unsigned int GLErr_StackUnderflow; static unsigned int GLErr_Unknown; -extern void (*R_DrawSpriteModel) (struct entity_s *ent); - - static unsigned int R_TestErrors (unsigned int numerous) { @@ -258,7 +255,7 @@ R_DrawEntitiesOnList (void) qfglInterleavedArrays (GL_T2F_C4UB_V3F, 0, gl_spriteVertexArray); for (size_t i = 0; i < r_ent_queue->ent_queues[mod_sprite].size; i++) { \ entity_t *ent = r_ent_queue->ent_queues[mod_sprite].a[i]; \ - R_DrawSpriteModel (ent); + gl_R_DrawSpriteModel (ent); } qfglDisable (GL_ALPHA_TEST); } @@ -324,7 +321,7 @@ R_DrawViewModel (void) qfglDepthRange (gldepthmin, gldepthmax); } -void +static void gl_R_SetupFrame (void) { R_AnimateLight (); diff --git a/libs/video/renderer/gl/gl_rmisc.c b/libs/video/renderer/gl/gl_rmisc.c index 49aef8679..35087b1fb 100644 --- a/libs/video/renderer/gl/gl_rmisc.c +++ b/libs/video/renderer/gl/gl_rmisc.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -56,8 +53,13 @@ #include "QF/vid.h" #include "QF/GL/defines.h" #include "QF/GL/funcs.h" +#include "QF/GL/qf_draw.h" +#include "QF/GL/qf_particles.h" +#include "QF/GL/qf_rlight.h" #include "QF/GL/qf_rmain.h" #include "QF/GL/qf_rsurf.h" +#include "QF/GL/qf_sky.h" +#include "QF/GL/qf_sprite.h" #include "QF/GL/qf_textures.h" #include "QF/GL/qf_vid.h" @@ -128,7 +130,7 @@ R_Envmap_f (void) gl_ctx->end_rendering ();*/ } -void +static void gl_R_LoadSky_f (void) { if (Cmd_Argc () != 2) { @@ -139,6 +141,34 @@ gl_R_LoadSky_f (void) gl_R_LoadSkys (Cmd_Argv (1)); } +/* + R_TimeRefresh_f + + For program optimization + LordHavoc: improved appearance and accuracy of timerefresh +*/ +static void +gl_R_TimeRefresh_f (void) +{ +/*FIXME update for simd + double start, stop, time; + int i; + + gl_ctx->end_rendering (); + + start = Sys_DoubleTime (); + for (i = 0; i < 128; i++) { + r_refdef.viewangles[1] = i * (360.0 / 128.0); + gl_R_RenderView (); + gl_ctx->end_rendering (); + } + + stop = Sys_DoubleTime (); + time = stop - start; + Sys_Printf ("%g seconds (%g fps)\n", time, 128 / time); +*/ +} + void gl_R_Init (void) { @@ -237,31 +267,3 @@ void gl_R_ViewChanged (void) { } - -/* - R_TimeRefresh_f - - For program optimization - LordHavoc: improved appearance and accuracy of timerefresh -*/ -void -gl_R_TimeRefresh_f (void) -{ -/*FIXME update for simd - double start, stop, time; - int i; - - gl_ctx->end_rendering (); - - start = Sys_DoubleTime (); - for (i = 0; i < 128; i++) { - r_refdef.viewangles[1] = i * (360.0 / 128.0); - gl_R_RenderView (); - gl_ctx->end_rendering (); - } - - stop = Sys_DoubleTime (); - time = stop - start; - Sys_Printf ("%g seconds (%g fps)\n", time, 128 / time); -*/ -} diff --git a/libs/video/renderer/gl/gl_rsurf.c b/libs/video/renderer/gl/gl_rsurf.c index 5a5bf3476..2e5f1d94a 100644 --- a/libs/video/renderer/gl/gl_rsurf.c +++ b/libs/video/renderer/gl/gl_rsurf.c @@ -29,9 +29,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -329,9 +326,6 @@ gl_R_DrawWaterSurfaces (void) if (!waterchain) return; - // go back to the world matrix - qfglLoadMatrixf (gl_r_world_matrix); - if (wateralpha < 1.0) { qfglDepthMask (GL_FALSE); color_white[3] = wateralpha * 255; @@ -342,18 +336,20 @@ gl_R_DrawWaterSurfaces (void) for (s = waterchain; s; s = s->tex_chain) { gltex_t *tex; surf = s->surface; - if (s->transform) + if (s->transform) { + qfglPushMatrix (); qfglLoadMatrixf (s->transform); - else - qfglLoadMatrixf (gl_r_world_matrix); + } tex = surf->texinfo->texture->render; if (i != tex->gl_texturenum) { i = tex->gl_texturenum; qfglBindTexture (GL_TEXTURE_2D, i); } GL_EmitWaterPolys (surf); + if (s->transform) { + qfglPopMatrix (); + } } - qfglLoadMatrixf (gl_r_world_matrix); waterchain = NULL; waterchain_tail = &waterchain; diff --git a/libs/video/renderer/gl/gl_sky.c b/libs/video/renderer/gl/gl_sky.c index e0ad50869..b0f00cfbe 100644 --- a/libs/video/renderer/gl/gl_sky.c +++ b/libs/video/renderer/gl/gl_sky.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_sky_clip.c b/libs/video/renderer/gl/gl_sky_clip.c index c11554315..fc1331dc8 100644 --- a/libs/video/renderer/gl/gl_sky_clip.c +++ b/libs/video/renderer/gl/gl_sky_clip.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #include #ifdef HAVE_STRING_H # include diff --git a/libs/video/renderer/gl/gl_textures.c b/libs/video/renderer/gl/gl_textures.c index 00a3d47c4..85a43eec9 100644 --- a/libs/video/renderer/gl/gl_textures.c +++ b/libs/video/renderer/gl/gl_textures.c @@ -29,9 +29,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/gl/gl_warp.c b/libs/video/renderer/gl/gl_warp.c index d32bc4141..3f08d83d7 100644 --- a/libs/video/renderer/gl/gl_warp.c +++ b/libs/video/renderer/gl/gl_warp.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #include "QF/cvar.h" #include "QF/sys.h" diff --git a/libs/video/renderer/gl/namehack.h b/libs/video/renderer/gl/namehack.h deleted file mode 100644 index 547442279..000000000 --- a/libs/video/renderer/gl/namehack.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifdef NH_DEFINE -#undef NH_DEFINE -#define Draw_Init gl_Draw_Init -#define Draw_Character gl_Draw_Character -#define Draw_String gl_Draw_String -#define Draw_nString gl_Draw_nString -#define Draw_AltString gl_Draw_AltString -#define Draw_ConsoleBackground gl_Draw_ConsoleBackground -#define Draw_Crosshair gl_Draw_Crosshair -#define Draw_CrosshairAt gl_Draw_CrosshairAt -#define Draw_TileClear gl_Draw_TileClear -#define Draw_Fill gl_Draw_Fill -#define Draw_TextBox gl_Draw_TextBox -#define Draw_FadeScreen gl_Draw_FadeScreen -#define Draw_BlendScreen gl_Draw_BlendScreen -#define Draw_CachePic gl_Draw_CachePic -#define Draw_UncachePic gl_Draw_UncachePic -#define Draw_MakePic gl_Draw_MakePic -#define Draw_DestroyPic gl_Draw_DestroyPic -#define Draw_PicFromWad gl_Draw_PicFromWad -#define Draw_Pic gl_Draw_Pic -#define Draw_Picf gl_Draw_Picf -#define Draw_SubPic gl_Draw_SubPic -#define R_AddTexture gl_R_AddTexture -#define R_BlendLightmaps gl_R_BlendLightmaps -#define R_CalcLightmaps gl_R_CalcLightmaps -#define R_ClearState gl_R_ClearState -#define R_ClearTextures gl_R_ClearTextures -#define R_DrawAliasModel gl_R_DrawAliasModel -#define R_DrawBrushModel gl_R_DrawBrushModel -#define R_DrawParticles gl_R_DrawParticles -#define R_DrawSky gl_R_DrawSky -#define R_DrawSkyChain gl_R_DrawSkyChain -#define R_DrawSpriteModel gl_R_DrawSpriteModel -#define R_DrawWaterSurfaces gl_R_DrawWaterSurfaces -#define R_DrawWorld gl_R_DrawWorld -#define R_InitBubble gl_R_InitBubble -#define R_InitGraphTextures gl_R_InitGraphTextures -#define R_InitParticles gl_R_InitParticles -#define R_InitSky gl_R_InitSky -#define R_InitSprites gl_R_InitSprites -#define R_InitSurfaceChains gl_R_InitSurfaceChains -#define R_LineGraph gl_R_LineGraph -#define R_LoadSky_f gl_R_LoadSky_f -#define R_LoadSkys gl_R_LoadSkys -#define R_NewMap gl_R_NewMap -#define R_Particle_New gl_R_Particle_New -#define R_Particle_NewRandom gl_R_Particle_NewRandom -#define R_Particles_Init_Cvars gl_R_Particles_Init_Cvars -#define R_ReadPointFile_f gl_R_ReadPointFile_f -#define R_RenderDlights gl_R_RenderDlights -#define R_RenderView gl_R_RenderView -#define R_RotateForEntity gl_R_RotateForEntity -#define R_SetupFrame gl_R_SetupFrame -#define R_TimeRefresh_f gl_R_TimeRefresh_f -#define R_ViewChanged gl_R_ViewChanged -#define SCR_CaptureBGR gl_SCR_CaptureBGR -#define SCR_ScreenShot gl_SCR_ScreenShot -#define SCR_ScreenShot_f gl_SCR_ScreenShot_f -#define R_RenderFrame gl_R_RenderFrame -#define c_alias_polys gl_c_alias_polys -#define c_brush_polys gl_c_brush_polys -#define r_easter_eggs_f gl_r_easter_eggs_f -#define r_particles_style_f gl_r_particles_style_f -#define r_world_matrix gl_r_world_matrix -#else -#undef R_AddTexture -#undef R_BlendLightmaps -#undef R_CalcLightmaps -#undef R_ClearState -#undef R_ClearTextures -#undef R_DrawAliasModel -#undef R_DrawBrushModel -#undef R_DrawParticles -#undef R_DrawSky -#undef R_DrawSkyChain -#undef R_DrawSpriteModel -#undef R_DrawWaterSurfaces -#undef R_DrawWorld -#undef R_Init -#undef R_InitBubble -#undef R_InitGraphTextures -#undef R_InitParticles -#undef R_InitSky -#undef R_InitSprites -#undef R_InitSurfaceChains -#undef R_LineGraph -#undef R_LoadSky_f -#undef R_LoadSkys -#undef R_NewMap -#undef R_Particle_New -#undef R_Particle_NewRandom -#undef R_Particles_Init_Cvars -#undef R_ReadPointFile_f -#undef R_RenderDlights -#undef R_RenderView -#undef R_RotateForEntity -#undef R_SetupFrame -#undef R_TimeRefresh_f -#undef R_ViewChanged -#undef SCR_CaptureBGR -#undef SCR_ScreenShot -#undef SCR_ScreenShot_f -#undef R_RenderFrame -#undef c_alias_polys -#undef c_brush_polys -#undef r_easter_eggs_f -#undef r_particles_style_f -#undef r_world_matrix -#endif diff --git a/libs/video/renderer/glsl/glsl_alias.c b/libs/video/renderer/glsl/glsl_alias.c index 05f2df3cd..f3399b119 100644 --- a/libs/video/renderer/glsl/glsl_alias.c +++ b/libs/video/renderer/glsl/glsl_alias.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/glsl_bsp.c b/libs/video/renderer/glsl/glsl_bsp.c index c01de2119..aecb2a9d1 100644 --- a/libs/video/renderer/glsl/glsl_bsp.c +++ b/libs/video/renderer/glsl/glsl_bsp.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -303,7 +300,7 @@ GET_RELEASE (elements_t, elements) GET_RELEASE (instsurf_t, static_instsurf) GET_RELEASE (instsurf_t, instsurf) -void +static void glsl_R_AddTexture (texture_t *tx) { int i; @@ -422,7 +419,7 @@ register_textures (mod_brush_t *brush) } } -void +static void glsl_R_ClearTextures (void) { r_num_texture_chains = 0; @@ -1183,7 +1180,7 @@ glsl_R_DrawWorld (void) } void -glsl_R_DrawWaterSurfaces () +glsl_R_DrawWaterSurfaces (void) { instsurf_t *is; msurface_t *surf; diff --git a/libs/video/renderer/glsl/glsl_draw.c b/libs/video/renderer/glsl/glsl_draw.c index f39040ab8..47b99575b 100644 --- a/libs/video/renderer/glsl/glsl_draw.c +++ b/libs/video/renderer/glsl/glsl_draw.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/glsl_iqm.c b/libs/video/renderer/glsl/glsl_iqm.c index a8e05096f..e140f6232 100644 --- a/libs/video/renderer/glsl/glsl_iqm.c +++ b/libs/video/renderer/glsl/glsl_iqm.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/glsl_lightmap.c b/libs/video/renderer/glsl/glsl_lightmap.c index 14561bbb0..8fa99cb8a 100644 --- a/libs/video/renderer/glsl/glsl_lightmap.c +++ b/libs/video/renderer/glsl/glsl_lightmap.c @@ -33,9 +33,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/glsl_main.c b/libs/video/renderer/glsl/glsl_main.c index d13196908..527843b43 100644 --- a/libs/video/renderer/glsl/glsl_main.c +++ b/libs/video/renderer/glsl/glsl_main.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include "string.h" #endif @@ -54,8 +51,11 @@ #include "QF/GLSL/funcs.h" #include "QF/GLSL/qf_alias.h" #include "QF/GLSL/qf_bsp.h" +#include "QF/GLSL/qf_draw.h" #include "QF/GLSL/qf_iqm.h" #include "QF/GLSL/qf_lightmap.h" +#include "QF/GLSL/qf_main.h" +#include "QF/GLSL/qf_particles.h" #include "QF/GLSL/qf_sprite.h" #include "QF/GLSL/qf_textures.h" @@ -93,7 +93,7 @@ glsl_R_ViewChanged (void) mmulf (proj, depth_range, proj); } -void +static void glsl_R_SetupFrame (void) { R_AnimateLight (); @@ -227,6 +227,28 @@ glsl_R_RenderView (void) } } +static void +glsl_R_TimeRefresh_f (void) +{ +/* FIXME update for simd + double start, stop, time; + int i; + + glsl_ctx->end_rendering (); + + start = Sys_DoubleTime (); + for (i = 0; i < 128; i++) { + r_refdef.viewangles[1] = i * (360.0 / 128.0); + glsl_R_RenderView (); + glsl_ctx->end_rendering (); + } + + stop = Sys_DoubleTime (); + time = stop - start; + Sys_Printf ("%g seconds (%g fps)\n", time, 128 / time); +*/ +} + void glsl_R_Init (void) { @@ -279,25 +301,3 @@ glsl_R_ClearState (void) R_ClearDlights (); R_ClearParticles (); } - -void -glsl_R_TimeRefresh_f (void) -{ -/* FIXME update for simd - double start, stop, time; - int i; - - glsl_ctx->end_rendering (); - - start = Sys_DoubleTime (); - for (i = 0; i < 128; i++) { - r_refdef.viewangles[1] = i * (360.0 / 128.0); - glsl_R_RenderView (); - glsl_ctx->end_rendering (); - } - - stop = Sys_DoubleTime (); - time = stop - start; - Sys_Printf ("%g seconds (%g fps)\n", time, 128 / time); -*/ -} diff --git a/libs/video/renderer/glsl/glsl_particles.c b/libs/video/renderer/glsl/glsl_particles.c index 81473369c..2dae866f0 100644 --- a/libs/video/renderer/glsl/glsl_particles.c +++ b/libs/video/renderer/glsl/glsl_particles.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/glsl_sprite.c b/libs/video/renderer/glsl/glsl_sprite.c index fc4cf8be7..8fabaffcc 100644 --- a/libs/video/renderer/glsl/glsl_sprite.c +++ b/libs/video/renderer/glsl/glsl_sprite.c @@ -31,9 +31,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif @@ -263,7 +260,7 @@ glsl_R_DrawSprite (entity_t *ent) // All sprites are drawn in a batch, so avoid thrashing the gl state void -R_SpriteBegin (void) +glsl_R_SpriteBegin (void) { mat4f_t mat; quat_t fog; @@ -298,7 +295,7 @@ R_SpriteBegin (void) } void -R_SpriteEnd (void) +glsl_R_SpriteEnd (void) { qfeglDisableVertexAttribArray (quake_sprite.vertexa.location); qfeglDisableVertexAttribArray (quake_sprite.vertexb.location); diff --git a/libs/video/renderer/glsl/glsl_textures.c b/libs/video/renderer/glsl/glsl_textures.c index 96c0f0c77..2aa971734 100644 --- a/libs/video/renderer/glsl/glsl_textures.c +++ b/libs/video/renderer/glsl/glsl_textures.c @@ -29,9 +29,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "namehack.h" - #ifdef HAVE_STRING_H # include #endif diff --git a/libs/video/renderer/glsl/namehack.h b/libs/video/renderer/glsl/namehack.h deleted file mode 100644 index 9aa8f0ed5..000000000 --- a/libs/video/renderer/glsl/namehack.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifdef NH_DEFINE -#undef NH_DEFINE -#define Draw_Init glsl_Draw_Init -#define Draw_Character glsl_Draw_Character -#define Draw_String glsl_Draw_String -#define Draw_nString glsl_Draw_nString -#define Draw_AltString glsl_Draw_AltString -#define Draw_ConsoleBackground glsl_Draw_ConsoleBackground -#define Draw_Crosshair glsl_Draw_Crosshair -#define Draw_CrosshairAt glsl_Draw_CrosshairAt -#define Draw_TileClear glsl_Draw_TileClear -#define Draw_Fill glsl_Draw_Fill -#define Draw_TextBox glsl_Draw_TextBox -#define Draw_FadeScreen glsl_Draw_FadeScreen -#define Draw_BlendScreen glsl_Draw_BlendScreen -#define Draw_CachePic glsl_Draw_CachePic -#define Draw_UncachePic glsl_Draw_UncachePic -#define Draw_MakePic glsl_Draw_MakePic -#define Draw_DestroyPic glsl_Draw_DestroyPic -#define Draw_PicFromWad glsl_Draw_PicFromWad -#define Draw_Pic glsl_Draw_Pic -#define Draw_Picf glsl_Draw_Picf -#define Draw_SubPic glsl_Draw_SubPic -#define R_AddTexture glsl_R_AddTexture -#define R_BlendLightmaps glsl_R_BlendLightmaps -#define R_BuildLightMap glsl_R_BuildLightMap -#define R_CalcLightmaps glsl_R_CalcLightmaps -#define R_ClearState glsl_R_ClearState -#define R_ClearTextures glsl_R_ClearTextures -#define R_DrawAliasModel glsl_R_DrawAliasModel -#define R_DrawBrushModel glsl_R_DrawBrushModel -#define R_DrawParticles glsl_R_DrawParticles -#define R_DrawSky glsl_R_DrawSky -#define R_DrawSkyChain glsl_R_DrawSkyChain -#define R_DrawSpriteModel glsl_R_DrawSpriteModel -#define R_DrawWaterSurfaces glsl_R_DrawWaterSurfaces -#define R_DrawWorld glsl_R_DrawWorld -#define R_InitBubble glsl_R_InitBubble -#define R_InitGraphTextures glsl_R_InitGraphTextures -#define R_InitParticles glsl_R_InitParticles -#define R_InitSky glsl_R_InitSky -#define R_InitSprites glsl_R_InitSprites -#define R_LineGraph glsl_R_LineGraph -#define R_LoadSky_f glsl_R_LoadSky_f -#define R_LoadSkys glsl_R_LoadSkys -#define R_NewMap glsl_R_NewMap -#define R_Particle_New glsl_R_Particle_New -#define R_Particle_NewRandom glsl_R_Particle_NewRandom -#define R_Particles_Init_Cvars glsl_R_Particles_Init_Cvars -#define R_ReadPointFile_f glsl_R_ReadPointFile_f -#define R_RenderDlights glsl_R_RenderDlights -#define R_RenderView glsl_R_RenderView -#define R_RotateForEntity glsl_R_RotateForEntity -#define R_SetupFrame glsl_R_SetupFrame -#define R_SpriteBegin glsl_R_SpriteBegin -#define R_SpriteEnd glsl_R_SpriteEnd -#define R_TimeRefresh_f glsl_R_TimeRefresh_f -#define R_ViewChanged glsl_R_ViewChanged -#define SCR_CaptureBGR glsl_SCR_CaptureBGR -#define SCR_ScreenShot glsl_SCR_ScreenShot -#define SCR_ScreenShot_f glsl_SCR_ScreenShot_f -#define R_RenderFrame glsl_R_RenderFrame -#define c_alias_polys glsl_c_alias_polys -#define c_brush_polys glsl_c_brush_polys -#define r_easter_eggs_f glsl_r_easter_eggs_f -#define r_particles_style_f glsl_r_particles_style_f -#define r_world_matrix glsl_r_world_matrix -#else -#undef R_AddTexture -#undef R_BlendLightmaps -#undef R_BuildLightMap -#undef R_CalcLightmaps -#undef R_ClearState -#undef R_ClearTextures -#undef R_DrawAliasModel -#undef R_DrawBrushModel -#undef R_DrawParticles -#undef R_DrawSky -#undef R_DrawSkyChain -#undef R_DrawSpriteModel -#undef R_DrawWaterSurfaces -#undef R_DrawWorld -#undef R_Init -#undef R_InitBubble -#undef R_InitGraphTextures -#undef R_InitParticles -#undef R_InitSky -#undef R_InitSprites -#undef R_InitSurfaceChains -#undef R_LineGraph -#undef R_LoadSky_f -#undef R_LoadSkys -#undef R_NewMap -#undef R_Particle_New -#undef R_Particle_NewRandom -#undef R_Particles_Init_Cvars -#undef R_ReadPointFile_f -#undef R_RenderDlights -#undef R_RenderView -#undef R_RotateForEntity -#undef R_SetupFrame -#undef R_TimeRefresh_f -#undef R_ViewChanged -#undef SCR_CaptureBGR -#undef SCR_ScreenShot -#undef SCR_ScreenShot_f -#undef R_RenderFrame -#undef c_alias_polys -#undef c_brush_polys -#undef r_easter_eggs_f -#undef r_particles_style_f -#undef r_world_matrix -#endif diff --git a/libs/video/renderer/vid_render_gl.c b/libs/video/renderer/vid_render_gl.c index 1ae2db22c..05a7c378c 100644 --- a/libs/video/renderer/vid_render_gl.c +++ b/libs/video/renderer/vid_render_gl.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "gl/namehack.h" - #include "QF/cvar.h" #include "QF/plugin/general.h" @@ -38,6 +35,7 @@ #include "QF/GL/funcs.h" #include "QF/GL/qf_draw.h" +#include "QF/GL/qf_rmain.h" #include "QF/GL/qf_rsurf.h" #include "QF/GL/qf_vid.h" @@ -47,8 +45,6 @@ #include "vid_internal.h" #include "vid_gl.h" -#include "gl/namehack.h" - gl_ctx_t *gl_ctx; static void diff --git a/libs/video/renderer/vid_render_glsl.c b/libs/video/renderer/vid_render_glsl.c index b5996226d..cb7e812ab 100644 --- a/libs/video/renderer/vid_render_glsl.c +++ b/libs/video/renderer/vid_render_glsl.c @@ -28,9 +28,6 @@ # include "config.h" #endif -#define NH_DEFINE -#include "glsl/namehack.h" - #include "QF/plugin/general.h" #include "QF/plugin/vid_render.h" @@ -38,6 +35,7 @@ #include "QF/GLSL/defines.h" #include "QF/GLSL/qf_bsp.h" #include "QF/GLSL/qf_draw.h" +#include "QF/GLSL/qf_main.h" #include "QF/GLSL/qf_vid.h" #include "mod_internal.h" @@ -45,8 +43,6 @@ #include "vid_internal.h" #include "vid_gl.h" -#include "glsl/namehack.h" - gl_ctx_t *glsl_ctx; static void