- 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
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue