mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
New def token for "multipsky": "yscale".
multipsky <tile> { yscale <yscale> } Default value is 65536. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6519 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6164e3dae8
commit
5fbe1b89be
6 changed files with 25 additions and 10 deletions
|
@ -727,6 +727,8 @@ typedef struct {
|
|||
|
||||
int8_t lognumtiles; // 1<<lognumtiles: number of tiles in multi-sky
|
||||
int8_t tileofs[MAXPSKYTILES]; // for 0 <= j < (1<<lognumtiles): tile offset relative to basetile
|
||||
|
||||
int32_t yscale;
|
||||
} psky_t;
|
||||
|
||||
// Index of map-global (legacy) multi-sky:
|
||||
|
|
|
@ -2646,6 +2646,7 @@ static int32_t defsparser(scriptfile *script)
|
|||
{ "lognumtiles", T_LOGNUMTILES },
|
||||
{ "tile", T_TILE },
|
||||
{ "panel", T_TILE },
|
||||
{ "yscale", T_YSCALE },
|
||||
};
|
||||
|
||||
if (scriptfile_getsymbol(script,&tile))
|
||||
|
@ -2708,6 +2709,14 @@ static int32_t defsparser(scriptfile *script)
|
|||
newpsky->tileofs[panel] = offset;
|
||||
break;
|
||||
}
|
||||
case T_YSCALE:
|
||||
{
|
||||
int32_t yscale;
|
||||
scriptfile_getsymbol(script,&yscale);
|
||||
|
||||
newpsky->yscale = yscale;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -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)<<globalshiftval) + ((uint32_t)globalypanning<<24);
|
||||
}
|
||||
globalyscale = divscale16(globalyscale,daptileyscale);
|
||||
|
||||
//if (globalorientation&256) globalyscale = -globalyscale, globalzd = -globalzd;
|
||||
|
||||
|
@ -7514,6 +7515,7 @@ psky_t * E_DefinePsky(int32_t const tilenum)
|
|||
psky_t * const newPsky = &multipsky[newPskyID];
|
||||
Bmemset(newPsky, 0, sizeof(psky_t));
|
||||
multipskytile[newPskyID] = tilenum;
|
||||
newPsky->yscale = 65536;
|
||||
|
||||
return newPsky;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<<dapskybits)-1;
|
||||
|
||||
i = 0;
|
||||
|
|
|
@ -2976,8 +2976,8 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
|
||||
DO_TILE_ANIM(globalpicnum, sectnum);
|
||||
|
||||
int32_t dapskybits, dapyoffs;
|
||||
int8_t const * dapskyoff = getpsky(globalpicnum, NULL, &dapskybits, &dapyoffs);
|
||||
int32_t dapskybits, dapyoffs, daptileyscale;
|
||||
int8_t const * dapskyoff = getpsky(globalpicnum, NULL, &dapskybits, &dapyoffs, &daptileyscale);
|
||||
|
||||
global_cf_fogpal = sec->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))<<dapskybits);
|
||||
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(65536.f*65536.f));
|
||||
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(daptileyscale*65536.f));
|
||||
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;
|
||||
|
@ -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))<<dapskybits);
|
||||
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(65536.f*65536.f));
|
||||
vv[1] = dd*((float)xdimscale*fviewingrange) * (1.f/(daptileyscale*65536.f));
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue