├── LICENSE ├── premake5.cmd ├── premake5.exe ├── premake5.lua ├── res └── .gitkeep ├── shaders ├── iiiBlurPS.hlsl └── vcBlurPS.hlsl └── src ├── MemoryMgr.h ├── ModuleList.hpp ├── Resource.rc ├── blur.cpp ├── d3d8.h ├── d3d8caps.h ├── d3d8types.h ├── debugmenu_public.h ├── resource.h ├── rw.cpp ├── sharptrails.h └── silenttrails.cpp /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /premake5.cmd: -------------------------------------------------------------------------------- 1 | premake5 vs2015 -------------------------------------------------------------------------------- /premake5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aap/sharptrails/a0297a77df70e958d4b2e7d666da28a6cb0b3654/premake5.exe -------------------------------------------------------------------------------- /premake5.lua: -------------------------------------------------------------------------------- 1 | workspace "sharptrails" 2 | configurations { "Release", "DebugIII", "DebugVC" } 3 | location "build" 4 | 5 | files { "src/*.*" } 6 | 7 | includedirs { "src" } 8 | includedirs { os.getenv("RWSDK34") } 9 | 10 | includedirs { "../rwd3d9/source" } 11 | libdirs { "../rwd3d9/libs" } 12 | links { "rwd3d9.lib" } 13 | 14 | prebuildcommands { 15 | "for /R \"../shaders/\" %%f in (*.hlsl) do \"%DXSDK_DIR%/Utilities/bin/x86/fxc.exe\" /T ps_2_0 /nologo /E main /Fo ../res/%%~nf.cso %%f", 16 | } 17 | 18 | project "sharptrails" 19 | kind "SharedLib" 20 | language "C++" 21 | targetname "sharptrails" 22 | targetdir "bin/%{cfg.buildcfg}" 23 | targetextension ".dll" 24 | characterset ("MBCS") 25 | 26 | filter "configurations:DebugIII" 27 | defines { "DEBUG" } 28 | symbols "On" 29 | debugdir "C:/Users/aap/games/gta3" 30 | debugcommand "C:/Users/aap/games/gta3/gta3.exe" 31 | postbuildcommands "copy /y \"$(TargetPath)\" \"C:\\Users\\aap\\games\\gta3\\plugins\\sharptrails.dll\"" 32 | 33 | filter "configurations:DebugVC" 34 | defines { "DEBUG" } 35 | symbols "On" 36 | debugdir "C:/Users/aap/games/gtavc" 37 | debugcommand "C:/Users/aap/games/gtavc/gta_vc.exe" 38 | postbuildcommands "copy /y \"$(TargetPath)\" \"C:\\Users\\aap\\games\\gtavc\\plugins\\sharptrails.dll\"" 39 | 40 | filter "configurations:Release" 41 | defines { "NDEBUG" } 42 | optimize "On" 43 | flags { "StaticRuntime" } 44 | -------------------------------------------------------------------------------- /res/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aap/sharptrails/a0297a77df70e958d4b2e7d666da28a6cb0b3654/res/.gitkeep -------------------------------------------------------------------------------- /shaders/iiiBlurPS.hlsl: -------------------------------------------------------------------------------- 1 | struct PS_INPUT 2 | { 3 | float4 position : POSITION; 4 | float3 texcoord0 : TEXCOORD0; 5 | float4 color : COLOR0; 6 | }; 7 | 8 | uniform float3 contrastMult : register(c3); 9 | uniform float3 contrastAdd : register(c4); 10 | 11 | sampler2D tex0 : register(s0); 12 | 13 | float4 14 | main(PS_INPUT In) : COLOR 15 | { 16 | float4 dst = tex2D(tex0, In.texcoord0.xy); 17 | 18 | // III 19 | float4 prev = dst; 20 | for(int i = 0; i < 5; i++){ 21 | float4 tmp = dst*(1-In.color.a) + prev*In.color*In.color.a; 22 | prev = tmp; 23 | } 24 | 25 | return prev; 26 | } 27 | -------------------------------------------------------------------------------- /shaders/vcBlurPS.hlsl: -------------------------------------------------------------------------------- 1 | struct PS_INPUT 2 | { 3 | float4 position : POSITION; 4 | float3 texcoord0 : TEXCOORD0; 5 | float4 color : COLOR0; 6 | }; 7 | 8 | sampler2D tex0 : register(s0); 9 | 10 | float4 11 | main(PS_INPUT In) : COLOR 12 | { 13 | //float4 color = tex2D(tex0, In.texcoord0.xy) * 0.25; 14 | //float2 dist = float2(0.005, 0.005); 15 | //color += tex2D(tex0, In.texcoord0.xy + dist) * 0.175; 16 | //color += tex2D(tex0, In.texcoord0.xy - dist) * 0.175; 17 | //color += tex2D(tex0, In.texcoord0.xy + float2(dist.x, -dist.y)) * 0.2; 18 | //color += tex2D(tex0, In.texcoord0.xy + float2(-dist.x, dist.y)) * 0.2; 19 | //return color; 20 | 21 | float a = 30/255.0f; 22 | float4 doublec = saturate(In.color*2); 23 | float4 dst = tex2D(tex0, In.texcoord0.xy); 24 | float4 prev = dst; 25 | for(int i = 0; i < 5; i++){ 26 | float4 tmp = dst*(1-a) + prev*doublec*a; 27 | tmp += prev*In.color; 28 | tmp += prev*In.color; 29 | prev = saturate(tmp); 30 | } 31 | return prev; 32 | } 33 | -------------------------------------------------------------------------------- /src/MemoryMgr.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMORYMGR 2 | #define __MEMORYMGR 3 | 4 | #define WRAPPER __declspec(naked) 5 | #define DEPRECATED __declspec(deprecated) 6 | #define EAXJMP(a) { _asm mov eax, a _asm jmp eax } 7 | #define VARJMP(a) { _asm jmp a } 8 | #define WRAPARG(a) UNREFERENCED_PARAMETER(a) 9 | 10 | #define NOVMT __declspec(novtable) 11 | #define SETVMT(a) *((DWORD_PTR*)this) = (DWORD_PTR)a 12 | 13 | enum 14 | { 15 | PATCH_CALL, 16 | PATCH_JUMP, 17 | PATCH_NOTHING, 18 | }; 19 | 20 | enum 21 | { 22 | III_10 = 1, 23 | III_11, 24 | III_STEAM, 25 | VC_10, 26 | VC_11, 27 | VC_STEAM 28 | }; 29 | 30 | extern int gtaversion; 31 | 32 | template 33 | inline T AddressByVersion(uintptr addressIII10, uintptr addressIII11, uintptr addressIIISteam, uintptr addressvc10, uintptr addressvc11, uintptr addressvcSteam) 34 | { 35 | if(gtaversion == -1){ 36 | if(*(uintptr*)0x5C1E75 == 0xB85548EC) gtaversion = III_10; 37 | else if(*(uintptr*)0x5C2135 == 0xB85548EC) gtaversion = III_11; 38 | else if(*(uintptr*)0x5C6FD5 == 0xB85548EC) gtaversion = III_STEAM; 39 | else if(*(uintptr*)0x667BF5 == 0xB85548EC) gtaversion = VC_10; 40 | else if(*(uintptr*)0x667C45 == 0xB85548EC) gtaversion = VC_11; 41 | else if(*(uintptr*)0x666BA5 == 0xB85548EC) gtaversion = VC_STEAM; 42 | else gtaversion = 0; 43 | } 44 | switch(gtaversion){ 45 | case III_10: 46 | return (T)addressIII10; 47 | case III_11: 48 | return (T)addressIII11; 49 | case III_STEAM: 50 | return (T)addressIIISteam; 51 | case VC_10: 52 | return (T)addressvc10; 53 | case VC_11: 54 | return (T)addressvc11; 55 | case VC_STEAM: 56 | return (T)addressvcSteam; 57 | default: 58 | return (T)0; 59 | } 60 | } 61 | 62 | inline bool 63 | is10(void) 64 | { 65 | return gtaversion == III_10 || gtaversion == VC_10; 66 | } 67 | 68 | inline bool 69 | isIII(void) 70 | { 71 | return gtaversion >= III_10 && gtaversion <= III_STEAM; 72 | } 73 | 74 | inline bool 75 | isVC(void) 76 | { 77 | return gtaversion >= VC_10 && gtaversion <= VC_STEAM; 78 | } 79 | 80 | #define PTRFROMCALL(addr) (uint32_t)(*(uint32_t*)((uint32_t)addr+1) + (uint32_t)addr + 5) 81 | #define INTERCEPT(saved, func, a) \ 82 | { \ 83 | saved = PTRFROMCALL(a); \ 84 | InjectHook(a, func); \ 85 | } 86 | 87 | template inline void 88 | Patch(AT address, T value) 89 | { 90 | DWORD dwProtect[2]; 91 | VirtualProtect((void*)address, sizeof(T), PAGE_EXECUTE_READWRITE, &dwProtect[0]); 92 | *(T*)address = value; 93 | VirtualProtect((void*)address, sizeof(T), dwProtect[0], &dwProtect[1]); 94 | } 95 | 96 | template inline void 97 | Nop(AT address, unsigned int nCount) 98 | { 99 | DWORD dwProtect[2]; 100 | VirtualProtect((void*)address, nCount, PAGE_EXECUTE_READWRITE, &dwProtect[0]); 101 | memset((void*)address, 0x90, nCount); 102 | VirtualProtect((void*)address, nCount, dwProtect[0], &dwProtect[1]); 103 | } 104 | 105 | template inline void 106 | InjectHook(AT address, HT hook, unsigned int nType=PATCH_NOTHING) 107 | { 108 | DWORD dwProtect[2]; 109 | switch ( nType ) 110 | { 111 | case PATCH_JUMP: 112 | VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &dwProtect[0]); 113 | *(BYTE*)address = 0xE9; 114 | break; 115 | case PATCH_CALL: 116 | VirtualProtect((void*)address, 5, PAGE_EXECUTE_READWRITE, &dwProtect[0]); 117 | *(BYTE*)address = 0xE8; 118 | break; 119 | default: 120 | VirtualProtect((void*)((DWORD)address + 1), 4, PAGE_EXECUTE_READWRITE, &dwProtect[0]); 121 | break; 122 | } 123 | DWORD dwHook; 124 | _asm 125 | { 126 | mov eax, hook 127 | mov dwHook, eax 128 | } 129 | 130 | *(ptrdiff_t*)((DWORD)address + 1) = (DWORD)dwHook - (DWORD)address - 5; 131 | if ( nType == PATCH_NOTHING ) 132 | VirtualProtect((void*)((DWORD)address + 1), 4, dwProtect[0], &dwProtect[1]); 133 | else 134 | VirtualProtect((void*)address, 5, dwProtect[0], &dwProtect[1]); 135 | } 136 | 137 | inline void ExtractCall(void *dst, uintptr a) 138 | { 139 | *(uintptr*)dst = (uintptr)(*(uintptr*)(a+1) + a + 5); 140 | } 141 | template 142 | inline void InterceptCall(void *dst, T func, uintptr a) 143 | { 144 | ExtractCall(dst, a); 145 | InjectHook(a, func); 146 | } 147 | template 148 | inline void InterceptVmethod(void *dst, T func, uintptr a) 149 | { 150 | *(uintptr*)dst = *(uintptr*)a; 151 | Patch(a, func); 152 | } 153 | 154 | #endif -------------------------------------------------------------------------------- /src/ModuleList.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | // Stores a list of loaded modules with their names, WITHOUT extension 8 | class ModuleList 9 | { 10 | public: 11 | // Initializes module list 12 | // Needs to be called before any calls to Get or GetAll 13 | void Enumerate() 14 | { 15 | constexpr size_t INITIAL_SIZE = sizeof(HMODULE) * 256; 16 | HMODULE* modules = static_cast(malloc( INITIAL_SIZE )); 17 | if ( modules != nullptr ) 18 | { 19 | typedef BOOL (WINAPI * Func)(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded); 20 | 21 | HMODULE hLib = LoadLibrary( TEXT("kernel32") ); 22 | assert( hLib != nullptr ); // If this fails then everything is probably broken anyway 23 | 24 | Func pEnumProcessModules = reinterpret_cast(GetProcAddress( hLib, "K32EnumProcessModules" )); 25 | if ( pEnumProcessModules == nullptr ) 26 | { 27 | // Try psapi 28 | FreeLibrary( hLib ); 29 | hLib = LoadLibrary( TEXT("psapi") ); 30 | if ( hLib != nullptr ) 31 | { 32 | pEnumProcessModules = reinterpret_cast(GetProcAddress( hLib, "EnumProcessModules" )); 33 | } 34 | } 35 | 36 | if ( pEnumProcessModules != nullptr ) 37 | { 38 | const HANDLE currentProcess = GetCurrentProcess(); 39 | DWORD cbNeeded = 0; 40 | if ( pEnumProcessModules( currentProcess, modules, INITIAL_SIZE, &cbNeeded ) != 0 ) 41 | { 42 | if ( cbNeeded > INITIAL_SIZE ) 43 | { 44 | HMODULE* newModules = static_cast(realloc( modules, cbNeeded )); 45 | if ( newModules != nullptr ) 46 | { 47 | modules = newModules; 48 | 49 | if ( pEnumProcessModules( currentProcess, modules, cbNeeded, &cbNeeded ) != 0 ) 50 | { 51 | EnumerateInternal( modules, cbNeeded / sizeof(HMODULE) ); 52 | } 53 | } 54 | } 55 | else 56 | { 57 | EnumerateInternal( modules, cbNeeded / sizeof(HMODULE) ); 58 | } 59 | } 60 | } 61 | 62 | if ( hLib != nullptr ) 63 | { 64 | FreeLibrary( hLib ); 65 | } 66 | 67 | free( modules ); 68 | } 69 | } 70 | 71 | // Recreates module list 72 | void ReEnumerate() 73 | { 74 | Clear(); 75 | Enumerate(); 76 | } 77 | 78 | // Clears module list 79 | void Clear() 80 | { 81 | m_moduleList.clear(); 82 | } 83 | 84 | // Gets handle of a loaded module with given name, NULL otherwise 85 | HMODULE Get( const wchar_t* moduleName ) const 86 | { 87 | // If vector is empty then we're trying to call it without calling Enumerate first 88 | assert( m_moduleList.size() != 0 ); 89 | 90 | auto it = std::find_if( m_moduleList.begin(), m_moduleList.end(), [&]( const auto& e ) { 91 | return _wcsicmp( moduleName, e.second.c_str() ) == 0; 92 | } ); 93 | return it != m_moduleList.end() ? it->first : nullptr; 94 | } 95 | 96 | // Gets handles to all loaded modules with given name 97 | std::vector GetAll( const wchar_t* moduleName ) const 98 | { 99 | // If vector is empty then we're trying to call it without calling Enumerate first 100 | assert( m_moduleList.size() != 0 ); 101 | 102 | std::vector results; 103 | for ( auto& e : m_moduleList ) 104 | { 105 | if ( _wcsicmp( moduleName, e.second.c_str() ) == 0 ) 106 | { 107 | results.push_back( e.first ); 108 | } 109 | } 110 | 111 | return results; 112 | } 113 | 114 | private: 115 | void EnumerateInternal( HMODULE* modules, size_t numModules ) 116 | { 117 | size_t moduleNameLength = MAX_PATH; 118 | wchar_t* moduleName = static_cast( malloc( moduleNameLength * sizeof(moduleName[0]) ) ); 119 | if ( moduleName != nullptr ) 120 | { 121 | m_moduleList.reserve( numModules ); 122 | for ( size_t i = 0; i < numModules; i++ ) 123 | { 124 | // Obtain module name, with resizing if necessary 125 | DWORD size; 126 | while ( size = GetModuleFileNameW( *modules, moduleName, moduleNameLength ), size == moduleNameLength ) 127 | { 128 | wchar_t* newName = static_cast( realloc( moduleName, 2 * moduleNameLength * sizeof(moduleName[0]) ) ); 129 | if ( newName != nullptr ) 130 | { 131 | moduleName = newName; 132 | moduleNameLength *= 2; 133 | } 134 | else 135 | { 136 | size = 0; 137 | break; 138 | } 139 | } 140 | 141 | if ( size != 0 ) 142 | { 143 | const wchar_t* nameBegin = wcsrchr( moduleName, '\\' ) + 1; 144 | const wchar_t* dotPos = wcsrchr( nameBegin, '.' ); 145 | if ( dotPos != nullptr ) 146 | { 147 | m_moduleList.emplace_back( *modules, std::wstring( nameBegin, std::distance( nameBegin, dotPos ) ) ); 148 | } 149 | else 150 | { 151 | m_moduleList.emplace_back( *modules, nameBegin ); 152 | } 153 | } 154 | modules++; 155 | } 156 | 157 | free( moduleName ); 158 | } 159 | } 160 | 161 | std::vector< std::pair > m_moduleList; 162 | }; -------------------------------------------------------------------------------- /src/Resource.rc: -------------------------------------------------------------------------------- 1 | #include "resource.h" 2 | #include 3 | 4 | IDR_VCBLURPS RCDATA "..\\res\\vcBlurPS.cso" 5 | IDR_IIIBLURPS RCDATA "..\\res\\iiiBlurPS.cso" 6 | IDR_CONTRASTPS RCDATA "..\\res\\contrastPS.cso" 7 | -------------------------------------------------------------------------------- /src/blur.cpp: -------------------------------------------------------------------------------- 1 | #include "sharptrails.h" 2 | #include "d3d9.h" 3 | #include "d3d9types.h" 4 | #include "debugmenu_public.h" 5 | #include "ModuleList.hpp" 6 | 7 | HMODULE dllModule; 8 | int gtaversion = -1; 9 | DebugMenuAPI gDebugMenuAPI; 10 | 11 | struct SkyGFXConfig { 12 | int version; 13 | 14 | // 2.7 15 | int worldPipeSwitch, worldPipeKey; 16 | int carPipeSwitch, carPipeKey; 17 | 18 | int neoGlossPipe, neoGlossPipeKey; 19 | int blendstyle, blendkey; 20 | int texgenstyle, texgenkey; 21 | int rimlight, rimlightkey; 22 | int neowaterdrops, neoblooddrops; 23 | int envMapSize; 24 | 25 | int disableColourOverlay; 26 | int trailsSwitch; 27 | int trailsBlur, trailsMotionBlur; 28 | 29 | // for leeds world 30 | float currentEmissiveRed; 31 | float currentEmissiveGreen; 32 | float currentEmissiveBlue; 33 | }; 34 | SkyGFXConfig *skyconf; 35 | 36 | 37 | int dontblur = 1; 38 | int coloroverlay = 0; 39 | 40 | 41 | static uint32_t DefinedState_A = AddressByVersion(0x526330, 0x526570, 0x526500, 0x57F9C0, 0x57F9E0, 0x57F7F0); 42 | WRAPPER void DefinedState(void) { VARJMP(DefinedState_A); } 43 | 44 | //void *overridePS = NULL; 45 | void *blurps = NULL; 46 | void *mobileps = NULL; 47 | 48 | class CMBlur { 49 | public: 50 | static bool &ms_bJustInitialised; 51 | static bool &BlurOn; 52 | static float &Drunkness; 53 | static RwRaster *&pFrontBuffer; 54 | static void MotionBlurRender(RwCamera *cam, RwUInt8 red, RwUInt8 green, RwUInt8 blue, RwUInt8 alpha, int type); 55 | static void OverlayRenderVC_noblur(RwCamera *cam, RwRaster *raster, RwRGBA color, int type); 56 | static void OverlayRenderVC(RwCamera *cam, RwRaster *raster, RwRGBA color, int type); 57 | static void OverlayRenderIII_noblur(RwCamera *cam, RwRaster *raster, RwRGBA color, int type, int alpha); 58 | static void OverlayRenderIII_fakething(RwCamera *cam, RwRaster *raster, RwRGBA color, int type, int alpha); 59 | static void OverlayRenderIII(RwCamera *cam, RwRaster *raster, RwRGBA color, int type, int alpha); 60 | static void OverlayRenderFx(RwCamera *cam, RwRaster *raster); 61 | static void MotionBlurOpen(RwCamera *cam); 62 | static void MotionBlurClose(void); 63 | }; 64 | 65 | //bool &CMBlur::ms_bJustInitialised = *(bool*)0xA10B71; 66 | bool &CMBlur::BlurOn = *AddressByVersion(0x95CDAD, 0x5FDB84, 0x60AB7C, 0x697D54, 0x697D54, 0x696D5C); 67 | //float &CMBlur::Drunkness = *(float*)0x983B38; 68 | RwRaster *&CMBlur::pFrontBuffer = *AddressByVersion(0x8E2C48, 0x8E2CFC, 0x8F2E3C, 0x9753A4, 0x9753AC, 0x9743AC); 69 | 70 | static uint32_t OverlayRenderFx_A = AddressByVersion(0, 0, 0, 0x55D870, 0x55D890, 0x55D760); 71 | WRAPPER void CMBlur::OverlayRenderFx(RwCamera*, RwRaster*) { VARJMP(OverlayRenderFx_A); } 72 | static uint32_t OverlayRenderVC_A = AddressByVersion(0, 0, 0, 0x55E750, 0x55E770, 0x55E640); 73 | WRAPPER void CMBlur::OverlayRenderVC(RwCamera*, RwRaster*, RwRGBA, int) { VARJMP(OverlayRenderVC_A); } 74 | static uint32_t OverlayRenderIII_A = AddressByVersion(0x50A9C0, 0x50AAA0, 0x50AA30, 0, 0, 0); 75 | WRAPPER void CMBlur::OverlayRenderIII(RwCamera*, RwRaster*, RwRGBA, int, int) { VARJMP(OverlayRenderIII_A); } 76 | static uint32_t MotionBlurOpen_A = AddressByVersion(0x50AE40, 0, 0, 0x55CE20, 0, 0); 77 | WRAPPER void CMBlur::MotionBlurOpen(RwCamera *cam) { VARJMP(MotionBlurOpen_A); } 78 | static uint32_t MotionBlurClose_A = AddressByVersion(0x50B170, 0, 0, 0x55CDF0, 0, 0); 79 | WRAPPER void CMBlur::MotionBlurClose(void) { VARJMP(MotionBlurClose_A); } 80 | 81 | 82 | /* 83 | void 84 | CMBlur::MotionBlurRender(RwCamera *cam, RwUInt8 red, RwUInt8 green, RwUInt8 blue, RwUInt8 alpha, int type) 85 | { 86 | RwRGBA color = { red, green, blue, alpha }; 87 | if(CMBlur::ms_bJustInitialised) 88 | CMBlur::ms_bJustInitialised = 0; 89 | else 90 | CMBlur::OverlayRender_noblur(cam, CMBlur::pFrontBuffer, color, type); 91 | if(CMBlur::BlurOn){ 92 | RwRasterPushContext(CMBlur::pFrontBuffer); 93 | RwRasterRenderFast(cam->frameBuffer, 0, 0); 94 | RwRasterPopContext(); 95 | } 96 | } 97 | */ 98 | 99 | RwD3D8Vertex *blurVertices = AddressByVersion(0x62F780, 0x62F780, 0x63F780, 0x7097A8, 0x7097A8, 0x7087A8); 100 | //RwD3D8Vertex *blurVertices2 = (RwD3D8Vertex*)0x709818; 101 | RwImVertexIndex *blurIndices = AddressByVersion(0x5FDD90, 0x5FDB78, 0x60AB70, 0x697D48, 0x697D48, 0x696D50); 102 | 103 | void 104 | setps(void) 105 | { 106 | if(blurps == NULL){ 107 | HRSRC resource = FindResource(dllModule, MAKEINTRESOURCE(isVC() ? IDR_VCBLURPS : IDR_IIIBLURPS), RT_RCDATA); 108 | RwUInt32 *shader = (RwUInt32*)LoadResource(dllModule, resource); 109 | RwD3D9CreatePixelShader(shader, &blurps); 110 | assert(blurps); 111 | FreeResource(shader); 112 | } 113 | RwD3D9SetIm2DPixelShader(blurps); 114 | } 115 | 116 | enum { NUMAVERAGE = 10 }; 117 | int PrevRed[NUMAVERAGE], AvgRed; 118 | int PrevGreen[NUMAVERAGE], AvgGreen; 119 | int PrevBlue[NUMAVERAGE], AvgBlue; 120 | int PrevAlpha[NUMAVERAGE], AvgAlpha; 121 | int Next; 122 | int NumValues; 123 | 124 | RwRGBA 125 | SmoothColor(RwRGBA color) 126 | { 127 | PrevRed[Next] = color.red; 128 | PrevGreen[Next] = color.green; 129 | PrevBlue[Next] = color.blue; 130 | PrevAlpha[Next] = color.alpha; 131 | Next = (Next+1) % NUMAVERAGE; 132 | NumValues = min(NumValues+1, NUMAVERAGE); 133 | 134 | AvgRed = 0; 135 | AvgGreen = 0; 136 | AvgBlue = 0; 137 | AvgAlpha = 0; 138 | for(int i = 0; i < NumValues; i++){ 139 | AvgRed += PrevRed[i]; 140 | AvgGreen += PrevGreen[i]; 141 | AvgBlue += PrevBlue[i]; 142 | AvgAlpha += PrevAlpha[i]; 143 | } 144 | color.red = AvgRed / NumValues; 145 | color.green = AvgGreen / NumValues; 146 | color.blue = AvgBlue / NumValues; 147 | color.alpha = AvgAlpha / NumValues; 148 | return color; 149 | } 150 | 151 | void 152 | CMBlur::OverlayRenderVC_noblur(RwCamera *cam, RwRaster *raster, RwRGBA color, int type) 153 | { 154 | if(0 && type == 1){ 155 | color.red = 180; 156 | color.green = 255; 157 | color.blue = 180; 158 | color.alpha = 120; 159 | 160 | DefinedState(); 161 | RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)1); 162 | RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); 163 | RwRenderStateSet(rwRENDERSTATEZTESTENABLE, 0); 164 | RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 0); 165 | RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); 166 | RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)1); 167 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); 168 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); 169 | RwUInt32 emissiveColor = D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue); 170 | for(int i = 0; i < 4; i++) 171 | blurVertices[i].emissiveColor = emissiveColor; 172 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); 173 | return; 174 | } 175 | 176 | if(type != 2 || !CMBlur::BlurOn || !dontblur || !RwD3D9Supported()){ 177 | CMBlur::OverlayRenderVC(cam, raster, color, type); 178 | NumValues = 0; 179 | return; 180 | } 181 | 182 | // this mostly gets rid of the annoying flicker 183 | color = SmoothColor(color); 184 | 185 | RwRasterPushContext(CMBlur::pFrontBuffer); 186 | RwRasterRenderFast(cam->frameBuffer, 0, 0); 187 | RwRasterPopContext(); 188 | 189 | DefinedState(); 190 | RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)1); 191 | RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); 192 | RwRenderStateSet(rwRENDERSTATEZTESTENABLE, 0); 193 | RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 0); 194 | RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); 195 | RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, 0); 196 | RwUInt32 emissiveColor = D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue); 197 | for(int i = 0; i < 4; i++) 198 | blurVertices[i].emissiveColor = emissiveColor; 199 | setps(); 200 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); 201 | RwD3D9SetIm2DPixelShader(NULL); 202 | 203 | if(type != 1){ 204 | RwRasterPushContext(CMBlur::pFrontBuffer); 205 | RwRasterRenderFast(cam->frameBuffer, 0, 0); 206 | RwRasterPopContext(); 207 | CMBlur::OverlayRenderFx(cam, CMBlur::pFrontBuffer); 208 | } 209 | } 210 | 211 | /* 212 | void 213 | CMBlur::OverlayRender(RwCamera *cam, RwRaster *raster, RwRGBA color, int type) 214 | { 215 | RwUInt8 red, green, blue, alpha; 216 | red = color.red; 217 | green = color.green; 218 | blue = color.blue; 219 | alpha = color.alpha; 220 | DefinedState(); 221 | switch(type){ 222 | case 3: 223 | red = 0; 224 | green = 0xFF; 225 | blue = 0; 226 | alpha = 0x80; 227 | break; 228 | case 5: 229 | red = 0x64; 230 | green = 0xDC; 231 | blue = 0xE6; 232 | alpha = 0x9E; 233 | break; 234 | case 6: 235 | red = 0x50; 236 | green = 0xFF; 237 | blue = 0xE6; 238 | alpha = 0x8A; 239 | break; 240 | case 8: 241 | red = 0xFF; 242 | green = 0x3C; 243 | blue = 0x3C; 244 | alpha = 0xC8; 245 | break; 246 | case 9: 247 | red = 0xFF; 248 | green = 0xB4; 249 | blue = 0xB4; 250 | alpha = 0x80; 251 | break; 252 | } 253 | printf("blurtype: %d\n", type); 254 | if(!CMBlur::BlurOn){ 255 | assert(0 && "no blur"); 256 | } 257 | RwUInt32 emissiveColor = D3DCOLOR_ARGB(alpha, red, green, blue); 258 | for(int i = 0; i < 4; i++) 259 | blurVertices[i].emissiveColor = blurVertices2[i].emissiveColor = emissiveColor; 260 | RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)1); 261 | RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); 262 | RwRenderStateSet(rwRENDERSTATEZTESTENABLE, 0); 263 | RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 0); 264 | RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); 265 | RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)1); 266 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); 267 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); 268 | if(CMBlur::BlurOn){ 269 | if(type == 1){ 270 | assert(0 && "type 1"); 271 | emissiveColor = D3DCOLOR_ARGB(0x50, red, green, blue); 272 | for(int i = 0; i < 4; i++) 273 | blurVertices2[i].emissiveColor = emissiveColor; 274 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); 275 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); 276 | *(int*)0x97F888 = 0; // what's that? 277 | }else{ 278 | emissiveColor = D3DCOLOR_ARGB(0x1E, red*2, green*2, blue*2); 279 | for(int i = 0; i < 4; i++) 280 | blurVertices[i].emissiveColor = blurVertices2[i].emissiveColor = emissiveColor; 281 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); 282 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); 283 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); 284 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); 285 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); 286 | emissiveColor = D3DCOLOR_ARGB(alpha, red, green, blue); 287 | for(int i = 0; i < 4; i++) 288 | blurVertices[i].emissiveColor = blurVertices2[i].emissiveColor = emissiveColor; 289 | setps(); 290 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); // 291 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); 292 | overridePS = NULL; 293 | } 294 | } 295 | if(CMBlur::Drunkness * 175.0f){ 296 | assert(0 && "drunk"); 297 | } 298 | if((GetAsyncKeyState(VK_F4) & 0x8000) == 0 && type != 1) 299 | CMBlur::OverlayRenderFx(cam, raster); 300 | RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); 301 | RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)1); 302 | RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)1); 303 | RwRenderStateSet(rwRENDERSTATETEXTURERASTER, NULL); 304 | RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, 0); 305 | RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); 306 | RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); 307 | } 308 | */ 309 | 310 | void 311 | CMBlur::OverlayRenderIII_noblur(RwCamera *cam, RwRaster *raster, RwRGBA color, int type, int bluralpha) 312 | { 313 | //{ 314 | // static bool keystate = false; 315 | // if(GetAsyncKeyState(VK_F4) & 0x8000){ 316 | // if(!keystate){ 317 | // dontblur = !dontblur; 318 | // keystate = true; 319 | // } 320 | // }else 321 | // keystate = false; 322 | //} 323 | 324 | if(!CMBlur::BlurOn || !dontblur || !RwD3D9Supported()){ 325 | CMBlur::OverlayRenderIII(cam, raster, color, type, bluralpha); 326 | return; 327 | } 328 | 329 | switch(type){ 330 | case 3: 331 | color.red = 0; 332 | color.green = 0xFF; 333 | color.blue = 0; 334 | color.alpha = 0x80; 335 | break; 336 | case 5: 337 | color.red = 0x64; 338 | color.green = 0xDC; 339 | color.blue = 0xE6; 340 | color.alpha = 0x9E; 341 | break; 342 | case 6: 343 | color.red = 0x50; 344 | color.green = 0xFF; 345 | color.blue = 0xE6; 346 | color.alpha = 0x8A; 347 | break; 348 | case 8: 349 | color.red = 0xFF; 350 | color.green = 0x3C; 351 | color.blue = 0x3C; 352 | color.alpha = 0xC8; 353 | break; 354 | case 9: 355 | color.red = 0xFF; 356 | color.green = 0xB4; 357 | color.blue = 0xB4; 358 | color.alpha = 0x80; 359 | break; 360 | } 361 | 362 | RwRasterPushContext(CMBlur::pFrontBuffer); 363 | RwRasterRenderFast(cam->frameBuffer, 0, 0); 364 | RwRasterPopContext(); 365 | 366 | DefinedState(); 367 | RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)1); 368 | RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); 369 | RwRenderStateSet(rwRENDERSTATEZTESTENABLE, 0); 370 | RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 0); 371 | RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); 372 | RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, 0); 373 | RwUInt32 emissiveColor = D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue); 374 | for(int i = 0; i < 4; i++) 375 | blurVertices[i].emissiveColor = emissiveColor; 376 | setps(); 377 | RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, blurVertices, 4, blurIndices, 6); 378 | RwD3D9SetIm2DPixelShader(NULL); 379 | } 380 | 381 | void 382 | CMBlur::OverlayRenderIII_fakething(RwCamera *cam, RwRaster *raster, RwRGBA color, int type, int alpha) 383 | { 384 | if(coloroverlay) 385 | OverlayRenderIII(cam, raster, color, type, alpha); 386 | } 387 | 388 | RwCamera *&SceneCamera = *AddressByVersion(0x72676C, 0x72676C, 0x7368AC, 0x8100BC, 0x8100C4, 0x80F0C4); 389 | 390 | void 391 | toggleBlur(void) 392 | { 393 | if(CMBlur::BlurOn) 394 | CMBlur::MotionBlurOpen(SceneCamera); 395 | else 396 | CMBlur::MotionBlurClose(); 397 | } 398 | 399 | void (*setparam)(const char*, int); 400 | 401 | void 402 | blurToggled(void) 403 | { 404 | if(setparam){ 405 | setparam("trailsBlur", !dontblur); 406 | setparam("trailsMotionBlur", !dontblur); 407 | } 408 | } 409 | 410 | int (*RsEventHandler_orig)(int a, int b); 411 | int 412 | delayedPatches(int a, int b) 413 | { 414 | ModuleList modlist; 415 | 416 | modlist.Enumerate(); 417 | HMODULE skygfx = modlist.Get(L"skygfx"); 418 | if(skygfx){ 419 | setparam = (void (*)(const char*, int))GetProcAddress(skygfx, "SkyGFXSetParam"); 420 | if(setparam){ 421 | setparam("trailsBlur", 0); 422 | setparam("trailsMotionBlur", 0); 423 | } 424 | } 425 | 426 | if(DebugMenuLoad()){ 427 | DebugMenuAddVarBool8("Sharptrails", "Trails", (int8_t*)&CMBlur::BlurOn, toggleBlur); 428 | if(isIII()) 429 | DebugMenuAddVarBool32("Sharptrails", "Colour overlay", &coloroverlay, NULL); 430 | if(gtaversion == VC_10) 431 | DebugMenuAddVar("Sharptrails", "brightness", (int*)0x869648, NULL, 1, 0, 512, NULL); 432 | DebugMenuAddVarBool32("Sharptrails", "No blur", &dontblur, blurToggled); 433 | } 434 | return RsEventHandler_orig(a, b); 435 | } 436 | 437 | void 438 | patch(void) 439 | { 440 | if(gtaversion == III_10 || gtaversion == VC_10) 441 | InterceptCall(&RsEventHandler_orig, delayedPatches, AddressByVersion(0x58275E, 0, 0, 0x5FFAFE, 0, 0)); 442 | 443 | if(isVC()) 444 | InjectHook(AddressByVersion(0, 0, 0, 0x55D838, 0x55D858, 0x55D728), CMBlur::OverlayRenderVC_noblur); 445 | else{ 446 | InjectHook(AddressByVersion(0x50ADDD, 0x50AEBD, 0x50AE4D, 0, 0, 0), CMBlur::OverlayRenderIII_noblur); 447 | InjectHook(AddressByVersion(0x50AE2F, 0x50AF0F, 0x50AE9F, 0, 0, 0), CMBlur::OverlayRenderIII_fakething); 448 | // Nop(AddressByVersion(0x50AE2F, 0x50AF0F, 0x50AE9F, 0, 0, 0), 5); 449 | } 450 | } 451 | 452 | BOOL WINAPI 453 | DllMain(HINSTANCE hInst, DWORD reason, LPVOID) 454 | { 455 | if(reason == DLL_PROCESS_ATTACH){ 456 | dllModule = hInst; 457 | 458 | /*AllocConsole(); 459 | freopen("CONIN$", "r", stdin); 460 | freopen("CONOUT$", "w", stdout); 461 | freopen("CONOUT$", "w", stderr);*/ 462 | 463 | AddressByVersion(0, 0, 0, 0, 0, 0); 464 | 465 | //if(gtaversion == III_10 || gtaversion == III_11 || gtaversion == VC_10) 466 | if (gtaversion != -1){ 467 | if (isVC()){ 468 | InjectHook(AddressByVersion(0, 0, 0, 0x48FEAF, 0x48FEBF, 0x48FDBF), enableTrailSetting, PATCH_CALL); 469 | 470 | //CMBlur::AddRenderFx Type 4 471 | Nop(AddressByVersion(0, 0, 0, 0x560FF9, 0x561019, 0x560EE9), 5); 472 | Nop(AddressByVersion(0, 0, 0, 0x561259, 0x561279, 0x561149), 5); 473 | 474 | char dllName[MAX_PATH]; 475 | GetModuleFileName(hInst, dllName, MAX_PATH); 476 | char *s = strrchr(dllName, '\\'); 477 | if(strstr(s + 1, "sharp") != NULL) 478 | patch(); 479 | }else 480 | patch(); 481 | } 482 | } 483 | 484 | return TRUE; 485 | } 486 | -------------------------------------------------------------------------------- /src/d3d8.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3d8.h 6 | * Content: Direct3D include file 7 | * 8 | ****************************************************************************/ 9 | 10 | #ifndef _D3D8_H_ 11 | #define _D3D8_H_ 12 | 13 | #ifndef DIRECT3D_VERSION 14 | #define DIRECT3D_VERSION 0x0800 15 | #endif //DIRECT3D_VERSION 16 | 17 | // include this file content only if compiling for DX8 interfaces 18 | #if(DIRECT3D_VERSION >= 0x0800) 19 | 20 | 21 | /* This identifier is passed to Direct3DCreate8 in order to ensure that an 22 | * application was built against the correct header files. This number is 23 | * incremented whenever a header (or other) change would require applications 24 | * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail. 25 | * (The number itself has no meaning.)*/ 26 | 27 | #define D3D_SDK_VERSION 220 28 | 29 | 30 | #include 31 | 32 | #define COM_NO_WINDOWS_H 33 | #include 34 | 35 | #include 36 | 37 | #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) 38 | #define HMONITOR_DECLARED 39 | DECLARE_HANDLE(HMONITOR); 40 | #endif 41 | 42 | #define D3DAPI WINAPI 43 | 44 | /* 45 | * Interface IID's 46 | */ 47 | #if defined( _WIN32 ) && !defined( _NO_COM) 48 | 49 | /* IID_IDirect3D8 */ 50 | /* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */ 51 | DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12); 52 | 53 | /* IID_IDirect3DDevice8 */ 54 | /* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */ 55 | DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf); 56 | 57 | /* IID_IDirect3DResource8 */ 58 | /* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */ 59 | DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f); 60 | 61 | /* IID_IDirect3DBaseTexture8 */ 62 | /* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */ 63 | DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e); 64 | 65 | /* IID_IDirect3DTexture8 */ 66 | /* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */ 67 | DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58); 68 | 69 | /* IID_IDirect3DCubeTexture8 */ 70 | /* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */ 71 | DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50); 72 | 73 | /* IID_IDirect3DVolumeTexture8 */ 74 | /* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */ 75 | DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad); 76 | 77 | /* IID_IDirect3DVertexBuffer8 */ 78 | /* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */ 79 | DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95); 80 | 81 | /* IID_IDirect3DIndexBuffer8 */ 82 | /* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */ 83 | DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86); 84 | 85 | /* IID_IDirect3DSurface8 */ 86 | /* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */ 87 | DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd); 88 | 89 | /* IID_IDirect3DVolume8 */ 90 | /* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */ 91 | DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0); 92 | 93 | /* IID_IDirect3DSwapChain8 */ 94 | /* {928C088B-76B9-4C6B-A536-A590853876CD} */ 95 | DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd); 96 | 97 | #endif 98 | 99 | #ifdef __cplusplus 100 | 101 | interface IDirect3D8; 102 | interface IDirect3DDevice8; 103 | 104 | interface IDirect3DResource8; 105 | interface IDirect3DBaseTexture8; 106 | interface IDirect3DTexture8; 107 | interface IDirect3DVolumeTexture8; 108 | interface IDirect3DCubeTexture8; 109 | 110 | interface IDirect3DVertexBuffer8; 111 | interface IDirect3DIndexBuffer8; 112 | 113 | interface IDirect3DSurface8; 114 | interface IDirect3DVolume8; 115 | 116 | interface IDirect3DSwapChain8; 117 | 118 | #endif 119 | 120 | 121 | typedef interface IDirect3D8 IDirect3D8; 122 | typedef interface IDirect3DDevice8 IDirect3DDevice8; 123 | typedef interface IDirect3DResource8 IDirect3DResource8; 124 | typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8; 125 | typedef interface IDirect3DTexture8 IDirect3DTexture8; 126 | typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8; 127 | typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8; 128 | typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8; 129 | typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8; 130 | typedef interface IDirect3DSurface8 IDirect3DSurface8; 131 | typedef interface IDirect3DVolume8 IDirect3DVolume8; 132 | typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8; 133 | 134 | #include "d3d8types.h" 135 | #include "d3d8caps.h" 136 | 137 | 138 | #ifdef __cplusplus 139 | extern "C" { 140 | #endif 141 | 142 | /* 143 | * DLL Function for creating a Direct3D8 object. This object supports 144 | * enumeration and allows the creation of Direct3DDevice8 objects. 145 | * Pass the value of the constant D3D_SDK_VERSION to this function, so 146 | * that the run-time can validate that your application was compiled 147 | * against the right headers. 148 | */ 149 | 150 | IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion); 151 | 152 | 153 | /* 154 | * Direct3D interfaces 155 | */ 156 | 157 | 158 | 159 | 160 | 161 | 162 | #undef INTERFACE 163 | #define INTERFACE IDirect3D8 164 | 165 | DECLARE_INTERFACE_(IDirect3D8, IUnknown) 166 | { 167 | /*** IUnknown methods ***/ 168 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 169 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 170 | STDMETHOD_(ULONG,Release)(THIS) PURE; 171 | 172 | /*** IDirect3D8 methods ***/ 173 | STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; 174 | STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; 175 | STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER8* pIdentifier) PURE; 176 | STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter) PURE; 177 | STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,UINT Mode,D3DDISPLAYMODE* pMode) PURE; 178 | STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; 179 | STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE CheckType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL Windowed) PURE; 180 | STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; 181 | STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType) PURE; 182 | STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; 183 | STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS8* pCaps) PURE; 184 | STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; 185 | STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice8** ppReturnedDeviceInterface) PURE; 186 | }; 187 | 188 | typedef struct IDirect3D8 *LPDIRECT3D8, *PDIRECT3D8; 189 | 190 | #if !defined(__cplusplus) || defined(CINTERFACE) 191 | #define IDirect3D8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 192 | #define IDirect3D8_AddRef(p) (p)->lpVtbl->AddRef(p) 193 | #define IDirect3D8_Release(p) (p)->lpVtbl->Release(p) 194 | #define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) 195 | #define IDirect3D8_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) 196 | #define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) 197 | #define IDirect3D8_GetAdapterModeCount(p,a) (p)->lpVtbl->GetAdapterModeCount(p,a) 198 | #define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->lpVtbl->EnumAdapterModes(p,a,b,c) 199 | #define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) 200 | #define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) 201 | #define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) 202 | #define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e) 203 | #define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) 204 | #define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) 205 | #define IDirect3D8_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) 206 | #define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) 207 | #else 208 | #define IDirect3D8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 209 | #define IDirect3D8_AddRef(p) (p)->AddRef() 210 | #define IDirect3D8_Release(p) (p)->Release() 211 | #define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) 212 | #define IDirect3D8_GetAdapterCount(p) (p)->GetAdapterCount() 213 | #define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) 214 | #define IDirect3D8_GetAdapterModeCount(p,a) (p)->GetAdapterModeCount(a) 215 | #define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->EnumAdapterModes(a,b,c) 216 | #define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) 217 | #define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) 218 | #define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) 219 | #define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->CheckDeviceMultiSampleType(a,b,c,d,e) 220 | #define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) 221 | #define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) 222 | #define IDirect3D8_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) 223 | #define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) 224 | #endif 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | #undef INTERFACE 245 | #define INTERFACE IDirect3DDevice8 246 | 247 | DECLARE_INTERFACE_(IDirect3DDevice8, IUnknown) 248 | { 249 | /*** IUnknown methods ***/ 250 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 251 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 252 | STDMETHOD_(ULONG,Release)(THIS) PURE; 253 | 254 | /*** IDirect3DDevice8 methods ***/ 255 | STDMETHOD(TestCooperativeLevel)(THIS) PURE; 256 | STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; 257 | STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE; 258 | STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE; 259 | STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8* pCaps) PURE; 260 | STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; 261 | STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; 262 | STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface8* pCursorBitmap) PURE; 263 | STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; 264 | STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; 265 | STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain8** pSwapChain) PURE; 266 | STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; 267 | STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; 268 | STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; 269 | STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; 270 | STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; 271 | STDMETHOD_(void, GetGammaRamp)(THIS_ D3DGAMMARAMP* pRamp) PURE; 272 | STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture) PURE; 273 | STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture) PURE; 274 | STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture) PURE; 275 | STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer) PURE; 276 | STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer) PURE; 277 | STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface) PURE; 278 | STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface) PURE; 279 | STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface) PURE; 280 | STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) PURE; 281 | STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture) PURE; 282 | STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8* pDestSurface) PURE; 283 | STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil) PURE; 284 | STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8** ppRenderTarget) PURE; 285 | STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8** ppZStencilSurface) PURE; 286 | STDMETHOD(BeginScene)(THIS) PURE; 287 | STDMETHOD(EndScene)(THIS) PURE; 288 | STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; 289 | STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; 290 | STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; 291 | STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; 292 | STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8* pViewport) PURE; 293 | STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8* pViewport) PURE; 294 | STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8* pMaterial) PURE; 295 | STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8* pMaterial) PURE; 296 | STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT8*) PURE; 297 | STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT8*) PURE; 298 | STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; 299 | STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; 300 | STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; 301 | STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; 302 | STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; 303 | STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; 304 | STDMETHOD(BeginStateBlock)(THIS) PURE; 305 | STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE; 306 | STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE; 307 | STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE; 308 | STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE; 309 | STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,DWORD* pToken) PURE; 310 | STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8* pClipStatus) PURE; 311 | STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8* pClipStatus) PURE; 312 | STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8** ppTexture) PURE; 313 | STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8* pTexture) PURE; 314 | STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; 315 | STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; 316 | STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; 317 | STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) PURE; 318 | STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; 319 | STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; 320 | STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; 321 | STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; 322 | STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; 323 | STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; 324 | STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; 325 | STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; 326 | STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) PURE; 327 | STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) PURE; 328 | STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE; 329 | STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE; 330 | STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE; 331 | STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; 332 | STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; 333 | STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; 334 | STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; 335 | STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride) PURE; 336 | STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) PURE; 337 | STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) PURE; 338 | STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) PURE; 339 | STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle) PURE; 340 | STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE; 341 | STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE; 342 | STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE; 343 | STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; 344 | STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; 345 | STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; 346 | STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; 347 | STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; 348 | STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; 349 | }; 350 | 351 | typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8, *PDIRECT3DDEVICE8; 352 | 353 | #if !defined(__cplusplus) || defined(CINTERFACE) 354 | #define IDirect3DDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 355 | #define IDirect3DDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) 356 | #define IDirect3DDevice8_Release(p) (p)->lpVtbl->Release(p) 357 | #define IDirect3DDevice8_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) 358 | #define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) 359 | #define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->lpVtbl->ResourceManagerDiscardBytes(p,a) 360 | #define IDirect3DDevice8_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) 361 | #define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) 362 | #define IDirect3DDevice8_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) 363 | #define IDirect3DDevice8_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) 364 | #define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) 365 | #define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) 366 | #define IDirect3DDevice8_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) 367 | #define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) 368 | #define IDirect3DDevice8_Reset(p,a) (p)->lpVtbl->Reset(p,a) 369 | #define IDirect3DDevice8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) 370 | #define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) 371 | #define IDirect3DDevice8_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) 372 | #define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b) 373 | #define IDirect3DDevice8_GetGammaRamp(p,a) (p)->lpVtbl->GetGammaRamp(p,a) 374 | #define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g) 375 | #define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h) 376 | #define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f) 377 | #define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e) 378 | #define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e) 379 | #define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f) 380 | #define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e) 381 | #define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->lpVtbl->CreateImageSurface(p,a,b,c,d) 382 | #define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->lpVtbl->CopyRects(p,a,b,c,d,e) 383 | #define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) 384 | #define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->lpVtbl->GetFrontBuffer(p,a) 385 | #define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) 386 | #define IDirect3DDevice8_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) 387 | #define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) 388 | #define IDirect3DDevice8_BeginScene(p) (p)->lpVtbl->BeginScene(p) 389 | #define IDirect3DDevice8_EndScene(p) (p)->lpVtbl->EndScene(p) 390 | #define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) 391 | #define IDirect3DDevice8_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) 392 | #define IDirect3DDevice8_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) 393 | #define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) 394 | #define IDirect3DDevice8_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) 395 | #define IDirect3DDevice8_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) 396 | #define IDirect3DDevice8_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) 397 | #define IDirect3DDevice8_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) 398 | #define IDirect3DDevice8_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) 399 | #define IDirect3DDevice8_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) 400 | #define IDirect3DDevice8_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) 401 | #define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) 402 | #define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) 403 | #define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) 404 | #define IDirect3DDevice8_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) 405 | #define IDirect3DDevice8_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) 406 | #define IDirect3DDevice8_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) 407 | #define IDirect3DDevice8_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) 408 | #define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) 409 | #define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) 410 | #define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) 411 | #define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) 412 | #define IDirect3DDevice8_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) 413 | #define IDirect3DDevice8_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) 414 | #define IDirect3DDevice8_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) 415 | #define IDirect3DDevice8_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) 416 | #define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) 417 | #define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) 418 | #define IDirect3DDevice8_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) 419 | #define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) 420 | #define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) 421 | #define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) 422 | #define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) 423 | #define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) 424 | #define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) 425 | #define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e) 426 | #define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) 427 | #define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) 428 | #define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e) 429 | #define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) 430 | #define IDirect3DDevice8_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) 431 | #define IDirect3DDevice8_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) 432 | #define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->lpVtbl->DeleteVertexShader(p,a) 433 | #define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c) 434 | #define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c) 435 | #define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c) 436 | #define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c) 437 | #define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->lpVtbl->SetStreamSource(p,a,b,c) 438 | #define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->lpVtbl->GetStreamSource(p,a,b,c) 439 | #define IDirect3DDevice8_SetIndices(p,a,b) (p)->lpVtbl->SetIndices(p,a,b) 440 | #define IDirect3DDevice8_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) 441 | #define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) 442 | #define IDirect3DDevice8_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) 443 | #define IDirect3DDevice8_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) 444 | #define IDirect3DDevice8_DeletePixelShader(p,a) (p)->lpVtbl->DeletePixelShader(p,a) 445 | #define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c) 446 | #define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c) 447 | #define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c) 448 | #define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) 449 | #define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) 450 | #define IDirect3DDevice8_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) 451 | #else 452 | #define IDirect3DDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 453 | #define IDirect3DDevice8_AddRef(p) (p)->AddRef() 454 | #define IDirect3DDevice8_Release(p) (p)->Release() 455 | #define IDirect3DDevice8_TestCooperativeLevel(p) (p)->TestCooperativeLevel() 456 | #define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() 457 | #define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->ResourceManagerDiscardBytes(a) 458 | #define IDirect3DDevice8_GetDirect3D(p,a) (p)->GetDirect3D(a) 459 | #define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) 460 | #define IDirect3DDevice8_GetDisplayMode(p,a) (p)->GetDisplayMode(a) 461 | #define IDirect3DDevice8_GetCreationParameters(p,a) (p)->GetCreationParameters(a) 462 | #define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) 463 | #define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) 464 | #define IDirect3DDevice8_ShowCursor(p,a) (p)->ShowCursor(a) 465 | #define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) 466 | #define IDirect3DDevice8_Reset(p,a) (p)->Reset(a) 467 | #define IDirect3DDevice8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) 468 | #define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) 469 | #define IDirect3DDevice8_GetRasterStatus(p,a) (p)->GetRasterStatus(a) 470 | #define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->SetGammaRamp(a,b) 471 | #define IDirect3DDevice8_GetGammaRamp(p,a) (p)->GetGammaRamp(a) 472 | #define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->CreateTexture(a,b,c,d,e,f,g) 473 | #define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h) 474 | #define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->CreateCubeTexture(a,b,c,d,e,f) 475 | #define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->CreateVertexBuffer(a,b,c,d,e) 476 | #define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->CreateIndexBuffer(a,b,c,d,e) 477 | #define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->CreateRenderTarget(a,b,c,d,e,f) 478 | #define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->CreateDepthStencilSurface(a,b,c,d,e) 479 | #define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->CreateImageSurface(a,b,c,d) 480 | #define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->CopyRects(a,b,c,d,e) 481 | #define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) 482 | #define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->GetFrontBuffer(a) 483 | #define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) 484 | #define IDirect3DDevice8_GetRenderTarget(p,a) (p)->GetRenderTarget(a) 485 | #define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) 486 | #define IDirect3DDevice8_BeginScene(p) (p)->BeginScene() 487 | #define IDirect3DDevice8_EndScene(p) (p)->EndScene() 488 | #define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) 489 | #define IDirect3DDevice8_SetTransform(p,a,b) (p)->SetTransform(a,b) 490 | #define IDirect3DDevice8_GetTransform(p,a,b) (p)->GetTransform(a,b) 491 | #define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) 492 | #define IDirect3DDevice8_SetViewport(p,a) (p)->SetViewport(a) 493 | #define IDirect3DDevice8_GetViewport(p,a) (p)->GetViewport(a) 494 | #define IDirect3DDevice8_SetMaterial(p,a) (p)->SetMaterial(a) 495 | #define IDirect3DDevice8_GetMaterial(p,a) (p)->GetMaterial(a) 496 | #define IDirect3DDevice8_SetLight(p,a,b) (p)->SetLight(a,b) 497 | #define IDirect3DDevice8_GetLight(p,a,b) (p)->GetLight(a,b) 498 | #define IDirect3DDevice8_LightEnable(p,a,b) (p)->LightEnable(a,b) 499 | #define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) 500 | #define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) 501 | #define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) 502 | #define IDirect3DDevice8_SetRenderState(p,a,b) (p)->SetRenderState(a,b) 503 | #define IDirect3DDevice8_GetRenderState(p,a,b) (p)->GetRenderState(a,b) 504 | #define IDirect3DDevice8_BeginStateBlock(p) (p)->BeginStateBlock() 505 | #define IDirect3DDevice8_EndStateBlock(p,a) (p)->EndStateBlock(a) 506 | #define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) 507 | #define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) 508 | #define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) 509 | #define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) 510 | #define IDirect3DDevice8_SetClipStatus(p,a) (p)->SetClipStatus(a) 511 | #define IDirect3DDevice8_GetClipStatus(p,a) (p)->GetClipStatus(a) 512 | #define IDirect3DDevice8_GetTexture(p,a,b) (p)->GetTexture(a,b) 513 | #define IDirect3DDevice8_SetTexture(p,a,b) (p)->SetTexture(a,b) 514 | #define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) 515 | #define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) 516 | #define IDirect3DDevice8_ValidateDevice(p,a) (p)->ValidateDevice(a) 517 | #define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) 518 | #define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) 519 | #define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) 520 | #define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) 521 | #define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) 522 | #define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) 523 | #define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->DrawIndexedPrimitive(a,b,c,d,e) 524 | #define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) 525 | #define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) 526 | #define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->ProcessVertices(a,b,c,d,e) 527 | #define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->CreateVertexShader(a,b,c,d) 528 | #define IDirect3DDevice8_SetVertexShader(p,a) (p)->SetVertexShader(a) 529 | #define IDirect3DDevice8_GetVertexShader(p,a) (p)->GetVertexShader(a) 530 | #define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->DeleteVertexShader(a) 531 | #define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->SetVertexShaderConstant(a,b,c) 532 | #define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->GetVertexShaderConstant(a,b,c) 533 | #define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->GetVertexShaderDeclaration(a,b,c) 534 | #define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->GetVertexShaderFunction(a,b,c) 535 | #define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->SetStreamSource(a,b,c) 536 | #define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->GetStreamSource(a,b,c) 537 | #define IDirect3DDevice8_SetIndices(p,a,b) (p)->SetIndices(a,b) 538 | #define IDirect3DDevice8_GetIndices(p,a,b) (p)->GetIndices(a,b) 539 | #define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) 540 | #define IDirect3DDevice8_SetPixelShader(p,a) (p)->SetPixelShader(a) 541 | #define IDirect3DDevice8_GetPixelShader(p,a) (p)->GetPixelShader(a) 542 | #define IDirect3DDevice8_DeletePixelShader(p,a) (p)->DeletePixelShader(a) 543 | #define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->SetPixelShaderConstant(a,b,c) 544 | #define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->GetPixelShaderConstant(a,b,c) 545 | #define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->GetPixelShaderFunction(a,b,c) 546 | #define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) 547 | #define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) 548 | #define IDirect3DDevice8_DeletePatch(p,a) (p)->DeletePatch(a) 549 | #endif 550 | 551 | 552 | 553 | #undef INTERFACE 554 | #define INTERFACE IDirect3DSwapChain8 555 | 556 | DECLARE_INTERFACE_(IDirect3DSwapChain8, IUnknown) 557 | { 558 | /*** IUnknown methods ***/ 559 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 560 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 561 | STDMETHOD_(ULONG,Release)(THIS) PURE; 562 | 563 | /*** IDirect3DSwapChain8 methods ***/ 564 | STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; 565 | STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; 566 | }; 567 | 568 | typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8; 569 | 570 | #if !defined(__cplusplus) || defined(CINTERFACE) 571 | #define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 572 | #define IDirect3DSwapChain8_AddRef(p) (p)->lpVtbl->AddRef(p) 573 | #define IDirect3DSwapChain8_Release(p) (p)->lpVtbl->Release(p) 574 | #define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) 575 | #define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) 576 | #else 577 | #define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 578 | #define IDirect3DSwapChain8_AddRef(p) (p)->AddRef() 579 | #define IDirect3DSwapChain8_Release(p) (p)->Release() 580 | #define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) 581 | #define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) 582 | #endif 583 | 584 | 585 | 586 | #undef INTERFACE 587 | #define INTERFACE IDirect3DResource8 588 | 589 | DECLARE_INTERFACE_(IDirect3DResource8, IUnknown) 590 | { 591 | /*** IUnknown methods ***/ 592 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 593 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 594 | STDMETHOD_(ULONG,Release)(THIS) PURE; 595 | 596 | /*** IDirect3DResource8 methods ***/ 597 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 598 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 599 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 600 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 601 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 602 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 603 | STDMETHOD_(void, PreLoad)(THIS) PURE; 604 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 605 | }; 606 | 607 | typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8; 608 | 609 | #if !defined(__cplusplus) || defined(CINTERFACE) 610 | #define IDirect3DResource8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 611 | #define IDirect3DResource8_AddRef(p) (p)->lpVtbl->AddRef(p) 612 | #define IDirect3DResource8_Release(p) (p)->lpVtbl->Release(p) 613 | #define IDirect3DResource8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 614 | #define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 615 | #define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 616 | #define IDirect3DResource8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 617 | #define IDirect3DResource8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 618 | #define IDirect3DResource8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 619 | #define IDirect3DResource8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 620 | #define IDirect3DResource8_GetType(p) (p)->lpVtbl->GetType(p) 621 | #else 622 | #define IDirect3DResource8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 623 | #define IDirect3DResource8_AddRef(p) (p)->AddRef() 624 | #define IDirect3DResource8_Release(p) (p)->Release() 625 | #define IDirect3DResource8_GetDevice(p,a) (p)->GetDevice(a) 626 | #define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 627 | #define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 628 | #define IDirect3DResource8_FreePrivateData(p,a) (p)->FreePrivateData(a) 629 | #define IDirect3DResource8_SetPriority(p,a) (p)->SetPriority(a) 630 | #define IDirect3DResource8_GetPriority(p) (p)->GetPriority() 631 | #define IDirect3DResource8_PreLoad(p) (p)->PreLoad() 632 | #define IDirect3DResource8_GetType(p) (p)->GetType() 633 | #endif 634 | 635 | 636 | 637 | 638 | #undef INTERFACE 639 | #define INTERFACE IDirect3DBaseTexture8 640 | 641 | DECLARE_INTERFACE_(IDirect3DBaseTexture8, IDirect3DResource8) 642 | { 643 | /*** IUnknown methods ***/ 644 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 645 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 646 | STDMETHOD_(ULONG,Release)(THIS) PURE; 647 | 648 | /*** IDirect3DResource8 methods ***/ 649 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 650 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 651 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 652 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 653 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 654 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 655 | STDMETHOD_(void, PreLoad)(THIS) PURE; 656 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 657 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 658 | STDMETHOD_(DWORD, GetLOD)(THIS) PURE; 659 | STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; 660 | }; 661 | 662 | typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8; 663 | 664 | #if !defined(__cplusplus) || defined(CINTERFACE) 665 | #define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 666 | #define IDirect3DBaseTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 667 | #define IDirect3DBaseTexture8_Release(p) (p)->lpVtbl->Release(p) 668 | #define IDirect3DBaseTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 669 | #define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 670 | #define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 671 | #define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 672 | #define IDirect3DBaseTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 673 | #define IDirect3DBaseTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 674 | #define IDirect3DBaseTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 675 | #define IDirect3DBaseTexture8_GetType(p) (p)->lpVtbl->GetType(p) 676 | #define IDirect3DBaseTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 677 | #define IDirect3DBaseTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 678 | #define IDirect3DBaseTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 679 | #else 680 | #define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 681 | #define IDirect3DBaseTexture8_AddRef(p) (p)->AddRef() 682 | #define IDirect3DBaseTexture8_Release(p) (p)->Release() 683 | #define IDirect3DBaseTexture8_GetDevice(p,a) (p)->GetDevice(a) 684 | #define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 685 | #define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 686 | #define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 687 | #define IDirect3DBaseTexture8_SetPriority(p,a) (p)->SetPriority(a) 688 | #define IDirect3DBaseTexture8_GetPriority(p) (p)->GetPriority() 689 | #define IDirect3DBaseTexture8_PreLoad(p) (p)->PreLoad() 690 | #define IDirect3DBaseTexture8_GetType(p) (p)->GetType() 691 | #define IDirect3DBaseTexture8_SetLOD(p,a) (p)->SetLOD(a) 692 | #define IDirect3DBaseTexture8_GetLOD(p) (p)->GetLOD() 693 | #define IDirect3DBaseTexture8_GetLevelCount(p) (p)->GetLevelCount() 694 | #endif 695 | 696 | 697 | 698 | 699 | 700 | #undef INTERFACE 701 | #define INTERFACE IDirect3DTexture8 702 | 703 | DECLARE_INTERFACE_(IDirect3DTexture8, IDirect3DBaseTexture8) 704 | { 705 | /*** IUnknown methods ***/ 706 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 707 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 708 | STDMETHOD_(ULONG,Release)(THIS) PURE; 709 | 710 | /*** IDirect3DBaseTexture8 methods ***/ 711 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 712 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 713 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 714 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 715 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 716 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 717 | STDMETHOD_(void, PreLoad)(THIS) PURE; 718 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 719 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 720 | STDMETHOD_(DWORD, GetLOD)(THIS) PURE; 721 | STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; 722 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; 723 | STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface8** ppSurfaceLevel) PURE; 724 | STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; 725 | STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; 726 | STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; 727 | }; 728 | 729 | typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8; 730 | 731 | #if !defined(__cplusplus) || defined(CINTERFACE) 732 | #define IDirect3DTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 733 | #define IDirect3DTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 734 | #define IDirect3DTexture8_Release(p) (p)->lpVtbl->Release(p) 735 | #define IDirect3DTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 736 | #define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 737 | #define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 738 | #define IDirect3DTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 739 | #define IDirect3DTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 740 | #define IDirect3DTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 741 | #define IDirect3DTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 742 | #define IDirect3DTexture8_GetType(p) (p)->lpVtbl->GetType(p) 743 | #define IDirect3DTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 744 | #define IDirect3DTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 745 | #define IDirect3DTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 746 | #define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 747 | #define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) 748 | #define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) 749 | #define IDirect3DTexture8_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) 750 | #define IDirect3DTexture8_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) 751 | #else 752 | #define IDirect3DTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 753 | #define IDirect3DTexture8_AddRef(p) (p)->AddRef() 754 | #define IDirect3DTexture8_Release(p) (p)->Release() 755 | #define IDirect3DTexture8_GetDevice(p,a) (p)->GetDevice(a) 756 | #define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 757 | #define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 758 | #define IDirect3DTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 759 | #define IDirect3DTexture8_SetPriority(p,a) (p)->SetPriority(a) 760 | #define IDirect3DTexture8_GetPriority(p) (p)->GetPriority() 761 | #define IDirect3DTexture8_PreLoad(p) (p)->PreLoad() 762 | #define IDirect3DTexture8_GetType(p) (p)->GetType() 763 | #define IDirect3DTexture8_SetLOD(p,a) (p)->SetLOD(a) 764 | #define IDirect3DTexture8_GetLOD(p) (p)->GetLOD() 765 | #define IDirect3DTexture8_GetLevelCount(p) (p)->GetLevelCount() 766 | #define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 767 | #define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) 768 | #define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) 769 | #define IDirect3DTexture8_UnlockRect(p,a) (p)->UnlockRect(a) 770 | #define IDirect3DTexture8_AddDirtyRect(p,a) (p)->AddDirtyRect(a) 771 | #endif 772 | 773 | 774 | 775 | 776 | 777 | #undef INTERFACE 778 | #define INTERFACE IDirect3DVolumeTexture8 779 | 780 | DECLARE_INTERFACE_(IDirect3DVolumeTexture8, IDirect3DBaseTexture8) 781 | { 782 | /*** IUnknown methods ***/ 783 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 784 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 785 | STDMETHOD_(ULONG,Release)(THIS) PURE; 786 | 787 | /*** IDirect3DBaseTexture8 methods ***/ 788 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 789 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 790 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 791 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 792 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 793 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 794 | STDMETHOD_(void, PreLoad)(THIS) PURE; 795 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 796 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 797 | STDMETHOD_(DWORD, GetLOD)(THIS) PURE; 798 | STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; 799 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; 800 | STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE; 801 | STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; 802 | STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; 803 | STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; 804 | }; 805 | 806 | typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8; 807 | 808 | #if !defined(__cplusplus) || defined(CINTERFACE) 809 | #define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 810 | #define IDirect3DVolumeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 811 | #define IDirect3DVolumeTexture8_Release(p) (p)->lpVtbl->Release(p) 812 | #define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 813 | #define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 814 | #define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 815 | #define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 816 | #define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 817 | #define IDirect3DVolumeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 818 | #define IDirect3DVolumeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 819 | #define IDirect3DVolumeTexture8_GetType(p) (p)->lpVtbl->GetType(p) 820 | #define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 821 | #define IDirect3DVolumeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 822 | #define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 823 | #define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 824 | #define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) 825 | #define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) 826 | #define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) 827 | #define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) 828 | #else 829 | #define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 830 | #define IDirect3DVolumeTexture8_AddRef(p) (p)->AddRef() 831 | #define IDirect3DVolumeTexture8_Release(p) (p)->Release() 832 | #define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->GetDevice(a) 833 | #define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 834 | #define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 835 | #define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 836 | #define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->SetPriority(a) 837 | #define IDirect3DVolumeTexture8_GetPriority(p) (p)->GetPriority() 838 | #define IDirect3DVolumeTexture8_PreLoad(p) (p)->PreLoad() 839 | #define IDirect3DVolumeTexture8_GetType(p) (p)->GetType() 840 | #define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->SetLOD(a) 841 | #define IDirect3DVolumeTexture8_GetLOD(p) (p)->GetLOD() 842 | #define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->GetLevelCount() 843 | #define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 844 | #define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) 845 | #define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) 846 | #define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->UnlockBox(a) 847 | #define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->AddDirtyBox(a) 848 | #endif 849 | 850 | 851 | 852 | 853 | 854 | #undef INTERFACE 855 | #define INTERFACE IDirect3DCubeTexture8 856 | 857 | DECLARE_INTERFACE_(IDirect3DCubeTexture8, IDirect3DBaseTexture8) 858 | { 859 | /*** IUnknown methods ***/ 860 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 861 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 862 | STDMETHOD_(ULONG,Release)(THIS) PURE; 863 | 864 | /*** IDirect3DBaseTexture8 methods ***/ 865 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 866 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 867 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 868 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 869 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 870 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 871 | STDMETHOD_(void, PreLoad)(THIS) PURE; 872 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 873 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 874 | STDMETHOD_(DWORD, GetLOD)(THIS) PURE; 875 | STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; 876 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; 877 | STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) PURE; 878 | STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; 879 | STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; 880 | STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; 881 | }; 882 | 883 | typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8; 884 | 885 | #if !defined(__cplusplus) || defined(CINTERFACE) 886 | #define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 887 | #define IDirect3DCubeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 888 | #define IDirect3DCubeTexture8_Release(p) (p)->lpVtbl->Release(p) 889 | #define IDirect3DCubeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 890 | #define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 891 | #define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 892 | #define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 893 | #define IDirect3DCubeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 894 | #define IDirect3DCubeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 895 | #define IDirect3DCubeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 896 | #define IDirect3DCubeTexture8_GetType(p) (p)->lpVtbl->GetType(p) 897 | #define IDirect3DCubeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 898 | #define IDirect3DCubeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 899 | #define IDirect3DCubeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 900 | #define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 901 | #define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) 902 | #define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) 903 | #define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) 904 | #define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) 905 | #else 906 | #define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 907 | #define IDirect3DCubeTexture8_AddRef(p) (p)->AddRef() 908 | #define IDirect3DCubeTexture8_Release(p) (p)->Release() 909 | #define IDirect3DCubeTexture8_GetDevice(p,a) (p)->GetDevice(a) 910 | #define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 911 | #define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 912 | #define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 913 | #define IDirect3DCubeTexture8_SetPriority(p,a) (p)->SetPriority(a) 914 | #define IDirect3DCubeTexture8_GetPriority(p) (p)->GetPriority() 915 | #define IDirect3DCubeTexture8_PreLoad(p) (p)->PreLoad() 916 | #define IDirect3DCubeTexture8_GetType(p) (p)->GetType() 917 | #define IDirect3DCubeTexture8_SetLOD(p,a) (p)->SetLOD(a) 918 | #define IDirect3DCubeTexture8_GetLOD(p) (p)->GetLOD() 919 | #define IDirect3DCubeTexture8_GetLevelCount(p) (p)->GetLevelCount() 920 | #define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 921 | #define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) 922 | #define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) 923 | #define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->UnlockRect(a,b) 924 | #define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) 925 | #endif 926 | 927 | 928 | 929 | 930 | #undef INTERFACE 931 | #define INTERFACE IDirect3DVertexBuffer8 932 | 933 | DECLARE_INTERFACE_(IDirect3DVertexBuffer8, IDirect3DResource8) 934 | { 935 | /*** IUnknown methods ***/ 936 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 937 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 938 | STDMETHOD_(ULONG,Release)(THIS) PURE; 939 | 940 | /*** IDirect3DResource8 methods ***/ 941 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 942 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 943 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 944 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 945 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 946 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 947 | STDMETHOD_(void, PreLoad)(THIS) PURE; 948 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 949 | STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; 950 | STDMETHOD(Unlock)(THIS) PURE; 951 | STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; 952 | }; 953 | 954 | typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8; 955 | 956 | #if !defined(__cplusplus) || defined(CINTERFACE) 957 | #define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 958 | #define IDirect3DVertexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) 959 | #define IDirect3DVertexBuffer8_Release(p) (p)->lpVtbl->Release(p) 960 | #define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 961 | #define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 962 | #define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 963 | #define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 964 | #define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 965 | #define IDirect3DVertexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 966 | #define IDirect3DVertexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 967 | #define IDirect3DVertexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) 968 | #define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) 969 | #define IDirect3DVertexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) 970 | #define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 971 | #else 972 | #define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 973 | #define IDirect3DVertexBuffer8_AddRef(p) (p)->AddRef() 974 | #define IDirect3DVertexBuffer8_Release(p) (p)->Release() 975 | #define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->GetDevice(a) 976 | #define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 977 | #define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 978 | #define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) 979 | #define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->SetPriority(a) 980 | #define IDirect3DVertexBuffer8_GetPriority(p) (p)->GetPriority() 981 | #define IDirect3DVertexBuffer8_PreLoad(p) (p)->PreLoad() 982 | #define IDirect3DVertexBuffer8_GetType(p) (p)->GetType() 983 | #define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) 984 | #define IDirect3DVertexBuffer8_Unlock(p) (p)->Unlock() 985 | #define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->GetDesc(a) 986 | #endif 987 | 988 | 989 | 990 | 991 | #undef INTERFACE 992 | #define INTERFACE IDirect3DIndexBuffer8 993 | 994 | DECLARE_INTERFACE_(IDirect3DIndexBuffer8, IDirect3DResource8) 995 | { 996 | /*** IUnknown methods ***/ 997 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 998 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 999 | STDMETHOD_(ULONG,Release)(THIS) PURE; 1000 | 1001 | /*** IDirect3DResource8 methods ***/ 1002 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1003 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 1004 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 1005 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1006 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 1007 | STDMETHOD_(DWORD, GetPriority)(THIS) PURE; 1008 | STDMETHOD_(void, PreLoad)(THIS) PURE; 1009 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; 1010 | STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; 1011 | STDMETHOD(Unlock)(THIS) PURE; 1012 | STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; 1013 | }; 1014 | 1015 | typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8; 1016 | 1017 | #if !defined(__cplusplus) || defined(CINTERFACE) 1018 | #define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1019 | #define IDirect3DIndexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) 1020 | #define IDirect3DIndexBuffer8_Release(p) (p)->lpVtbl->Release(p) 1021 | #define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1022 | #define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1023 | #define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1024 | #define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1025 | #define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 1026 | #define IDirect3DIndexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 1027 | #define IDirect3DIndexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 1028 | #define IDirect3DIndexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) 1029 | #define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) 1030 | #define IDirect3DIndexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) 1031 | #define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1032 | #else 1033 | #define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1034 | #define IDirect3DIndexBuffer8_AddRef(p) (p)->AddRef() 1035 | #define IDirect3DIndexBuffer8_Release(p) (p)->Release() 1036 | #define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->GetDevice(a) 1037 | #define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1038 | #define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1039 | #define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1040 | #define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->SetPriority(a) 1041 | #define IDirect3DIndexBuffer8_GetPriority(p) (p)->GetPriority() 1042 | #define IDirect3DIndexBuffer8_PreLoad(p) (p)->PreLoad() 1043 | #define IDirect3DIndexBuffer8_GetType(p) (p)->GetType() 1044 | #define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) 1045 | #define IDirect3DIndexBuffer8_Unlock(p) (p)->Unlock() 1046 | #define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->GetDesc(a) 1047 | #endif 1048 | 1049 | 1050 | 1051 | 1052 | #undef INTERFACE 1053 | #define INTERFACE IDirect3DSurface8 1054 | 1055 | DECLARE_INTERFACE_(IDirect3DSurface8, IUnknown) 1056 | { 1057 | /*** IUnknown methods ***/ 1058 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 1059 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 1060 | STDMETHOD_(ULONG,Release)(THIS) PURE; 1061 | 1062 | /*** IDirect3DSurface8 methods ***/ 1063 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1064 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 1065 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 1066 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1067 | STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; 1068 | STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; 1069 | STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; 1070 | STDMETHOD(UnlockRect)(THIS) PURE; 1071 | }; 1072 | 1073 | typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8; 1074 | 1075 | #if !defined(__cplusplus) || defined(CINTERFACE) 1076 | #define IDirect3DSurface8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1077 | #define IDirect3DSurface8_AddRef(p) (p)->lpVtbl->AddRef(p) 1078 | #define IDirect3DSurface8_Release(p) (p)->lpVtbl->Release(p) 1079 | #define IDirect3DSurface8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1080 | #define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1081 | #define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1082 | #define IDirect3DSurface8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1083 | #define IDirect3DSurface8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) 1084 | #define IDirect3DSurface8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1085 | #define IDirect3DSurface8_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) 1086 | #define IDirect3DSurface8_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) 1087 | #else 1088 | #define IDirect3DSurface8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1089 | #define IDirect3DSurface8_AddRef(p) (p)->AddRef() 1090 | #define IDirect3DSurface8_Release(p) (p)->Release() 1091 | #define IDirect3DSurface8_GetDevice(p,a) (p)->GetDevice(a) 1092 | #define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1093 | #define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1094 | #define IDirect3DSurface8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1095 | #define IDirect3DSurface8_GetContainer(p,a,b) (p)->GetContainer(a,b) 1096 | #define IDirect3DSurface8_GetDesc(p,a) (p)->GetDesc(a) 1097 | #define IDirect3DSurface8_LockRect(p,a,b,c) (p)->LockRect(a,b,c) 1098 | #define IDirect3DSurface8_UnlockRect(p) (p)->UnlockRect() 1099 | #endif 1100 | 1101 | 1102 | 1103 | 1104 | #undef INTERFACE 1105 | #define INTERFACE IDirect3DVolume8 1106 | 1107 | DECLARE_INTERFACE_(IDirect3DVolume8, IUnknown) 1108 | { 1109 | /*** IUnknown methods ***/ 1110 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 1111 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 1112 | STDMETHOD_(ULONG,Release)(THIS) PURE; 1113 | 1114 | /*** IDirect3DVolume8 methods ***/ 1115 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1116 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; 1117 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; 1118 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1119 | STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; 1120 | STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; 1121 | STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; 1122 | STDMETHOD(UnlockBox)(THIS) PURE; 1123 | }; 1124 | 1125 | typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8; 1126 | 1127 | #if !defined(__cplusplus) || defined(CINTERFACE) 1128 | #define IDirect3DVolume8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1129 | #define IDirect3DVolume8_AddRef(p) (p)->lpVtbl->AddRef(p) 1130 | #define IDirect3DVolume8_Release(p) (p)->lpVtbl->Release(p) 1131 | #define IDirect3DVolume8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1132 | #define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1133 | #define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1134 | #define IDirect3DVolume8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1135 | #define IDirect3DVolume8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) 1136 | #define IDirect3DVolume8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1137 | #define IDirect3DVolume8_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) 1138 | #define IDirect3DVolume8_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) 1139 | #else 1140 | #define IDirect3DVolume8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1141 | #define IDirect3DVolume8_AddRef(p) (p)->AddRef() 1142 | #define IDirect3DVolume8_Release(p) (p)->Release() 1143 | #define IDirect3DVolume8_GetDevice(p,a) (p)->GetDevice(a) 1144 | #define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1145 | #define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1146 | #define IDirect3DVolume8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1147 | #define IDirect3DVolume8_GetContainer(p,a,b) (p)->GetContainer(a,b) 1148 | #define IDirect3DVolume8_GetDesc(p,a) (p)->GetDesc(a) 1149 | #define IDirect3DVolume8_LockBox(p,a,b,c) (p)->LockBox(a,b,c) 1150 | #define IDirect3DVolume8_UnlockBox(p) (p)->UnlockBox() 1151 | #endif 1152 | 1153 | /**************************************************************************** 1154 | * Flags for SetPrivateData method on all D3D8 interfaces 1155 | * 1156 | * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData 1157 | * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this 1158 | * pointer and Release when the private data is destroyed. The data will be 1159 | * destroyed when another SetPrivateData with the same GUID is set, when 1160 | * FreePrivateData is called, or when the D3D8 object is freed. 1161 | ****************************************************************************/ 1162 | #define D3DSPD_IUNKNOWN 0x00000001L 1163 | 1164 | /**************************************************************************** 1165 | * 1166 | * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for 1167 | * the current mode only. 1168 | * 1169 | ****************************************************************************/ 1170 | 1171 | #define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL 1172 | 1173 | /**************************************************************************** 1174 | * 1175 | * Flags for IDirect3D8::CreateDevice's BehaviorFlags 1176 | * 1177 | ****************************************************************************/ 1178 | 1179 | #define D3DCREATE_FPU_PRESERVE 0x00000002L 1180 | #define D3DCREATE_MULTITHREADED 0x00000004L 1181 | 1182 | #define D3DCREATE_PUREDEVICE 0x00000010L 1183 | #define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L 1184 | #define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L 1185 | #define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L 1186 | 1187 | #define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L 1188 | 1189 | 1190 | /**************************************************************************** 1191 | * 1192 | * Parameter for IDirect3D8::CreateDevice's iAdapter 1193 | * 1194 | ****************************************************************************/ 1195 | 1196 | #define D3DADAPTER_DEFAULT 0 1197 | 1198 | /**************************************************************************** 1199 | * 1200 | * Flags for IDirect3D8::EnumAdapters 1201 | * 1202 | ****************************************************************************/ 1203 | 1204 | #define D3DENUM_NO_WHQL_LEVEL 0x00000002L 1205 | 1206 | /**************************************************************************** 1207 | * 1208 | * Maximum number of back-buffers supported in DX8 1209 | * 1210 | ****************************************************************************/ 1211 | 1212 | #define D3DPRESENT_BACK_BUFFERS_MAX 3L 1213 | 1214 | /**************************************************************************** 1215 | * 1216 | * Flags for IDirect3DDevice8::SetGammaRamp 1217 | * 1218 | ****************************************************************************/ 1219 | 1220 | #define D3DSGR_NO_CALIBRATION 0x00000000L 1221 | #define D3DSGR_CALIBRATE 0x00000001L 1222 | 1223 | /**************************************************************************** 1224 | * 1225 | * Flags for IDirect3DDevice8::SetCursorPosition 1226 | * 1227 | ****************************************************************************/ 1228 | 1229 | #define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L 1230 | 1231 | /**************************************************************************** 1232 | * 1233 | * Flags for DrawPrimitive/DrawIndexedPrimitive 1234 | * Also valid for Begin/BeginIndexed 1235 | * Also valid for VertexBuffer::CreateVertexBuffer 1236 | ****************************************************************************/ 1237 | 1238 | 1239 | /* 1240 | * DirectDraw error codes 1241 | */ 1242 | #define _FACD3D 0x876 1243 | #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) 1244 | 1245 | /* 1246 | * Direct3D Errors 1247 | */ 1248 | #define D3D_OK S_OK 1249 | 1250 | #define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) 1251 | #define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) 1252 | #define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) 1253 | #define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) 1254 | #define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) 1255 | #define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) 1256 | #define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) 1257 | #define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) 1258 | #define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) 1259 | #define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) 1260 | #define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) 1261 | #define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) 1262 | 1263 | #define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) 1264 | #define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) 1265 | #define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) 1266 | #define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) 1267 | #define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) 1268 | #define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) 1269 | #define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) 1270 | #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) 1271 | #define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) 1272 | 1273 | #ifdef __cplusplus 1274 | }; 1275 | #endif 1276 | 1277 | #endif /* (DIRECT3D_VERSION >= 0x0800) */ 1278 | #endif /* _D3D_H_ */ 1279 | 1280 | -------------------------------------------------------------------------------- /src/d3d8caps.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3d8caps.h 6 | * Content: Direct3D capabilities include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef _D3D8CAPS_H 11 | #define _D3D8CAPS_H 12 | 13 | #ifndef DIRECT3D_VERSION 14 | #define DIRECT3D_VERSION 0x0800 15 | #endif //DIRECT3D_VERSION 16 | 17 | // include this file content only if compiling for DX8 interfaces 18 | #if(DIRECT3D_VERSION >= 0x0800) 19 | 20 | #if defined(_X86_) || defined(_IA64_) 21 | #pragma pack(4) 22 | #endif 23 | 24 | typedef struct _D3DCAPS8 25 | { 26 | /* Device Info */ 27 | D3DDEVTYPE DeviceType; 28 | UINT AdapterOrdinal; 29 | 30 | /* Caps from DX7 Draw */ 31 | DWORD Caps; 32 | DWORD Caps2; 33 | DWORD Caps3; 34 | DWORD PresentationIntervals; 35 | 36 | /* Cursor Caps */ 37 | DWORD CursorCaps; 38 | 39 | /* 3D Device Caps */ 40 | DWORD DevCaps; 41 | 42 | DWORD PrimitiveMiscCaps; 43 | DWORD RasterCaps; 44 | DWORD ZCmpCaps; 45 | DWORD SrcBlendCaps; 46 | DWORD DestBlendCaps; 47 | DWORD AlphaCmpCaps; 48 | DWORD ShadeCaps; 49 | DWORD TextureCaps; 50 | DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's 51 | DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's 52 | DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's 53 | DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's 54 | DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's 55 | 56 | DWORD LineCaps; // D3DLINECAPS 57 | 58 | DWORD MaxTextureWidth, MaxTextureHeight; 59 | DWORD MaxVolumeExtent; 60 | 61 | DWORD MaxTextureRepeat; 62 | DWORD MaxTextureAspectRatio; 63 | DWORD MaxAnisotropy; 64 | float MaxVertexW; 65 | 66 | float GuardBandLeft; 67 | float GuardBandTop; 68 | float GuardBandRight; 69 | float GuardBandBottom; 70 | 71 | float ExtentsAdjust; 72 | DWORD StencilCaps; 73 | 74 | DWORD FVFCaps; 75 | DWORD TextureOpCaps; 76 | DWORD MaxTextureBlendStages; 77 | DWORD MaxSimultaneousTextures; 78 | 79 | DWORD VertexProcessingCaps; 80 | DWORD MaxActiveLights; 81 | DWORD MaxUserClipPlanes; 82 | DWORD MaxVertexBlendMatrices; 83 | DWORD MaxVertexBlendMatrixIndex; 84 | 85 | float MaxPointSize; 86 | 87 | DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call 88 | DWORD MaxVertexIndex; 89 | DWORD MaxStreams; 90 | DWORD MaxStreamStride; // max stride for SetStreamSource 91 | 92 | DWORD VertexShaderVersion; 93 | DWORD MaxVertexShaderConst; // number of vertex shader constant registers 94 | 95 | DWORD PixelShaderVersion; 96 | float MaxPixelShaderValue; // max value of pixel shader arithmetic component 97 | 98 | } D3DCAPS8; 99 | 100 | // 101 | // BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS 102 | // 103 | 104 | // 105 | // Caps 106 | // 107 | #define D3DCAPS_READ_SCANLINE 0x00020000L 108 | 109 | // 110 | // Caps2 111 | // 112 | #define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L 113 | #define D3DCAPS2_FULLSCREENGAMMA 0x00020000L 114 | #define D3DCAPS2_CANRENDERWINDOWED 0x00080000L 115 | #define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L 116 | #define D3DCAPS2_RESERVED 0x02000000L 117 | #define D3DCAPS2_CANMANAGERESOURCE 0x10000000L 118 | #define D3DCAPS2_DYNAMICTEXTURES 0x20000000L 119 | 120 | // 121 | // Caps3 122 | // 123 | #define D3DCAPS3_RESERVED 0x8000001fL 124 | 125 | // Indicates that the device can respect the ALPHABLENDENABLE render state 126 | // when fullscreen while using the FLIP or DISCARD swap effect. 127 | // COPY and COPYVSYNC swap effects work whether or not this flag is set. 128 | #define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L 129 | 130 | // 131 | // PresentationIntervals 132 | // 133 | #define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L 134 | #define D3DPRESENT_INTERVAL_ONE 0x00000001L 135 | #define D3DPRESENT_INTERVAL_TWO 0x00000002L 136 | #define D3DPRESENT_INTERVAL_THREE 0x00000004L 137 | #define D3DPRESENT_INTERVAL_FOUR 0x00000008L 138 | #define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L 139 | 140 | // 141 | // CursorCaps 142 | // 143 | // Driver supports HW color cursor in at least hi-res modes(height >=400) 144 | #define D3DCURSORCAPS_COLOR 0x00000001L 145 | // Driver supports HW cursor also in low-res modes(height < 400) 146 | #define D3DCURSORCAPS_LOWRES 0x00000002L 147 | 148 | // 149 | // DevCaps 150 | // 151 | #define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ 152 | #define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ 153 | #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ 154 | #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ 155 | #define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ 156 | #define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ 157 | #define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ 158 | #define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ 159 | #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ 160 | #define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ 161 | #define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ 162 | #define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ 163 | #define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ 164 | #define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ 165 | #define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ 166 | #define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ 167 | #define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ 168 | #define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ 169 | #define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ 170 | #define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ 171 | 172 | // 173 | // PrimitiveMiscCaps 174 | // 175 | #define D3DPMISCCAPS_MASKZ 0x00000002L 176 | #define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L 177 | #define D3DPMISCCAPS_CULLNONE 0x00000010L 178 | #define D3DPMISCCAPS_CULLCW 0x00000020L 179 | #define D3DPMISCCAPS_CULLCCW 0x00000040L 180 | #define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L 181 | #define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ 182 | #define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ 183 | #define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ 184 | #define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ 185 | #define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ 186 | 187 | // 188 | // LineCaps 189 | // 190 | #define D3DLINECAPS_TEXTURE 0x00000001L 191 | #define D3DLINECAPS_ZTEST 0x00000002L 192 | #define D3DLINECAPS_BLEND 0x00000004L 193 | #define D3DLINECAPS_ALPHACMP 0x00000008L 194 | #define D3DLINECAPS_FOG 0x00000010L 195 | 196 | // 197 | // RasterCaps 198 | // 199 | #define D3DPRASTERCAPS_DITHER 0x00000001L 200 | #define D3DPRASTERCAPS_PAT 0x00000008L 201 | #define D3DPRASTERCAPS_ZTEST 0x00000010L 202 | #define D3DPRASTERCAPS_FOGVERTEX 0x00000080L 203 | #define D3DPRASTERCAPS_FOGTABLE 0x00000100L 204 | #define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L 205 | #define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L 206 | #define D3DPRASTERCAPS_ZBIAS 0x00004000L 207 | #define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L 208 | #define D3DPRASTERCAPS_FOGRANGE 0x00010000L 209 | #define D3DPRASTERCAPS_ANISOTROPY 0x00020000L 210 | #define D3DPRASTERCAPS_WBUFFER 0x00040000L 211 | #define D3DPRASTERCAPS_WFOG 0x00100000L 212 | #define D3DPRASTERCAPS_ZFOG 0x00200000L 213 | #define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ 214 | #define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L 215 | 216 | // 217 | // ZCmpCaps, AlphaCmpCaps 218 | // 219 | #define D3DPCMPCAPS_NEVER 0x00000001L 220 | #define D3DPCMPCAPS_LESS 0x00000002L 221 | #define D3DPCMPCAPS_EQUAL 0x00000004L 222 | #define D3DPCMPCAPS_LESSEQUAL 0x00000008L 223 | #define D3DPCMPCAPS_GREATER 0x00000010L 224 | #define D3DPCMPCAPS_NOTEQUAL 0x00000020L 225 | #define D3DPCMPCAPS_GREATEREQUAL 0x00000040L 226 | #define D3DPCMPCAPS_ALWAYS 0x00000080L 227 | 228 | // 229 | // SourceBlendCaps, DestBlendCaps 230 | // 231 | #define D3DPBLENDCAPS_ZERO 0x00000001L 232 | #define D3DPBLENDCAPS_ONE 0x00000002L 233 | #define D3DPBLENDCAPS_SRCCOLOR 0x00000004L 234 | #define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L 235 | #define D3DPBLENDCAPS_SRCALPHA 0x00000010L 236 | #define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L 237 | #define D3DPBLENDCAPS_DESTALPHA 0x00000040L 238 | #define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L 239 | #define D3DPBLENDCAPS_DESTCOLOR 0x00000100L 240 | #define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L 241 | #define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L 242 | #define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L 243 | #define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L 244 | 245 | // 246 | // ShadeCaps 247 | // 248 | #define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L 249 | #define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L 250 | #define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L 251 | #define D3DPSHADECAPS_FOGGOURAUD 0x00080000L 252 | 253 | // 254 | // TextureCaps 255 | // 256 | #define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ 257 | #define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ 258 | #define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ 259 | #define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ 260 | #define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ 261 | #define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ 262 | // Device can use non-POW2 textures if: 263 | // 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage 264 | // 2) D3DRS_WRAP(N) is zero for this texture's coordinates 265 | // 3) mip mapping is not enabled (use magnification filter only) 266 | #define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L 267 | #define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ 268 | #define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ 269 | #define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ 270 | #define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ 271 | #define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ 272 | #define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ 273 | #define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ 274 | #define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ 275 | 276 | // 277 | // TextureFilterCaps 278 | // 279 | #define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ 280 | #define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L 281 | #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L 282 | #define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ 283 | #define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L 284 | #define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ 285 | #define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L 286 | #define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L 287 | #define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L 288 | #define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L 289 | 290 | // 291 | // TextureAddressCaps 292 | // 293 | #define D3DPTADDRESSCAPS_WRAP 0x00000001L 294 | #define D3DPTADDRESSCAPS_MIRROR 0x00000002L 295 | #define D3DPTADDRESSCAPS_CLAMP 0x00000004L 296 | #define D3DPTADDRESSCAPS_BORDER 0x00000008L 297 | #define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L 298 | #define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L 299 | 300 | // 301 | // StencilCaps 302 | // 303 | #define D3DSTENCILCAPS_KEEP 0x00000001L 304 | #define D3DSTENCILCAPS_ZERO 0x00000002L 305 | #define D3DSTENCILCAPS_REPLACE 0x00000004L 306 | #define D3DSTENCILCAPS_INCRSAT 0x00000008L 307 | #define D3DSTENCILCAPS_DECRSAT 0x00000010L 308 | #define D3DSTENCILCAPS_INVERT 0x00000020L 309 | #define D3DSTENCILCAPS_INCR 0x00000040L 310 | #define D3DSTENCILCAPS_DECR 0x00000080L 311 | 312 | // 313 | // TextureOpCaps 314 | // 315 | #define D3DTEXOPCAPS_DISABLE 0x00000001L 316 | #define D3DTEXOPCAPS_SELECTARG1 0x00000002L 317 | #define D3DTEXOPCAPS_SELECTARG2 0x00000004L 318 | #define D3DTEXOPCAPS_MODULATE 0x00000008L 319 | #define D3DTEXOPCAPS_MODULATE2X 0x00000010L 320 | #define D3DTEXOPCAPS_MODULATE4X 0x00000020L 321 | #define D3DTEXOPCAPS_ADD 0x00000040L 322 | #define D3DTEXOPCAPS_ADDSIGNED 0x00000080L 323 | #define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L 324 | #define D3DTEXOPCAPS_SUBTRACT 0x00000200L 325 | #define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L 326 | #define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L 327 | #define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L 328 | #define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L 329 | #define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L 330 | #define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L 331 | #define D3DTEXOPCAPS_PREMODULATE 0x00010000L 332 | #define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L 333 | #define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L 334 | #define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L 335 | #define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L 336 | #define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L 337 | #define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L 338 | #define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L 339 | #define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L 340 | #define D3DTEXOPCAPS_LERP 0x02000000L 341 | 342 | // 343 | // FVFCaps 344 | // 345 | #define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ 346 | #define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ 347 | #define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ 348 | 349 | // 350 | // VertexProcessingCaps 351 | // 352 | #define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ 353 | #define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ 354 | #define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ 355 | #define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ 356 | #define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ 357 | #define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ 358 | #define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */ 359 | 360 | #pragma pack() 361 | 362 | #endif /* (DIRECT3D_VERSION >= 0x0800) */ 363 | #endif /* _D3D8CAPS_H_ */ 364 | 365 | -------------------------------------------------------------------------------- /src/d3d8types.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3d8types.h 6 | * Content: Direct3D capabilities include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef _D3D8TYPES_H_ 11 | #define _D3D8TYPES_H_ 12 | 13 | #ifndef DIRECT3D_VERSION 14 | #define DIRECT3D_VERSION 0x0800 15 | #endif //DIRECT3D_VERSION 16 | 17 | // include this file content only if compiling for DX8 interfaces 18 | #if(DIRECT3D_VERSION >= 0x0800) 19 | 20 | #include 21 | 22 | #if _MSC_VER >= 1200 23 | #pragma warning(push) 24 | #endif 25 | #pragma warning(disable:4201) // anonymous unions warning 26 | #if defined(_X86_) || defined(_IA64_) 27 | #pragma pack(4) 28 | #endif 29 | 30 | // D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 31 | #ifndef D3DCOLOR_DEFINED 32 | typedef DWORD D3DCOLOR; 33 | #define D3DCOLOR_DEFINED 34 | #endif 35 | 36 | // maps unsigned 8 bits/channel to D3DCOLOR 37 | #define D3DCOLOR_ARGB(a,r,g,b) \ 38 | ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) 39 | #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) 40 | #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) 41 | 42 | // maps floating point channels (0.f to 1.f range) to D3DCOLOR 43 | #define D3DCOLOR_COLORVALUE(r,g,b,a) \ 44 | D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) 45 | 46 | 47 | #ifndef D3DVECTOR_DEFINED 48 | typedef struct _D3DVECTOR { 49 | float x; 50 | float y; 51 | float z; 52 | } D3DVECTOR; 53 | #define D3DVECTOR_DEFINED 54 | #endif 55 | 56 | #ifndef D3DCOLORVALUE_DEFINED 57 | typedef struct _D3DCOLORVALUE { 58 | float r; 59 | float g; 60 | float b; 61 | float a; 62 | } D3DCOLORVALUE; 63 | #define D3DCOLORVALUE_DEFINED 64 | #endif 65 | 66 | #ifndef D3DRECT_DEFINED 67 | typedef struct _D3DRECT { 68 | LONG x1; 69 | LONG y1; 70 | LONG x2; 71 | LONG y2; 72 | } D3DRECT; 73 | #define D3DRECT_DEFINED 74 | #endif 75 | 76 | #ifndef D3DMATRIX_DEFINED 77 | typedef struct _D3DMATRIX { 78 | union { 79 | struct { 80 | float _11, _12, _13, _14; 81 | float _21, _22, _23, _24; 82 | float _31, _32, _33, _34; 83 | float _41, _42, _43, _44; 84 | 85 | }; 86 | float m[4][4]; 87 | }; 88 | } D3DMATRIX; 89 | #define D3DMATRIX_DEFINED 90 | #endif 91 | 92 | typedef struct _D3DVIEWPORT8 { 93 | DWORD X; 94 | DWORD Y; /* Viewport Top left */ 95 | DWORD Width; 96 | DWORD Height; /* Viewport Dimensions */ 97 | float MinZ; /* Min/max of clip Volume */ 98 | float MaxZ; 99 | } D3DVIEWPORT8; 100 | 101 | /* 102 | * Values for clip fields. 103 | */ 104 | 105 | // Max number of user clipping planes, supported in D3D. 106 | #define D3DMAXUSERCLIPPLANES 32 107 | 108 | // These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE 109 | // 110 | #define D3DCLIPPLANE0 (1 << 0) 111 | #define D3DCLIPPLANE1 (1 << 1) 112 | #define D3DCLIPPLANE2 (1 << 2) 113 | #define D3DCLIPPLANE3 (1 << 3) 114 | #define D3DCLIPPLANE4 (1 << 4) 115 | #define D3DCLIPPLANE5 (1 << 5) 116 | 117 | // The following bits are used in the ClipUnion and ClipIntersection 118 | // members of the D3DCLIPSTATUS8 119 | // 120 | 121 | #define D3DCS_LEFT 0x00000001L 122 | #define D3DCS_RIGHT 0x00000002L 123 | #define D3DCS_TOP 0x00000004L 124 | #define D3DCS_BOTTOM 0x00000008L 125 | #define D3DCS_FRONT 0x00000010L 126 | #define D3DCS_BACK 0x00000020L 127 | #define D3DCS_PLANE0 0x00000040L 128 | #define D3DCS_PLANE1 0x00000080L 129 | #define D3DCS_PLANE2 0x00000100L 130 | #define D3DCS_PLANE3 0x00000200L 131 | #define D3DCS_PLANE4 0x00000400L 132 | #define D3DCS_PLANE5 0x00000800L 133 | 134 | #define D3DCS_ALL (D3DCS_LEFT | \ 135 | D3DCS_RIGHT | \ 136 | D3DCS_TOP | \ 137 | D3DCS_BOTTOM | \ 138 | D3DCS_FRONT | \ 139 | D3DCS_BACK | \ 140 | D3DCS_PLANE0 | \ 141 | D3DCS_PLANE1 | \ 142 | D3DCS_PLANE2 | \ 143 | D3DCS_PLANE3 | \ 144 | D3DCS_PLANE4 | \ 145 | D3DCS_PLANE5) 146 | 147 | typedef struct _D3DCLIPSTATUS8 { 148 | DWORD ClipUnion; 149 | DWORD ClipIntersection; 150 | } D3DCLIPSTATUS8; 151 | 152 | typedef struct _D3DMATERIAL8 { 153 | D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ 154 | D3DCOLORVALUE Ambient; /* Ambient color RGB */ 155 | D3DCOLORVALUE Specular; /* Specular 'shininess' */ 156 | D3DCOLORVALUE Emissive; /* Emissive color RGB */ 157 | float Power; /* Sharpness if specular highlight */ 158 | } D3DMATERIAL8; 159 | 160 | typedef enum _D3DLIGHTTYPE { 161 | D3DLIGHT_POINT = 1, 162 | D3DLIGHT_SPOT = 2, 163 | D3DLIGHT_DIRECTIONAL = 3, 164 | D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 165 | } D3DLIGHTTYPE; 166 | 167 | typedef struct _D3DLIGHT8 { 168 | D3DLIGHTTYPE Type; /* Type of light source */ 169 | D3DCOLORVALUE Diffuse; /* Diffuse color of light */ 170 | D3DCOLORVALUE Specular; /* Specular color of light */ 171 | D3DCOLORVALUE Ambient; /* Ambient color of light */ 172 | D3DVECTOR Position; /* Position in world space */ 173 | D3DVECTOR Direction; /* Direction in world space */ 174 | float Range; /* Cutoff range */ 175 | float Falloff; /* Falloff */ 176 | float Attenuation0; /* Constant attenuation */ 177 | float Attenuation1; /* Linear attenuation */ 178 | float Attenuation2; /* Quadratic attenuation */ 179 | float Theta; /* Inner angle of spotlight cone */ 180 | float Phi; /* Outer angle of spotlight cone */ 181 | } D3DLIGHT8; 182 | 183 | /* 184 | * Options for clearing 185 | */ 186 | #define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ 187 | #define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ 188 | #define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ 189 | 190 | /* 191 | * The following defines the rendering states 192 | */ 193 | 194 | typedef enum _D3DSHADEMODE { 195 | D3DSHADE_FLAT = 1, 196 | D3DSHADE_GOURAUD = 2, 197 | D3DSHADE_PHONG = 3, 198 | D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 199 | } D3DSHADEMODE; 200 | 201 | typedef enum _D3DFILLMODE { 202 | D3DFILL_POINT = 1, 203 | D3DFILL_WIREFRAME = 2, 204 | D3DFILL_SOLID = 3, 205 | D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 206 | } D3DFILLMODE; 207 | 208 | typedef struct _D3DLINEPATTERN { 209 | WORD wRepeatFactor; 210 | WORD wLinePattern; 211 | } D3DLINEPATTERN; 212 | 213 | typedef enum _D3DBLEND { 214 | D3DBLEND_ZERO = 1, 215 | D3DBLEND_ONE = 2, 216 | D3DBLEND_SRCCOLOR = 3, 217 | D3DBLEND_INVSRCCOLOR = 4, 218 | D3DBLEND_SRCALPHA = 5, 219 | D3DBLEND_INVSRCALPHA = 6, 220 | D3DBLEND_DESTALPHA = 7, 221 | D3DBLEND_INVDESTALPHA = 8, 222 | D3DBLEND_DESTCOLOR = 9, 223 | D3DBLEND_INVDESTCOLOR = 10, 224 | D3DBLEND_SRCALPHASAT = 11, 225 | D3DBLEND_BOTHSRCALPHA = 12, 226 | D3DBLEND_BOTHINVSRCALPHA = 13, 227 | D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 228 | } D3DBLEND; 229 | 230 | typedef enum _D3DBLENDOP { 231 | D3DBLENDOP_ADD = 1, 232 | D3DBLENDOP_SUBTRACT = 2, 233 | D3DBLENDOP_REVSUBTRACT = 3, 234 | D3DBLENDOP_MIN = 4, 235 | D3DBLENDOP_MAX = 5, 236 | D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 237 | } D3DBLENDOP; 238 | 239 | typedef enum _D3DTEXTUREADDRESS { 240 | D3DTADDRESS_WRAP = 1, 241 | D3DTADDRESS_MIRROR = 2, 242 | D3DTADDRESS_CLAMP = 3, 243 | D3DTADDRESS_BORDER = 4, 244 | D3DTADDRESS_MIRRORONCE = 5, 245 | D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 246 | } D3DTEXTUREADDRESS; 247 | 248 | typedef enum _D3DCULL { 249 | D3DCULL_NONE = 1, 250 | D3DCULL_CW = 2, 251 | D3DCULL_CCW = 3, 252 | D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 253 | } D3DCULL; 254 | 255 | typedef enum _D3DCMPFUNC { 256 | D3DCMP_NEVER = 1, 257 | D3DCMP_LESS = 2, 258 | D3DCMP_EQUAL = 3, 259 | D3DCMP_LESSEQUAL = 4, 260 | D3DCMP_GREATER = 5, 261 | D3DCMP_NOTEQUAL = 6, 262 | D3DCMP_GREATEREQUAL = 7, 263 | D3DCMP_ALWAYS = 8, 264 | D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 265 | } D3DCMPFUNC; 266 | 267 | typedef enum _D3DSTENCILOP { 268 | D3DSTENCILOP_KEEP = 1, 269 | D3DSTENCILOP_ZERO = 2, 270 | D3DSTENCILOP_REPLACE = 3, 271 | D3DSTENCILOP_INCRSAT = 4, 272 | D3DSTENCILOP_DECRSAT = 5, 273 | D3DSTENCILOP_INVERT = 6, 274 | D3DSTENCILOP_INCR = 7, 275 | D3DSTENCILOP_DECR = 8, 276 | D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 277 | } D3DSTENCILOP; 278 | 279 | typedef enum _D3DFOGMODE { 280 | D3DFOG_NONE = 0, 281 | D3DFOG_EXP = 1, 282 | D3DFOG_EXP2 = 2, 283 | D3DFOG_LINEAR = 3, 284 | D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 285 | } D3DFOGMODE; 286 | 287 | typedef enum _D3DZBUFFERTYPE { 288 | D3DZB_FALSE = 0, 289 | D3DZB_TRUE = 1, // Z buffering 290 | D3DZB_USEW = 2, // W buffering 291 | D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 292 | } D3DZBUFFERTYPE; 293 | 294 | // Primitives supported by draw-primitive API 295 | typedef enum _D3DPRIMITIVETYPE { 296 | D3DPT_POINTLIST = 1, 297 | D3DPT_LINELIST = 2, 298 | D3DPT_LINESTRIP = 3, 299 | D3DPT_TRIANGLELIST = 4, 300 | D3DPT_TRIANGLESTRIP = 5, 301 | D3DPT_TRIANGLEFAN = 6, 302 | D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 303 | } D3DPRIMITIVETYPE; 304 | 305 | typedef enum _D3DTRANSFORMSTATETYPE { 306 | D3DTS_VIEW = 2, 307 | D3DTS_PROJECTION = 3, 308 | D3DTS_TEXTURE0 = 16, 309 | D3DTS_TEXTURE1 = 17, 310 | D3DTS_TEXTURE2 = 18, 311 | D3DTS_TEXTURE3 = 19, 312 | D3DTS_TEXTURE4 = 20, 313 | D3DTS_TEXTURE5 = 21, 314 | D3DTS_TEXTURE6 = 22, 315 | D3DTS_TEXTURE7 = 23, 316 | D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 317 | } D3DTRANSFORMSTATETYPE; 318 | 319 | #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) 320 | #define D3DTS_WORLD D3DTS_WORLDMATRIX(0) 321 | #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) 322 | #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) 323 | #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) 324 | 325 | typedef enum _D3DRENDERSTATETYPE { 326 | D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ 327 | D3DRS_FILLMODE = 8, /* D3DFILLMODE */ 328 | D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ 329 | D3DRS_LINEPATTERN = 10, /* D3DLINEPATTERN */ 330 | D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ 331 | D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ 332 | D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ 333 | D3DRS_SRCBLEND = 19, /* D3DBLEND */ 334 | D3DRS_DESTBLEND = 20, /* D3DBLEND */ 335 | D3DRS_CULLMODE = 22, /* D3DCULL */ 336 | D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ 337 | D3DRS_ALPHAREF = 24, /* D3DFIXED */ 338 | D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ 339 | D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ 340 | D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ 341 | D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ 342 | D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ 343 | D3DRS_ZVISIBLE = 30, /* TRUE to enable z checking */ 344 | D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ 345 | D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ 346 | D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ 347 | D3DRS_FOGEND = 37, /* Fog end */ 348 | D3DRS_FOGDENSITY = 38, /* Fog density */ 349 | D3DRS_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ 350 | D3DRS_ZBIAS = 47, /* LONG Z bias */ 351 | D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ 352 | D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ 353 | D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ 354 | D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ 355 | D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ 356 | D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ 357 | D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ 358 | D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ 359 | D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ 360 | D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ 361 | D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ 362 | D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ 363 | D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ 364 | D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ 365 | D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ 366 | D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ 367 | D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ 368 | D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ 369 | D3DRS_CLIPPING = 136, 370 | D3DRS_LIGHTING = 137, 371 | D3DRS_AMBIENT = 139, 372 | D3DRS_FOGVERTEXMODE = 140, 373 | D3DRS_COLORVERTEX = 141, 374 | D3DRS_LOCALVIEWER = 142, 375 | D3DRS_NORMALIZENORMALS = 143, 376 | D3DRS_DIFFUSEMATERIALSOURCE = 145, 377 | D3DRS_SPECULARMATERIALSOURCE = 146, 378 | D3DRS_AMBIENTMATERIALSOURCE = 147, 379 | D3DRS_EMISSIVEMATERIALSOURCE = 148, 380 | D3DRS_VERTEXBLEND = 151, 381 | D3DRS_CLIPPLANEENABLE = 152, 382 | D3DRS_SOFTWAREVERTEXPROCESSING = 153, 383 | D3DRS_POINTSIZE = 154, /* float point size */ 384 | D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ 385 | D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ 386 | D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ 387 | D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ 388 | D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ 389 | D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ 390 | D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer 391 | D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable 392 | D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation 393 | D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches 394 | D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor 395 | D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ 396 | D3DRS_INDEXEDVERTEXBLENDENABLE = 167, 397 | D3DRS_COLORWRITEENABLE = 168, // per-channel write enable 398 | D3DRS_TWEENFACTOR = 170, // float tween factor 399 | D3DRS_BLENDOP = 171, // D3DBLENDOP setting 400 | D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) 401 | D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC 402 | 403 | D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 404 | } D3DRENDERSTATETYPE; 405 | 406 | // Values for material source 407 | typedef enum _D3DMATERIALCOLORSOURCE 408 | { 409 | D3DMCS_MATERIAL = 0, // Color from material is used 410 | D3DMCS_COLOR1 = 1, // Diffuse vertex color is used 411 | D3DMCS_COLOR2 = 2, // Specular vertex color is used 412 | D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum 413 | } D3DMATERIALCOLORSOURCE; 414 | 415 | // Bias to apply to the texture coordinate set to apply a wrap to. 416 | #define D3DRENDERSTATE_WRAPBIAS 128UL 417 | 418 | /* Flags to construct the WRAP render states */ 419 | #define D3DWRAP_U 0x00000001L 420 | #define D3DWRAP_V 0x00000002L 421 | #define D3DWRAP_W 0x00000004L 422 | 423 | /* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ 424 | #define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U 425 | #define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V 426 | #define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W 427 | #define D3DWRAPCOORD_3 0x00000008L 428 | 429 | /* Flags to construct D3DRS_COLORWRITEENABLE */ 430 | #define D3DCOLORWRITEENABLE_RED (1L<<0) 431 | #define D3DCOLORWRITEENABLE_GREEN (1L<<1) 432 | #define D3DCOLORWRITEENABLE_BLUE (1L<<2) 433 | #define D3DCOLORWRITEENABLE_ALPHA (1L<<3) 434 | 435 | /* 436 | * State enumerants for per-stage texture processing. 437 | */ 438 | typedef enum _D3DTEXTURESTAGESTATETYPE 439 | { 440 | D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ 441 | D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ 442 | D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ 443 | D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ 444 | D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ 445 | D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ 446 | D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ 447 | D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ 448 | D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ 449 | D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ 450 | D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ 451 | D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ 452 | D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ 453 | D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ 454 | D3DTSS_MAGFILTER = 16, /* D3DTEXTUREFILTER filter to use for magnification */ 455 | D3DTSS_MINFILTER = 17, /* D3DTEXTUREFILTER filter to use for minification */ 456 | D3DTSS_MIPFILTER = 18, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ 457 | D3DTSS_MIPMAPLODBIAS = 19, /* float Mipmap LOD bias */ 458 | D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ 459 | D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ 460 | D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ 461 | D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ 462 | D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ 463 | D3DTSS_ADDRESSW = 25, /* D3DTEXTUREADDRESS for W coordinate */ 464 | D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ 465 | D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ 466 | D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ 467 | D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ 468 | } D3DTEXTURESTAGESTATETYPE; 469 | 470 | // Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position 471 | // and normal in the camera space) should be taken as texture coordinates 472 | // Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from 473 | // 474 | #define D3DTSS_TCI_PASSTHRU 0x00000000 475 | #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 476 | #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 477 | #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 478 | 479 | /* 480 | * Enumerations for COLOROP and ALPHAOP texture blending operations set in 481 | * texture processing stage controls in D3DTSS. 482 | */ 483 | typedef enum _D3DTEXTUREOP 484 | { 485 | // Control 486 | D3DTOP_DISABLE = 1, // disables stage 487 | D3DTOP_SELECTARG1 = 2, // the default 488 | D3DTOP_SELECTARG2 = 3, 489 | 490 | // Modulate 491 | D3DTOP_MODULATE = 4, // multiply args together 492 | D3DTOP_MODULATE2X = 5, // multiply and 1 bit 493 | D3DTOP_MODULATE4X = 6, // multiply and 2 bits 494 | 495 | // Add 496 | D3DTOP_ADD = 7, // add arguments together 497 | D3DTOP_ADDSIGNED = 8, // add with -0.5 bias 498 | D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit 499 | D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation 500 | D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product 501 | // Arg1 + Arg2 - Arg1*Arg2 502 | // = Arg1 + (1-Arg1)*Arg2 503 | 504 | // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) 505 | D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha 506 | D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha 507 | D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR 508 | 509 | // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) 510 | D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha 511 | D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color 512 | 513 | // Specular mapping 514 | D3DTOP_PREMODULATE = 17, // modulate with next texture before use 515 | D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB 516 | // COLOROP only 517 | D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A 518 | // COLOROP only 519 | D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB 520 | // COLOROP only 521 | D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A 522 | // COLOROP only 523 | 524 | // Bump mapping 525 | D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation 526 | D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel 527 | 528 | // This can do either diffuse or specular bump mapping with correct input. 529 | // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) 530 | // where each component has been scaled and offset to make it signed. 531 | // The result is replicated into all four (including alpha) channels. 532 | // This is a valid COLOROP only. 533 | D3DTOP_DOTPRODUCT3 = 24, 534 | 535 | // Triadic ops 536 | D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 537 | D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 538 | 539 | D3DTOP_FORCE_DWORD = 0x7fffffff, 540 | } D3DTEXTUREOP; 541 | 542 | /* 543 | * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending 544 | * operations set in texture processing stage controls in D3DRENDERSTATE. 545 | */ 546 | #define D3DTA_SELECTMASK 0x0000000f // mask for arg selector 547 | #define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) 548 | #define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) 549 | #define D3DTA_TEXTURE 0x00000002 // select texture color (read only) 550 | #define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) 551 | #define D3DTA_SPECULAR 0x00000004 // select specular color (read only) 552 | #define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) 553 | #define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) 554 | #define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) 555 | 556 | // 557 | // Values for D3DTSS_***FILTER texture stage states 558 | // 559 | typedef enum _D3DTEXTUREFILTERTYPE 560 | { 561 | D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) 562 | D3DTEXF_POINT = 1, // nearest 563 | D3DTEXF_LINEAR = 2, // linear interpolation 564 | D3DTEXF_ANISOTROPIC = 3, // anisotropic 565 | D3DTEXF_FLATCUBIC = 4, // cubic 566 | D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel 567 | D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum 568 | } D3DTEXTUREFILTERTYPE; 569 | 570 | /* Bits for Flags in ProcessVertices call */ 571 | 572 | #define D3DPV_DONOTCOPYDATA (1 << 0) 573 | 574 | //------------------------------------------------------------------- 575 | 576 | // Flexible vertex format bits 577 | // 578 | #define D3DFVF_RESERVED0 0x001 579 | #define D3DFVF_POSITION_MASK 0x00E 580 | #define D3DFVF_XYZ 0x002 581 | #define D3DFVF_XYZRHW 0x004 582 | #define D3DFVF_XYZB1 0x006 583 | #define D3DFVF_XYZB2 0x008 584 | #define D3DFVF_XYZB3 0x00a 585 | #define D3DFVF_XYZB4 0x00c 586 | #define D3DFVF_XYZB5 0x00e 587 | 588 | #define D3DFVF_NORMAL 0x010 589 | #define D3DFVF_PSIZE 0x020 590 | #define D3DFVF_DIFFUSE 0x040 591 | #define D3DFVF_SPECULAR 0x080 592 | 593 | #define D3DFVF_TEXCOUNT_MASK 0xf00 594 | #define D3DFVF_TEXCOUNT_SHIFT 8 595 | #define D3DFVF_TEX0 0x000 596 | #define D3DFVF_TEX1 0x100 597 | #define D3DFVF_TEX2 0x200 598 | #define D3DFVF_TEX3 0x300 599 | #define D3DFVF_TEX4 0x400 600 | #define D3DFVF_TEX5 0x500 601 | #define D3DFVF_TEX6 0x600 602 | #define D3DFVF_TEX7 0x700 603 | #define D3DFVF_TEX8 0x800 604 | 605 | #define D3DFVF_LASTBETA_UBYTE4 0x1000 606 | 607 | #define D3DFVF_RESERVED2 0xE000 // 4 reserved bits 608 | 609 | //--------------------------------------------------------------------- 610 | // Vertex Shaders 611 | // 612 | 613 | /* 614 | 615 | Vertex Shader Declaration 616 | 617 | The declaration portion of a vertex shader defines the static external 618 | interface of the shader. The information in the declaration includes: 619 | 620 | - Assignments of vertex shader input registers to data streams. These 621 | assignments bind a specific vertex register to a single component within a 622 | vertex stream. A vertex stream element is identified by a byte offset 623 | within the stream and a type. The type specifies the arithmetic data type 624 | plus the dimensionality (1, 2, 3, or 4 values). Stream data which is 625 | less than 4 values are always expanded out to 4 values with zero or more 626 | 0.F values and one 1.F value. 627 | 628 | - Assignment of vertex shader input registers to implicit data from the 629 | primitive tessellator. This controls the loading of vertex data which is 630 | not loaded from a stream, but rather is generated during primitive 631 | tessellation prior to the vertex shader. 632 | 633 | - Loading data into the constant memory at the time a shader is set as the 634 | current shader. Each token specifies values for one or more contiguous 4 635 | DWORD constant registers. This allows the shader to update an arbitrary 636 | subset of the constant memory, overwriting the device state (which 637 | contains the current values of the constant memory). Note that these 638 | values can be subsequently overwritten (between DrawPrimitive calls) 639 | during the time a shader is bound to a device via the 640 | SetVertexShaderConstant method. 641 | 642 | 643 | Declaration arrays are single-dimensional arrays of DWORDs composed of 644 | multiple tokens each of which is one or more DWORDs. The single-DWORD 645 | token value 0xFFFFFFFF is a special token used to indicate the end of the 646 | declaration array. The single DWORD token value 0x00000000 is a NOP token 647 | with is ignored during the declaration parsing. Note that 0x00000000 is a 648 | valid value for DWORDs following the first DWORD for multiple word tokens. 649 | 650 | [31:29] TokenType 651 | 0x0 - NOP (requires all DWORD bits to be zero) 652 | 0x1 - stream selector 653 | 0x2 - stream data definition (map to vertex input memory) 654 | 0x3 - vertex input memory from tessellator 655 | 0x4 - constant memory from shader 656 | 0x5 - extension 657 | 0x6 - reserved 658 | 0x7 - end-of-array (requires all DWORD bits to be 1) 659 | 660 | NOP Token (single DWORD token) 661 | [31:29] 0x0 662 | [28:00] 0x0 663 | 664 | Stream Selector (single DWORD token) 665 | [31:29] 0x1 666 | [28] indicates whether this is a tessellator stream 667 | [27:04] 0x0 668 | [03:00] stream selector (0..15) 669 | 670 | Stream Data Definition (single DWORD token) 671 | Vertex Input Register Load 672 | [31:29] 0x2 673 | [28] 0x0 674 | [27:20] 0x0 675 | [19:16] type (dimensionality and data type) 676 | [15:04] 0x0 677 | [03:00] vertex register address (0..15) 678 | Data Skip (no register load) 679 | [31:29] 0x2 680 | [28] 0x1 681 | [27:20] 0x0 682 | [19:16] count of DWORDS to skip over (0..15) 683 | [15:00] 0x0 684 | Vertex Input Memory from Tessellator Data (single DWORD token) 685 | [31:29] 0x3 686 | [28] indicates whether data is normals or u/v 687 | [27:24] 0x0 688 | [23:20] vertex register address (0..15) 689 | [19:16] type (dimensionality) 690 | [15:04] 0x0 691 | [03:00] vertex register address (0..15) 692 | 693 | Constant Memory from Shader (multiple DWORD token) 694 | [31:29] 0x4 695 | [28:25] count of 4*DWORD constants to load (0..15) 696 | [24:07] 0x0 697 | [06:00] constant memory address (0..95) 698 | 699 | Extension Token (single or multiple DWORD token) 700 | [31:29] 0x5 701 | [28:24] count of additional DWORDs in token (0..31) 702 | [23:00] extension-specific information 703 | 704 | End-of-array token (single DWORD token) 705 | [31:29] 0x7 706 | [28:00] 0x1fffffff 707 | 708 | The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element. 709 | Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant. 710 | The token sequence: 711 | Stream Select: stream=0 712 | Stream Data Definition (Load): type=FLOAT3; register=3 713 | Stream Data Definition (Load): type=FLOAT3; register=4 714 | Stream Data Definition (Skip): count=2 715 | Stream Data Definition (Load): type=FLOAT2; register=7 716 | 717 | defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data. 718 | Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed. 719 | 720 | */ 721 | 722 | typedef enum _D3DVSD_TOKENTYPE 723 | { 724 | D3DVSD_TOKEN_NOP = 0, // NOP or extension 725 | D3DVSD_TOKEN_STREAM, // stream selector 726 | D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) 727 | D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator 728 | D3DVSD_TOKEN_CONSTMEM, // constant memory from shader 729 | D3DVSD_TOKEN_EXT, // extension 730 | D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) 731 | D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum 732 | } D3DVSD_TOKENTYPE; 733 | 734 | #define D3DVSD_TOKENTYPESHIFT 29 735 | #define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT) 736 | 737 | #define D3DVSD_STREAMNUMBERSHIFT 0 738 | #define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT) 739 | 740 | #define D3DVSD_DATALOADTYPESHIFT 28 741 | #define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) 742 | 743 | #define D3DVSD_DATATYPESHIFT 16 744 | #define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT) 745 | 746 | #define D3DVSD_SKIPCOUNTSHIFT 16 747 | #define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT) 748 | 749 | #define D3DVSD_VERTEXREGSHIFT 0 750 | #define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT) 751 | 752 | #define D3DVSD_VERTEXREGINSHIFT 20 753 | #define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT) 754 | 755 | #define D3DVSD_CONSTCOUNTSHIFT 25 756 | #define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) 757 | 758 | #define D3DVSD_CONSTADDRESSSHIFT 0 759 | #define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT) 760 | 761 | #define D3DVSD_CONSTRSSHIFT 16 762 | #define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT) 763 | 764 | #define D3DVSD_EXTCOUNTSHIFT 24 765 | #define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT) 766 | 767 | #define D3DVSD_EXTINFOSHIFT 0 768 | #define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT) 769 | 770 | #define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) 771 | 772 | // macros for generation of CreateVertexShader Declaration token array 773 | 774 | // Set current stream 775 | // _StreamNumber [0..(MaxStreams-1)] stream to get data from 776 | // 777 | #define D3DVSD_STREAM( _StreamNumber ) \ 778 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) 779 | 780 | // Set tessellator stream 781 | // 782 | #define D3DVSD_STREAMTESSSHIFT 28 783 | #define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) 784 | #define D3DVSD_STREAM_TESS( ) \ 785 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) 786 | 787 | // bind single vertex register to vertex element from vertex stream 788 | // 789 | // _VertexRegister [0..15] address of the vertex register 790 | // _Type [D3DVSDT_*] dimensionality and arithmetic data type 791 | 792 | #define D3DVSD_REG( _VertexRegister, _Type ) \ 793 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ 794 | ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) 795 | 796 | // Skip _DWORDCount DWORDs in vertex 797 | // 798 | #define D3DVSD_SKIP( _DWORDCount ) \ 799 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ 800 | ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) 801 | 802 | // load data into vertex shader constant memory 803 | // 804 | // _ConstantAddress [0..95] - address of constant array to begin filling data 805 | // _Count [0..15] - number of constant vectors to load (4 DWORDs each) 806 | // followed by 4*_Count DWORDS of data 807 | // 808 | #define D3DVSD_CONST( _ConstantAddress, _Count ) \ 809 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ 810 | ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) 811 | 812 | // enable tessellator generated normals 813 | // 814 | // _VertexRegisterIn [0..15] address of vertex register whose input stream 815 | // will be used in normal computation 816 | // _VertexRegisterOut [0..15] address of vertex register to output the normal to 817 | // 818 | #define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ 819 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ 820 | ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ 821 | ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) 822 | 823 | // enable tessellator generated surface parameters 824 | // 825 | // _VertexRegister [0..15] address of vertex register to output parameters 826 | // 827 | #define D3DVSD_TESSUV( _VertexRegister ) \ 828 | (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ 829 | ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) 830 | 831 | // Generates END token 832 | // 833 | #define D3DVSD_END() 0xFFFFFFFF 834 | 835 | // Generates NOP token 836 | #define D3DVSD_NOP() 0x00000000 837 | 838 | // bit declarations for _Type fields 839 | #define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) 840 | #define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) 841 | #define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) 842 | #define D3DVSDT_FLOAT4 0x03 // 4D float 843 | #define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range 844 | // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) 845 | #define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte 846 | #define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) 847 | #define D3DVSDT_SHORT4 0x07 // 4D signed short 848 | 849 | // assignments of vertex input registers for fixed function vertex shader 850 | // 851 | #define D3DVSDE_POSITION 0 852 | #define D3DVSDE_BLENDWEIGHT 1 853 | #define D3DVSDE_BLENDINDICES 2 854 | #define D3DVSDE_NORMAL 3 855 | #define D3DVSDE_PSIZE 4 856 | #define D3DVSDE_DIFFUSE 5 857 | #define D3DVSDE_SPECULAR 6 858 | #define D3DVSDE_TEXCOORD0 7 859 | #define D3DVSDE_TEXCOORD1 8 860 | #define D3DVSDE_TEXCOORD2 9 861 | #define D3DVSDE_TEXCOORD3 10 862 | #define D3DVSDE_TEXCOORD4 11 863 | #define D3DVSDE_TEXCOORD5 12 864 | #define D3DVSDE_TEXCOORD6 13 865 | #define D3DVSDE_TEXCOORD7 14 866 | #define D3DVSDE_POSITION2 15 867 | #define D3DVSDE_NORMAL2 16 868 | 869 | // Maximum supported number of texture coordinate sets 870 | #define D3DDP_MAXTEXCOORD 8 871 | 872 | 873 | // 874 | // Instruction Token Bit Definitions 875 | // 876 | #define D3DSI_OPCODE_MASK 0x0000FFFF 877 | 878 | typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE 879 | { 880 | D3DSIO_NOP = 0, // PS/VS 881 | D3DSIO_MOV , // PS/VS 882 | D3DSIO_ADD , // PS/VS 883 | D3DSIO_SUB , // PS 884 | D3DSIO_MAD , // PS/VS 885 | D3DSIO_MUL , // PS/VS 886 | D3DSIO_RCP , // VS 887 | D3DSIO_RSQ , // VS 888 | D3DSIO_DP3 , // PS/VS 889 | D3DSIO_DP4 , // PS/VS 890 | D3DSIO_MIN , // VS 891 | D3DSIO_MAX , // VS 892 | D3DSIO_SLT , // VS 893 | D3DSIO_SGE , // VS 894 | D3DSIO_EXP , // VS 895 | D3DSIO_LOG , // VS 896 | D3DSIO_LIT , // VS 897 | D3DSIO_DST , // VS 898 | D3DSIO_LRP , // PS 899 | D3DSIO_FRC , // VS 900 | D3DSIO_M4x4 , // VS 901 | D3DSIO_M4x3 , // VS 902 | D3DSIO_M3x4 , // VS 903 | D3DSIO_M3x3 , // VS 904 | D3DSIO_M3x2 , // VS 905 | 906 | D3DSIO_TEXCOORD = 64, // PS 907 | D3DSIO_TEXKILL , // PS 908 | D3DSIO_TEX , // PS 909 | D3DSIO_TEXBEM , // PS 910 | D3DSIO_TEXBEML , // PS 911 | D3DSIO_TEXREG2AR , // PS 912 | D3DSIO_TEXREG2GB , // PS 913 | D3DSIO_TEXM3x2PAD , // PS 914 | D3DSIO_TEXM3x2TEX , // PS 915 | D3DSIO_TEXM3x3PAD , // PS 916 | D3DSIO_TEXM3x3TEX , // PS 917 | D3DSIO_TEXM3x3DIFF , // PS 918 | D3DSIO_TEXM3x3SPEC , // PS 919 | D3DSIO_TEXM3x3VSPEC , // PS 920 | D3DSIO_EXPP , // VS 921 | D3DSIO_LOGP , // VS 922 | D3DSIO_CND , // PS 923 | D3DSIO_DEF , // PS 924 | D3DSIO_TEXREG2RGB , // PS 925 | D3DSIO_TEXDP3TEX , // PS 926 | D3DSIO_TEXM3x2DEPTH , // PS 927 | D3DSIO_TEXDP3 , // PS 928 | D3DSIO_TEXM3x3 , // PS 929 | D3DSIO_TEXDEPTH , // PS 930 | D3DSIO_CMP , // PS 931 | D3DSIO_BEM , // PS 932 | 933 | D3DSIO_PHASE = 0xFFFD, 934 | D3DSIO_COMMENT = 0xFFFE, 935 | D3DSIO_END = 0xFFFF, 936 | 937 | D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum 938 | } D3DSHADER_INSTRUCTION_OPCODE_TYPE; 939 | 940 | // 941 | // Co-Issue Instruction Modifier - if set then this instruction is to be 942 | // issued in parallel with the previous instruction(s) for which this bit 943 | // is not set. 944 | // 945 | #define D3DSI_COISSUE 0x40000000 946 | 947 | // 948 | // Parameter Token Bit Definitions 949 | // 950 | #define D3DSP_REGNUM_MASK 0x00001FFF 951 | 952 | // destination parameter write mask 953 | #define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) 954 | #define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) 955 | #define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) 956 | #define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) 957 | #define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components 958 | 959 | // destination parameter modifiers 960 | #define D3DSP_DSTMOD_SHIFT 20 961 | #define D3DSP_DSTMOD_MASK 0x00F00000 962 | 963 | typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE 964 | { 965 | D3DSPDM_NONE = 0<>8)&0xFF) 1114 | #define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) 1115 | 1116 | // destination/source parameter register type 1117 | #define D3DSI_COMMENTSIZE_SHIFT 16 1118 | #define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 1119 | #define D3DSHADER_COMMENT(_DWordSize) \ 1120 | ((((_DWordSize)<= 1200 1677 | #pragma warning(pop) 1678 | #else 1679 | #pragma warning(default:4201) 1680 | #endif 1681 | 1682 | #endif /* (DIRECT3D_VERSION >= 0x0800) */ 1683 | #endif /* _D3D8TYPES(P)_H_ */ 1684 | 1685 | -------------------------------------------------------------------------------- /src/debugmenu_public.h: -------------------------------------------------------------------------------- 1 | 2 | extern "C" { 3 | 4 | typedef void (*TriggerFunc)(void); 5 | 6 | struct DebugMenuEntry; 7 | 8 | typedef DebugMenuEntry *(*DebugMenuAddInt8_TYPE)(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc, int8_t step, int8_t lowerBound, int8_t upperBound, const char **strings); 9 | typedef DebugMenuEntry *(*DebugMenuAddInt16_TYPE)(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc, int16_t step, int16_t lowerBound, int16_t upperBound, const char **strings); 10 | typedef DebugMenuEntry *(*DebugMenuAddInt32_TYPE)(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc, int32_t step, int32_t lowerBound, int32_t upperBound, const char **strings); 11 | typedef DebugMenuEntry *(*DebugMenuAddInt64_TYPE)(const char *path, const char *name, int64_t *ptr, TriggerFunc triggerFunc, int64_t step, int64_t lowerBound, int64_t upperBound, const char **strings); 12 | typedef DebugMenuEntry *(*DebugMenuAddUInt8_TYPE)(const char *path, const char *name, uint8_t *ptr, TriggerFunc triggerFunc, uint8_t step, uint8_t lowerBound, uint8_t upperBound, const char **strings); 13 | typedef DebugMenuEntry *(*DebugMenuAddUInt16_TYPE)(const char *path, const char *name, uint16_t *ptr, TriggerFunc triggerFunc, uint16_t step, uint16_t lowerBound, uint16_t upperBound, const char **strings); 14 | typedef DebugMenuEntry *(*DebugMenuAddUInt32_TYPE)(const char *path, const char *name, uint32_t *ptr, TriggerFunc triggerFunc, uint32_t step, uint32_t lowerBound, uint32_t upperBound, const char **strings); 15 | typedef DebugMenuEntry *(*DebugMenuAddUInt64_TYPE)(const char *path, const char *name, uint64_t *ptr, TriggerFunc triggerFunc, uint64_t step, uint64_t lowerBound, uint64_t upperBound, const char **strings); 16 | typedef DebugMenuEntry *(*DebugMenuAddFloat32_TYPE)(const char *path, const char *name, float *ptr, TriggerFunc triggerFunc, float step, float lowerBound, float upperBound); 17 | typedef DebugMenuEntry *(*DebugMenuAddFloat64_TYPE)(const char *path, const char *name, double *ptr, TriggerFunc triggerFunc, double step, double lowerBound, double upperBound); 18 | typedef DebugMenuEntry *(*DebugMenuAddCmd_TYPE)(const char *path, const char *name, TriggerFunc triggerFunc); 19 | typedef void (*DebugMenuEntrySetWrap_TYPE)(DebugMenuEntry *e, bool wrap); 20 | typedef void (*DebugMenuEntrySetStrings_TYPE)(DebugMenuEntry *e, const char **strings); 21 | typedef void (*DebugMenuEntrySetAddress_TYPE)(DebugMenuEntry *e, void *addr); 22 | 23 | struct DebugMenuAPI 24 | { 25 | bool isLoaded; 26 | DebugMenuAddInt8_TYPE addint8; 27 | DebugMenuAddInt16_TYPE addint16; 28 | DebugMenuAddInt32_TYPE addint32; 29 | DebugMenuAddInt64_TYPE addint64; 30 | DebugMenuAddUInt8_TYPE adduint8; 31 | DebugMenuAddUInt16_TYPE adduint16; 32 | DebugMenuAddUInt32_TYPE adduint32; 33 | DebugMenuAddUInt64_TYPE adduint64; 34 | DebugMenuAddFloat32_TYPE addfloat32; 35 | DebugMenuAddFloat64_TYPE addfloat64; 36 | DebugMenuAddCmd_TYPE addcmd; 37 | DebugMenuEntrySetWrap_TYPE setwrap; 38 | DebugMenuEntrySetStrings_TYPE setstrings; 39 | DebugMenuEntrySetAddress_TYPE setaddress; 40 | }; 41 | extern DebugMenuAPI gDebugMenuAPI; 42 | 43 | inline DebugMenuEntry *DebugMenuAddInt8(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc, int8_t step, int8_t lowerBound, int8_t upperBound, const char **strings) 44 | { return gDebugMenuAPI.addint8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 45 | inline DebugMenuEntry *DebugMenuAddInt16(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc, int16_t step, int16_t lowerBound, int16_t upperBound, const char **strings) 46 | { return gDebugMenuAPI.addint16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 47 | inline DebugMenuEntry *DebugMenuAddInt32(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc, int32_t step, int32_t lowerBound, int32_t upperBound, const char **strings) 48 | { return gDebugMenuAPI.addint32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 49 | inline DebugMenuEntry *DebugMenuAddInt64(const char *path, const char *name, int64_t *ptr, TriggerFunc triggerFunc, int64_t step, int64_t lowerBound, int64_t upperBound, const char **strings) 50 | { return gDebugMenuAPI.addint64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 51 | inline DebugMenuEntry *DebugMenuAddUInt8(const char *path, const char *name, uint8_t *ptr, TriggerFunc triggerFunc, uint8_t step, uint8_t lowerBound, uint8_t upperBound, const char **strings) 52 | { return gDebugMenuAPI.adduint8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 53 | inline DebugMenuEntry *DebugMenuAddUInt16(const char *path, const char *name, uint16_t *ptr, TriggerFunc triggerFunc, uint16_t step, uint16_t lowerBound, uint16_t upperBound, const char **strings) 54 | { return gDebugMenuAPI.adduint16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 55 | inline DebugMenuEntry *DebugMenuAddUInt32(const char *path, const char *name, uint32_t *ptr, TriggerFunc triggerFunc, uint32_t step, uint32_t lowerBound, uint32_t upperBound, const char **strings) 56 | { return gDebugMenuAPI.adduint32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 57 | inline DebugMenuEntry *DebugMenuAddUInt64(const char *path, const char *name, uint64_t *ptr, TriggerFunc triggerFunc, uint64_t step, uint64_t lowerBound, uint64_t upperBound, const char **strings) 58 | { return gDebugMenuAPI.adduint64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 59 | inline DebugMenuEntry *DebugMenuAddFloat32(const char *path, const char *name, float *ptr, TriggerFunc triggerFunc, float step, float lowerBound, float upperBound) 60 | { return gDebugMenuAPI.addfloat32(path, name, ptr, triggerFunc, step, lowerBound, upperBound); } 61 | inline DebugMenuEntry *DebugMenuAddFloat64(const char *path, const char *name, double *ptr, TriggerFunc triggerFunc, double step, double lowerBound, double upperBound) 62 | { return gDebugMenuAPI.addfloat64(path, name, ptr, triggerFunc, step, lowerBound, upperBound); } 63 | inline DebugMenuEntry *DebugMenuAddCmd(const char *path, const char *name, TriggerFunc triggerFunc) 64 | { return gDebugMenuAPI.addcmd(path, name, triggerFunc); } 65 | inline void DebugMenuEntrySetWrap(DebugMenuEntry *e, bool wrap) 66 | { gDebugMenuAPI.setwrap(e, wrap); } 67 | inline void DebugMenuEntrySetStrings(DebugMenuEntry *e, const char **strings) 68 | { gDebugMenuAPI.setstrings(e, strings); } 69 | inline void DebugMenuEntrySetAddress(DebugMenuEntry *e, void *addr) 70 | { gDebugMenuAPI.setaddress(e, addr); } 71 | 72 | inline bool DebugMenuLoad(void) 73 | { 74 | if(gDebugMenuAPI.isLoaded) 75 | return true; 76 | HMODULE mod = LoadLibrary("debugmenu.dll"); 77 | if(mod == 0){ 78 | char modulePath[MAX_PATH]; 79 | HMODULE dllModule; 80 | GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR)&gDebugMenuAPI, &dllModule); 81 | GetModuleFileName(dllModule, modulePath, MAX_PATH); 82 | char *p = strrchr(modulePath, '\\'); 83 | if(p) p[1] = '\0'; 84 | strcat(modulePath, "debugmenu.dll"); 85 | mod = LoadLibrary(modulePath); 86 | } 87 | if(mod == 0) 88 | return false; 89 | gDebugMenuAPI.addint8 = (DebugMenuAddInt8_TYPE)GetProcAddress(mod, "DebugMenuAddInt8"); 90 | gDebugMenuAPI.addint16 = (DebugMenuAddInt16_TYPE)GetProcAddress(mod, "DebugMenuAddInt16"); 91 | gDebugMenuAPI.addint32 = (DebugMenuAddInt32_TYPE)GetProcAddress(mod, "DebugMenuAddInt32"); 92 | gDebugMenuAPI.addint64 = (DebugMenuAddInt64_TYPE)GetProcAddress(mod, "DebugMenuAddInt64"); 93 | gDebugMenuAPI.adduint8 = (DebugMenuAddUInt8_TYPE)GetProcAddress(mod, "DebugMenuAddUInt8"); 94 | gDebugMenuAPI.adduint16 = (DebugMenuAddUInt16_TYPE)GetProcAddress(mod, "DebugMenuAddUInt16"); 95 | gDebugMenuAPI.adduint32 = (DebugMenuAddUInt32_TYPE)GetProcAddress(mod, "DebugMenuAddUInt32"); 96 | gDebugMenuAPI.adduint64 = (DebugMenuAddUInt64_TYPE)GetProcAddress(mod, "DebugMenuAddUInt64"); 97 | gDebugMenuAPI.addfloat32 = (DebugMenuAddFloat32_TYPE)GetProcAddress(mod, "DebugMenuAddFloat32"); 98 | gDebugMenuAPI.addfloat64 = (DebugMenuAddFloat64_TYPE)GetProcAddress(mod, "DebugMenuAddFloat64"); 99 | gDebugMenuAPI.addcmd = (DebugMenuAddCmd_TYPE)GetProcAddress(mod, "DebugMenuAddCmd"); 100 | gDebugMenuAPI.setwrap = (DebugMenuEntrySetWrap_TYPE)GetProcAddress(mod, "DebugMenuEntrySetWrap"); 101 | gDebugMenuAPI.setstrings = (DebugMenuEntrySetStrings_TYPE)GetProcAddress(mod, "DebugMenuEntrySetStrings"); 102 | gDebugMenuAPI.setaddress = (DebugMenuEntrySetAddress_TYPE)GetProcAddress(mod, "DebugMenuEntrySetAddress"); 103 | gDebugMenuAPI.isLoaded = true; 104 | return true; 105 | } 106 | 107 | } 108 | 109 | // Also overload them for simplicity 110 | 111 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc, int8_t step, int8_t lowerBound, int8_t upperBound, const char **strings) 112 | { return gDebugMenuAPI.addint8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 113 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc, int16_t step, int16_t lowerBound, int16_t upperBound, const char **strings) 114 | { return gDebugMenuAPI.addint16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 115 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc, int32_t step, int32_t lowerBound, int32_t upperBound, const char **strings) 116 | { return gDebugMenuAPI.addint32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 117 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int64_t *ptr, TriggerFunc triggerFunc, int64_t step, int64_t lowerBound, int64_t upperBound, const char **strings) 118 | { return gDebugMenuAPI.addint64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 119 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint8_t *ptr, TriggerFunc triggerFunc, uint8_t step, uint8_t lowerBound, uint8_t upperBound, const char **strings) 120 | { return gDebugMenuAPI.adduint8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 121 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint16_t *ptr, TriggerFunc triggerFunc, uint16_t step, uint16_t lowerBound, uint16_t upperBound, const char **strings) 122 | { return gDebugMenuAPI.adduint16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 123 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint32_t *ptr, TriggerFunc triggerFunc, uint32_t step, uint32_t lowerBound, uint32_t upperBound, const char **strings) 124 | { return gDebugMenuAPI.adduint32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 125 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint64_t *ptr, TriggerFunc triggerFunc, uint64_t step, uint64_t lowerBound, uint64_t upperBound, const char **strings) 126 | { return gDebugMenuAPI.adduint64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } 127 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, float *ptr, TriggerFunc triggerFunc, float step, float lowerBound, float upperBound) 128 | { return gDebugMenuAPI.addfloat32(path, name, ptr, triggerFunc, step, lowerBound, upperBound); } 129 | inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, double *ptr, TriggerFunc triggerFunc, double step, double lowerBound, double upperBound) 130 | { return gDebugMenuAPI.addfloat64(path, name, ptr, triggerFunc, step, lowerBound, upperBound); } 131 | 132 | inline DebugMenuEntry *DebugMenuAddVarBool32(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc) 133 | { 134 | static const char *boolstr[] = { "Off", "On" }; 135 | DebugMenuEntry *e = DebugMenuAddVar(path, name, ptr, triggerFunc, 1, 0, 1, boolstr); 136 | DebugMenuEntrySetWrap(e, true); 137 | return e; 138 | } 139 | inline DebugMenuEntry *DebugMenuAddVarBool16(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc) 140 | { 141 | static const char *boolstr[] = { "Off", "On" }; 142 | DebugMenuEntry *e = DebugMenuAddVar(path, name, ptr, triggerFunc, 1, 0, 1, boolstr); 143 | DebugMenuEntrySetWrap(e, true); 144 | return e; 145 | } 146 | inline DebugMenuEntry *DebugMenuAddVarBool8(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc) 147 | { 148 | static const char *boolstr[] = { "Off", "On" }; 149 | DebugMenuEntry *e = DebugMenuAddVar(path, name, ptr, triggerFunc, 1, 0, 1, boolstr); 150 | DebugMenuEntrySetWrap(e, true); 151 | return e; 152 | } 153 | -------------------------------------------------------------------------------- /src/resource.h: -------------------------------------------------------------------------------- 1 | #define IDR_VCBLURPS 101 2 | #define IDR_IIIBLURPS 102 3 | #define IDR_CONTRASTPS 103 4 | -------------------------------------------------------------------------------- /src/rw.cpp: -------------------------------------------------------------------------------- 1 | #include "sharptrails.h" 2 | 3 | static uint32_t RwMatrixCreate_A = AddressByVersion(0x5A3330, 0x5A35F0, 0x5A3FA0, 0x644620, 0x644670, 0x6435D0); 4 | WRAPPER RwMatrix *RwMatrixCreate(void) { VARJMP(RwMatrixCreate_A); } 5 | static uint32_t RwMatrixDestroy_A = AddressByVersion(0x5A3300, 0x5A35C0, 0x5A3F70, 0x6445F0, 0x644640, 0x6435A0); 6 | WRAPPER RwBool RwMatrixDestroy(RwMatrix*) { VARJMP(RwMatrixDestroy_A); } 7 | static uint32_t RwMatrixMultiply_A = AddressByVersion(0x5A28F0, 0x5A2BB0, 0x5A2E10, 0x6437C0, 0x643810, 0x642770); 8 | WRAPPER RwMatrix *RwMatrixMultiply(RwMatrix*, const RwMatrix*, const RwMatrix*) { VARJMP(RwMatrixMultiply_A); } 9 | static uint32_t RwMatrixInvert_A = AddressByVersion(0x5A2C90, 0x5A2F50, 0x5A35A0, 0x643F40, 0x643F90, 0x642EF0); 10 | WRAPPER RwMatrix *RwMatrixInvert(RwMatrix*, const RwMatrix*) { VARJMP(RwMatrixInvert_A); } 11 | static uint32_t RwMatrixUpdate_A = AddressByVersion(0x5A28E0, 0x5A2BA0, 0x5A2DF0, 0x6437B0, 0x643800, 0x642760); 12 | WRAPPER RwMatrix *RwMatrixUpdate(RwMatrix*) { VARJMP(RwMatrixUpdate_A); } 13 | static uint32_t RwMatrixRotate_A = AddressByVersion(0x5A2BF0, 0x5A2EB0, 0x5A3510, 0x643EA0, 0x643EF0, 0x642E50); 14 | WRAPPER RwMatrix *RwMatrixRotate(RwMatrix*, const RwV3d*, RwReal, RwOpCombineType) { VARJMP(RwMatrixRotate_A); } 15 | 16 | static uint32_t RwFrameCreate_A = AddressByVersion(0x5A1A00, 0x5A1CC0, 0x5A2270, 0x644AA0, 0x644AF0, 0x643A50); 17 | WRAPPER RwFrame *RwFrameCreate(void) { VARJMP(RwFrameCreate_A); } 18 | static uint32_t RwFrameUpdateObjects_A = AddressByVersion(0x5A1C60, 0x5A1F20, 0x5A23B4, 0x644D00, 0x644D50, 0x643CB0); 19 | WRAPPER RwFrame *RwFrameUpdateObjects(RwFrame* a1) 20 | { 21 | if (gtaversion != III_STEAM) 22 | VARJMP(RwFrameUpdateObjects_A); 23 | 24 | __asm 25 | { 26 | mov eax, a1 27 | jmp RwFrameUpdateObjects_A 28 | } 29 | } 30 | static uint32_t RwFrameGetLTM_A = AddressByVersion(0x5A1CE0, 0x5A1FA0, 0x5A2430, 0x644D80, 0x644DD0, 0x643D30); 31 | WRAPPER RwMatrix *RwFrameGetLTM(RwFrame*) { VARJMP(RwFrameGetLTM_A); } 32 | static uint32_t RwFrameTransform_A = AddressByVersion(0x5A2140, 0x5A2400, 0x5A26E0, 0x6451E0, 0x645230, 0x644190); 33 | WRAPPER RwFrame *RwFrameTransform(RwFrame*, const RwMatrix*, RwOpCombineType) { VARJMP(RwFrameTransform_A); } 34 | 35 | static uint32_t RwCameraCreate_A = AddressByVersion(0x5A5360, 0x5A5620, 0x5A74E0, 0x64AB50, 0x64ABA0, 0x649B00); 36 | WRAPPER RwCamera *RwCameraCreate(void) { VARJMP(RwCameraCreate_A); } 37 | static uint32_t RwCameraBeginUpdate_A = AddressByVersion(0x5A5030, 0x5A52F0, 0x5A7220, 0x64A820, 0x64A870, 0x6497D0); 38 | WRAPPER RwCamera *RwCameraBeginUpdate(RwCamera*) { VARJMP(RwCameraBeginUpdate_A); } 39 | static uint32_t RwCameraEndUpdate_A = AddressByVersion(0x5A5020, 0x5A52E0, 0x5A7200, 0x64A810, 0x64A860, 0x6497C0); 40 | WRAPPER RwCamera *RwCameraEndUpdate(RwCamera*) { VARJMP(RwCameraEndUpdate_A); } 41 | static uint32_t RwCameraSetNearClipPlane_A = AddressByVersion(0x5A5070, 0x5A5330, 0x5A7270, 0x64A860, 0x64A8B0, 0x649810); 42 | WRAPPER RwCamera *RwCameraSetNearClipPlane(RwCamera*, RwReal) { VARJMP(RwCameraSetNearClipPlane_A); } 43 | static uint32_t RwCameraSetFarClipPlane_A = AddressByVersion(0x5A5140, 0x5A5400, 0x5A72A0, 0x64A930, 0x64A980, 0x6498E0); 44 | WRAPPER RwCamera *RwCameraSetFarClipPlane(RwCamera*, RwReal) { VARJMP(RwCameraSetFarClipPlane_A); } 45 | static uint32_t RwCameraSetViewWindow_A = AddressByVersion(0x5A52B0, 0x5A5570, 0x5A7440, 0x64AAA0, 0x64AAF0, 0x649A50); 46 | WRAPPER RwCamera *RwCameraSetViewWindow(RwCamera*, const RwV2d*) { VARJMP(RwCameraSetViewWindow_A); } 47 | static uint32_t RwCameraClear_A = AddressByVersion(0x5A51E0, 0x5A54A0, 0x5A7350, 0x64A9D0, 0x64AA20, 0x649980); 48 | WRAPPER RwCamera *RwCameraClear(RwCamera*, RwRGBA*, RwInt32) { VARJMP(RwCameraClear_A); } 49 | 50 | static uint32_t RwRasterCreate_A = AddressByVersion(0x5AD930, 0x5ADBF0, 0x5B0580, 0x655490, 0x6554E0, 0x654440); 51 | WRAPPER RwRaster *RwRasterCreate(RwInt32, RwInt32, RwInt32, RwInt32) { VARJMP(RwRasterCreate_A); } 52 | static uint32_t RwRasterSetFromImage_A = AddressByVersion(0x5BBF50, 0x5BC210, 0x5C0BF0, 0x6602B0, 0x660300, 0x65F260); 53 | WRAPPER RwRaster *RwRasterSetFromImage(RwRaster*, RwImage*) { VARJMP(RwRasterSetFromImage_A); } 54 | static uint32_t RwRasterPushContext_A = AddressByVersion(0x5AD7C0, 0x5ADA80, 0x5B03C0, 0x655320, 0x655370, 0x6542D0); 55 | WRAPPER RwRaster *RwRasterPushContext(RwRaster*) { VARJMP(RwRasterPushContext_A); } 56 | static uint32_t RwRasterPopContext_A = AddressByVersion(0x5AD870, 0x5ADB30, 0x5B0460, 0x6553D0, 0x655420, 0x654380); 57 | WRAPPER RwRaster *RwRasterPopContext(void) { VARJMP(RwRasterPopContext_A); } 58 | static uint32_t RwRasterRenderFast_A = AddressByVersion(0x5AD710, 0x5AD9D0, 0x5B0800, 0x655270, 0x6552C0, 0x654220); 59 | WRAPPER RwRaster *RwRasterRenderFast(RwRaster*, RwInt32, RwInt32) { VARJMP(RwRasterRenderFast_A); } 60 | 61 | static uint32_t RwTextureCreate_A = AddressByVersion(0x5A72D0, 0x5A7590, 0x5A8AC0, 0x64DE60, 0x64DEB0, 0x64CE10); 62 | WRAPPER RwTexture *RwTextureCreate(RwRaster*) { VARJMP(RwTextureCreate_A); } 63 | 64 | static uint32_t RwRenderStateGet_A = AddressByVersion(0x5A4410, 0x5A46D0, 0x5A53B0, 0x649BF0, 0x649C40, 0x648BA0); 65 | WRAPPER RwBool RwRenderStateGet(RwRenderState, void*) { VARJMP(RwRenderStateGet_A); } 66 | static uint32_t RwRenderStateSet_A = AddressByVersion(0x5A43C0, 0x5A4680, 0x5A5360, 0x649BA0, 0x649BF0, 0x648B50); 67 | WRAPPER RwBool RwRenderStateSet(RwRenderState, void*) { VARJMP(RwRenderStateSet_A); } 68 | 69 | static uint32_t RwD3D8SetTexture_A = AddressByVersion(0x5B53A0, 0x5B5660, 0x5BA2D0, 0x659850, 0x6598A0, 0x658800); 70 | WRAPPER RwBool RwD3D8SetTexture(RwTexture*, RwUInt32) { VARJMP(RwD3D8SetTexture_A); } 71 | static uint32_t RwD3D8SetRenderState_A = AddressByVersion(0x5B3CF0, 0x5B3FB0, 0x5B84B0, 0x6582A0, 0x6582F0, 0x657250); 72 | WRAPPER RwBool RwD3D8SetRenderState(RwUInt32, RwUInt32) { VARJMP(RwD3D8SetRenderState_A); } 73 | static uint32_t RwD3D8GetRenderState_A = AddressByVersion(0x5B3D40, 0x5B4000, 0x5B8510, 0x6582F0, 0x658340, 0x6572A0); 74 | WRAPPER void RwD3D8GetRenderState(RwUInt32, void*) { VARJMP(RwD3D8GetRenderState_A); } 75 | static uint32_t RwD3D8SetTextureStageState_A = AddressByVersion(0x5B3D60, 0x5B4020, 0x5B8530, 0x658310, 0x658360, 0x6572C0); 76 | WRAPPER RwBool RwD3D8SetTextureStageState(RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8SetTextureStageState_A); } 77 | static uint32_t RwD3D8SetVertexShader_A = AddressByVersion(0x5BAF90, 0x5BB250, 0x5BF440, 0x65F2F0, 0x65F340, 0x65E2A0); 78 | WRAPPER RwBool RwD3D8SetVertexShader(RwUInt32) { VARJMP(RwD3D8SetVertexShader_A); } 79 | static uint32_t RwD3D8SetPixelShader_A = AddressByVersion(0x5BAFD0, 0x5BB290, 0x5BF4A0, 0x65F330, 0x65F380, 0x65E2E0); 80 | WRAPPER RwBool RwD3D8SetPixelShader(RwUInt32 handle) { VARJMP(RwD3D8SetPixelShader_A); } 81 | static uint32_t RwD3D8SetStreamSource_A = AddressByVersion(0x5BB010, 0x5BB2D0, 0x5BF500, 0x65F370, 0x65F3C0, 0x65E320); 82 | WRAPPER RwBool RwD3D8SetStreamSource(RwUInt32, void*, RwUInt32) { VARJMP(RwD3D8SetStreamSource_A); } 83 | static uint32_t RwD3D8SetIndices_A = AddressByVersion(0x5BB060, 0x5BB320, 0x5BF590, 0x65F3C0, 0x65F410, 0x65E370); 84 | WRAPPER RwBool RwD3D8SetIndices(void*, RwUInt32) { VARJMP(RwD3D8SetIndices_A); } 85 | static uint32_t RwD3D8DrawIndexedPrimitive_A = AddressByVersion(0x5BB0B0, 0x5BB370, 0x5BF610, 0x65F410, 0x65F460, 0x65E3C0); 86 | WRAPPER RwBool RwD3D8DrawIndexedPrimitive(RwUInt32, RwUInt32, RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8DrawIndexedPrimitive_A); } 87 | static uint32_t RwD3D8DrawPrimitive_A = AddressByVersion(0x5BB140, 0x5BB400, 0x5BF6C0, 0x65F4A0, 0x65F4F0, 0x65E450); 88 | WRAPPER RwBool RwD3D8DrawPrimitive(RwUInt32, RwUInt32, RwUInt32) { VARJMP(RwD3D8DrawPrimitive_A); } 89 | static uint32_t RwD3D8SetSurfaceProperties_A = AddressByVersion(0x5BB490, 0x5BB750, 0x5BFB30, 0x65F7F0, 0x65F840, 0x65E7A0); 90 | WRAPPER RwBool RwD3D8SetSurfaceProperties(const RwRGBA*, const RwSurfaceProperties*, RwBool) { VARJMP(RwD3D8SetSurfaceProperties_A); } 91 | static uint32_t RwD3D8SetTransform_A = AddressByVersion(0x5BB1D0, 0x5BB490, 0x5BF768, 0x65F530, 0x65F580, 0x65E4E0); 92 | WRAPPER RwBool RwD3D8SetTransform(RwUInt32 a1, const void* a2) 93 | { 94 | if (gtaversion != III_STEAM) 95 | VARJMP(RwD3D8SetTransform_A); 96 | 97 | __asm 98 | { 99 | mov edx, [esp+8] 100 | mov eax, [esp+4] 101 | jmp RwD3D8SetTransform_A 102 | } 103 | } 104 | static uint32_t RwD3D8GetTransform_A = AddressByVersion(0x5BB310, 0x5BB5D0, 0x5BF930, 0x65F670, 0x65F6C0, 0x65E620); 105 | WRAPPER void RwD3D8GetTransform(RwUInt32, void*) { VARJMP(RwD3D8GetTransform_A); } 106 | 107 | //WRAPPER RwBool RwD3D8SetLight(RwInt32, const void*) { EAXJMP(0x65FB20); } 108 | //WRAPPER RwBool RwD3D8EnableLight(RwInt32, RwBool) { EAXJMP(0x65FC10); } 109 | 110 | static uint32_t rwD3D8RenderStateIsVertexAlphaEnable_A = AddressByVersion(0x5B5A50, 0x5B5D10, 0x5BA970, 0x659F60, 0x659FB0, 0x658F10); 111 | WRAPPER RwBool rwD3D8RenderStateIsVertexAlphaEnable(void) { VARJMP(rwD3D8RenderStateIsVertexAlphaEnable_A); }; 112 | static uint32_t rwD3D8RenderStateVertexAlphaEnable_A = AddressByVersion(0x5B57E0, 0x5B5AA0, 0x5BA840, 0x659CF0, 0x659D40, 0x658CA0); 113 | WRAPPER void rwD3D8RenderStateVertexAlphaEnable(RwBool x) { VARJMP(rwD3D8RenderStateVertexAlphaEnable_A); }; 114 | static uint32_t RpAtomicGetWorldBoundingSphere_A = AddressByVersion(0x59E800, 0x59EAC0, 0x59EB20, 0x640710, 0x640760, 0x63F6C0); 115 | WRAPPER const RwSphere *RpAtomicGetWorldBoundingSphere(RpAtomic*) { VARJMP(RpAtomicGetWorldBoundingSphere_A); }; 116 | static uint32_t RwD3D8CameraIsSphereFullyInsideFrustum_A = AddressByVersion(0x5BBC40, 0x5BBF00, 0x5C0450, 0x65FFB0, 0x660000, 0x65EF60); 117 | WRAPPER RwBool RwD3D8CameraIsSphereFullyInsideFrustum(const void*, const void*) { VARJMP(RwD3D8CameraIsSphereFullyInsideFrustum_A); }; 118 | static uint32_t RwD3D8CameraIsBBoxFullyInsideFrustum_A = AddressByVersion(0x5BBCA0, 0x5BBF60, 0x5C04B0, 0x660010, 0x660060, 0x65EFC0); 119 | WRAPPER RwBool RwD3D8CameraIsBBoxFullyInsideFrustum(const void*, const void*) { VARJMP(RwD3D8CameraIsBBoxFullyInsideFrustum_A); }; 120 | 121 | static uint32_t RtBMPImageRead_A = AddressByVersion(0x5AFE70, 0x5B0130, 0x5B3390, 0x657870, 0x6578C0, 0x656820); 122 | WRAPPER RwImage *RtBMPImageRead(const RwChar*) { VARJMP(RtBMPImageRead_A); } 123 | static uint32_t RwImageFindRasterFormat_A = AddressByVersion(0x5BBF80, 0x5BC240, 0x5C0C40, 0x6602E0, 0x660330, 0x65F290); 124 | WRAPPER RwImage *RwImageFindRasterFormat(RwImage*, RwInt32, RwInt32*, RwInt32*, RwInt32*, RwInt32*) { VARJMP(RwImageFindRasterFormat_A); } 125 | static uint32_t RwImageDestroy_A = AddressByVersion(0x5A9180, 0x5A9440, 0x5AB6A0, 0x6512B0, 0x651300, 0x650260); 126 | WRAPPER RwBool RwImageDestroy(RwImage*) { VARJMP(RwImageDestroy_A); } 127 | 128 | static uint32_t RwIm2DGetNearScreenZ_A = AddressByVersion(0x5A43A0, 0x5A4660, 0x5A5340, 0x649B80, 0x649BD0, 0x648B30); 129 | WRAPPER RwReal RwIm2DGetNearScreenZ(void) { VARJMP(RwIm2DGetNearScreenZ_A); } 130 | static uint32_t RwIm2DRenderIndexedPrimitive_A = AddressByVersion(0x5A4440, 0x5A4700, 0x5A5440, 0x649C20, 0x649C70, 0x648BD0); 131 | WRAPPER RwBool RwIm2DRenderIndexedPrimitive(RwPrimitiveType, RwIm2DVertex*, RwInt32, RwImVertexIndex*, RwInt32) { VARJMP(RwIm2DRenderIndexedPrimitive_A); } 132 | 133 | static uint32_t _rwObjectHasFrameSetFrame_A = AddressByVersion(0x5BC950, 0x5BCC10, 0x5C1820, 0x660CC0, 0x660D10, 0x65FC70); 134 | WRAPPER void _rwObjectHasFrameSetFrame(void*, RwFrame*) { VARJMP(_rwObjectHasFrameSetFrame_A); } 135 | 136 | static uint32_t RxPipelineCreate_A = AddressByVersion(0x5C2E00, 0x5C30C0, 0x5C8FC0, 0x668FC0, 0x669010, 0x667F70); 137 | WRAPPER RxPipeline *RxPipelineCreate(void) { VARJMP(RxPipelineCreate_A); } 138 | static uint32_t RxPipelineLock_A = AddressByVersion(0x5D29F0, 0x5D2CB0, 0x5DDBF0, 0x67AC50, 0x67ACA0, 0x679C00); 139 | WRAPPER RxLockedPipe *RxPipelineLock(RxPipeline*) { VARJMP(RxPipelineLock_A); } 140 | static uint32_t RxLockedPipeUnlock_A = AddressByVersion(0x5D1FA0, 0x5D2260, 0x5DD0C0, 0x67A200, 0x67A250, 0x6791B0); 141 | WRAPPER RxPipeline *RxLockedPipeUnlock(RxLockedPipe*) { VARJMP(RxLockedPipeUnlock_A); } 142 | static uint32_t RxNodeDefinitionGetD3D8AtomicAllInOne_A = AddressByVersion(0x5DC500, 0x5DC7C0, 0x5EC470, 0x67CB90, 0x67CBE0, 0x67BB40); 143 | WRAPPER RxNodeDefinition *RxNodeDefinitionGetD3D8AtomicAllInOne(void) { VARJMP(RxNodeDefinitionGetD3D8AtomicAllInOne_A); } 144 | static uint32_t RxLockedPipeAddFragment_A = AddressByVersion(0x5D2BA0, 0x5D2E60, 0x5DE000, 0x67AE00, 0x67AE50, 0x679DB0); 145 | WRAPPER RxLockedPipe *RxLockedPipeAddFragment(RxLockedPipe*, RwUInt32*, RxNodeDefinition*, ...) { VARJMP(RxLockedPipeAddFragment_A); } 146 | static uint32_t _rxPipelineDestroy_A = AddressByVersion(0x5C2E70, 0x5C3130, 0x5C9030, 0x669030, 0x669080, 0x667FE0); 147 | WRAPPER void _rxPipelineDestroy(RxPipeline*) { VARJMP(_rxPipelineDestroy_A); } 148 | static uint32_t RxPipelineFindNodeByName_A = AddressByVersion(0x5D2B10, 0x5D2DD0, 0x5DDF40, 0x67AD70, 0x67ADC0, 0x679D20); 149 | WRAPPER RxPipelineNode *RxPipelineFindNodeByName(RxPipeline*, const RwChar*, RxPipelineNode*, RwInt32*) { VARJMP(RxPipelineFindNodeByName_A); } 150 | static uint32_t RxD3D8AllInOneSetRenderCallBack_A = AddressByVersion(0x5DFC60, 0x5DFF20, 0x5EE330, 0x678E30, 0x678E80, 0x677DE0); 151 | WRAPPER void RxD3D8AllInOneSetRenderCallBack(RxPipelineNode*, RxD3D8AllInOneRenderCallBack) { VARJMP(RxD3D8AllInOneSetRenderCallBack_A); } 152 | 153 | static uint32_t rxD3D8DefaultRenderCallback_A = AddressByVersion(0x5DF960, 0x5DFC20, 0x5EE350, 0x678B30, 0x678B80, 0x677AE0); 154 | WRAPPER void rxD3D8DefaultRenderCallback(RwResEntry*, void*, RwUInt8, RwUInt32) { VARJMP(rxD3D8DefaultRenderCallback_A); } 155 | static uint32_t rwD3D8AtomicMatFXRenderCallback_A = AddressByVersion(0x5D0B80, 0x5D0E40, 0x5D8B20, 0x676460, 0x6764B0, 0x675410); 156 | WRAPPER void rwD3D8AtomicMatFXRenderCallback(RwResEntry*, void*, RwUInt8, RwUInt32) { VARJMP(rwD3D8AtomicMatFXRenderCallback_A); } 157 | //static uint32_t RpMatFXAtomicEnableEffects_A = AddressByVersion(0, 0x657020); 158 | //WRAPPER RpAtomic *RpMatFXAtomicEnableEffects(RpAtomic*) { VARJMP(RpMatFXAtomicEnableEffects_A); } 159 | 160 | static uint32_t RpClumpForAllAtomics_A = AddressByVersion(0x59EDD0, 0x59F090, 0x59EFC0, 0x640D00, 0x640D50, 0x63FCB0); 161 | WRAPPER RpClump *RpClumpForAllAtomics(RpClump*, RpAtomicCallBack, void*) { VARJMP(RpClumpForAllAtomics_A); } 162 | //static uint32_t RpGeometryForAllMaterials_A = AddressByVersion(0, 0x64CC90); 163 | //WRAPPER RpGeometry *RpGeometryForAllMaterials(RpGeometry*, RpMaterialCallBack, void*) { VARJMP(RpGeometryForAllMaterials_A); } -------------------------------------------------------------------------------- /src/sharptrails.h: -------------------------------------------------------------------------------- 1 | #define _CRT_SECURE_NO_WARNINGS 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "resource.h" 14 | typedef uintptr_t uintptr; 15 | #include "MemoryMgr.h" 16 | 17 | extern HMODULE dllModule; 18 | 19 | void enableTrailSetting(void); -------------------------------------------------------------------------------- /src/silenttrails.cpp: -------------------------------------------------------------------------------- 1 | #include "sharptrails.h" 2 | 3 | // stolen from Silent: 4 | // https://github.com/CookiePLMonster/VC-Trails 5 | 6 | struct SMenuEntry 7 | { 8 | WORD action; 9 | char description[8]; 10 | BYTE style; 11 | BYTE targetMenu; 12 | WORD posX; 13 | WORD posY; 14 | WORD align; 15 | }; 16 | 17 | static_assert(sizeof(SMenuEntry) == 0x12, "SMenuEntry error!"); 18 | 19 | const SMenuEntry displaySettingsPatch[] = { 20 | /*Trails*/ 21 | { 9, "FED_TRA", 0, 4, 40, 153, 1 }, 22 | /*Subtitles*/ 23 | { 10, "FED_SUB", 0, 4, 40, 178, 1 }, 24 | /*Widescreen*/ 25 | { 11, "FED_WIS", 0, 4, 40, 202, 1 }, 26 | /*Map Legend*/ 27 | { 31, "MAP_LEG", 0, 4, 40, 228, 1 }, 28 | /*Radar Mode*/ 29 | { 32, "FED_RDR", 0, 4, 40, 253, 1 }, 30 | /*HUD Mode*/ 31 | { 33, "FED_HUD", 0, 4, 40, 278, 1 }, 32 | /*Resolution*/ 33 | { 43, "FED_RES", 0, 4, 40, 303, 1 }, 34 | /*Restore Defaults*/ 35 | { 47, "FET_DEF", 0, 4, 320, 328, 3 }, 36 | /*Back*/ 37 | { 34, "FEDS_TB", 0, 33, 320, 353, 3 } 38 | }; 39 | 40 | void LoadSetFile(unsigned char* pTrails) 41 | { 42 | FILE* hFile = fopen("gta_vc.set", "rb"); 43 | if ( hFile ) 44 | { 45 | fseek(hFile, 0x5B8, SEEK_SET); 46 | fread(pTrails, 1, 1, hFile); 47 | if (*pTrails > 0) 48 | *pTrails = 1; 49 | fclose(hFile); 50 | } 51 | } 52 | 53 | void 54 | enableTrailSetting(void) 55 | { 56 | if( *(DWORD*)0x667BF5 == 0xB85548EC ) // VC 1.0 57 | { 58 | int pMenuEntries = *(int*)0x4966A0 + 0x3C8; 59 | unsigned char* pTrailsOptionEnabled = *(unsigned char**)0x498DEE; 60 | 61 | Patch(0x4902D2, pTrailsOptionEnabled); 62 | memcpy((void*)pMenuEntries, displaySettingsPatch, sizeof(displaySettingsPatch)); 63 | 64 | ((void(*)())0x48E020)(); // chdir user dir 65 | LoadSetFile(pTrailsOptionEnabled); 66 | ((void(*)(const char*))0x48E030)(""); // chdir root dir 67 | } 68 | else if ( *(DWORD*)0x667C45 == 0xB85548EC ) // VC 1.1 69 | { 70 | int pMenuEntries = *(int*)0x4966B0 + 0x3C8; 71 | unsigned char* pTrailsOptionEnabled = *(unsigned char**)0x498DFE; 72 | 73 | Patch(0x4902E2, pTrailsOptionEnabled); 74 | memcpy((void*)pMenuEntries, displaySettingsPatch, sizeof(displaySettingsPatch)); 75 | 76 | ((void(*)())0x48E030)(); // chdir user dir 77 | LoadSetFile(pTrailsOptionEnabled); 78 | ((void(*)(const char*))0x48E040)(""); // chdir root dir 79 | } 80 | else if ( *(DWORD*)0x666BA5 == 0xB85548EC ) // VC Steam 81 | { 82 | int pMenuEntries = *(int*)0x4965B0 + 0x3C8; 83 | unsigned char* pTrailsOptionEnabled = *(unsigned char**)0x498CFE; 84 | 85 | Patch(0x4901E2, pTrailsOptionEnabled); 86 | memcpy((void*)pMenuEntries, displaySettingsPatch, sizeof(displaySettingsPatch)); 87 | 88 | ((void(*)())0x48DF10)(); // chdir user dir 89 | LoadSetFile(pTrailsOptionEnabled); 90 | ((void(*)(const char*))0x48DF20)(""); // chdir root dir 91 | } 92 | } --------------------------------------------------------------------------------