[D3DX8 Patch]: new header + new interfaces + stubs

Raphaël Junqueira fenix at club-internet.fr
Mon Dec 23 17:16:48 CST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

  Changelog:
    - new d3dx8.h header (who include all sub d3dx8*.h headers)
    - new d3dx8math.h (maths utilities, maths structures definitions, ...)
    - new ID3DXMatrixStack definition (d3dx8math.h) and first draft implementation (d3dxmatrix.c) (very basic impl)
    - implements ID3DXFont Interface (currently stubs)
    - all needed interfaces defined in d3dx8core.h

 TODO:
    - finish ID3DXFont an ID3DXMatrixStack
    - implementation of D3DXAssembleShader* functions
    - interface and impl: d3dx8mesh.h, d3dx8effect.h, d3dx8shape.h, d3dx8tex.h
    - code stubs functions

Happy Christmas,
 Raphael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+B5lhp7NA3AmQTU4RAgX5AJwI7Iv/vn/jLXPhZOf2kBhDVd/JkQCgmj8I
fn+76b0Bq6m+zGTdte4uawU=
=EG2E
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: include/d3dx8core.h
===================================================================
RCS file: /home/wine/wine/include/d3dx8core.h,v
retrieving revision 1.1
diff -u -r1.1 d3dx8core.h
--- include/d3dx8core.h	17 Dec 2002 01:15:15 -0000	1.1
+++ include/d3dx8core.h	23 Dec 2002 22:59:21 -0000
@@ -21,20 +21,20 @@
 
 #include "objbase.h"
 
-#include "d3d8.h"
-#include "d3d8types.h"
-#include "d3d8caps.h"
+#include "d3dx8.h"
 
 /*****************************************************************************
  * #defines and error codes
  */
-#define D3DXASM_DEBUG           1
-#define D3DXASM_SKIPVALIDATION  2
+
+/** Flags for D3DXAssemble functions */
+#define D3DXASM_DEBUG           0x0001
+#define D3DXASM_SKIPVALIDATION  0x0010
 
 #define _FACD3D  0x876
 #define MAKE_D3DXHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
 
-/*
+/**
  * Direct3D Errors
  */
 #define D3DXERR_CANNOTATTRSORT                  MAKE_D3DXHRESULT(2158)
@@ -47,10 +47,16 @@
 /*****************************************************************************
  * Predeclare the interfaces
  */
