From fe5b8c58afb65c8545dfafce6d0109935f2af442 Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Sun, 31 Jul 2016 20:51:39 +0100
Subject: [PATCH] Add basic support for animated sky textures

---
 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 a839601777..e3d9bc2187 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -5325,7 +5325,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
@@ -5345,7 +5345,7 @@ static void HWR_DrawSkyBackground(player_t *player)
 
 	angle = (dup_viewangle + gr_xtoviewangle[0]);
 
-	dimensionmultiply = ((float)textures[skytexture]->width/256.0f);
+	dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f);
 
 	v[0].sow = v[3].sow = ((float) angle / ((ANGLE_90-1)*dimensionmultiply));
 	v[2].sow = v[1].sow = (-1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply));
@@ -5354,7 +5354,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 19007d88fa..ad30f42475 100644
--- a/src/r_plane.c
+++ b/src/r_plane.c
@@ -711,7 +711,7 @@ void R_DrawPlanes(void)
 						angle = (pl->viewangle + xtoviewangle[x])>>ANGLETOSKYSHIFT;
 						dc_x = x;
 						dc_source =
-							R_GetColumn(skytexture,
+							R_GetColumn(texturetranslation[skytexture],
 								angle);
 						wallcolfunc();
 					}
-- 
GitLab