mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- moved the CVAR definitions from gl/ to hwrenderer/.
- disabled gl_texture_format because in its existing form it is mostly a useless feature.
This commit is contained in:
parent
3129840a04
commit
ceeb479261
25 changed files with 49 additions and 70 deletions
|
@ -1049,7 +1049,6 @@ set (PCH_SOURCES
|
|||
gl/system/gl_interface.cpp
|
||||
gl/system/gl_framebuffer.cpp
|
||||
gl/system/gl_debug.cpp
|
||||
gl/system/gl_menu.cpp
|
||||
gl/system/gl_wipe.cpp
|
||||
gl/textures/gl_hwtexture.cpp
|
||||
gl/textures/gl_texture.cpp
|
||||
|
@ -1059,6 +1058,7 @@ set (PCH_SOURCES
|
|||
hwrenderer/textures/hw_material.cpp
|
||||
hwrenderer/textures/hw_precache.cpp
|
||||
hwrenderer/utility/hw_clock.cpp
|
||||
hwrenderer/utility/hw_cvars.cpp
|
||||
|
||||
menu/joystickmenu.cpp
|
||||
menu/loadsavemenu.cpp
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/scene/gl_drawinfo.h"
|
||||
#include "gl/scene/gl_scenedrawer.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "gl/shaders/gl_shader.h"
|
||||
#include "gl/dynlights/gl_shadowmap.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_postprocessstate.h"
|
||||
#include "gl/renderer/gl_renderbuffers.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "gl/system/gl_system.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_colormap.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "r_utility.h"
|
||||
#include "d_player.h"
|
||||
#include "gl/system/gl_framebuffer.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "gl/system/gl_system.h"
|
||||
#include "v_video.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_renderbuffers.h"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_framebuffer.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "gl/system/gl_system.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/data/gl_vertexbuffer.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/shaders/gl_shader.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_colormap.h"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "r_utility.h"
|
||||
#include "g_levellocals.h"
|
||||
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/data/gl_vertexbuffer.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include "hwrenderer/dynlights/hw_dynlightdata.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "gl/dynlights/gl_lightbuffer.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_framebuffer.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/renderer/gl_renderbuffers.h"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "r_data/r_vanillatrans.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "hwrenderer/textures/hw_material.h"
|
||||
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
|
||||
#include "gl/scene/gl_drawinfo.h"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "hwrenderer/dynlights/hw_dynlightdata.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "g_levellocals.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_lightdata.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "gl/system/gl_system.h"
|
||||
#include "v_video.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/shaders/gl_ambientshader.h"
|
||||
|
||||
void FLinearDepthShader::Bind()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "gl/system/gl_system.h"
|
||||
#include "v_video.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/shaders/gl_shaderprogram.h"
|
||||
#include "w_wad.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "gl/system/gl_system.h"
|
||||
#include "v_video.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/shaders/gl_tonemapshader.h"
|
||||
|
||||
void FTonemapShader::Bind()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "gl_stereo_leftright.h"
|
||||
#include "vectors.h" // RAD2DEG
|
||||
#include "doomtype.h" // M_PI
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_system.h"
|
||||
#include "gl/renderer/gl_renderstate.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "m_argv.h"
|
||||
#include "version.h"
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
|
||||
void gl_PatchMenu();
|
||||
static TArray<FString> m_Extensions;
|
||||
|
|
|
@ -32,15 +32,35 @@
|
|||
#include "hwrenderer/textures/hw_material.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl/renderer/gl_colormap.h"
|
||||
#include "gl/textures/gl_samplers.h"
|
||||
|
||||
|
||||
extern TexFilter_s TexFilter[];
|
||||
extern int TexFormat[];
|
||||
TexFilter_s TexFilter[]={
|
||||
{GL_NEAREST, GL_NEAREST, false},
|
||||
{GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST, true},
|
||||
{GL_LINEAR, GL_LINEAR, false},
|
||||
{GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR, true},
|
||||
{GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, true},
|
||||
{GL_NEAREST_MIPMAP_LINEAR, GL_NEAREST, true},
|
||||
{GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST, true},
|
||||
};
|
||||
|
||||
int TexFormat[]={
|
||||
GL_RGBA8,
|
||||
GL_RGB5_A1,
|
||||
GL_RGBA4,
|
||||
GL_RGBA2,
|
||||
// [BB] Added compressed texture formats.
|
||||
GL_COMPRESSED_RGBA_ARB,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
};
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
@ -162,13 +182,15 @@ void FHardwareTexture::Resize(int swidth, int sheight, int width, int height, un
|
|||
unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int h, int texunit, bool mipmap, int translation, const char *name)
|
||||
{
|
||||
int rh,rw;
|
||||
int texformat=TexFormat[gl_texture_format];
|
||||
int texformat = GL_RGBA8;// TexFormat[gl_texture_format];
|
||||
bool deletebuffer=false;
|
||||
|
||||
/*
|
||||
if (forcenocompression)
|
||||
{
|
||||
texformat = GL_RGBA8;
|
||||
}
|
||||
*/
|
||||
TranslatedTexture * glTex=GetTexID(translation);
|
||||
if (glTex->glTexID==0) glGenTextures(1,&glTex->glTexID);
|
||||
if (texunit != 0) glActiveTexture(GL_TEXTURE0+texunit);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "c_cvars.h"
|
||||
|
||||
#include "gl/system/gl_interface.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hwrenderer/utility/hw_cvars.h"
|
||||
#include "gl/system/gl_debug.h"
|
||||
#include "gl/renderer/gl_renderer.h"
|
||||
#include "gl_samplers.h"
|
||||
|
|
|
@ -60,20 +60,6 @@ CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINI
|
|||
if (GLRenderer != NULL && GLRenderer->mSamplerManager != NULL) GLRenderer->mSamplerManager->SetTextureFilterMode();
|
||||
}
|
||||
|
||||
CUSTOM_CVAR(Int, gl_texture_format, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
||||
{
|
||||
// [BB] The number of available texture modes depends on the GPU capabilities.
|
||||
// RFL_TEXTURE_COMPRESSION gives us one additional mode and RFL_TEXTURE_COMPRESSION_S3TC
|
||||
// another three.
|
||||
int numOfAvailableTextureFormat = 4;
|
||||
if ( gl.flags & RFL_TEXTURE_COMPRESSION && gl.flags & RFL_TEXTURE_COMPRESSION_S3TC )
|
||||
numOfAvailableTextureFormat = 8;
|
||||
else if ( gl.flags & RFL_TEXTURE_COMPRESSION )
|
||||
numOfAvailableTextureFormat = 5;
|
||||
if (self < 0 || self > numOfAvailableTextureFormat-1) self=0;
|
||||
GLRenderer->FlushTextures();
|
||||
}
|
||||
|
||||
CUSTOM_CVAR(Bool, gl_texture_usehires, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
|
||||
{
|
||||
if (GLRenderer != NULL) GLRenderer->FlushTextures();
|
||||
|
@ -83,25 +69,3 @@ CVAR(Bool, gl_precache, false, CVAR_ARCHIVE)
|
|||
|
||||
CVAR(Bool, gl_trimsprites, true, CVAR_ARCHIVE);
|
||||
|
||||
TexFilter_s TexFilter[]={
|
||||
{GL_NEAREST, GL_NEAREST, false},
|
||||
{GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST, true},
|
||||
{GL_LINEAR, GL_LINEAR, false},
|
||||
{GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR, true},
|
||||
{GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, true},
|
||||
{GL_NEAREST_MIPMAP_LINEAR, GL_NEAREST, true},
|
||||
{GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST, true},
|
||||
};
|
||||
|
||||
int TexFormat[]={
|
||||
GL_RGBA8,
|
||||
GL_RGB5_A1,
|
||||
GL_RGBA4,
|
||||
GL_RGBA2,
|
||||
// [BB] Added compressed texture formats.
|
||||
GL_COMPRESSED_RGBA_ARB,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "c_cvars.h"
|
||||
#include "v_video.h"
|
||||
#include "gl/system/gl_cvars.h"
|
||||
#include "hw_cvars.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
|
|
@ -1,15 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#ifndef _GL_INTERN_H
|
||||
#define _GL_INTERN_H
|
||||
|
||||
#include "r_defs.h"
|
||||
#include "c_cvars.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
|
||||
EXTERN_CVAR(Bool,gl_enhanced_nightvision)
|
||||
EXTERN_CVAR(Int, screenblocks);
|
||||
EXTERN_CVAR(Bool, gl_texture)
|
||||
|
@ -63,4 +57,3 @@ EXTERN_CVAR(Float, gl_ssao_blur_amount)
|
|||
EXTERN_CVAR(Int, gl_debug_level)
|
||||
EXTERN_CVAR(Bool, gl_debug_breakpoint)
|
||||
|
||||
#endif // _GL_INTERN_H
|
Loading…
Reference in a new issue