git-svn-id: https://svn.eduke32.com/eduke32@1161 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-11-26 08:14:23 +00:00
parent 31c1db57d7
commit 3faee810e5
4 changed files with 28 additions and 14 deletions

View file

@ -27,7 +27,7 @@ DXROOT=c:\sdks\dx6
MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC
PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DUSE_OPENAL /DPOLYMER /DRANCID_NETWORKING
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DUSE_OPENAL /DRANCID_NETWORKING /DPOLYMER
CC=cl
AS=ml

View file

@ -5788,8 +5788,10 @@ void uninitengine(void)
polymost_glreset();
hicinit();
freeallmodels();
if (cachefilehandle > -1) Bclose(cachefilehandle);
if (cacheindexptr != NULL) Bfclose(cacheindexptr);
/* if (cachefilehandle > -1)
Bclose(cachefilehandle);
if (cacheindexptr != NULL)
Bfclose(cacheindexptr); */
datextures = &firstcacheindex;
while (datextures->next)
{
@ -10461,7 +10463,7 @@ int getceilzofslope(short sectnum, int dax, int day)
dx = wall[wal->point2].x-wal->x; dy = wall[wal->point2].y-wal->y;
i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return(sector[sectnum].ceilingz);
j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
return(sector[sectnum].ceilingz+scale(sector[sectnum].ceilingheinum,j,i));
return(sector[sectnum].ceilingz+(scale(sector[sectnum].ceilingheinum,j>>1,i)<<1));
}
@ -10478,7 +10480,7 @@ int getflorzofslope(short sectnum, int dax, int day)
dx = wall[wal->point2].x-wal->x; dy = wall[wal->point2].y-wal->y;
i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return(sector[sectnum].floorz);
j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
return(sector[sectnum].floorz+scale(sector[sectnum].floorheinum,j,i));
return(sector[sectnum].floorz+(scale(sector[sectnum].floorheinum,j>>1,i)<<1));
}
@ -10499,8 +10501,8 @@ void getzsofslope(short sectnum, int dax, int day, int *ceilz, int *florz)
dx = wal2->x-wal->x; dy = wal2->y-wal->y;
i = (nsqrtasm(dx*dx+dy*dy)<<5); if (i == 0) return;
j = dmulscale3(dx,day-wal->y,-dy,dax-wal->x);
if (sec->ceilingstat&2) *ceilz = (*ceilz)+scale(sec->ceilingheinum,j,i);
if (sec->floorstat&2) *florz = (*florz)+scale(sec->floorheinum,j,i);
if (sec->ceilingstat&2) *ceilz = (*ceilz)+(scale(sec->ceilingheinum,j>>1,i)<<1);
if (sec->floorstat&2) *florz = (*florz)+(scale(sec->floorheinum,j>>1,i)<<1);
}
}

View file

@ -583,9 +583,6 @@ int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcachehead
// fil = kopen4load(cachefn, 0);
// if (fil < 0) return -1;
if (firstcacheindex.next == NULL)
return -1;
else
{
int offset = 0;
int len = 0;

View file

@ -717,10 +717,16 @@ void polymost_glreset()
}
if (cachefilehandle != -1)
{
Bclose(cachefilehandle);
cachefilehandle = -1;
}
if (cacheindexptr)
{
Bfclose(cacheindexptr);
cacheindexptr = NULL;
}
datextures = &firstcacheindex;
numcacheentries = 0;
@ -922,10 +928,16 @@ void polymost_glinit()
bglEnableClientState(GL_TEXTURE_COORD_ARRAY);
if (cachefilehandle > -1)
{
Bclose(cachefilehandle);
cachefilehandle = -1;
}
if (cacheindexptr)
{
Bfclose(cacheindexptr);
cacheindexptr = NULL;
}
datextures = &firstcacheindex;
numcacheentries = 0;
@ -976,11 +988,17 @@ void polymost_glinit()
void invalidatecache(void)
{
if (cachefilehandle != -1)
if (cachefilehandle > -1)
{
Bclose(cachefilehandle);
cachefilehandle = -1;
}
if (cacheindexptr)
{
Bfclose(cacheindexptr);
cacheindexptr = NULL;
}
datextures = &firstcacheindex;
numcacheentries = 0;
@ -1456,9 +1474,6 @@ int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head
// fil = kopen4load(cachefn, 0);
// if (fil < 0) return -1;
if (firstcacheindex.next == NULL)
return -1;
else
{
int offset = 0;
int len = 0;