From 527181f151f17a3cfdf7a4613470c5d912c757f8 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 14 Oct 2016 07:40:50 +0000 Subject: [PATCH] Re-enable the use of psky_t's yoffset. git-svn-id: https://svn.eduke32.com/eduke32@5896 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 11 +++++------ polymer/eduke32/build/src/engine_priv.h | 6 ++++-- polymer/eduke32/build/src/polymer.c | 4 ++-- polymer/eduke32/build/src/polymost.c | 10 +++++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 454592fe5..831809efe 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -3577,9 +3577,6 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i int32_t j, k, l, m, n, x, z, wallnum, nextsectnum, globalhorizbak; int16_t *topptr, *botptr; - int32_t dapyscale, dapskybits; - const int8_t *dapskyoff; - int32_t logtilesizy, tsizy; UNREFERENCED_PARAMETER(dax1); @@ -3623,7 +3620,9 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i if (tsizy==0) return; - dapskyoff = getpsky(globalpicnum, &dapyscale, &dapskybits); + + int32_t dapyscale, dapskybits, dapyoffs; + int8_t const * const dapskyoff = getpsky(globalpicnum, &dapyscale, &dapskybits, &dapyoffs); globalshiftval = logtilesizy; @@ -3637,14 +3636,14 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i globaltilesizy = tsizy; globalyscale = 65536 / tsizy; globalshiftval = 0; - globalzd = divscale32(((tsizy>>1)+parallaxyoffs_override/*+g_psky.yoffs*/), tsizy) + ((uint32_t)globalypanning<<24); + globalzd = divscale32(((tsizy>>1)+dapyoffs), tsizy) + ((uint32_t)globalypanning<<24); } else #endif { globalshiftval = 32-globalshiftval; globalyscale = (8<<(globalshiftval-19)); - globalzd = (((tsizy>>1)+parallaxyoffs_override/*+g_psky.yoffs*/)<>1)+dapyoffs)<lognumtiles : pskybits_override); if (dapyscale) *dapyscale = (parallaxyscale_override == 0 ? psky->horizfrac : parallaxyscale_override); + if (dapyoffs) + *dapyoffs = psky->yoffs + parallaxyoffs_override; return psky->tileofs; } diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 0ddd5fb83..7943d9925 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -4100,7 +4100,7 @@ static void polymer_getsky(void) curskypal = sector[i].ceilingpal; curskyshade = sector[i].ceilingshade; - getpsky(cursky, &horizfrac, NULL); + getpsky(cursky, &horizfrac, NULL, NULL); switch (horizfrac) { @@ -4176,7 +4176,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); + const int8_t *dapskyoff = getpsky(tilenum, NULL, &dapskybits, NULL); const int32_t numskytilesm1 = (1<fogpal; global_cf_shade = sec->floorshade, global_cf_pal = sec->floorpal; global_cf_z = sec->floorz; // REFACT @@ -2958,7 +2958,7 @@ static void polymost_drawalls(int32_t const bunch) float vv[2]; float t = (float)((1<<(picsiz[globalpicnum]&15))<>1)+parallaxyoffs_override/*+g_psky.yoffs*/)) - vv[1]*ghoriz; + vv[0] = dd*((float)((tilesiz[globalpicnum].y>>1)+dapyoffs)) - vv[1]*ghoriz; int i = (1<<(picsiz[globalpicnum]>>4)); if (i != tilesiz[globalpicnum].y) i += i; vec3f_t o; @@ -3220,7 +3220,7 @@ static void polymost_drawalls(int32_t const bunch) DO_TILE_ANIM(globalpicnum, sectnum); - dapskyoff = getpsky(globalpicnum, NULL, &dapskybits); + dapskyoff = getpsky(globalpicnum, NULL, &dapskybits, &dapyoffs); global_cf_fogpal = sec->fogpal; global_cf_shade = sec->ceilingshade, global_cf_pal = sec->ceilingpal; global_cf_z = sec->ceilingz; // REFACT @@ -3250,7 +3250,7 @@ static void polymost_drawalls(int32_t const bunch) float vv[2]; float t = (float)((1<<(picsiz[globalpicnum]&15))<>1)+parallaxyoffs_override/*+g_psky.yoffs*/)) - vv[1]*ghoriz; + vv[0] = dd*((float)((tilesiz[globalpicnum].y>>1)+dapyoffs)) - vv[1]*ghoriz; int i = (1<<(picsiz[globalpicnum]>>4)); if (i != tilesiz[globalpicnum].y) i += i; vec3f_t o;