From 6a917a68b3975b275f992e385927cb6c96323142 Mon Sep 17 00:00:00 2001
From: Stuart Buchanan <stuart_d_buchanan@yahoo.co.uk>
Date: Sat, 18 Dec 2021 21:55:17 +0000
Subject: [PATCH] WS30: Revert to green channel for texture atlas

---
 Shaders/ws30-ALS-landclass-search-functions.frag | 2 +-
 Shaders/ws30-q1.frag                             | 2 +-
 Shaders/ws30.frag                                | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Shaders/ws30-ALS-landclass-search-functions.frag b/Shaders/ws30-ALS-landclass-search-functions.frag
index af480b089..4fb579074 100644
--- a/Shaders/ws30-ALS-landclass-search-functions.frag
+++ b/Shaders/ws30-ALS-landclass-search-functions.frag
@@ -370,7 +370,7 @@ int read_landclass_id(in vec2 tile_coord)
   vec2 dy = dFdy(tile_coord.st);
   int lc;
 
-  if (landclass_source == 0) lc = (int(texture2D(landclass, tile_coord.st).r * 255.0 + 0.5));
+  if (landclass_source == 0) lc = (int(texture2D(landclass, tile_coord.st).g * 255.0 + 0.5));
   else lc = (get_random_landclass(tile_coord.st, tile_size));
   return lc;
 }
diff --git a/Shaders/ws30-q1.frag b/Shaders/ws30-q1.frag
index 987886d0e..550adb5de 100644
--- a/Shaders/ws30-q1.frag
+++ b/Shaders/ws30-q1.frag
@@ -58,7 +58,7 @@ void main()
 	} else {
 		// The Landclass for this particular fragment.  This can be used to
 		// index into the atlas textures.
-		int lc = int(texture2D(landclass, gl_TexCoord[0].st).r * 255.0 + 0.5);
+		int lc = int(texture2D(landclass, gl_TexCoord[0].st).g * 255.0 + 0.5);
 		uint tex1 = uint(fg_textureLookup1[lc].r * 255.0 + 0.5);
 
 		// Color Mode is always AMBIENT_AND_DIFFUSE, which means
diff --git a/Shaders/ws30.frag b/Shaders/ws30.frag
index 006b94383..782ed36bf 100644
--- a/Shaders/ws30.frag
+++ b/Shaders/ws30.frag
@@ -57,7 +57,7 @@ void main()
 	} else {
 		// The Landclass for this particular fragment.  This can be used to
 		// index into the atlas textures.
-		int lc = int(texture2D(landclass, gl_TexCoord[0].st).r * 255.0 + 0.5);
+		int lc = int(texture2D(landclass, gl_TexCoord[0].st).g * 255.0 + 0.5);
 
 		// Color Mode is always AMBIENT_AND_DIFFUSE, which means
 		// using a base colour of white for ambient/diffuse,