[Scummvm-git-logs] scummvm master -> e5b055d064896e0b06684afbfd32bbf3e0f8a830

aquadran noreply at scummvm.org
Sat Dec 4 00:09:16 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e5b055d064 TINYGL: Cleanup texture pixel formats


Commit: e5b055d064896e0b06684afbfd32bbf3e0f8a830
    https://github.com/scummvm/scummvm/commit/e5b055d064896e0b06684afbfd32bbf3e0f8a830
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2021-12-04T01:09:12+01:00

Commit Message:
TINYGL: Cleanup texture pixel formats

Changed paths:
    graphics/tinygl/gl.h
    graphics/tinygl/texture.cpp


diff --git a/graphics/tinygl/gl.h b/graphics/tinygl/gl.h
index a9a0cbb575..8b3aa04ede 100644
--- a/graphics/tinygl/gl.h
+++ b/graphics/tinygl/gl.h
@@ -593,6 +593,8 @@ enum {
 	TGL_UNSIGNED_INT_8_8_8_8_REV    = 0x8367,
 	TGL_UNSIGNED_SHORT_5_5_5_1      = 0x8034,
 	TGL_UNSIGNED_SHORT_1_5_5_5_REV  = 0x8366,
+	TGL_UNSIGNED_SHORT_4_4_4_4      = 0x8033,
+	TGL_UNSIGNED_SHORT_4_4_4_4_REV  = 0x8365,
 
 	// Utility
 	TGL_VENDOR                      = 0x1F00,
diff --git a/graphics/tinygl/texture.cpp b/graphics/tinygl/texture.cpp
index 885ce6dc1a..ba14ff3b4b 100644
--- a/graphics/tinygl/texture.cpp
+++ b/graphics/tinygl/texture.cpp
@@ -39,35 +39,18 @@ struct tglColorAssociation {
 };
 
 static const struct tglColorAssociation colorAssociationList[] = {
-/*
- * TGL_UNSIGNED_BYTE before other variants to provide OpenGLES-friendly formats
- * when this table is used to look these up.
- * Note: this does not matter at all for TinyGL, but this is to be consistent
- * with future OpenGL equivalent for this code.
- */
 #if defined(SCUMM_LITTLE_ENDIAN)
 	{Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), TGL_RGBA, TGL_UNSIGNED_BYTE},
 	{Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), TGL_BGRA, TGL_UNSIGNED_BYTE},
 	{Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0),  TGL_RGB,  TGL_UNSIGNED_BYTE},
-	{Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0),  TGL_BGR,  TGL_UNSIGNED_BYTE},
 #else
 	{Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), TGL_RGBA, TGL_UNSIGNED_BYTE},
 	{Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0), TGL_BGRA, TGL_UNSIGNED_BYTE},
 	{Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0),  TGL_RGB,  TGL_UNSIGNED_BYTE},
-	{Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0),  TGL_BGR,  TGL_UNSIGNED_BYTE},
 #endif
-	{Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24), TGL_RGBA, TGL_UNSIGNED_INT_8_8_8_8_REV},
-	{Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), TGL_RGBA, TGL_UNSIGNED_INT_8_8_8_8},
-	{Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), TGL_BGRA, TGL_UNSIGNED_INT_8_8_8_8_REV},
-	{Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0), TGL_BGRA, TGL_UNSIGNED_INT_8_8_8_8},
-	{Graphics::PixelFormat(2, 5, 5, 5, 1, 0, 5, 10, 15), TGL_RGBA, TGL_UNSIGNED_SHORT_1_5_5_5_REV},
+	{Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),  TGL_RGB,  TGL_UNSIGNED_SHORT_5_6_5},
 	{Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0),  TGL_RGBA, TGL_UNSIGNED_SHORT_5_5_5_1},
-	{Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15), TGL_BGRA, TGL_UNSIGNED_SHORT_1_5_5_5_REV},
-	{Graphics::PixelFormat(2, 5, 5, 5, 1, 1, 6, 11, 0),  TGL_BGRA, TGL_UNSIGNED_SHORT_5_5_5_1},
-	{Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0),  TGL_RGB,  TGL_UNSIGNED_SHORT_5_6_5_REV},
-	{Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),  TGL_BGR,  TGL_UNSIGNED_SHORT_5_6_5},
-	{Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),  TGL_BGR,  TGL_UNSIGNED_SHORT_5_6_5_REV},
-	{Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0),  TGL_RGB,  TGL_UNSIGNED_SHORT_5_6_5}
+	{Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0),  TGL_RGBA, TGL_UNSIGNED_SHORT_4_4_4_4}
 };
 #define COLOR_ASSOCIATION_LIST_LENGTH (sizeof(colorAssociationList) / sizeof(*colorAssociationList))
 




More information about the Scummvm-git-logs mailing list