2004-08-22 22:29:09 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
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
|
2011-06-01 13:21:54 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2004-08-22 22:29:09 +00:00
|
|
|
|
|
|
|
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 the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
// r_surf.c: surface-related refresh code
|
|
|
|
|
|
|
|
#include "quakedef.h"
|
2009-11-07 13:29:15 +00:00
|
|
|
#if defined(GLQUAKE)
|
2004-08-22 22:29:09 +00:00
|
|
|
#include "glquake.h"
|
|
|
|
#include "shader.h"
|
|
|
|
#include "renderque.h"
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
extern cvar_t gl_bump;
|
|
|
|
|
|
|
|
|
2011-01-04 02:56:16 +00:00
|
|
|
void GLBE_ClearVBO(vbo_t *vbo)
|
2009-07-05 18:45:53 +00:00
|
|
|
{
|
|
|
|
int vboh[7];
|
|
|
|
int i, j;
|
|
|
|
vboh[0] = vbo->vboe;
|
|
|
|
vboh[1] = vbo->vbocoord;
|
|
|
|
vboh[2] = vbo->vbotexcoord;
|
|
|
|
vboh[3] = vbo->vbolmcoord;
|
|
|
|
vboh[4] = vbo->vbonormals;
|
|
|
|
vboh[5] = vbo->vbosvector;
|
|
|
|
vboh[6] = vbo->vbotvector;
|
|
|
|
|
|
|
|
for (i = 0; i < 7; i++)
|
|
|
|
{
|
|
|
|
if (!vboh[i])
|
|
|
|
continue;
|
|
|
|
for (j = 0; j < 7; j++)
|
|
|
|
{
|
|
|
|
if (vboh[j] == vboh[i])
|
|
|
|
break; //already freed by one of the other ones
|
|
|
|
}
|
|
|
|
if (j == 7)
|
|
|
|
qglDeleteBuffersARB(1, &vboh[i]);
|
|
|
|
}
|
2011-02-25 04:22:14 +00:00
|
|
|
if (vbo->vertdata)
|
|
|
|
BZ_Free(vbo->vertdata);
|
2010-07-12 22:46:37 +00:00
|
|
|
BZ_Free(vbo->meshlist);
|
2009-07-05 18:45:53 +00:00
|
|
|
memset(vbo, 0, sizeof(*vbo));
|
|
|
|
}
|
|
|
|
|
2009-11-07 13:29:15 +00:00
|
|
|
static qboolean GL_BuildVBO(vbo_t *vbo, void *vdata, int vsize, void *edata, int elementsize)
|
2009-07-05 18:45:53 +00:00
|
|
|
{
|
|
|
|
unsigned int vbos[2];
|
|
|
|
|
2009-07-11 20:56:09 +00:00
|
|
|
if (!qglGenBuffersARB)
|
2009-07-05 18:45:53 +00:00
|
|
|
return false;
|
|
|
|
|
2011-04-30 17:21:10 +00:00
|
|
|
qglGenBuffersARB(1+(elementsize>0), vbos);
|
2009-11-04 21:16:50 +00:00
|
|
|
GL_SelectVBO(vbos[0]);
|
2009-07-05 18:45:53 +00:00
|
|
|
qglBufferDataARB(GL_ARRAY_BUFFER_ARB, vsize, vdata, GL_STATIC_DRAW_ARB);
|
2011-04-30 17:21:10 +00:00
|
|
|
if (elementsize>0)
|
|
|
|
{
|
|
|
|
GL_SelectEBO(vbos[1]);
|
|
|
|
qglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, elementsize, edata, GL_STATIC_DRAW_ARB);
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
|
2009-07-05 18:45:53 +00:00
|
|
|
if (qglGetError())
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
GL_SelectVBO(0);
|
|
|
|
GL_SelectEBO(0);
|
2011-04-30 17:21:10 +00:00
|
|
|
qglDeleteBuffersARB(1+(elementsize>0), vbos);
|
2009-07-05 18:45:53 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//opengl ate our data, fixup the vbo arrays to point to the vbo instead of the raw data
|
|
|
|
|
2011-04-30 17:21:10 +00:00
|
|
|
if (vbo->indicies && elementsize)
|
2009-07-05 18:45:53 +00:00
|
|
|
{
|
|
|
|
vbo->vboe = vbos[1];
|
|
|
|
vbo->indicies = (index_t*)((char*)vbo->indicies - (char*)edata);
|
|
|
|
}
|
|
|
|
if (vbo->coord)
|
|
|
|
{
|
|
|
|
vbo->vbocoord = vbos[0];
|
2009-11-04 21:16:50 +00:00
|
|
|
vbo->coord = (vecV_t*)((char*)vbo->coord - (char*)vdata);
|
2009-07-05 18:45:53 +00:00
|
|
|
}
|
|
|
|
if (vbo->texcoord)
|
|
|
|
{
|
|
|
|
vbo->vbotexcoord = vbos[0];
|
|
|
|
vbo->texcoord = (vec2_t*)((char*)vbo->texcoord - (char*)vdata);
|
|
|
|
}
|
|
|
|
if (vbo->lmcoord)
|
|
|
|
{
|
|
|
|
vbo->vbolmcoord = vbos[0];
|
|
|
|
vbo->lmcoord = (vec2_t*)((char*)vbo->lmcoord - (char*)vdata);
|
|
|
|
}
|
|
|
|
if (vbo->normals)
|
|
|
|
{
|
|
|
|
vbo->vbonormals = vbos[0];
|
|
|
|
vbo->normals = (vec3_t*)((char*)vbo->normals - (char*)vdata);
|
|
|
|
}
|
|
|
|
if (vbo->svector)
|
|
|
|
{
|
|
|
|
vbo->vbosvector = vbos[0];
|
|
|
|
vbo->svector = (vec3_t*)((char*)vbo->svector - (char*)vdata);
|
|
|
|
}
|
|
|
|
if (vbo->tvector)
|
|
|
|
{
|
|
|
|
vbo->vbotvector = vbos[0];
|
|
|
|
vbo->tvector = (vec3_t*)((char*)vbo->tvector - (char*)vdata);
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
if (vbo->colours4f)
|
|
|
|
{
|
|
|
|
vbo->vbocolours = vbos[0];
|
|
|
|
vbo->colours4f = (vec4_t*)((char*)vbo->colours4f - (char*)vdata);
|
|
|
|
}
|
|
|
|
|
2009-07-05 18:45:53 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
void *allocbuf(char **p, int elements, int elementsize)
|
|
|
|
{
|
|
|
|
void *ret;
|
|
|
|
*p += elementsize - 1;
|
2011-06-01 13:21:54 +00:00
|
|
|
*p -= (size_t)*p & (elementsize-1);
|
2011-02-25 04:22:14 +00:00
|
|
|
ret = *p;
|
|
|
|
*p += elements*elementsize;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2011-01-04 02:56:16 +00:00
|
|
|
void GLBE_GenBrushModelVBO(model_t *mod)
|
2009-05-24 10:11:17 +00:00
|
|
|
{
|
|
|
|
unsigned int maxvboverts;
|
|
|
|
unsigned int maxvboelements;
|
|
|
|
|
|
|
|
unsigned int t;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int v;
|
|
|
|
unsigned int vcount, ecount;
|
2009-07-05 18:45:53 +00:00
|
|
|
unsigned int pervertsize; //erm, that name wasn't intentional
|
2009-11-04 21:16:50 +00:00
|
|
|
unsigned int meshes;
|
2009-07-05 18:45:53 +00:00
|
|
|
|
|
|
|
vbo_t *vbo;
|
2009-05-24 10:11:17 +00:00
|
|
|
mesh_t *m;
|
2011-02-25 04:22:14 +00:00
|
|
|
char *p;
|
2009-05-24 10:28:26 +00:00
|
|
|
|
2009-07-05 18:45:53 +00:00
|
|
|
if (!mod->numsurfaces)
|
2009-05-24 10:11:17 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (t = 0; t < mod->numtextures; t++)
|
|
|
|
{
|
|
|
|
if (!mod->textures[t])
|
|
|
|
continue;
|
2009-07-05 18:45:53 +00:00
|
|
|
vbo = &mod->textures[t]->vbo;
|
2009-11-04 21:16:50 +00:00
|
|
|
BE_ClearVBO(vbo);
|
2009-05-24 10:11:17 +00:00
|
|
|
|
|
|
|
maxvboverts = 0;
|
|
|
|
maxvboelements = 0;
|
2009-11-04 21:16:50 +00:00
|
|
|
meshes = 0;
|
2009-05-24 10:11:17 +00:00
|
|
|
for (i=0 ; i<mod->numsurfaces ; i++)
|
|
|
|
{
|
|
|
|
if (mod->surfaces[i].texinfo->texture != mod->textures[t])
|
|
|
|
continue;
|
|
|
|
m = mod->surfaces[i].mesh;
|
2009-07-25 11:05:06 +00:00
|
|
|
if (!m)
|
|
|
|
continue;
|
2009-05-24 10:11:17 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
meshes++;
|
2009-05-24 10:11:17 +00:00
|
|
|
maxvboelements += m->numindexes;
|
|
|
|
maxvboverts += m->numvertexes;
|
|
|
|
}
|
2009-11-07 13:29:15 +00:00
|
|
|
#if sizeof_index_t == 2
|
2009-05-24 10:11:17 +00:00
|
|
|
if (maxvboverts > (1<<(sizeof(index_t)*8))-1)
|
|
|
|
continue;
|
2009-11-07 13:29:15 +00:00
|
|
|
#endif
|
2009-05-24 10:11:17 +00:00
|
|
|
if (!maxvboverts)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
//fixme: stop this from leaking!
|
|
|
|
vcount = 0;
|
|
|
|
ecount = 0;
|
2009-07-05 18:45:53 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
pervertsize = sizeof(vecV_t)+ //coord
|
2009-07-05 18:45:53 +00:00
|
|
|
sizeof(vec2_t)+ //tex
|
|
|
|
sizeof(vec2_t)+ //lm
|
|
|
|
sizeof(vec3_t)+ //normal
|
|
|
|
sizeof(vec3_t)+ //sdir
|
2009-11-04 21:16:50 +00:00
|
|
|
sizeof(vec3_t)+ //tdir
|
|
|
|
sizeof(vec4_t); //colours
|
2009-07-05 18:45:53 +00:00
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
vbo->vertdata = BZ_Malloc((maxvboverts+1)*pervertsize + (maxvboelements+1)*sizeof(index_t));
|
|
|
|
|
|
|
|
p = vbo->vertdata;
|
2009-07-05 18:45:53 +00:00
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
vbo->coord = allocbuf(&p, maxvboverts, sizeof(*vbo->coord));
|
|
|
|
vbo->texcoord = allocbuf(&p, maxvboverts, sizeof(*vbo->texcoord));
|
|
|
|
vbo->lmcoord = allocbuf(&p, maxvboverts, sizeof(*vbo->lmcoord));
|
|
|
|
vbo->normals = allocbuf(&p, maxvboverts, sizeof(*vbo->normals));
|
|
|
|
vbo->svector = allocbuf(&p, maxvboverts, sizeof(*vbo->svector));
|
|
|
|
vbo->tvector = allocbuf(&p, maxvboverts, sizeof(*vbo->tvector));
|
|
|
|
vbo->colours4f = allocbuf(&p, maxvboverts, sizeof(*vbo->colours4f));
|
|
|
|
vbo->indicies = allocbuf(&p, maxvboelements, sizeof(index_t));
|
2009-07-05 18:45:53 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
vbo->meshcount = meshes;
|
|
|
|
vbo->meshlist = BZ_Malloc(meshes*sizeof(*vbo->meshlist));
|
|
|
|
|
|
|
|
meshes = 0;
|
|
|
|
|
2009-05-24 10:11:17 +00:00
|
|
|
for (i=0 ; i<mod->numsurfaces ; i++)
|
|
|
|
{
|
|
|
|
if (mod->surfaces[i].texinfo->texture != mod->textures[t])
|
|
|
|
continue;
|
|
|
|
m = mod->surfaces[i].mesh;
|
2009-07-25 11:05:06 +00:00
|
|
|
if (!m)
|
|
|
|
continue;
|
2009-05-24 10:11:17 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
mod->surfaces[i].mark = &vbo->meshlist[meshes++];
|
|
|
|
*mod->surfaces[i].mark = NULL;
|
|
|
|
|
2009-05-24 10:11:17 +00:00
|
|
|
m->vbofirstvert = vcount;
|
|
|
|
m->vbofirstelement = ecount;
|
|
|
|
for (v = 0; v < m->numindexes; v++)
|
2009-07-05 18:45:53 +00:00
|
|
|
vbo->indicies[ecount++] = vcount + m->indexes[v];
|
2009-05-24 10:11:17 +00:00
|
|
|
for (v = 0; v < m->numvertexes; v++)
|
|
|
|
{
|
2009-07-05 18:45:53 +00:00
|
|
|
vbo->coord[vcount+v][0] = m->xyz_array[v][0];
|
|
|
|
vbo->coord[vcount+v][1] = m->xyz_array[v][1];
|
|
|
|
vbo->coord[vcount+v][2] = m->xyz_array[v][2];
|
2009-05-24 10:11:17 +00:00
|
|
|
if (m->st_array)
|
2009-06-21 17:45:33 +00:00
|
|
|
{
|
2009-07-05 18:45:53 +00:00
|
|
|
vbo->texcoord[vcount+v][0] = m->st_array[v][0];
|
|
|
|
vbo->texcoord[vcount+v][1] = m->st_array[v][1];
|
2009-06-21 17:45:33 +00:00
|
|
|
}
|
2009-05-24 10:11:17 +00:00
|
|
|
if (m->lmst_array)
|
2009-06-21 17:45:33 +00:00
|
|
|
{
|
2009-07-05 18:45:53 +00:00
|
|
|
vbo->lmcoord[vcount+v][0] = m->lmst_array[v][0];
|
|
|
|
vbo->lmcoord[vcount+v][1] = m->lmst_array[v][1];
|
2009-06-21 17:45:33 +00:00
|
|
|
}
|
2009-07-18 20:46:42 +00:00
|
|
|
if (m->normals_array)
|
|
|
|
{
|
|
|
|
vbo->normals[vcount+v][0] = m->normals_array[v][0];
|
|
|
|
vbo->normals[vcount+v][1] = m->normals_array[v][1];
|
|
|
|
vbo->normals[vcount+v][2] = m->normals_array[v][2];
|
|
|
|
}
|
|
|
|
if (m->snormals_array)
|
|
|
|
{
|
|
|
|
vbo->svector[vcount+v][0] = m->snormals_array[v][0];
|
|
|
|
vbo->svector[vcount+v][1] = m->snormals_array[v][1];
|
|
|
|
vbo->svector[vcount+v][2] = m->snormals_array[v][2];
|
|
|
|
}
|
|
|
|
if (m->tnormals_array)
|
|
|
|
{
|
|
|
|
vbo->tvector[vcount+v][0] = m->tnormals_array[v][0];
|
|
|
|
vbo->tvector[vcount+v][1] = m->tnormals_array[v][1];
|
|
|
|
vbo->tvector[vcount+v][2] = m->tnormals_array[v][2];
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
if (m->colors4f_array)
|
|
|
|
{
|
|
|
|
vbo->colours4f[vcount+v][0] = m->colors4f_array[v][0];
|
|
|
|
vbo->colours4f[vcount+v][1] = m->colors4f_array[v][1];
|
|
|
|
vbo->colours4f[vcount+v][2] = m->colors4f_array[v][2];
|
|
|
|
vbo->colours4f[vcount+v][3] = m->colors4f_array[v][3];
|
|
|
|
}
|
2009-05-24 10:11:17 +00:00
|
|
|
}
|
|
|
|
vcount += v;
|
|
|
|
}
|
2009-07-05 18:45:53 +00:00
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
if (GL_BuildVBO(vbo, vbo->coord, vcount*pervertsize, vbo->indicies, ecount*sizeof(index_t)))
|
2009-07-05 18:45:53 +00:00
|
|
|
{
|
2011-02-25 04:22:14 +00:00
|
|
|
BZ_Free(vbo->vertdata);
|
|
|
|
vbo->vertdata = NULL;
|
2009-07-05 18:45:53 +00:00
|
|
|
}
|
2009-05-24 10:11:17 +00:00
|
|
|
}
|
2010-07-11 02:22:39 +00:00
|
|
|
/* for (i=0 ; i<mod->numsurfaces ; i++)
|
2009-11-04 21:16:50 +00:00
|
|
|
{
|
|
|
|
if (!mod->surfaces[i].mark)
|
|
|
|
Host_EndGame("Surfaces with bad textures detected\n");
|
2010-07-11 02:22:39 +00:00
|
|
|
}*/
|
2009-05-24 10:11:17 +00:00
|
|
|
}
|
2004-08-22 22:29:09 +00:00
|
|
|
|
2011-01-04 02:56:16 +00:00
|
|
|
void GLBE_UploadAllLightmaps(void)
|
2004-08-22 22:29:09 +00:00
|
|
|
{
|
2009-11-07 13:29:15 +00:00
|
|
|
int i;
|
2004-08-22 22:29:09 +00:00
|
|
|
//
|
|
|
|
// upload all lightmaps that were filled
|
|
|
|
//
|
|
|
|
for (i=0 ; i<numlightmaps ; i++)
|
|
|
|
{
|
|
|
|
if (!lightmap[i])
|
|
|
|
break; // no more used
|
|
|
|
lightmap[i]->rectchange.l = LMBLOCK_WIDTH;
|
|
|
|
lightmap[i]->rectchange.t = LMBLOCK_HEIGHT;
|
|
|
|
lightmap[i]->rectchange.w = 0;
|
|
|
|
lightmap[i]->rectchange.h = 0;
|
2008-11-09 22:29:28 +00:00
|
|
|
if (!lightmap[i]->modified)
|
|
|
|
continue;
|
|
|
|
lightmap[i]->modified = false;
|
2011-02-25 04:22:14 +00:00
|
|
|
GL_MTBind(0, GL_TEXTURE_2D, lightmap_textures[i]);
|
2009-11-04 21:16:50 +00:00
|
|
|
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
|
|
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
switch (lightmap_bytes)
|
|
|
|
{
|
|
|
|
case 4:
|
2011-06-01 13:21:54 +00:00
|
|
|
qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
LMBLOCK_WIDTH, LMBLOCK_WIDTH, 0, (lightmap_bgra?GL_BGRA_EXT:GL_RGBA), GL_UNSIGNED_INT_8_8_8_8_REV,
|
|
|
|
lightmap[i]->lightmaps);
|
|
|
|
break;
|
|
|
|
case 3:
|
2011-06-01 13:21:54 +00:00
|
|
|
qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
LMBLOCK_WIDTH, LMBLOCK_WIDTH, 0, (lightmap_bgra?GL_BGR_EXT:GL_RGB), GL_UNSIGNED_BYTE,
|
|
|
|
lightmap[i]->lightmaps);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
qglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
|
|
|
|
LMBLOCK_WIDTH, LMBLOCK_WIDTH, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
|
|
|
|
lightmap[i]->lightmaps);
|
|
|
|
break;
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
if (gl_bump.ival)
|
2005-09-14 04:25:10 +00:00
|
|
|
{
|
|
|
|
lightmap[i]->deluxmodified = false;
|
|
|
|
lightmap[i]->deluxrectchange.l = LMBLOCK_WIDTH;
|
|
|
|
lightmap[i]->deluxrectchange.t = LMBLOCK_HEIGHT;
|
|
|
|
lightmap[i]->deluxrectchange.w = 0;
|
|
|
|
lightmap[i]->deluxrectchange.h = 0;
|
2011-02-25 04:22:14 +00:00
|
|
|
GL_MTBind(0, GL_TEXTURE_2D, deluxmap_textures[i]);
|
2009-11-04 21:16:50 +00:00
|
|
|
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
|
|
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
2005-09-14 04:25:10 +00:00
|
|
|
qglTexImage2D (GL_TEXTURE_2D, 0, 3
|
2011-06-01 13:21:54 +00:00
|
|
|
, LMBLOCK_WIDTH, LMBLOCK_HEIGHT, 0,
|
2010-07-11 02:22:39 +00:00
|
|
|
GL_RGB, GL_UNSIGNED_BYTE, lightmap[i]->deluxmaps);
|
2005-09-14 04:25:10 +00:00
|
|
|
}
|
2004-08-22 22:29:09 +00:00
|
|
|
}
|
|
|
|
}
|
2004-12-15 19:53:30 +00:00
|
|
|
#endif
|