mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
q3bsps suck.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@489 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c8438cbc3e
commit
b8a58b4db2
1 changed files with 12 additions and 6 deletions
|
@ -3465,7 +3465,7 @@ int GLAllocBlock (int w, int h, int *x, int *y)
|
||||||
//rather than forgetting that and redoing it, let's just keep the data.
|
//rather than forgetting that and redoing it, let's just keep the data.
|
||||||
int GLFillBlock (int texnum, int w, int h, int x, int y)
|
int GLFillBlock (int texnum, int w, int h, int x, int y)
|
||||||
{
|
{
|
||||||
int i;
|
int i, l;
|
||||||
while (texnum >= numlightmaps) //allocate 4 more lightmap slots. not much memory usage, but we don't want any caps here.
|
while (texnum >= numlightmaps) //allocate 4 more lightmap slots. not much memory usage, but we don't want any caps here.
|
||||||
{
|
{
|
||||||
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
|
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(numlightmaps+4));
|
||||||
|
@ -3485,15 +3485,21 @@ int GLFillBlock (int texnum, int w, int h, int x, int y)
|
||||||
for (i = texnum; i >= 0; i--)
|
for (i = texnum; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (!lightmap[i])
|
if (!lightmap[i])
|
||||||
|
{
|
||||||
lightmap[i] = BZ_Malloc(sizeof(*lightmap[i]));
|
lightmap[i] = BZ_Malloc(sizeof(*lightmap[i]));
|
||||||
|
for (l=0 ; l<LMBLOCK_HEIGHT ; l++)
|
||||||
|
{
|
||||||
|
lightmap[i]->allocated[l] = LMBLOCK_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//maybe someone screwed with my lightmap...
|
||||||
|
memset(lightmap[i]->lightmaps, 255, LMBLOCK_HEIGHT*LMBLOCK_HEIGHT*3);
|
||||||
|
memcpy(lightmap[i]->lightmaps, cl.worldmodel->lightdata+3*LMBLOCK_HEIGHT*LMBLOCK_HEIGHT*i, LMBLOCK_HEIGHT*LMBLOCK_HEIGHT*3);
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0 ; i<w ; i++)
|
|
||||||
{
|
|
||||||
lightmap[texnum]->allocated[x + i] = y + h;
|
|
||||||
}
|
|
||||||
return texnum;
|
return texnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue