Index: ddraw/colorconv.c |
— | — | @@ -18,6 +18,21 @@ |
19 | 19 | #include "common.h"
|
20 | 20 | #include "colorconv.h"
|
21 | 21 |
|
| 22 | +typedef void(*COLORCONVPROC) (size_t count, void *dest, void *src);
|
| 23 | +COLORCONVPROC colorconvproc[] =
|
| 24 | +{
|
| 25 | + rgba8332torgba8888,
|
| 26 | + rgba8888torgba8332,
|
| 27 | + rgb565torgba8888,
|
| 28 | + rgb565torgbx8888,
|
| 29 | + rgbx8888torgb565,
|
| 30 | + rgba1555torgba8888,
|
| 31 | + rgba8888torgba1555,
|
| 32 | + rgba4444torgba8888,
|
| 33 | + rgba8888torgba4444,
|
| 34 | + uyvytorgbx8888
|
| 35 | +};
|
| 36 | +
|
22 | 37 | __inline unsigned int _1to8(unsigned int input)
|
23 | 38 | {
|
24 | 39 | return input * 255;
|
Index: ddraw/colorconv.h |
— | — | @@ -23,9 +23,19 @@ |
24 | 24 | extern "C" {
|
25 | 25 | #endif
|
26 | 26 |
|
| 27 | +typedef void(*COLORCONVPROC) (size_t count, void *dest, void *src);
|
| 28 | +extern COLORCONVPROC colorconvproc[];
|
| 29 | +
|
27 | 30 | void rgba8332torgba8888(size_t count, DWORD *dest, WORD *src);
|
28 | 31 | void rgba8888torgba8332(size_t count, WORD *dest, DWORD *src);
|
29 | 32 | void rgb565torgba8888(size_t count, DWORD *dest, WORD *src);
|
| 33 | +void rgb565torgbx8888(size_t count, DWORD *dest, WORD *src);
|
| 34 | +void rgbx8888torgb565(size_t count, WORD *dest, DWORD *src);
|
| 35 | +void rgba1555torgba8888(size_t count, DWORD *dest, WORD *src);
|
| 36 | +void rgba8888torgba1555(size_t count, WORD *dest, DWORD *src);
|
| 37 | +void rgba4444torgba8888(size_t count, DWORD *dest, WORD *src);
|
| 38 | +void rgba8888torgba4444(size_t count, WORD *dest, DWORD *src);
|
| 39 | +void uyvytorgbx8888(size_t count, DWORD *dest, DWORD *src);
|
30 | 40 |
|
31 | 41 | #ifdef __cplusplus
|
32 | 42 | }
|
Index: ddraw/glTexture.cpp |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | #include "util.h"
|
27 | 27 | #include <math.h>
|
28 | 28 | #include "scalers.h"
|
| 29 | +#include "colorconv.h"
|
29 | 30 |
|
30 | 31 | extern "C" {
|
31 | 32 |
|
— | — | @@ -816,9 +817,11 @@ |
817 | 818 | This->colorbits[3] = 0;
|
818 | 819 | break;
|
819 | 820 | case 7: // 16-bit RGBA8332
|
820 | | - //This->useconv = TRUE;
|
821 | | - //This->convfunction = 0;
|
822 | | - FIXME("Unusual texture format RGBA8332 not supported");
|
| 821 | + This->useconv = TRUE;
|
| 822 | + This->convfunctionupload = 0;
|
| 823 | + This->convfunctiondownload = 1;
|
| 824 | + This->internalformats[0] = GL_RGBA8;
|
| 825 | + This->type = GL_UNSIGNED_BYTE;
|
823 | 826 | This->colororder = 1;
|
824 | 827 | This->colorsizes[0] = 7;
|
825 | 828 | This->colorsizes[1] = 7;
|
— | — | @@ -930,7 +933,7 @@ |
931 | 934 | case 15: // 24-bit Z buffer
|
932 | 935 | This->internalformats[0] = GL_DEPTH_COMPONENT24;
|
933 | 936 | This->format = GL_DEPTH_COMPONENT;
|
934 | | - This->type = GL_UNSIGNED_INT;
|
| 937 | + This->type = GL_UNSIGNED_SHORT;
|
935 | 938 | This->colororder = 4;
|
936 | 939 | This->colorsizes[0] = 16777215;
|
937 | 940 | This->colorsizes[1] = 16777215;
|
Index: ddraw/struct.h |
— | — | @@ -312,7 +312,8 @@ |
313 | 313 | GLenum type;
|
314 | 314 | BOOL zhasstencil;
|
315 | 315 | BOOL useconv;
|
316 | | - int convfunction;
|
| 316 | + int convfunctionupload;
|
| 317 | + int convfunctiondownload;
|
317 | 318 | struct glTexture *palette;
|
318 | 319 | struct glTexture *stencil;
|
319 | 320 | struct glTexture *dummycolor;
|