Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b220ce13
Commit
b220ce13
authored
Jul 13, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Jul 13, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct a few formats that were incorrect.
parent
40f37a14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
10 deletions
+51
-10
directx.c
dlls/wined3d/directx.c
+1
-1
utils.c
dlls/wined3d/utils.c
+49
-8
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/directx.c
View file @
b220ce13
...
...
@@ -821,7 +821,7 @@ HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayMode(IWineD3D *iface, UINT Adapter,
switch
(
bpp
)
{
case
8
:
pMode
->
Format
=
D3DFMT_R3G3B2
;
break
;
case
16
:
pMode
->
Format
=
D3DFMT_R5G6B5
;
break
;
case
24
:
/*pMode->Format = D3DFMT_R5G6B5; break;*/
/* Make 24bit appear as 32 bit
*/
case
24
:
pMode
->
Format
=
D3DFMT_X8R8G8B8
;
break
;
/* Robots needs 24bit to be X8R8G8B8
*/
case
32
:
pMode
->
Format
=
D3DFMT_A8R8G8B8
;
break
;
default:
pMode
->
Format
=
D3DFMT_UNKNOWN
;
}
...
...
dlls/wined3d/utils.c
View file @
b220ce13
...
...
@@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
/*****************************************************************************
* Trace formatting of useful values
*/
const
char
*
debug_d3dformat
(
D3DFORMAT
fmt
)
{
const
char
*
debug_d3dformat
(
WINE
D3DFORMAT
fmt
)
{
switch
(
fmt
)
{
#define FMT_TO_STR(fmt) case fmt: return #fmt
FMT_TO_STR
(
WINED3DFMT_UNKNOWN
);
...
...
@@ -256,9 +256,12 @@ const char* debug_d3dsamplerstate(DWORD state) {
D3DSTATE_TO_STR
(
WINED3DSAMP_MIPMAPLODBIAS
);
D3DSTATE_TO_STR
(
WINED3DSAMP_MAXMIPLEVEL
);
D3DSTATE_TO_STR
(
WINED3DSAMP_MAXANISOTROPY
);
D3DSTATE_TO_STR
(
WINED3DSAMP_SRGBTEXTURE
);
D3DSTATE_TO_STR
(
WINED3DSAMP_ELEMENTINDEX
);
D3DSTATE_TO_STR
(
WINED3DSAMP_DMAPOFFSET
);
#undef D3DSTATE_TO_STR
default:
FIXME
(
"Unrecognized %lu
texture
state!
\n
"
,
state
);
FIXME
(
"Unrecognized %lu
sampler
state!
\n
"
,
state
);
return
"unrecognized"
;
}
}
...
...
@@ -284,6 +287,7 @@ const char* debug_d3dtexturestate(DWORD state) {
D3DSTATE_TO_STR
(
WINED3DTSS_COLORARG0
);
D3DSTATE_TO_STR
(
WINED3DTSS_ALPHAARG0
);
D3DSTATE_TO_STR
(
WINED3DTSS_RESULTARG
);
D3DSTATE_TO_STR
(
WINED3DTSS_CONSTANT
);
#undef D3DSTATE_TO_STR
case
12
:
/* Note D3DTSS are not consecutive, so skip these */
...
...
@@ -1586,7 +1590,9 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_V8U8
:
retVal
=
GL_COLOR_INDEX8_EXT
;
break
;
case
WINED3DFMT_V16U16
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_L6V5U5
:
retVal
=
GL_COLOR_INDEX8_EXT
;
break
;
case
WINED3DFMT_X8L8V8U8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_X8L8V8U8
:
retVal
=
GL_RGBA8
;
break
;
case
WINED3DFMT_Q8W8V8U8
:
retVal
=
GL_RGBA8
;
break
;
/* almost but not quite... */
case
WINED3DFMT_Q16W16V16U16
:
retVal
=
GL_COLOR_INDEX
;
break
;
/* almost but not quite... */
/* color buffer */
case
WINED3DFMT_R3G3B2
:
retVal
=
GL_R3_G3_B2
;
break
;
case
WINED3DFMT_R5G6B5
:
retVal
=
GL_RGB5
;
break
;
/* fixme: internal format 6 for g? */
...
...
@@ -1594,11 +1600,21 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_A1R5G5B5
:
retVal
=
GL_RGB5_A1
;
break
;
case
WINED3DFMT_X1R5G5B5
:
retVal
=
GL_RGB5_A1
;
break
;
case
WINED3DFMT_A4R4G4B4
:
retVal
=
GL_RGBA4
;
break
;
case
WINED3DFMT_X4R4G4B4
:
retVal
=
GL_RGB
A
4
;
break
;
case
WINED3DFMT_X4R4G4B4
:
retVal
=
GL_RGB4
;
break
;
case
WINED3DFMT_A8R8G8B8
:
retVal
=
GL_RGBA8
;
break
;
case
WINED3DFMT_X8R8G8B8
:
retVal
=
GL_RGB
A8
;
break
;
case
WINED3DFMT_X8R8G8B8
:
retVal
=
GL_RGB
;
break
;
/* to see */
case
WINED3DFMT_A8
:
retVal
=
GL_ALPHA8
;
break
;
/* Depth + Stencil NOTE: OpenGL doesn't support depth-stencil surfaces so the formats are the closes bits match for the data */
case
WINED3DFMT_D24S8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D24X8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D24X4S4
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D32
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D16
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D15S1
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D16_LOCKABLE
:
retVal
=
GL_COLOR_INDEX
;
break
;
default:
FIXME
(
"Unhandled fmt(%u,%s)
\n
"
,
fmt
,
debug_d3dformat
(
fmt
));
retVal
=
GL_RGB8
;
...
...
@@ -1635,11 +1651,13 @@ GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_V8U8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_V16U16
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_L6V5U5
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_X8L8V8U8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_X8L8V8U8
:
retVal
=
GL_BGRA
;
break
;
case
WINED3DFMT_Q8W8V8U8
:
retVal
=
GL_RGBA
;
break
;
case
WINED3DFMT_Q16W16V16U16
:
retVal
=
GL_COLOR_INDEX
;
break
;
/* color buffer */
case
WINED3DFMT_R3G3B2
:
retVal
=
GL_BGR
;
break
;
case
WINED3DFMT_R5G6B5
:
retVal
=
GL_
RGB
;
break
;
case
WINED3DFMT_R8G8B8
:
retVal
=
GL_
RGB
;
break
;
case
WINED3DFMT_R5G6B5
:
retVal
=
GL_
BGR
;
break
;
case
WINED3DFMT_R8G8B8
:
retVal
=
GL_
BGR
;
break
;
case
WINED3DFMT_A1R5G5B5
:
retVal
=
GL_BGRA
;
break
;
case
WINED3DFMT_X1R5G5B5
:
retVal
=
GL_BGRA
;
break
;
case
WINED3DFMT_A4R4G4B4
:
retVal
=
GL_BGRA
;
break
;
...
...
@@ -1648,6 +1666,14 @@ GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_X8R8G8B8
:
retVal
=
GL_BGRA
;
break
;
/* to see */
case
WINED3DFMT_A8
:
retVal
=
GL_ALPHA
;
break
;
/* Depth + Stencil */
case
WINED3DFMT_D24S8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D24X8
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D24X4S4
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D32
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D16
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D15S1
:
retVal
=
GL_COLOR_INDEX
;
break
;
case
WINED3DFMT_D16_LOCKABLE
:
retVal
=
GL_COLOR_INDEX
;
break
;
default:
FIXME
(
"Unhandled fmt(%u,%s)
\n
"
,
fmt
,
debug_d3dformat
(
fmt
));
retVal
=
GL_BGR
;
...
...
@@ -1698,6 +1724,19 @@ GLenum D3DFmt2GLType(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_X8R8G8B8
:
retVal
=
GL_UNSIGNED_INT_8_8_8_8_REV
;
break
;
/* to see */
case
WINED3DFMT_A8
:
retVal
=
GL_ALPHA
;
break
;
/* Depth + Stencil */
case
WINED3DFMT_D24S8
:
retVal
=
GL_UNSIGNED_INT
;
break
;
case
WINED3DFMT_D24X8
:
retVal
=
GL_UNSIGNED_INT
;
break
;
case
WINED3DFMT_D24X4S4
:
retVal
=
GL_UNSIGNED_INT
;
break
;
case
WINED3DFMT_D32
:
retVal
=
GL_UNSIGNED_INT
;
break
;
case
WINED3DFMT_D16
:
retVal
=
GL_UNSIGNED_SHORT
;
break
;
case
WINED3DFMT_D15S1
:
retVal
=
GL_UNSIGNED_SHORT
;
break
;
case
WINED3DFMT_D16_LOCKABLE
:
retVal
=
GL_UNSIGNED_SHORT
;
break
;
/* compressed textures */
case
WINED3DFMT_DXT1
:
retVal
=
0
;
break
;
case
WINED3DFMT_DXT3
:
retVal
=
0
;
break
;
case
WINED3DFMT_DXT5
:
retVal
=
0
;
break
;
default:
FIXME
(
"Unhandled fmt(%u,%s)
\n
"
,
fmt
,
debug_d3dformat
(
fmt
));
retVal
=
GL_UNSIGNED_BYTE
;
...
...
@@ -1742,6 +1781,8 @@ SHORT D3DFmtGetBpp(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case
WINED3DFMT_L6V5U5
:
retVal
=
2
;
break
;
case
WINED3DFMT_V16U16
:
retVal
=
4
;
break
;
case
WINED3DFMT_X8L8V8U8
:
retVal
=
4
;
break
;
case
WINED3DFMT_Q8W8V8U8
:
retVal
=
4
;
break
;
case
WINED3DFMT_Q16W16V16U16
:
retVal
=
8
;
break
;
/* Compressed */
case
WINED3DFMT_DXT1
:
retVal
=
1
;
break
;
/* Actually 8 bytes per 16 pixels - Special cased later */
case
WINED3DFMT_DXT3
:
retVal
=
1
;
break
;
/* Actually 16 bytes per 16 pixels */
...
...
dlls/wined3d/wined3d_private.h
View file @
b220ce13
...
...
@@ -857,7 +857,7 @@ extern IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl;
*/
/* Trace routines */
const
char
*
debug_d3dformat
(
D3DFORMAT
fmt
);
const
char
*
debug_d3dformat
(
WINE
D3DFORMAT
fmt
);
const
char
*
debug_d3ddevicetype
(
D3DDEVTYPE
devtype
);
const
char
*
debug_d3dresourcetype
(
D3DRESOURCETYPE
res
);
const
char
*
debug_d3dusage
(
DWORD
usage
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment