mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- sky positioning tweaks.
It does not use the panning info of the wall and needs a texture height relative adjustment.
This commit is contained in:
parent
92bb9c5319
commit
6fcb6fa1d5
2 changed files with 3 additions and 8 deletions
|
@ -42,8 +42,6 @@ FGameTexture* GetSkyTexture(int basetile, int lognumtiles, const int16_t* tilema
|
||||||
void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane, PalEntry FadeColor)
|
void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane, PalEntry FadeColor)
|
||||||
{
|
{
|
||||||
int picnum = plane == plane_ceiling ? sector->ceilingpicnum : sector->floorpicnum;
|
int picnum = plane == plane_ceiling ? sector->ceilingpicnum : sector->floorpicnum;
|
||||||
float xpanning = plane == plane_ceiling ? sector->ceilingxpan_ : sector->floorxpan_;
|
|
||||||
float ypanning = plane == plane_ceiling ? sector->ceilingypan_ : sector->floorypan_;
|
|
||||||
|
|
||||||
int32_t dapyscale = 0, dapskybits = 0, dapyoffs = 0, daptileyscale = 0;
|
int32_t dapyscale = 0, dapskybits = 0, dapyoffs = 0, daptileyscale = 0;
|
||||||
FGameTexture* skytex = nullptr;
|
FGameTexture* skytex = nullptr;
|
||||||
|
@ -58,13 +56,10 @@ void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane,
|
||||||
else skytex = tileGetTexture(picnum);
|
else skytex = tileGetTexture(picnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
float t = (float)((1 << (sizeToBits(tileWidth(picnum)))) << dapskybits);
|
|
||||||
int ti = (1 << (sizeToBits(tileHeight(picnum)))); if (ti != tileHeight(picnum)) ti += ti;
|
|
||||||
|
|
||||||
// dapyscale is not relvant for a sky dome.
|
// dapyscale is not relvant for a sky dome.
|
||||||
sky->y_scale = FixedToFloat(daptileyscale);
|
sky->y_scale = FixedToFloat(daptileyscale);
|
||||||
sky->y_offset = dapyoffs*2 + (ypanning * ti / 64.f);
|
sky->y_offset = dapyoffs*2;
|
||||||
sky->x_offset = xpanning / (1 << (realskybits - dapskybits));
|
sky->x_offset = 0;// xpanning / (1 << (realskybits - dapskybits));
|
||||||
sky->fadecolor = FadeColor;
|
sky->fadecolor = FadeColor;
|
||||||
sky->shade = 0;// clamp(plane == plane_ceiling ? sector->ceilingshade : sector->floorshade, 0, numshades - 1);
|
sky->shade = 0;// clamp(plane == plane_ceiling ? sector->ceilingshade : sector->floorshade, 0, numshades - 1);
|
||||||
sky->texture = skytex;
|
sky->texture = skytex;
|
||||||
|
|
|
@ -69,7 +69,7 @@ void HWSkyPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
|
||||||
|
|
||||||
modelMatrix.loadIdentity();
|
modelMatrix.loadIdentity();
|
||||||
modelMatrix.rotate(-180.0f + origin->x_offset, 0.f, 1.f, 0.f);
|
modelMatrix.rotate(-180.0f + origin->x_offset, 0.f, 1.f, 0.f);
|
||||||
modelMatrix.translate(0.f, (-40 + texskyoffset) * skyoffsetfactor, 0.f);
|
modelMatrix.translate(0.f, -40 + texskyoffset + (tex->GetTexelHeight() - 300) / 2 * skyoffsetfactor, 0.f);
|
||||||
//modelMatrix.scale(1.f, 0.8f * 1.17f, 1.f);
|
//modelMatrix.scale(1.f, 0.8f * 1.17f, 1.f);
|
||||||
textureMatrix.loadIdentity();
|
textureMatrix.loadIdentity();
|
||||||
textureMatrix.scale(-1.f, 0.5, 1.f);
|
textureMatrix.scale(-1.f, 0.5, 1.f);
|
||||||
|
|
Loading…
Reference in a new issue