From 5fbe1b89be6e14488c18d58c8724b87fba22b2ae Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 29 Nov 2017 07:29:48 +0000 Subject: [PATCH] New def token for "multipsky": "yscale". multipsky { yscale } Default value is 65536. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6519 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/build.h | 2 ++ source/build/src/defs.cpp | 9 +++++++++ source/build/src/engine.cpp | 6 ++++-- source/build/src/engine_priv.h | 4 +++- source/build/src/polymer.cpp | 4 ++-- source/build/src/polymost.cpp | 10 +++++----- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index dad93f65e..1171ebe24 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -727,6 +727,8 @@ typedef struct { int8_t lognumtiles; // 1<tileofs[panel] = offset; break; } + case T_YSCALE: + { + int32_t yscale; + scriptfile_getsymbol(script,&yscale); + + newpsky->yscale = yscale; + break; + } default: break; } diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 62ae03ff9..2ce56e453 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -3618,8 +3618,8 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i return; - int32_t dapyscale, dapskybits, dapyoffs; - int8_t const * const dapskyoff = getpsky(globalpicnum, &dapyscale, &dapskybits, &dapyoffs); + int32_t dapyscale, dapskybits, dapyoffs, daptileyscale; + int8_t const * const dapskyoff = getpsky(globalpicnum, &dapyscale, &dapskybits, &dapyoffs, &daptileyscale); globalshiftval = logtilesizy; @@ -3642,6 +3642,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i globalyscale = (8<<(globalshiftval-19)); globalzd = (((tsizy>>1)+dapyoffs)<yscale = 65536; return newPsky; } diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index d01355ec1..dd6672818 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -372,7 +372,7 @@ static FORCE_INLINE void setgotpic(int32_t tilenume) // Get properties of parallaxed sky to draw. // Returns: pointer to tile offset array. Sets-by-pointer the other three. -static FORCE_INLINE const int8_t *getpsky(int32_t picnum, int32_t *dapyscale, int32_t *dapskybits, int32_t *dapyoffs) +static FORCE_INLINE const int8_t *getpsky(int32_t picnum, int32_t *dapyscale, int32_t *dapskybits, int32_t *dapyoffs, int32_t *daptileyscale) { psky_t const * const psky = &multipsky[getpskyidx(picnum)]; @@ -382,6 +382,8 @@ static FORCE_INLINE const int8_t *getpsky(int32_t picnum, int32_t *dapyscale, in *dapyscale = (parallaxyscale_override == 0 ? psky->horizfrac : parallaxyscale_override); if (dapyoffs) *dapyoffs = psky->yoffs + parallaxyoffs_override; + if (daptileyscale) + *daptileyscale = psky->yscale; return psky->tileofs; } diff --git a/source/build/src/polymer.cpp b/source/build/src/polymer.cpp index d9b16b385..9f2643861 100644 --- a/source/build/src/polymer.cpp +++ b/source/build/src/polymer.cpp @@ -4102,7 +4102,7 @@ static void polymer_getsky(void) curskypal = sector[i].ceilingpal; curskyshade = sector[i].ceilingshade; - getpsky(cursky, &horizfrac, NULL, NULL); + getpsky(cursky, &horizfrac, NULL, NULL, NULL); switch (horizfrac) { @@ -4178,7 +4178,7 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad GLfloat height = 2.45f / 2.0f; int32_t dapskybits; - const int8_t *dapskyoff = getpsky(tilenum, NULL, &dapskybits, NULL); + const int8_t *dapskyoff = getpsky(tilenum, NULL, &dapskybits, NULL, NULL); const int32_t numskytilesm1 = (1<fogpal; global_cf_shade = sec->floorshade, global_cf_pal = sec->floorpal; global_cf_z = sec->floorz; // REFACT @@ -3006,7 +3006,7 @@ static void polymost_drawalls(int32_t const bunch) float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size! float vv[2]; float t = (float)((1<<(picsiz[globalpicnum]&15))<>1)+dapyoffs)) - vv[1]*ghoriz; int i = (1<<(picsiz[globalpicnum]>>4)); if (i != tilesiz[globalpicnum].y) i += i; vec3f_t o; @@ -3269,7 +3269,7 @@ static void polymost_drawalls(int32_t const bunch) DO_TILE_ANIM(globalpicnum, sectnum); - dapskyoff = getpsky(globalpicnum, NULL, &dapskybits, &dapyoffs); + dapskyoff = getpsky(globalpicnum, NULL, &dapskybits, &dapyoffs, &daptileyscale); global_cf_fogpal = sec->fogpal; global_cf_shade = sec->ceilingshade, global_cf_pal = sec->ceilingpal; global_cf_z = sec->ceilingz; // REFACT @@ -3298,7 +3298,7 @@ static void polymost_drawalls(int32_t const bunch) float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size! float vv[2]; float t = (float)((1<<(picsiz[globalpicnum]&15))<>1)+dapyoffs)) - vv[1]*ghoriz; int i = (1<<(picsiz[globalpicnum]>>4)); if (i != tilesiz[globalpicnum].y) i += i; vec3f_t o;