From b87feaecebf06c71b3c120f8a9aa9426e83e404b Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 17 Sep 2018 11:21:25 +0100 Subject: [PATCH] Animated sky backport --- src/hardware/hw_main.c | 6 +++--- src/r_plane.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 9dbf37dcc..f1c5e555f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5581,7 +5581,7 @@ static void HWR_DrawSkyBackground(player_t *player) // 0--1 (void)player; - HWR_GetTexture(skytexture); + HWR_GetTexture(texturetranslation[skytexture]); //Hurdler: the sky is the only texture who need 4.0f instead of 1.0 // because it's called just after clearing the screen @@ -5601,7 +5601,7 @@ static void HWR_DrawSkyBackground(player_t *player) // The only time this will probably be an issue is when a sky wider than 1024 is used as a sky AND a regular wall texture angle = (dup_viewangle + gr_xtoviewangle[0]); - dimensionmultiply = ((float)textures[skytexture]->width/256.0f); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f); if (atransform.mirror) { @@ -5616,7 +5616,7 @@ static void HWR_DrawSkyBackground(player_t *player) angle = aimingangle; aspectratio = (float)vid.width/(float)vid.height; - dimensionmultiply = ((float)textures[skytexture]->height/(128.0f*aspectratio)); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio)); angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply; // Middle of the sky should always be at angle 0 diff --git a/src/r_plane.c b/src/r_plane.c index 68be24b28..cf973ebc9 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -720,7 +720,7 @@ void R_DrawPlanes(void) dc_iscale = FixedMul(skyscale, FINECOSINE(xtoviewangle[x]>>ANGLETOFINESHIFT)); dc_x = x; dc_source = - R_GetColumn(skytexture, + R_GetColumn(texturetranslation[skytexture], angle); wallcolfunc(); }