From 19719cf7fbf4d1eb5d0979fe1e0058ade7ceb433 Mon Sep 17 00:00:00 2001 From: Plagman Date: Thu, 1 Mar 2007 18:19:11 +0000 Subject: [PATCH] Detail map scaling. git-svn-id: https://svn.eduke32.com/eduke32@512 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/Makefile.msvc | 13 ++++++++++--- polymer/build/src/defs.c | 10 ++++++---- polymer/build/src/kplib.c | 2 ++ polymer/build/src/polymost.c | 8 +++++++- polymer/eduke32/eduke32.vcproj | 10 +++++----- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/polymer/build/Makefile.msvc b/polymer/build/Makefile.msvc index fd21b277d..dbbe5e63e 100644 --- a/polymer/build/Makefile.msvc +++ b/polymer/build/Makefile.msvc @@ -24,8 +24,10 @@ MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK # /D these to enable certain features of the port's compile process -# NOASM When defined, uses C instead of assembly code -TARGETOPTS=#/DNOASM +# NOASM When defined, uses C instead of assembly code +!ifdef NOASM +TARGETOPTS=/DNOASM +!endif !ifdef DEBUG # debugging options @@ -46,7 +48,12 @@ CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\i ASFLAGS=/nologo /coff EXESUFFIX=.exe -ENGINEOBJS=$(OBJ)\a.$o \ +ENGINEOBJS= \ +!ifdef NOASM + $(OBJ)\a-c.$o \ +!else + $(OBJ)\a.$o \ +!endif $(OBJ)\baselayer.$o \ $(OBJ)\cache1d.$o \ $(OBJ)\compat.$o \ diff --git a/polymer/build/src/defs.c b/polymer/build/src/defs.c index 7103ba03f..dfc506e32 100644 --- a/polymer/build/src/defs.c +++ b/polymer/build/src/defs.c @@ -1159,7 +1159,7 @@ static int defsparser(scriptfile *script) char *detailtokptr = script->ltextptr, *detailend; int pal = 0, i; char *fn = NULL; - double param = 1.0; + double xscale = 1.0, yscale = 1.0; char flags = 0; if (scriptfile_getbraces(script,&detailend)) break; @@ -1168,7 +1168,9 @@ static int defsparser(scriptfile *script) case T_FILE: scriptfile_getstring(script,&fn); break; case T_XSCALE: - scriptfile_getdouble(script,¶m); break; + scriptfile_getdouble(script,&xscale); break; + case T_YSCALE: + scriptfile_getdouble(script,&yscale); break; case T_NOCOMPRESS: flags |= 1; break; default: @@ -1190,12 +1192,12 @@ static int defsparser(scriptfile *script) if (token == T_DETAIL) { pal = DETAILPAL; - param = 1.0f / param; + xscale = 1.0f / xscale; } else if (token == T_GLOW) pal = GLOWPAL; - hicsetsubsttex(tile,pal,fn,-1.0,param,1.0,flags); + hicsetsubsttex(tile,pal,fn,-1.0,xscale,yscale,flags); } break; default: break; diff --git a/polymer/build/src/kplib.c b/polymer/build/src/kplib.c index 7f3c1feb1..038889a19 100644 --- a/polymer/build/src/kplib.c +++ b/polymer/build/src/kplib.c @@ -28,6 +28,8 @@ credits. -Ken S. **************************************************************************************************/ +#include "compat.h" + #include #include #include diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index ac13cb6a8..b125fba16 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -1694,7 +1694,13 @@ void drawpoly (double *dpx, double *dpy, long n, long method) bglMatrixMode(GL_TEXTURE); bglLoadIdentity(); - bglScalef(f, f, 1.0f); + + if (pth && pth->hicr && ((pth->hicr->xscale != 1.0f) || (pth->hicr->yscale != 1.0f))) + bglScalef(pth->hicr->xscale, pth->hicr->yscale, 1.0f); + + if (detailpth && detailpth->hicr && ((detailpth->hicr->xscale != 1.0f) || (detailpth->hicr->yscale != 1.0f))) + bglScalef(detailpth->hicr->xscale, detailpth->hicr->yscale, 1.0f); + bglMatrixMode(GL_MODELVIEW); } else diff --git a/polymer/eduke32/eduke32.vcproj b/polymer/eduke32/eduke32.vcproj index 37a222f0b..bdd5ce292 100644 --- a/polymer/eduke32/eduke32.vcproj +++ b/polymer/eduke32/eduke32.vcproj @@ -44,11 +44,11 @@ >