-DEFINE_GUID(IID_ID3DXBuffer,             0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */
-typedef struct ID3DXBuffer              ID3DXBuffer, *LPD3DXBUFFER;
-DEFINE_GUID(IID_ID3DXFont,               0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */
-typedef struct ID3DXFont                ID3DXFont, *LPD3DXFONT;
+DEFINE_GUID(IID_ID3DXBuffer,              0x932E6A7E,0xC68E,0x45DD,0xA7,0xBf,0x53,0xD1,0x9C,0x86,0xDB,0x1F);
+typedef struct ID3DXBuffer                ID3DXBuffer, *LPD3DXBUFFER;
+DEFINE_GUID(IID_ID3DXFont,                0x89FAD6A5,0x24D,0x49AF,0x8F,0xE7,0xF5,0x11,0x23,0xB8,0x5E,0x25);
+typedef struct ID3DXFont                  ID3DXFont, *LPD3DXFONT;
+DEFINE_GUID(IID_ID3DXSprite,              0x13D69D15,0xF9B0,0x4E0F,0xB3,0x9E,0xC9,0x1E,0xB3,0x3F,0x6C,0xE7);
+typedef struct ID3DXSprite                ID3DXSprite, *LPD3DXSPRITE;
+DEFINE_GUID(IID_ID3DXRenderToSurface,     0x82DF5B90,0xE34E,0x496E,0xAC,0x1C,0x62,0x11,0x7A,0x6A,0x59,0x13);
+typedef struct ID3DXRenderToSurface       ID3DXRenderToSurface, *LPD3DXRENDERTOSURFACE;
+DEFINE_GUID(IID_ID3DXRenderToEnvMap,      0x4E42C623,0x9451,0x44B7,0x8C,0x86,0xAB,0xCC,0xDE,0x5D,0x52,0xC8);
+typedef struct ID3DXRenderToEnvMap        ID3DXRenderToEnvMap, *LPD3DXRenderToEnvMap;
 
 /*****************************************************************************
  * ID3DXBuffer interface
@@ -84,9 +90,14 @@
 #define ICOM_INTERFACE ID3DXFont
 #define ID3DXFont_METHODS \
     /*** ID3DXFont methods ***/ \
-    ICOM_METHOD (HRESULT,  Begin) \
-    ICOM_METHOD (HRESULT,  DrawTextA) \
-    ICOM_METHOD (HRESULT,  End)
+    ICOM_METHOD1(HRESULT, GetDevice,  LPDIRECT3DDEVICE8*, ppDevice) \
+    ICOM_METHOD1(HRESULT, GetLogFont, LOGFONTA*, pLogFont) \
+    ICOM_METHOD (HRESULT, Begin) \
+    ICOM_METHOD5(INT,     DrawTextA, LPCSTR,  pString, INT, Count, LPRECT, pRect, DWORD, Format, D3DCOLOR, Color) \
+    ICOM_METHOD5(INT,     DrawTextW, LPCWSTR, pString, INT, Count, LPRECT, pRect, DWORD, Format, D3DCOLOR, Color) \
+    ICOM_METHOD (HRESULT, End) \
+    ICOM_METHOD (HRESULT, OnLostDevice) \
+    ICOM_METHOD (HRESULT, OnResetDevice)
 
     /*** ID3DXFont methods ***/
 #define ID3DXFont_IMETHODS \
@@ -100,27 +111,168 @@
 #define ID3DXFont_AddRef(p)             ICOM_CALL (AddRef,p)
 #define ID3DXFont_Release(p)            ICOM_CALL (Release,p)
 /*** ID3DXFont methods ***/
+#define ID3DXFont_GetDevice(p,a)        ICOM_CALL1(GetDevice,p,a)
+#define ID3DXFont_GetLogFont(p,a)       ICOM_CALL1(GetLogFont,p,a)
 #define ID3DXFont_Begin(p)              ICOM_CALL (Begin,p)
-#define ID3DXFont_DrawTextA(p,a,b,c,d,e)ICOM_CALL5(DrawText,p,a,b,c,d,e)
+#define ID3DXFont_DrawTextA(p,a,b,c,d,e)ICOM_CALL5(DrawTextA,p,a,b,c,d,e)
+#define ID3DXFont_DrawTextW(p,a,b,c,d,e)ICOM_CALL5(DrawTextW,p,a,b,c,d,e)
 #define ID3DXFont_End(p)                ICOM_CALL (End,p)
+#define ID3DXFont_OnLostDevice(p)       ICOM_CALL (OnLostDevice,p)
+#define ID3DXFont_OnResetDevice(p)      ICOM_CALL (OnResetDevice,p)
+
+/*****************************************************************************
+ * ID3DXSprite interface
+ */
+#undef ICOM_INTERFACE
+#define ICOM_INTERFACE ID3DXSprite
+#define ID3DXSprite_METHODS \
+    /*** ID3DSprite methods ***/ \
+    ICOM_METHOD1(HRESULT, GetDevice,  LPDIRECT3DDEVICE8*, ppDevice) \
+    ICOM_METHOD (HRESULT, Begin) \
+    ICOM_METHOD7(HRESULT, Draw, LPDIRECT3DTEXTURE8, pSrcTexture, CONST RECT*, pSrcRect, CONST D3DXVECTOR2*, pScaling, \
+                                CONST D3DXVECTOR2*, pRotationCenter, FLOAT, Rotation,  CONST D3DXVECTOR2*, pTranslation, D3DCOLOR, Color) \
+    ICOM_METHOD4(HRESULT, DrawTransform, LPDIRECT3DTEXTURE8, pSrcTexture, CONST RECT*, pSrcRect, CONST D3DXMATRIX*, pTransform, D3DCOLOR, Color) \
+    ICOM_METHOD (HRESULT, End) \
+    ICOM_METHOD (HRESULT, OnLostDevice) \
+    ICOM_METHOD (HRESULT, OnResetDevice)
+
+    /*** ID3DXSprite methods ***/
+#define ID3DXSprite_IMETHODS \
+    IUnknown_IMETHODS \
+    ID3DXSprite_METHODS
+ICOM_DEFINE(ID3DXSprite,IUnknown)
+#undef ICOM_INTERFACE
+
+/*** IUnknown methods ***/
+#define ID3DXSprite_QueryInterface(p,a,b)    ICOM_CALL2(QueryInterface,p,a,b)
+#define ID3DXSprite_AddRef(p)                ICOM_CALL (AddRef,p)
+#define ID3DXSprite_Release(p)               ICOM_CALL (Release,p)
+/*** ID3DXSprite methods ***/ 
+#define ID3DXSprite_GetDevice(p,a)           ICOM_CALL1(GetDevice,p,a)
+#define ID3DXSprite_Begin(p)                 ICOM_CALL (Begin,p)
+#define ID3DXSprite_Draw(p,a,b,c,d,e,f,g)    ICOM_CALL7(Draw,p,a,b,c,d,e,f,g)
+#define ID3DXSprite_DrawTransform(p,a,b,c,d) ICOM_CALL4(DrawTransform,p,a,b,c,d)
+#define ID3DXSprite_End(p)                   ICOM_CALL (End,p)
+#define ID3DXSprite_OnLostDevice(p)          ICOM_CALL (OnLostDevice,p)
+#define ID3DXSprite_OnResetDevice(p)         ICOM_CALL (OnResetDevice,p)
+
+/*****************************************************************************
+ * ID3DXRenderToSurface interface
+ */
+typedef struct _D3DXRTS_DESC {
+  UINT       Width;
+  UINT       Height;
+  D3DFORMAT  Format;
+  BOOL       DepthStencil;
+  D3DFORMAT  DepthStencilFormat;
+} D3DXRTS_DESC;
+
+#undef ICOM_INTERFACE
+#define ICOM_INTERFACE ID3DXRenderToSurface
+#define ID3DXRenderToSurface_METHODS \
+    /*** ID3DRenderToSurface methods ***/ \
+    ICOM_METHOD1(HRESULT, GetDevice,  LPDIRECT3DDEVICE8*, ppDevice) \
+    ICOM_METHOD1(HRESULT, GetDesc, D3DXRTS_DESC*, pDesc) \
+    ICOM_METHOD2(HRESULT, BeginScene, LPDIRECT3DSURFACE8, pSurface, CONST D3DVIEWPORT8*, pViewport) \
+    ICOM_METHOD (HRESULT, EndScene) \
+    ICOM_METHOD (HRESULT, OnLostDevice) \
+    ICOM_METHOD (HRESULT, OnResetDevice)
+
+    /*** ID3DXRenderToSurface methods ***/
+#define ID3DXRenderToSurface_IMETHODS \
+    IUnknown_IMETHODS \
+    ID3DXRenderToSurface_METHODS
+ICOM_DEFINE(ID3DXRenderToSurface,IUnknown)
+#undef ICOM_INTERFACE
+
+/*** IUnknown methods ***/
+#define ID3DXRenderToSurface_QueryInterface(p,a,b)    ICOM_CALL2(QueryInterface,p,a,b)
+#define ID3DXRenderToSurface_AddRef(p)                ICOM_CALL (AddRef,p)
+#define ID3DXRenderToSurface_Release(p)               ICOM_CALL (Release,p)
+/*** ID3DXRenderToSurface methods ***/ 
+#define ID3DXRenderToSurface_GetDevice(p,a)           ICOM_CALL1(GetDevice,p,a)
+#define ID3DXRenderToSurface_GetDesc(p,a)             ICOM_CALL1(GetDesc,p,a)
+#define ID3DXRenderToSurface_BeginScene(p,a,b)        ICOM_CALL2(BeginScene,p,a,b)
+#define ID3DXRenderToSurface_EndScene(p)              ICOM_CALL (EndScene,p)
+#define ID3DXRenderToSurface_OnLostDevice(p)          ICOM_CALL (OnLostDevice,p)
+#define ID3DXRenderToSurface_OnResetDevice(p)         ICOM_CALL (OnResetDevice,p)
+
+/*****************************************************************************
+ * ID3DXRenderToEnvMap interface
+ */
+typedef struct _D3DXRTE_DESC {
+  UINT       Size;
+  D3DFORMAT  Format;
+  BOOL       DepthStencil;
+  D3DFORMAT  DepthStencilFormat;
+} D3DXRTE_DESC;
+
+#undef ICOM_INTERFACE
+#define ICOM_INTERFACE ID3DXRenderToEnvMap
+#define ID3DXRenderToEnvMap_METHODS \
+    /*** ID3DRenderToEnvMap methods ***/ \
+    ICOM_METHOD1(HRESULT, GetDevice,  LPDIRECT3DDEVICE8*, ppDevice) \
+    ICOM_METHOD1(HRESULT, GetDesc, D3DXRTE_DESC*, pDesc) \
+    ICOM_METHOD1(HRESULT, BeginCube, LPDIRECT3DCUBETEXTURE8, pCubeTex) \
+    ICOM_METHOD1(HRESULT, BeginSphere, LPDIRECT3DTEXTURE8, pTex) \
+    ICOM_METHOD2(HRESULT, BeginHemisphere, LPDIRECT3DTEXTURE8, pTexZPos, LPDIRECT3DTEXTURE8, pTexZNeg) \
+    ICOM_METHOD2(HRESULT, BeginParabolic,  LPDIRECT3DTEXTURE8, pTexZPos, LPDIRECT3DTEXTURE8, pTexZNeg) \
+    ICOM_METHOD1(HRESULT, Face, D3DCUBEMAP_FACES, Face) \
+    ICOM_METHOD (HRESULT, End) \
+    ICOM_METHOD (HRESULT, OnLostDevice) \
+    ICOM_METHOD (HRESULT, OnResetDevice)
+
+    /*** ID3DXRenderToEnvMap methods ***/
+#define ID3DXRenderToEnvMap_IMETHODS \
+    IUnknown_IMETHODS \
+    ID3DXRenderToEnvMap_METHODS
+ICOM_DEFINE(ID3DXRenderToEnvMap,IUnknown)
+#undef ICOM_INTERFACE
+
+/*** IUnknown methods ***/
+#define ID3DXRenderToEnvMap_QueryInterface(p,a,b)    ICOM_CALL2(QueryInterface,p,a,b)
+#define ID3DXRenderToEnvMap_AddRef(p)                ICOM_CALL (AddRef,p)
+#define ID3DXRenderToEnvMap_Release(p)               ICOM_CALL (Release,p)
+/*** ID3DXRenderToEnvMap methods ***/ 
+#define ID3DXRenderToEnvMap_GetDevice(p,a)           ICOM_CALL1(GetDevice,p,a)
+#define ID3DXRenderToEnvMap_GetDesc(p,a)             ICOM_CALL1(GetDesc,p,a)
+#define ID3DXRenderToEnvMap_BeginCube(p,a)           ICOM_CALL1(BeginCube,p,a)
+#define ID3DXRenderToEnvMap_BeginSphere(p,a)         ICOM_CALL1(BeginSphere,p,a)
+#define ID3DXRenderToEnvMap_BeginHemisphere(p,a,b)   ICOM_CALL2(BeginHemisphere,p,a,b)
+#define ID3DXRenderToEnvMap_BeginParabolic(p,a,b)    ICOM_CALL2(BeginParabolic,p,a,b)
+#define ID3DXRenderToEnvMap_Face(p,a)                ICOM_CALL1(Face,p,a)
+#define ID3DXRenderToEnvMap_End(p)                   ICOM_CALL (End,p)
+#define ID3DXRenderToEnvMap_OnLostDevice(p)          ICOM_CALL (OnLostDevice,p)
+#define ID3DXRenderToEnvMap_OnResetDevice(p)         ICOM_CALL (OnResetDevice,p)
 
 /*************************************************************************************
  * Define entrypoints 
  */
-HRESULT D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer);
-HRESULT D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
-UINT D3DXGetFVFVertexSize(DWORD FVF);
-HRESULT D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 
-			   LPD3DXBUFFER* ppConstants, 
-			   LPD3DXBUFFER* ppCompiledShader,
-			   LPD3DXBUFFER* ppCompilationErrors);
-HRESULT D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
-				    LPD3DXBUFFER* ppConstants,
-				    LPD3DXBUFFER* ppCompiledShader,
-				    LPD3DXBUFFER* ppCompilationErrors);
-HRESULT D3DXAssembleShaderFromFileW(LPSTR pSrcFile, DWORD Flags,
-				    LPD3DXBUFFER* ppConstants,
-				    LPD3DXBUFFER* ppCompiledShader,
-				    LPD3DXBUFFER* ppCompilationErrors);
+#ifdef __cplusplus
+extern "C" {
+#endif  /* defined(__cplusplus) */
+
+HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer);
+HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
+HRESULT WINAPI D3DXCreateFontIndirect(LPDIRECT3DDEVICE8 pDevice, CONST LOGFONTA* pLogFont, LPD3DXFONT* ppFont);
+HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE8 pDevice, LPD3DXSPRITE* ppSprite);
+HRESULT WINAPI D3DXCreateRenderToSurface(LPDIRECT3DDEVICE8 pDevice, UINT Width, UINT Height, D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRENDERTOSURFACE* ppRenderToSurface);
+HRESULT WINAPI D3DXCreateRenderToEnvMap(LPDIRECT3DDEVICE8 pDevice, UINT Size,                D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRenderToEnvMap* ppRenderToEnvMap);
+HRESULT WINAPI D3DXGetErrorStringA(HRESULT hr, LPSTR  pBuffer, UINT BufferLen);
+HRESULT WINAPI D3DXGetErrorStringW(HRESULT hr, LPWSTR pBuffer, UINT BufferLen);
+HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen,                     DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors);
+HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile,                              DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors);
+HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile,                             DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors);
+HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE hSrcModule, LPCSTR  pSrcResource, DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors);
+HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors);
+
+/**
+ * TODO: move to the adequat header: d3dx8mesh.h
+ */
+UINT    WINAPI D3DXGetFVFVertexSize(DWORD FVF);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
 
 #endif /* __WINE_D3DX8CORE_H */
