From 4c5621edfa44964acc640edc8b13eedf31ba5431 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 28 Apr 2011 08:56:23 +0100 Subject: [PATCH] Re-add d3d8 support. --- CMakeLists.txt | 24 ++++++++++++++---------- d3d8.py | 18 +++++++++++++----- trace.py | 3 ++- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd2c8f9..59adde5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,16 +148,20 @@ add_custom_command ( if (WIN32) # d3d8.dll - #if (DirectX_D3D8_INCLUDE_DIR) - # include_directories (${DirectX_D3D8_INCLUDE_DIR}) - # add_custom_command ( - # OUTPUT d3d8.cpp - # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp - # DEPENDS d3d8.py d3d8types.py d3d8caps.py winapi.py stdapi.py - # ) - # add_library (d3d8 SHARED d3d8.def d3d8.cpp trace_write.cpp os_win32.cpp) - # set_target_properties (d3d8 PROPERTIES PREFIX "") - #endif (DirectX_D3D8_INCLUDE_DIR) + if (DirectX_D3D8_INCLUDE_DIR) + include_directories (${DirectX_D3D8_INCLUDE_DIR}) + add_custom_command ( + OUTPUT d3d8.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8.cpp + DEPENDS d3d8.py trace.py d3d8types.py d3d8caps.py d3dshader.py winapi.py stdapi.py + ) + add_library (d3d8 SHARED d3d8.def d3d8.cpp trace_write.cpp os_win32.cpp) + set_target_properties (d3d8 + PROPERTIES PREFIX "" + RUNTIME_OUTPUT_PATH ${PROJECT_BINARY_DIR}/wrappers + LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/wrappers + ) + endif (DirectX_D3D8_INCLUDE_DIR) # d3d9.dll if (DirectX_D3DX9_INCLUDE_DIR) diff --git a/d3d8.py b/d3d8.py index fdf788f..73c9c85 100644 --- a/d3d8.py +++ b/d3d8.py @@ -28,6 +28,7 @@ from winapi import * from d3d8types import * from d3d8caps import * +from trace import DllTracer HRESULT = Enum("HRESULT", [ "D3D_OK", @@ -273,17 +274,24 @@ IDirect3DVolume8.methods += [ Method(HRESULT, "UnlockBox", []), ] -d3d8 = Dll("d3d8") -d3d8.functions += [ +d3d8 = API("d3d8") +d3d8.add_functions([ StdFunction(PDIRECT3D8, "Direct3DCreate8", [(UINT, "SDKVersion")]), -] +]) + + +class D3D8Tracer(DllTracer): + + pass + if __name__ == '__main__': print '#include ' - print '#include ' print '#include ' print print '#include "trace_write.hpp"' + print '#include "os.hpp"' print - wrap() + tracer = D3D8Tracer('d3d8.dll') + tracer.trace_api(d3d8) diff --git a/trace.py b/trace.py index 1a29a4a..72e9375 100644 --- a/trace.py +++ b/trace.py @@ -469,7 +469,8 @@ __getPublicProcAddress(LPCSTR lpProcName) return GetProcAddress(g_hDll, lpProcName); } - ''' % self.dllname +#define __abort() OS::Abort() +''' % self.dllname dispatcher = Dispatcher() dispatcher.dispatch_api(api) -- 2.7.4