*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1192 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-08-06 01:36:38 +00:00
parent 73ecb4a8e5
commit 4770ce26d5
3 changed files with 12 additions and 5 deletions
+1
View File
@@ -87,6 +87,7 @@ extern bool intermission;
extern int maxclients;
extern hashtable<char *, enet_uint32> mapinfo;
extern bool hasTE, hasMT, hasMDA;
extern int hwtexsize;
#include "protos.h" // external function decls
+2 -3
View File
@@ -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<<reflectres, sizelimit = min(hwtexsize, min(w, h));
while(size > sizelimit) size /= 2;
if(size!=reflectlastsize)
@@ -462,8 +461,8 @@ void drawminimap(int w, int h)
{
if(!minimapdirty) return;
int size = 1<<minimapres;
while(size > w || size > h) size /= 2;
int size = 1<<minimapres, sizelimit = min(hwtexsize, min(w, h));
while(size > sizelimit) size /= 2;
if(size!=minimaplastsize)
{
glDeleteTextures(1, &minimaptex);
+9 -2
View File
@@ -7,6 +7,8 @@ hashtable<char *, Texture> 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)