Index: dlls/d3dx8/d3dx8_main.c
===================================================================
RCS file: /home/wine/wine/dlls/d3dx8/d3dx8_main.c,v
retrieving revision 1.1
diff -u -r1.1 d3dx8_main.c
--- dlls/d3dx8/d3dx8_main.c	17 Dec 2002 01:15:15 -0000	1.1
+++ dlls/d3dx8/d3dx8_main.c	23 Dec 2002 22:59:24 -0000
@@ -1,6 +1,6 @@
-/*
+/* 
  * Direct3D X 8 main file
- *
+ * 
  * Copyright (C) 2002 Raphael Junqueira
  *
  * This library is free software; you can redistribute it and/or
@@ -19,23 +19,20 @@
  *
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
 #include "winuser.h"
 #include "wine/debug.h"
 
-#include "d3dx8core.h"
+#include "d3dx8.h"
 #include "d3dx8core_private.h"
 
-
 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
 
-HRESULT D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) {
-  ID3DXBufferImpl *object;
+HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) {
+  FIXME("(void): stub\n");
+  ID3DXBufferImpl* object;
 
   object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXBufferImpl));
   if (NULL == object) {
@@ -55,36 +52,70 @@
   return D3D_OK;
 }
 
-HRESULT D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont) {
+HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE8 pDevice, LPD3DXSPRITE* ppSprite) {
   FIXME("(void): stub\n");
+  *ppSprite = NULL;
   return D3D_OK;
 }
 
-UINT D3DXGetFVFVertexSize(DWORD FVF) {
+HRESULT WINAPI D3DXCreateRenderToSurface(LPDIRECT3DDEVICE8 pDevice, UINT Width, UINT Height, D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRENDERTOSURFACE* ppRenderToSurface) {
   FIXME("(void): stub\n");
-  return 0;
+  *ppRenderToSurface = NULL;
+  return D3D_OK;
+}
+
+HRESULT WINAPI D3DXCreateRenderToEnvMap(LPDIRECT3DDEVICE8 pDevice, UINT Size, D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRenderToEnvMap* ppRenderToEnvMap) {
+  FIXME("(void): stub\n");
+  *ppRenderToEnvMap = NULL;
+  return D3D_OK;
+}
+
+HRESULT WINAPI D3DXGetErrorStringA(HRESULT hr, LPSTR pBuffer, UINT BufferLen) {
+  FIXME("(void): stub\n");
+  return D3D_OK;
 }
 
-HRESULT D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 
-			   LPD3DXBUFFER* ppConstants, 
-			   LPD3DXBUFFER* ppCompiledShader,
-			   LPD3DXBUFFER* ppCompilationErrors) {
+HRESULT WINAPI D3DXGetErrorStringW(HRESULT hr, LPWSTR pBuffer, UINT BufferLen) {
   FIXME("(void): stub\n");
   return D3D_OK;
 }
 
-HRESULT D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
-				    LPD3DXBUFFER* ppConstants,
-				    LPD3DXBUFFER* ppCompiledShader,
-				    LPD3DXBUFFER* ppCompilationErrors) {
+HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 
+				  LPD3DXBUFFER* ppConstants, 
+				  LPD3DXBUFFER* ppCompiledShader,
+				  LPD3DXBUFFER* ppCompilationErrors) {
   FIXME("(void): stub\n");
   return D3D_OK;
 }
 
-HRESULT D3DXAssembleShaderFromFileW(LPSTR pSrcFile, DWORD Flags,
-				    LPD3DXBUFFER* ppConstants,
-				    LPD3DXBUFFER* ppCompiledShader,
-				    LPD3DXBUFFER* ppCompilationErrors) {
+HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile, DWORD Flags,
+					   LPD3DXBUFFER* ppConstants,
+					   LPD3DXBUFFER* ppCompiledShader,
+					   LPD3DXBUFFER* ppCompilationErrors) {
   FIXME("(void): stub\n");
   return D3D_OK;
 }
+
+HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile, DWORD Flags,
+					   LPD3DXBUFFER* ppConstants,
+					   LPD3DXBUFFER* ppCompiledShader,
+					   LPD3DXBUFFER* ppCompilationErrors) {
+  FIXME("(void): stub\n");
+  return D3D_OK;
+}
+
+HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE hSrcModule, LPCSTR  pSrcResource, DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors) {
+  FIXME("(void): stub\n");
+  return D3D_OK;
+}
+
+HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, DWORD Flags, LPD3DXBUFFER* ppConstants, LPD3DXBUFFER* ppCompiledShader, LPD3DXBUFFER* ppCompilationErrors) {
+  FIXME("(void): stub\n");
+  return D3D_OK;
+}
+
+UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF) {
+  FIXME("(void): stub\n");
+  return 0;
+}
+
Index: dlls/d3dx8/d3dxbuffer.c
===================================================================
RCS file: /home/wine/wine/dlls/d3dx8/d3dxbuffer.c,v
retrieving revision 1.1
diff -u -r1.1 d3dxbuffer.c
--- dlls/d3dx8/d3dxbuffer.c	17 Dec 2002 01:15:15 -0000	1.1
+++ dlls/d3dx8/d3dxbuffer.c	23 Dec 2002 22:59:25 -0000
@@ -18,9 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
-------------- next part --------------
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ include/d3dx8.h	2002-12-22 19:25:02.000000000 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2002 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_D3DX8_H
+#define __WINE_D3DX8_H
+
+#include "objbase.h"
+
+#include "d3d8.h"
+#include "d3d8types.h"
+#include "d3d8caps.h"
+
+#define D3DXINLINE
+
+#include "d3dx8math.h"
+#include "d3dx8core.h"
+
+#endif /* __WINE_D3DX8_H */
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ include/d3dx8math.h	2002-12-22 19:28:30.000000000 +0100
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2002 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_D3DX8MATH_H
+#define __WINE_D3DX8MATH_H
+
+#include <math.h>
+
+#include "objbase.h"
+
+#include "d3dx8.h"
+
+/*****************************************************************************
+ * D3DX v8 math defines
+ */
+#define D3DX_PI    ((FLOAT)  3.141592654f)
+#define D3DX_1BYPI ((FLOAT)  0.318309886f)
+
+#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f))
+#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI))
+
+/*****************************************************************************
+ * D3DX v8 math typedefs
+ */
+typedef struct D3DXVECTOR2 {
+  FLOAT x;
+  FLOAT y;
+} D3DXVECTOR2, *LPD3DXVECTOR2;
+
+typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
+
+typedef struct D3DXVECTOR4 {
+  FLOAT x;
+  FLOAT y;
+  FLOAT z;
+  FLOAT w;
+} D3DXVECTOR4, *LPD3DXVECTOR4;
+
+typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
+
+typedef struct D3DXQUATERNION {
+  FLOAT x;
+  FLOAT y;
+  FLOAT z;
+  FLOAT w;
+} D3DXQUATERNION, *LPD3DXQUATERNION;
+
+typedef struct D3DXPLANE {
+  FLOAT a;
+  FLOAT b;
+  FLOAT c;
+  FLOAT d;
+} D3DXPLANE, *LPD3DXPLANE;
+
+typedef struct D3DXCOLOR {
+  FLOAT r;
+  FLOAT g;
+  FLOAT b;
+  FLOAT a;
+} D3DXCOLOR, *LPD3DXCOLOR;
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(IID_ID3DXMatrixStack,   0xE3357330,0xCC5E,0x11D2,0xA4,0x34,0x00,0xA0,0xC9,0x06,0x29,0xA8);
+typedef struct ID3DXMatrixStack     ID3DXMatrixStack, *LPD3DXMATRIXSTACK;
+
+/*****************************************************************************
+ * ID3DXMatrixStack interface
+ */
+#undef ICOM_INTERFACE
+#define ICOM_INTERFACE ID3DXMatrixStack
+#define ID3DXMatrixStack_METHODS \
+    /*** ID3DXBuffer methods ***/ \
+    ICOM_METHOD (HRESULT, Pop) \
+    ICOM_METHOD (HRESULT, Push) \
+    ICOM_METHOD (HRESULT, LoadIdentity) \
+    ICOM_METHOD1(HRESULT, LoadMatrix,      CONST D3DXMATRIX*, pMatrix) \
+    ICOM_METHOD1(HRESULT, MultMatrix,      CONST D3DXMATRIX*, pMatrix) \
+    ICOM_METHOD1(HRESULT, MultMatrixLocal, CONST D3DXMATRIX*, pMatrix) \
+    ICOM_METHOD2(HRESULT, RotateAxis,      CONST D3DXVECTOR3*, pVector, FLOAT, Angle) \
+    ICOM_METHOD2(HRESULT, RotateAxisLocal, CONST D3DXVECTOR3*, pVector, FLOAT, Angle) \
+    ICOM_METHOD3(HRESULT, RotateYawPitchRoll,      FLOAT, Yaw, FLOAT, Pitch, FLOAT, Roll) \
+    ICOM_METHOD3(HRESULT, RotateYawPitchRollLocal, FLOAT, Yaw, FLOAT, Pitch, FLOAT, Roll) \
+    ICOM_METHOD3(HRESULT, Scale,           FLOAT, x, FLOAT, y, FLOAT, z) \
+    ICOM_METHOD3(HRESULT, ScaleLocal,      FLOAT, x, FLOAT, y, FLOAT, z) \
+    ICOM_METHOD3(HRESULT, Translate,       FLOAT, x, FLOAT, y, FLOAT, z) \
+    ICOM_METHOD3(HRESULT, TranslateLocal,  FLOAT, x, FLOAT, y, FLOAT, z) \
+    ICOM_METHOD (D3DXMATRIX*, GetTop)
+
+    /*** ID3DXMatrixStack methods ***/
+#define ID3DXMatrixStack_IMETHODS \
+    IUnknown_IMETHODS \
+    ID3DXMatrixStack_METHODS
+ICOM_DEFINE(ID3DXMatrixStack,IUnknown)
+#undef ICOM_INTERFACE
+
+/*** IUnknown methods ***/
+#define ID3DXMatrixStack_QueryInterface(p,a,b)   ICOM_CALL2(QueryInterface,p,a,b)
+#define ID3DXMatrixStack_AddRef(p)               ICOM_CALL (AddRef,p)
+#define ID3DXMatrixStack_Release(p)              ICOM_CALL (Release,p)
+/*** ID3DXMatrixStack methods ***/
+#define ID3DXMatrixStack_Pop(p)                  ICOM_CALL (Pop,p)
+#define ID3DXMatrixStack_Push(p)                 ICOM_CALL (Push,p)
+#define ID3DXMatrixStack_LoadIdentity(p)         ICOM_CALL (LoadIdentity,p)
+#define ID3DXMatrixStack_LoadMatrix(p,a)         ICOM_CALL1(LoadMatrix,p,a)
+#define ID3DXMatrixStack_MultMatrix(p,a)         ICOM_CALL1(MultMatrix,p,a)
+#define ID3DXMatrixStack_MultMatrixLocal(p,a)    ICOM_CALL1(MultMatrixLocal,p,a)
+#define ID3DXMatrixStack_RotateAxis(p,a,b)       ICOM_CALL2(RotateAxis,p,a,b)
+#define ID3DXMatrixStack_RotateAxisLocal(p,a,b)  ICOM_CALL2(RotateAxisLocal,p,a,b)
+#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c)       ICOM_CALL3(RotateYawPitchRoll,p,a,b,c)
+#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c)  ICOM_CALL3(RotateYawPitchRollLocal,p,a,b,c)
+#define ID3DXMatrixStack_Scale(p,a,b,c)          ICOM_CALL3(Scale,p,a,b,c)
+#define ID3DXMatrixStack_ScaleLocal(p,a,b,c)     ICOM_CALL3(ScaleLocal,p,a,b,c)
+#define ID3DXMatrixStack_Translate(p,a,b,c)      ICOM_CALL3(Translate,p,a,b,c)
+#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) ICOM_CALL3(TranslateLocal,p,a,b,c)
+#define ID3DXMatrixStack_GetTop(p)               ICOM_CALL (GetTop,p)
+
+/*************************************************************************************
+ * Define entrypoints 
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif  /* defined(__cplusplus) */
+
+HRESULT WINAPI D3DXCreateMatrixStack(DWORD Flags, LPD3DXMATRIXSTACK* ppStack);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+/*************************************************************************************
+ * Inlines D3DX math utilities functions
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif  /* defined(__cplusplus) */
+
+D3DXINLINE FLOAT D3DXVec2Length(CONST D3DXVECTOR2* pV);
+D3DXINLINE FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2* pV);
+D3DXINLINE FLOAT D3DXVec2Dot(CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE FLOAT D3DXVec2CCW(CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV, FLOAT s);
+D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2, FLOAT s);
+/**
+ * TODO:
+ *  D3DXVec3 and D3DXVec4 inlines functions
+ */
+D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX* pMOut);
+D3DXINLINE BOOL D3DXMatrixIsIdentity(CONST D3DXMATRIX* pM);
+/**
+ * TODO:
+ *  D3DXQuaternion, D3DXPlane and D3DXColor inlines functions
+ */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+#endif /* __WINE_D3DX8MATH_H */
-------------- next part --------------
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ dlls/d3dx8/d3dxfont.c	2002-12-23 23:27:12.000000000 +0100
@@ -0,0 +1,161 @@
+/*
+ * D3DX font implementation
+ *
+ * Copyright 2002 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "wine/debug.h"
+
+#include "d3d8.h"
+#include "d3dx8core_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d);
+
+/* ID3DXFont IUnknown parts follow: */
+HRESULT WINAPI ID3DXFontImpl_QueryInterface(LPD3DXFONT iface, REFIID riid, LPVOID* obj) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  if (IsEqualGUID(riid, &IID_IUnknown)
+      || IsEqualGUID(riid, &IID_ID3DXFont)) {
+    ID3DXFontImpl_AddRef(iface);
+    *obj = This;
+    return D3D_OK;
+  }
+  WARN("(%p)->(%s,%p), not found\n", This, debugstr_guid(riid), obj);
+  return E_NOINTERFACE;
+}
+
+ULONG   WINAPI ID3DXFontImpl_AddRef(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : AddRef from %ld\n", This, This->ref);
+  return ++(This->ref);
+}
+
+ULONG   WINAPI ID3DXFontImpl_Release(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  ULONG ref = --This->ref;
+  TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
+  if (ref == 0) {
+    HeapFree(GetProcessHeap(), 0, This);
+  }
+  return ref;
+}
+
+/* ID3DXFont */
+HRESULT WINAPI ID3DXFontImpl_GetDevice(LPD3DXFONT iface, LPDIRECT3DDEVICE8* ppDevice) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : returning %p\n", This, This->Device);
+  *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
+  IDirect3DDevice8_AddRef(*ppDevice);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXFontImpl_GetLogFont(LPD3DXFONT iface, LOGFONTA* pLogFont) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXFontImpl_Begin(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+INT     WINAPI ID3DXFontImpl_DrawTextA(LPD3DXFONT iface, LPCSTR  pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return 0;
+}
+
+INT     WINAPI ID3DXFontImpl_DrawTextW(LPD3DXFONT iface, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return 0;
+}
+
+HRESULT WINAPI ID3DXFontImpl_End(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXFontImpl_OnLostDevice(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXFontImpl_OnResetDevice(LPD3DXFONT iface) {
+  ICOM_THIS(ID3DXFontImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+ICOM_VTABLE(ID3DXFont) D3DXFont_Vtbl =
+{
+  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+  ID3DXFontImpl_QueryInterface,
+  ID3DXFontImpl_AddRef,
+  ID3DXFontImpl_Release,
+  ID3DXFontImpl_GetDevice,
+  ID3DXFontImpl_GetLogFont,
+  ID3DXFontImpl_Begin,
+  ID3DXFontImpl_DrawTextA,
+  ID3DXFontImpl_DrawTextW,
+  ID3DXFontImpl_End,
+  ID3DXFontImpl_OnLostDevice,
+  ID3DXFontImpl_OnResetDevice
+};
+
+HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont) {
+  FIXME("(void): D3DXFont not fully supported yet\n");
+  ID3DXFontImpl* object;
+
+  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXFontImpl));
+  if (NULL == object) {
+    *ppFont = (LPD3DXFONT)NULL;
+    return E_OUTOFMEMORY;
+  }
+  object->lpVtbl = &D3DXFont_Vtbl;
+  object->ref = 1;
+  object->hFont = hFont;
+  object->Device = (IDirect3DDevice8Impl*) pDevice;
+  *ppFont = (LPD3DXFONT)object;
+  return D3D_OK;
+}
+
+HRESULT WINAPI D3DXCreateFontIndirect(LPDIRECT3DDEVICE8 pDevice, CONST LOGFONTA* pLogFont, LPD3DXFONT* ppFont) {
+  FIXME("(void): D3DXFont not fully supported yet\n");
+  ID3DXFontImpl* object;
+
+  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXFontImpl));
+  if (NULL == object) {
+    *ppFont = (LPD3DXFONT)NULL;
+    return E_OUTOFMEMORY;
+  }
+  object->lpVtbl = &D3DXFont_Vtbl;
+  object->ref = 1;
+  object->hFont = CreateFontIndirectA(pLogFont);
+  object->Device = (IDirect3DDevice8Impl*) pDevice;
+  *ppFont = (LPD3DXFONT)object;
+  return D3D_OK;
+}
+
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ dlls/d3dx8/d3dxmath.c	2002-12-22 21:35:16.000000000 +0100
@@ -0,0 +1,100 @@
+/*
+ * D3DX math utilities functions implementation
+ *
+ * Copyright 2002 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "wine/debug.h"
+
+#include "d3d8.h"
+#include "d3dx8core_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d);
+
+
+FLOAT D3DXVec2Length(CONST D3DXVECTOR2* pV) { 
+  return sqrtf(pV->x * pV->x + pV->y * pV->y); 
+}
+FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2* pV) { 
+  return pV->x * pV->x + pV->y * pV->y; 
+}
+FLOAT D3DXVec2Dot(CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) { 
+  return pV1->x * pV2->x + pV1->y * pV2->y; 
+}
+FLOAT D3DXVec2CCW(CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) { 
+  return pV1->x * pV2->x - pV1->y * pV2->y; 
+}
+D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) {
+  pVOut->x = pV1->x + pV2->x;
+  pVOut->y = pV1->y + pV2->y;
+  return pVOut;
+}
+D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) {
+  pVOut->x = pV1->x - pV2->x;
+  pVOut->y = pV1->y - pV2->y;
+  return pVOut;
+}
+D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) {
+  pVOut->x = (pV1->x < pV2->x) ? pV1->x : pV2->x;
+  pVOut->y = (pV1->y < pV2->y) ? pV1->y : pV2->y;
+  return pVOut;
+}
+D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2) {
+  pVOut->x = (pV1->x > pV2->x) ? pV1->x : pV2->x;
+  pVOut->y = (pV1->y > pV2->y) ? pV1->y : pV2->y;
+  return pVOut;
+}
+D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV, FLOAT s) {
+  pVOut->x = pV->x * s;
+  pVOut->y = pV->y * s;
+  return pVOut;
+}
+D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2* pVOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pV2, FLOAT s) {
+  pVOut->x = pV1->x + s * (pV2->x - pV1->x);
+  pVOut->y = pV1->y + s * (pV2->y - pV1->y);
+  return pVOut;
+}
+
+/**
+ * TODO:
+ *  D3DXVec3 and D3DXVec4 s functions
+ */
+
+D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX* pMOut) {
+  pMOut->u.m[0][1] = pMOut->u.m[0][2] = pMOut->u.m[0][3] = 0.0f;
+  pMOut->u.m[1][0] = pMOut->u.m[1][2] = pMOut->u.m[1][3] = 0.0f;
+  pMOut->u.m[2][0] = pMOut->u.m[2][1] = pMOut->u.m[2][3] = 0.0f;
+  pMOut->u.m[3][0] = pMOut->u.m[3][1] = pMOut->u.m[3][2] = 0.0f;
+  pMOut->u.m[0][0] = pMOut->u.m[1][1] = pMOut->u.m[2][2] = pMOut->u.m[3][3] = 1.0f;
+  return pMOut;
+}
+
+BOOL D3DXMatrixIsIdentity(CONST D3DXMATRIX* pM) {
+  return pM->u.m[0][0] == 1.0f && pM->u.m[0][1] == 0.0f && pM->u.m[0][2] == 0.0f && pM->u.m[0][3] == 0.0f &&
+         pM->u.m[1][0] == 0.0f && pM->u.m[1][1] == 1.0f && pM->u.m[1][2] == 0.0f && pM->u.m[1][3] == 0.0f &&
+         pM->u.m[2][0] == 0.0f && pM->u.m[2][1] == 0.0f && pM->u.m[2][2] == 1.0f && pM->u.m[2][3] == 0.0f &&
+         pM->u.m[3][0] == 0.0f && pM->u.m[3][1] == 0.0f && pM->u.m[3][2] == 0.0f && pM->u.m[3][3] == 1.0f;
+}
+
+/**
+ * TODO:
+ *  D3DXQuaternion, D3DXPlane and D3DXColor inlines functions
+ */
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ dlls/d3dx8/d3dxmatrixstack.c	2002-12-22 21:35:20.000000000 +0100
@@ -0,0 +1,203 @@
+/*
+ * D3DX matrix stack implementation
+ *
+ * Copyright 2002 Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "wingdi.h"
+#include "wine/debug.h"
+
+#include "d3d8.h"
+#include "d3dx8core_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d);
+
+
+HRESULT WINAPI ID3DXMatrixStackImpl_QueryInterface(LPD3DXMATRIXSTACK iface, REFIID riid, LPVOID *obj) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  if (IsEqualGUID(riid, &IID_IUnknown)
+      || IsEqualGUID(riid, &IID_ID3DXMatrixStack)) {
+    ID3DXMatrixStackImpl_AddRef(iface);
+    *obj = This;
+    return D3D_OK;
+  }
+  WARN("(%p)->(%s,%p), not found\n", This, debugstr_guid(riid), obj);
+  return E_NOINTERFACE;
+}
+
+ULONG WINAPI ID3DXMatrixStackImpl_AddRef(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : AddRef from %ld\n", This, This->ref);
+  return ++(This->ref);
+}
+
+ULONG WINAPI ID3DXMatrixStackImpl_Release(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  ULONG ref = --This->ref;
+  TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
+  if (ref == 0) {
+    HeapFree(GetProcessHeap(), 0, This);
+  }
+  return ref;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_Pop(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  if (This->current > 0) {
+    --This->current;
+    TRACE("(%p) : pop to %u\n", This, This->current);
+  } else {
+    ERR("(%p) : trying to pop an empty stack\n", This);
+  }
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_Push(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  ++This->current;
+  FIXME("(%p) : copy of current Matrix not really done\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_LoadIdentity(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  if (This->current == 0) {
+    ERR("(%p) : trying to load to an empty stack\n", This);
+    return E_FAIL;
+  }
+  TRACE("(%p) : loading identity to stack %u\n", This, This->current);
+  D3DXMatrixIdentity(&This->stack[This->current - 1]);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_LoadMatrix(LPD3DXMATRIXSTACK iface, CONST D3DXMATRIX* pMatrix) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_MultMatrix(LPD3DXMATRIXSTACK iface, CONST D3DXMATRIX* pMatrix) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_MultMatrixLocal(LPD3DXMATRIXSTACK iface, CONST D3DXMATRIX* pMatrix) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_RotateAxis(LPD3DXMATRIXSTACK iface, CONST D3DXVECTOR3* pVector, FLOAT Angle) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_RotateAxisLocal(LPD3DXMATRIXSTACK iface, CONST D3DXVECTOR3* pVector, FLOAT Angle) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_RotateYawPitchRoll(LPD3DXMATRIXSTACK iface, FLOAT Yaw, FLOAT Pitch, FLOAT Roll) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_RotateYawPitchRollLocal(LPD3DXMATRIXSTACK iface, FLOAT Yaw, FLOAT Pitch, FLOAT Roll) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_Scale(LPD3DXMATRIXSTACK iface, FLOAT x, FLOAT y, FLOAT z) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_ScaleLocal(LPD3DXMATRIXSTACK iface, FLOAT x, FLOAT y, FLOAT z) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_Translate(LPD3DXMATRIXSTACK iface, FLOAT x, FLOAT y, FLOAT z) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+HRESULT WINAPI ID3DXMatrixStackImpl_TranslateLocal(LPD3DXMATRIXSTACK iface, FLOAT x, FLOAT y, FLOAT z) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : stub\n", This);
+  return D3D_OK;
+}
+
+D3DXMATRIX* WINAPI ID3DXMatrixStackImpl_GetTop(LPD3DXMATRIXSTACK iface) {
+  ICOM_THIS(ID3DXMatrixStackImpl,iface);
+  TRACE("(%p) : returning stack %d\n", This, This->current);
+  if (This->current == 0) {
+    ERR("(%p) : trying to use an empty stack\n", This);
+    return NULL;
+  }
+  return &This->stack[This->current - 1];
+}
+
+ICOM_VTABLE(ID3DXMatrixStack) D3DXMatrixStack_Vtbl =
+{
+    ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+    ID3DXMatrixStackImpl_QueryInterface,
+    ID3DXMatrixStackImpl_AddRef,
+    ID3DXMatrixStackImpl_Release,
+    ID3DXMatrixStackImpl_Pop,
+    ID3DXMatrixStackImpl_Push,
+    ID3DXMatrixStackImpl_LoadIdentity,
+    ID3DXMatrixStackImpl_LoadMatrix,
+    ID3DXMatrixStackImpl_MultMatrix,
+    ID3DXMatrixStackImpl_MultMatrixLocal,
+    ID3DXMatrixStackImpl_RotateAxis,
+    ID3DXMatrixStackImpl_RotateAxisLocal,
+    ID3DXMatrixStackImpl_RotateYawPitchRoll,
+    ID3DXMatrixStackImpl_RotateYawPitchRollLocal,
+    ID3DXMatrixStackImpl_Scale,
+    ID3DXMatrixStackImpl_ScaleLocal,
+    ID3DXMatrixStackImpl_Translate,
+    ID3DXMatrixStackImpl_TranslateLocal,
+    ID3DXMatrixStackImpl_GetTop
+};
+
+HRESULT WINAPI D3DXCreateMatrixStack(DWORD Flags, LPD3DXMATRIXSTACK* ppStack) {
+  ID3DXMatrixStackImpl* object;
+
+  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXMatrixStackImpl));
+  if (NULL == object) {
+    *ppStack = (LPD3DXMATRIXSTACK)NULL;
+    return E_OUTOFMEMORY;
+  }
+  object->lpVtbl = &D3DXMatrixStack_Vtbl;
+  object->ref = 1;
+  /* set current stack to 0 => empty */
+  object->current = 0;
+  *ppStack = (LPD3DXMATRIXSTACK)object;
+  return D3D_OK;
+}
-------------- next part --------------
Index: dlls/d3dx8/d3dx8.spec
===================================================================
RCS file: /home/wine/wine/dlls/d3dx8/d3dx8.spec,v
retrieving revision 1.1
diff -u -r1.1 d3dx8.spec
--- dlls/d3dx8/d3dx8.spec	17 Dec 2002 01:15:15 -0000	1.1
+++ dlls/d3dx8/d3dx8.spec	23 Dec 2002 23:10:36 -0000
@@ -1,6 +1,15 @@
 @ stdcall D3DXCreateBuffer(long ptr)   D3DXCreateBuffer 
 @ stdcall D3DXCreateFont(ptr ptr ptr)  D3DXCreateFont
