diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-08-25 20:28:10 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-08-25 20:28:10 +0400 |
commit | cafb24c1f3896240a566f9898891fba605e438e6 (patch) | |
tree | bf7e357a74c0c4f6250db9d23d6357db0604d63a /overlay | |
parent | 93b6c57f4b79ebc25a133ad99984e33c63b1714b (diff) |
Include fxo binary in overlay
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/d3d10.cpp | 18 | ||||
-rw-r--r-- | overlay/overlay.fx | 19 | ||||
-rw-r--r-- | overlay/overlay.pro | 10 |
3 files changed, 30 insertions, 17 deletions
diff --git a/overlay/d3d10.cpp b/overlay/d3d10.cpp index 6126db6ee..2cbdcd31a 100644 --- a/overlay/d3d10.cpp +++ b/overlay/d3d10.cpp @@ -29,13 +29,12 @@ */ #include "lib.h" +#include "overlay.hex" #include <d3d10.h> #include <d3dx10.h> DXGIData *dxgi; -static char fx[8192]; -static int fxlen = 0; static bool bHooked = false; static bool bChaining = false; static HardHook hhPresent; @@ -129,14 +128,7 @@ D10State::D10State(IDXGISwapChain *pSwapChain, ID3D10Device *pDevice) { float bf[4]; pDevice->OMSetBlendState(pBlendState, bf, 0xffffffff); -/* - DWORD dwShaderFlags = D3D10_SHADER_ENABLE_STRICTNESS | D3D10_SHADER_DEBUG; - hr = D3DX10CreateEffectFromFileW( L"C:\\dev\\dxsdk\\Samples\\C++\\Direct3D10\\Tutorials\\Tutorial02\\Tutorial02.fx", NULL, NULL, "fx_4_0", dwShaderFlags, 0, - pDevice, NULL, NULL, &pEffect, NULL, NULL ); -*/ - pEffect = NULL; - ods("Effectum maximum %p %d", fx, fxlen); - pD3D10CreateEffectFromMemory(fx, fxlen, 0, pDevice, NULL, &pEffect); + pD3D10CreateEffectFromMemory((void *) g_main, sizeof(g_main), 0, pDevice, NULL, &pEffect); pTechnique = pEffect->GetTechniqueByName( "Render" ); @@ -299,12 +291,6 @@ void checkDXGIHook(bool preonly) { unsigned char *raw = (unsigned char *) hDXGI; HookPresentRaw((voidFunc)(raw + dxgi->iOffsetPresent)); HookResizeRaw((voidFunc)(raw + dxgi->iOffsetResize)); - - FILE *f = fopen("C:\\dev\\mumble\\overlay\\overlay.fxo", "rb"); - fxlen=fread(fx, 1, 8192, f); - ods("Gotcha %p %d", f, fxlen); - fclose(f); - } else if (! preonly) { fods("DXGI Interface changed, can't rawpatch"); } else { diff --git a/overlay/overlay.fx b/overlay/overlay.fx new file mode 100644 index 000000000..e5509ba78 --- /dev/null +++ b/overlay/overlay.fx @@ -0,0 +1,19 @@ +float4 VS( float4 Pos : POSITION ) : SV_POSITION +{ + return Pos; +} + +float4 PS( float4 Pos : SV_POSITION ) : SV_Target +{ + return float4( 1.0f, 1.0f, 0.0f, 0.5f ); // Yellow, with Alpha = 1 +} + +technique10 Render +{ + pass P0 + { + SetVertexShader( CompileShader( vs_4_0, VS() ) ); + SetGeometryShader( NULL ); + SetPixelShader( CompileShader( ps_4_0, PS() ) ); + } +} diff --git a/overlay/overlay.pro b/overlay/overlay.pro index 0b40eadef..4b5c52cff 100644 --- a/overlay/overlay.pro +++ b/overlay/overlay.pro @@ -6,7 +6,8 @@ CONFIG *= dll shared debug_and_release warn_on CONFIG -= embed_manifest_dll TARGET = mumble_ol SOURCES = lib.cpp d3d9.cpp d3d10.cpp opengl.cpp -DIST = overlay.h +EFFECTS = overlay.fx +DIST = overlay.h overlay.fx DEFINES -= UNICODE @@ -28,3 +29,10 @@ CONFIG(debug, debug|release) { DESTDIR = ../release DEFINES *= DEBUG } + +fxc.output = ${QMAKE_FILE_BASE}.hex +fxc.commands = fxc /Tfx_4_0 /O3 /Fh${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} +fxc.input = EFFECTS +fxc.CONFIG *= no_link target_predeps +QMAKE_EXTRA_COMPILERS *= fxc + |