ChangeSet ID: 21313
CVSROOT: /opt/cvs-commit
Module name: wine
Changes by: julliard(a)winehq.org 2005/11/17 05:40:43
Modified files:
dlls/wined3d : device.c
Log message:
Oliver Stieber <oliver_stieber(a)yahoo.co.uk>
Disable support for creation FMT_Unknown textures. This gets most of
the d3d8 demos from www.codesampler.com working.
Patch: http://cvs.winehq.org/patch.py?id=21313
Old revision New revision Changes Path
1.97 1.98 +21 -0 wine/dlls/wined3d/device.c
Index: wine/dlls/wined3d/device.c
diff -u -p wine/dlls/wined3d/device.c:1.97 wine/dlls/wined3d/device.c:1.98
--- wine/dlls/wined3d/device.c:1.97 17 Nov 2005 11:40:43 -0000
+++ wine/dlls/wined3d/device.c 17 Nov 2005 11:40:43 -0000
@@ -829,6 +829,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_Creat
TRACE("(%p), Width(%d) Height(%d) Levels(%d) Usage(%ld) ....\n", This, Width, Height, Levels, Usage);
+ /* TODO: It should only be possible to create textures for formats
+ that are reported as supported */
+ if (WINED3DFMT_UNKNOWN >= Format) {
+ WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
+ return D3DERR_INVALIDCALL;
+ }
+
D3DCREATERESOURCEOBJECTINSTANCE(object, Texture, D3DRTYPE_TEXTURE, 0);
D3DINITILIZEBASETEXTURE(object->baseTexture);
object->width = Width;
@@ -907,6 +914,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_Create
UINT tmpH;
UINT tmpD;
+ /* TODO: It should only be possible to create textures for formats
+ that are reported as supported */
+ if (WINED3DFMT_UNKNOWN >= Format) {
+ WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
+ return D3DERR_INVALIDCALL;
+ }
+
D3DCREATERESOURCEOBJECTINSTANCE(object, VolumeTexture, D3DRTYPE_VOLUMETEXTURE, 0);
D3DINITILIZEBASETEXTURE(object->baseTexture);
@@ -1000,6 +1014,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_Create
HRESULT hr;
unsigned int pow2EdgeLength = EdgeLength;
+ /* TODO: It should only be possible to create textures for formats
+ that are reported as supported */
+ if (WINED3DFMT_UNKNOWN >= Format) {
+ WARN("(%p) : Texture cannot be created with a format of D3DFMT_UNKNOWN\n", This);
+ return D3DERR_INVALIDCALL;
+ }
+
D3DCREATERESOURCEOBJECTINSTANCE(object, CubeTexture, D3DRTYPE_CUBETEXTURE, 0);
D3DINITILIZEBASETEXTURE(object->baseTexture);