-@ stdcall D3DXGetFVFVertexSize(long)   D3DXGetFVFVertexSize
+@ stdcall D3DXCreateFontIndirect(ptr ptr ptr)  D3DXCreateFontIndirect
+@ stdcall D3DXCreateSprite(ptr ptr)  D3DXCreateSprite
+@ stdcall D3DXCreateRenderToSurface(ptr long long long long long ptr)  D3DXCreateRenderToSurface
+@ stdcall D3DXCreateRenderToEnvMap(ptr long long long long ptr)  D3DXCreateRenderToEnvMap
+@ stdcall D3DXGetErrorStringA(long str long) D3DXGetErrorStringA
+@ stdcall D3DXGetErrorStringW(long wstr long) D3DXGetErrorStringW
 @ stdcall D3DXAssembleShader(ptr long long ptr ptr ptr) D3DXAssembleShader
-@ stdcall D3DXAssembleShaderFromFileA(ptr long ptr ptr ptr) D3DXAssembleShaderFromFileA
-@ stdcall D3DXAssembleShaderFromFileW(ptr long ptr ptr ptr) D3DXAssembleShaderFromFileW
+@ stdcall D3DXAssembleShaderFromFileA(str long ptr ptr ptr) D3DXAssembleShaderFromFileA
+@ stdcall D3DXAssembleShaderFromFileW(wstr long ptr ptr ptr) D3DXAssembleShaderFromFileW
+@ stdcall D3DXAssembleShaderFromResourceA(ptr str long ptr ptr ptr) D3DXAssembleShaderFromResourceA
+@ stdcall D3DXAssembleShaderFromResourceW(ptr wstr long ptr ptr ptr) D3DXAssembleShaderFromResourceW
+@ stdcall D3DXGetFVFVertexSize(long)   D3DXGetFVFVertexSize
+@ stdcall D3DXCreateMatrixStack(long ptr) D3DXCreateMatrixStack
\ No newline at end of file


More information about the wine-patches mailing list