DXGL r885 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r884‎ | r885 | r886 >
Date:01:27, 16 December 2018
Author:admin
Status:new
Tags:
Comment:
Add 24-bit reversed order color format.
Modified paths:
  • /ddraw/glTexture.cpp (modified) (history)
  • /dxglcfg/surfacegen.cpp (modified) (history)

Diff [purge]

Index: ddraw/glTexture.cpp
@@ -74,6 +74,7 @@
7575 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0x7C00, 0x3E0, 0x1F, 0}, // 15 bit 555
7676 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0xF800, 0x7E0, 0x1F, 0}, // 16 bit 565
7777 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 24, 0xFF0000, 0xFF00, 0xFF, 0}, // 24 bit 888
 78+ {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 24, 0xFF, 0xFF00, 0xFF0000, 0}, // 24 bit 888 RGB
7879 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 32, 0xFF0000, 0xFF00, 0xFF, 0}, // 32 bit 888
7980 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 32, 0xFF, 0xFF00, 0xFF0000, 0}, // 32 bit 888 RGB
8081 {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_ALPHAPIXELS, 0, 16, 0xE0, 0x1C, 0x3, 0xFF00}, // 16-bit 8332
@@ -864,7 +865,22 @@
865866 This->colorbits[2] = 8;
866867 This->colorbits[3] = 0;
867868 break;
868 - case 5: // 32-bit RGB888
 869+ case 5: // 24-bit BGR888
 870+ This->internalformats[0] = GL_RGB8;
 871+ This->internalformats[1] = GL_RGBA8;
 872+ This->format = GL_RGB;
 873+ This->type = GL_UNSIGNED_BYTE;
 874+ This->colororder = 1;
 875+ This->colorsizes[0] = 255;
 876+ This->colorsizes[1] = 255;
 877+ This->colorsizes[2] = 255;
 878+ This->colorsizes[3] = 1;
 879+ This->colorbits[0] = 8;
 880+ This->colorbits[1] = 8;
 881+ This->colorbits[2] = 8;
 882+ This->colorbits[3] = 0;
 883+ break;
 884+ case 6: // 32-bit RGB888
869885 This->internalformats[0] = GL_RGBA8;
870886 This->format = GL_BGRA;
871887 This->type = GL_UNSIGNED_INT_8_8_8_8_REV;
@@ -878,7 +894,7 @@
879895 This->colorbits[2] = 8;
880896 This->colorbits[3] = 0;
881897 break;
882 - case 6: // 32-bit BGR888
 898+ case 7: // 32-bit BGR888
883899 This->internalformats[0] = GL_RGBA8;
884900 This->format = GL_RGBA;
885901 This->type = GL_UNSIGNED_INT_8_8_8_8_REV;
@@ -892,7 +908,7 @@
893909 This->colorbits[2] = 8;
894910 This->colorbits[3] = 0;
895911 break;
896 - case 7: // 16-bit RGBA8332
 912+ case 8: // 16-bit RGBA8332
897913 This->useconv = TRUE;
898914 This->convfunctionupload = 0;
899915 This->convfunctiondownload = 1;
@@ -910,7 +926,7 @@
911927 This->colorbits[2] = 2;
912928 This->colorbits[3] = 8;
913929 break;
914 - case 8: // 16-bit RGBA4444
 930+ case 9: // 16-bit RGBA4444
915931 This->internalformats[0] = GL_RGBA4;
916932 This->internalformats[1] = GL_RGBA8;
917933 This->format = GL_BGRA;
@@ -925,7 +941,7 @@
926942 This->colorbits[2] = 4;
927943 This->colorbits[3] = 4;
928944 break;
929 - case 9: // 16-bit RGBA1555
 945+ case 10: // 16-bit RGBA1555
930946 This->internalformats[0] = GL_RGB5_A1;
931947 This->internalformats[1] = GL_RGBA8;
932948 This->format = GL_BGRA;
@@ -935,7 +951,7 @@
936952 This->colorbits[2] = 5;
937953 This->colorbits[3] = 1;
938954 break;
939 - case 10: // 32-bit RGBA8888
 955+ case 11: // 32-bit RGBA8888
940956 This->internalformats[0] = GL_RGBA8;
941957 This->format = GL_BGRA;
942958 This->type = GL_UNSIGNED_INT_8_8_8_8_REV;
@@ -949,7 +965,7 @@
950966 This->colorbits[2] = 8;
951967 This->colorbits[3] = 8;
952968 break;
953 - case 11: // 8-bit Luminance
 969+ case 12: // 8-bit Luminance
954970 This->internalformats[0] = GL_LUMINANCE8;
955971 This->internalformats[1] = GL_RGB8;
956972 This->internalformats[2] = GL_RGBA8;
@@ -965,7 +981,7 @@
966982 This->colorbits[2] = 0;
967983 This->colorbits[3] = 0;
968984 break;
969 - case 12: // 8-bit Alpha
 985+ case 13: // 8-bit Alpha
