From 4770ce26d54c2cce64642e0b4550157b0a7e84da Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 6 Aug 2007 01:36:38 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1192 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/cube.h | 1 + source/src/rendergl.cpp | 5 ++--- source/src/texture.cpp | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/src/cube.h b/source/src/cube.h index a72a7f50..1908bc69 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -87,6 +87,7 @@ extern bool intermission; extern int maxclients; extern hashtable mapinfo; extern bool hasTE, hasMT, hasMDA; +extern int hwtexsize; #include "protos.h" // external function decls diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 381954fe..f46ac345 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -333,7 +333,6 @@ void drawreflection(float hf, int w, int h, float changelod, bool refract) reflecting = true; refracting = refract; - extern int hwtexsize; int size = 1< sizelimit) size /= 2; if(size!=reflectlastsize) @@ -462,8 +461,8 @@ void drawminimap(int w, int h) { if(!minimapdirty) return; - int size = 1< w || size > h) size /= 2; + int size = 1< sizelimit) size /= 2; if(size!=minimaplastsize) { glDeleteTextures(1, &minimaptex); diff --git a/source/src/texture.cpp b/source/src/texture.cpp index c2194d04..28ee9b08 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -7,6 +7,8 @@ hashtable textures; VAR(hwtexsize, 1, 0, 0); VARP(maxtexsize, 0, 0, 4096); +VARP(trilinear, 0, 1, 1); +VARP(bilinear, 0, 1, 1); void createtexture(int tnum, int w, int h, void *pixels, int clamp, bool mipmap, GLenum format) { @@ -14,8 +16,13 @@ void createtexture(int tnum, int w, int h, void *pixels, int clamp, bool mipmap, glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, bilinear ? GL_LINEAR : GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + mipmap ? + (trilinear ? + (bilinear ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR) : + (bilinear ? GL_LINEAR_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_NEAREST)) : + (bilinear ? GL_LINEAR : GL_NEAREST)); int tw = w, th = h; if(pixels)