From 3faee810e51baa42537c33e14de4c359fab54c18 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 26 Nov 2008 08:14:23 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1161 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.msvc | 2 +- polymer/eduke32/build/src/engine.c | 14 ++++++++------ polymer/eduke32/build/src/mdsprite.c | 3 --- polymer/eduke32/build/src/polymost.c | 23 +++++++++++++++++++---- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index bb7030342..294ee788c 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -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 diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 120fa453c..278c54643 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -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); } } diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 624f3fabe..a140485c9 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -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; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index ec2b7fbe8..fe628009e 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -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;