970986 This->internalformats[0] = GL_ALPHA8;
971987 This->format = GL_ALPHA;
972988 This->type = GL_UNSIGNED_BYTE;
@@ -979,7 +995,7 @@
980996 This->colorbits[2] = 0;
981997 This->colorbits[3] = 8;
982998 break;
983 - case 13: // 16-bit Luminance Alpha
 999+ case 14: // 16-bit Luminance Alpha
9841000 This->internalformats[0] = GL_LUMINANCE8_ALPHA8;
9851001 This->internalformats[1] = GL_RGBA8;
9861002 This->format = GL_LUMINANCE_ALPHA;
@@ -994,7 +1010,7 @@
9951011 This->colorbits[2] = 0;
9961012 This->colorbits[3] = 8;
9971013 break;
998 - case 14: // 16-bit Z buffer
 1014+ case 15: // 16-bit Z buffer
9991015 This->internalformats[0] = GL_DEPTH_COMPONENT16;
10001016 This->format = GL_DEPTH_COMPONENT;
10011017 This->type = GL_UNSIGNED_SHORT;
@@ -1008,7 +1024,7 @@
10091025 This->colorbits[2] = 0;
10101026 This->colorbits[3] = 0;
10111027 break;
1012 - case 15: // 24-bit Z buffer
 1028+ case 16: // 24-bit Z buffer
10131029 This->internalformats[0] = GL_DEPTH_COMPONENT24;
10141030 This->format = GL_DEPTH_COMPONENT;
10151031 This->type = GL_UNSIGNED_SHORT;
@@ -1022,7 +1038,7 @@
10231039 This->colorbits[2] = 0;
10241040 This->colorbits[3] = 0;
10251041 break;
1026 - case 16: // 32/24 bit Z buffer
 1042+ case 17: // 32/24 bit Z buffer
10271043 This->internalformats[0] = GL_DEPTH_COMPONENT24;
10281044 This->format = GL_DEPTH_COMPONENT;
10291045 This->type = GL_UNSIGNED_INT;
@@ -1036,7 +1052,7 @@
10371053 This->colorbits[2] = 0;
10381054 This->colorbits[3] = 0;
10391055 break;
1040 - case 17: // 32-bit Z buffer
 1056+ case 18: // 32-bit Z buffer
10411057 This->internalformats[0] = GL_DEPTH_COMPONENT32;
10421058 This->format = GL_DEPTH_COMPONENT;
10431059 This->type = GL_UNSIGNED_INT;
@@ -1050,7 +1066,7 @@
10511067 This->colorbits[2] = 0;
10521068 This->colorbits[3] = 0;
10531069 break;
1054 - case 18: // 32-bit Z/Stencil buffer, depth LSB
 1070+ case 19: // 32-bit Z/Stencil buffer, depth LSB
10551071 This->internalformats[0] = GL_DEPTH24_STENCIL8;
10561072 This->format = GL_DEPTH_STENCIL;
10571073 This->type = GL_UNSIGNED_INT_24_8;
@@ -1064,7 +1080,7 @@
10651081 This->colorbits[2] = 0;
10661082 This->colorbits[3] = 8;
10671083 break;
1068 - case 19: // 32-bit Z/Stencil buffer, depth MSB
 1084+ case 20: // 32-bit Z/Stencil buffer, depth MSB
10691085 This->internalformats[0] = GL_DEPTH24_STENCIL8;
10701086 This->format = GL_DEPTH_STENCIL;
10711087 This->type = GL_UNSIGNED_INT_24_8;
Index: dxglcfg/surfacegen.cpp
@@ -1677,6 +1677,7 @@
16781678 _T("15-bit 555"),
16791679 _T("16-bit 565"),
16801680 _T("24-bit 888"),
 1681+ _T("24-bit 888 RGB"),
16811682 _T("32-bit 888"),
16821683 _T("32-bit 888 RGB"),
16831684 _T("16-bit 8332"),
@@ -1704,6 +1705,7 @@
17051706 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0x7C00, 0x3E0, 0x1F, 0}, // 15 bit 555
17061707 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 16, 0xF800, 0x7E0, 0x1F, 0}, // 16 bit 565
17071708 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 24, 0xFF0000, 0xFF00, 0xFF, 0}, // 24 bit 888
 1709+ {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 24, 0xFF, 0xFF00, 0xFF0000, 0}, // 24 bit 888 RGB
17081710 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 32, 0xFF0000, 0xFF00, 0xFF, 0}, // 32 bit 888
17091711 {sizeof(DDPIXELFORMAT), DDPF_RGB, 0, 32, 0xFF, 0xFF00, 0xFF0000, 0}, // 32 bit 888 RGB
17101712 {sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_ALPHAPIXELS, 0, 16, 0xE0, 0x1C, 0x3, 0xFF00}, // 16-bit 8332