From a739cb0da9e7d87cb857048295420ba2f642e48d Mon Sep 17 00:00:00 2001
From: Jaime Passos <lazymyuutsu@gmail.com>
Date: Mon, 6 Jul 2020 00:58:09 -0300
Subject: [PATCH] Remove unused texture formats

---
 src/hardware/hw_cache.c          |  6 +-----
 src/hardware/hw_data.h           | 18 ++++++++----------
 src/hardware/r_opengl/r_opengl.c |  6 +-----
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c
index a284b8ed0d..0b3169147a 100644
--- a/src/hardware/hw_cache.c
+++ b/src/hardware/hw_cache.c
@@ -34,11 +34,7 @@ static INT32 format2bpp(GLTextureFormat_t format)
 {
 	if (format == GL_TEXFMT_RGBA)
 		return 4;
-	else if (format == GL_TEXFMT_RGB_565
-		|| format == GL_TEXFMT_ARGB_1555
-		|| format == GL_TEXFMT_ARGB_4444
-		|| format == GL_TEXFMT_ALPHA_INTENSITY_88
-		|| format == GL_TEXFMT_AP_88)
+	else if (format == GL_TEXFMT_ALPHA_INTENSITY_88 || format == GL_TEXFMT_AP_88)
 		return 2;
 	else
 		return 1;
diff --git a/src/hardware/hw_data.h b/src/hardware/hw_data.h
index 1e1381d7c5..e5477d7292 100644
--- a/src/hardware/hw_data.h
+++ b/src/hardware/hw_data.h
@@ -29,16 +29,14 @@
 
 typedef enum GLTextureFormat_e
 {
-	GL_TEXFMT_ALPHA_8             = 0x2, /* (0..0xFF) alpha     */
-	GL_TEXFMT_INTENSITY_8         = 0x3, /* (0..0xFF) intensity */
-	GL_TEXFMT_ALPHA_INTENSITY_44  = 0x4,
-	GL_TEXFMT_P_8                 = 0x5, /* 8-bit palette */
-	GL_TEXFMT_RGBA                = 0x6, /* 32 bit RGBA! */
-	GL_TEXFMT_RGB_565             = 0xa,
-	GL_TEXFMT_ARGB_1555           = 0xb,
-	GL_TEXFMT_ARGB_4444           = 0xc,
-	GL_TEXFMT_ALPHA_INTENSITY_88  = 0xd,
-	GL_TEXFMT_AP_88               = 0xe, /* 8-bit alpha 8-bit palette */
+	GL_TEXFMT_P_8                 = 0x01, /* 8-bit palette */
+	GL_TEXFMT_AP_88               = 0x02, /* 8-bit alpha, 8-bit palette */
+
+	GL_TEXFMT_RGBA                = 0x10, /* 32 bit RGBA! */
+
+	GL_TEXFMT_ALPHA_8             = 0x20, /* (0..0xFF) alpha     */
+	GL_TEXFMT_INTENSITY_8         = 0x21, /* (0..0xFF) intensity */
+	GL_TEXFMT_ALPHA_INTENSITY_88  = 0x22,
 } GLTextureFormat_t;
 
 // data holds the address of the graphics data cached in heap memory
diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c
index 04bbd916de..49dbcd08f1 100644
--- a/src/hardware/r_opengl/r_opengl.c
+++ b/src/hardware/r_opengl/r_opengl.c
@@ -2971,11 +2971,7 @@ EXPORT INT32  HWRAPI(GetTextureUsed) (void)
 		int format = tmp->format;
 		if (format == GL_TEXFMT_RGBA)
 			bpp = 4;
-		else if (format == GL_TEXFMT_RGB_565
-			|| format == GL_TEXFMT_ARGB_1555
-			|| format == GL_TEXFMT_ARGB_4444
-			|| format == GL_TEXFMT_ALPHA_INTENSITY_88
-			|| format == GL_TEXFMT_AP_88)
+		else if (format == GL_TEXFMT_ALPHA_INTENSITY_88 || format == GL_TEXFMT_AP_88)
 			bpp = 2;
 
 		// Add it up!
-- 
GitLab