diff --git a/.gitattributes b/.gitattributes index 5f850cc..a25475f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,74 +1,74 @@ * text=auto !eol -OTM_DX9/OTM_ArrayHandler.cpp -text -OTM_DX9/OTM_ArrayHandler.h -text -OTM_DX9/OTM_DX9_dll.cpp -text -OTM_DX9/OTM_DX9_dll.h -text -OTM_DX9/OTM_DX9_dll_DIRECT_INJECTION.def -text -OTM_DX9/OTM_DX9_dll_HOOK_INJECTION.def -text -OTM_DX9/OTM_DX9_dll_NO_INJECTION.def -text -OTM_DX9/OTM_Defines.h -text -OTM_DX9/OTM_IDirect3D9.cpp -text -OTM_DX9/OTM_IDirect3D9.h -text -OTM_DX9/OTM_IDirect3D9Ex.cpp -text -OTM_DX9/OTM_IDirect3D9Ex.h -text -OTM_DX9/OTM_IDirect3DCubeTexture9.cpp -text -OTM_DX9/OTM_IDirect3DCubeTexture9.h -text -OTM_DX9/OTM_IDirect3DDevice9.cpp -text -OTM_DX9/OTM_IDirect3DDevice9.h -text -OTM_DX9/OTM_IDirect3DDevice9Ex.cpp -text -OTM_DX9/OTM_IDirect3DDevice9Ex.h -text -OTM_DX9/OTM_IDirect3DTexture9.cpp -text -OTM_DX9/OTM_IDirect3DTexture9.h -text -OTM_DX9/OTM_IDirect3DVolumeTexture9.cpp -text -OTM_DX9/OTM_IDirect3DVolumeTexture9.h -text -OTM_DX9/OTM_Main.h -text -OTM_DX9/OTM_TextureClient.cpp -text -OTM_DX9/OTM_TextureClient.h -text -OTM_DX9/OTM_TextureFunction.cpp -text -OTM_DX9/OTM_TextureFunction.h -text -OTM_DX9/OTM_TextureServer.cpp -text -OTM_DX9/OTM_TextureServer.h -text -OTM_DX9/makefile.gcc -text -OTM_DX9/makefile.vc -text -/OTM_Error.h -text -OTM_GUI/OTM.ico -text -OTM_GUI/OTM.rc -text -OTM_GUI/OTM_AddTexture.cpp -text -OTM_GUI/OTM_AddTexture.h -text -OTM_GUI/OTM_Client.cpp -text -OTM_GUI/OTM_Client.h -text -OTM_GUI/OTM_DirectInjection.cpp -text -OTM_GUI/OTM_DirectInjection.h -text -OTM_GUI/OTM_Event.cpp -text -OTM_GUI/OTM_Event.h -text -OTM_GUI/OTM_File.cpp -text -OTM_GUI/OTM_File.h -text -OTM_GUI/OTM_GUI.cpp -text -OTM_GUI/OTM_GUI.h -text -OTM_GUI/OTM_GameInfo.cpp -text -OTM_GUI/OTM_GameInfo.h -text -OTM_GUI/OTM_GamePage.cpp -text -OTM_GUI/OTM_GamePage.h -text -OTM_GUI/OTM_Language.cpp -text -OTM_GUI/OTM_Language.h -text -OTM_GUI/OTM_Main.h -text -OTM_GUI/OTM_Sender.cpp -text -OTM_GUI/OTM_Sender.h -text -OTM_GUI/OTM_Server.cpp -text -OTM_GUI/OTM_Server.h -text -OTM_GUI/OTM_Settings.cpp -text -OTM_GUI/OTM_Settings.h -text -OTM_GUI/bin/README_Deutsch.txt -text -OTM_GUI/bin/README_English.txt -text -OTM_GUI/bin/languages/Example_OTM_LanguagePack_English.txt -text -OTM_GUI/bin/languages/OTM_LanguagePackU_Deutsch.txt -text -OTM_GUI/bin/languages/OTM_LanguagePackU_Russian.txt -text -OTM_GUI/config.gcc -text -OTM_GUI/config.vc -text -OTM_GUI/makefile.gcc -text -OTM_GUI/makefile.vc -text -OTM_GUI/unzip.cpp -text -OTM_GUI/unzip.h -text -OTM_GUI/zip.cpp -text -OTM_GUI/zip.h -text -/OTM_GlobalDefines.h -text +uMod_DX9/makefile.gcc -text +uMod_DX9/makefile.vc -text +uMod_DX9/uMod_ArrayHandler.cpp -text +uMod_DX9/uMod_ArrayHandler.h -text +uMod_DX9/uMod_DX9_dll.cpp -text +uMod_DX9/uMod_DX9_dll.h -text +uMod_DX9/uMod_DX9_dll_DIRECT_INJECTION.def -text +uMod_DX9/uMod_DX9_dll_HOOK_INJECTION.def -text +uMod_DX9/uMod_DX9_dll_NO_INJECTION.def -text +uMod_DX9/uMod_Defines.h -text +uMod_DX9/uMod_IDirect3D9.cpp -text +uMod_DX9/uMod_IDirect3D9.h -text +uMod_DX9/uMod_IDirect3D9Ex.cpp -text +uMod_DX9/uMod_IDirect3D9Ex.h -text +uMod_DX9/uMod_IDirect3DCubeTexture9.cpp -text +uMod_DX9/uMod_IDirect3DCubeTexture9.h -text +uMod_DX9/uMod_IDirect3DDevice9.cpp -text +uMod_DX9/uMod_IDirect3DDevice9.h -text +uMod_DX9/uMod_IDirect3DDevice9Ex.cpp -text +uMod_DX9/uMod_IDirect3DDevice9Ex.h -text +uMod_DX9/uMod_IDirect3DTexture9.cpp -text +uMod_DX9/uMod_IDirect3DTexture9.h -text +uMod_DX9/uMod_IDirect3DVolumeTexture9.cpp -text +uMod_DX9/uMod_IDirect3DVolumeTexture9.h -text +uMod_DX9/uMod_Main.h -text +uMod_DX9/uMod_TextureClient.cpp -text +uMod_DX9/uMod_TextureClient.h -text +uMod_DX9/uMod_TextureFunction.cpp -text +uMod_DX9/uMod_TextureFunction.h -text +uMod_DX9/uMod_TextureServer.cpp -text +uMod_DX9/uMod_TextureServer.h -text +/uMod_Error.h -text +uMod_GUI/bin/README_Deutsch.txt -text +uMod_GUI/bin/README_English.txt -text +uMod_GUI/bin/languages/Example_uMod_LanguagePack_English.txt -text +uMod_GUI/bin/languages/uMod_LanguagePackU_Deutsch.txt -text +uMod_GUI/bin/languages/uMod_LanguagePackU_Russian.txt -text +uMod_GUI/config.gcc -text +uMod_GUI/config.vc -text +uMod_GUI/makefile.gcc -text +uMod_GUI/makefile.vc -text +uMod_GUI/uMod.ico -text +uMod_GUI/uMod.rc -text +uMod_GUI/uMod_AddTexture.cpp -text +uMod_GUI/uMod_AddTexture.h -text +uMod_GUI/uMod_Client.cpp -text +uMod_GUI/uMod_Client.h -text +uMod_GUI/uMod_DirectInjection.cpp -text +uMod_GUI/uMod_DirectInjection.h -text +uMod_GUI/uMod_Event.cpp -text +uMod_GUI/uMod_Event.h -text +uMod_GUI/uMod_File.cpp -text +uMod_GUI/uMod_File.h -text +uMod_GUI/uMod_GUI.cpp -text +uMod_GUI/uMod_GUI.h -text +uMod_GUI/uMod_GameInfo.cpp -text +uMod_GUI/uMod_GameInfo.h -text +uMod_GUI/uMod_GamePage.cpp -text +uMod_GUI/uMod_GamePage.h -text +uMod_GUI/uMod_Language.cpp -text +uMod_GUI/uMod_Language.h -text +uMod_GUI/uMod_Main.h -text +uMod_GUI/uMod_Sender.cpp -text +uMod_GUI/uMod_Sender.h -text +uMod_GUI/uMod_Server.cpp -text +uMod_GUI/uMod_Server.h -text +uMod_GUI/uMod_Settings.cpp -text +uMod_GUI/uMod_Settings.h -text +uMod_GUI/unzip.cpp -text +uMod_GUI/unzip.h -text +uMod_GUI/zip.cpp -text +uMod_GUI/zip.h -text +/uMod_GlobalDefines.h -text diff --git a/OTM_DX9/OTM_DX9_dll_DIRECT_INJECTION.def b/OTM_DX9/OTM_DX9_dll_DIRECT_INJECTION.def deleted file mode 100644 index 6d6a341..0000000 --- a/OTM_DX9/OTM_DX9_dll_DIRECT_INJECTION.def +++ /dev/null @@ -1,5 +0,0 @@ -LIBRARY "OTM_d3d9_DI" -EXPORTS - OTM_Direct3DCreate9 @1 - OTM_Direct3DCreate9Ex @2 - Nothing @3 \ No newline at end of file diff --git a/OTM_DX9/OTM_DX9_dll_HOOK_INJECTION.def b/OTM_DX9/OTM_DX9_dll_HOOK_INJECTION.def deleted file mode 100644 index bc3e2a5..0000000 --- a/OTM_DX9/OTM_DX9_dll_HOOK_INJECTION.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY "OTM_d3d9_Hook" -EXPORTS - OTM_Direct3DCreate9 @1 - OTM_Direct3DCreate9Ex @2 - InstallHook @3 - RemoveHook @4 \ No newline at end of file diff --git a/OTM_DX9/OTM_IDirect3D9Ex.cpp b/OTM_DX9/OTM_IDirect3D9Ex.cpp deleted file mode 100644 index f14673e..0000000 --- a/OTM_DX9/OTM_IDirect3D9Ex.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* -This file is part of OpenTexMod. - - -OpenTexMod is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -OpenTexMod is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . -*/ - - - - - -#include "OTM_Main.h" - - - -#define IDirect3D9 IDirect3D9Ex -#define OTM_IDirect3D9 OTM_IDirect3D9Ex -#define m_pIDirect3D9 m_pIDirect3D9Ex -#define PRE_MESSAGE "OTM_IDirect3D9Ex" - -#include "OTM_IDirect3D9.cpp" - - -HRESULT __stdcall OTM_IDirect3D9Ex::CreateDeviceEx( UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3DDevice9Ex **ppReturnedDeviceInterface) -{ - Message( "OTM_IDirect3D9Ex::CreateDeviceEx: %lu\n", this); - // we intercept this call and provide our own "fake" Device Object - HRESULT hres = m_pIDirect3D9Ex->CreateDeviceEx( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface); - - OTM_IDirect3DDevice9Ex *pIDirect3DDevice9Ex = new OTM_IDirect3DDevice9Ex(*ppReturnedDeviceInterface, OTM_Server); - - // store our pointer (the fake one) for returning it to the calling program - *ppReturnedDeviceInterface = pIDirect3DDevice9Ex; - - return(hres); - return (m_pIDirect3D9Ex->CreateDeviceEx( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface)); -} - -HRESULT __stdcall OTM_IDirect3D9Ex::EnumAdapterModesEx( UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter, UINT Mode, D3DDISPLAYMODEEX *pMode) -{ - return (m_pIDirect3D9Ex->EnumAdapterModesEx( Adapter, pFilter, Mode, pMode)); -} - -HRESULT __stdcall OTM_IDirect3D9Ex::GetAdapterDisplayModeEx( UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) -{ - return (m_pIDirect3D9Ex->GetAdapterDisplayModeEx( Adapter, pMode, pRotation)); -} - -HRESULT __stdcall OTM_IDirect3D9Ex::GetAdapterLUID( UINT Adapter, LUID *pLUID) -{ - return (m_pIDirect3D9Ex->GetAdapterLUID( Adapter, pLUID)); -} - -UINT __stdcall OTM_IDirect3D9Ex::GetAdapterModeCountEx( UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter) -{ - return (m_pIDirect3D9Ex->GetAdapterModeCountEx( Adapter, pFilter)); -} - diff --git a/OTM_DX9/OTM_IDirect3DDevice9Ex.cpp b/OTM_DX9/OTM_IDirect3DDevice9Ex.cpp deleted file mode 100644 index 683f699..0000000 --- a/OTM_DX9/OTM_IDirect3DDevice9Ex.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is part of OpenTexMod. - - -OpenTexMod is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -OpenTexMod is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . -*/ - - - -#include "OTM_Main.h" - -#define OTM_IDirect3DDevice9 OTM_IDirect3DDevice9Ex -#define IDirect3DDevice9 IDirect3DDevice9Ex -#define m_pIDirect3DDevice9 m_pIDirect3DDevice9Ex - -#define RETURN_QueryInterface 0x01000001L -#define PRE_MESSAGE "OTM_IDirect3DDevice9Ex" - - -#include "OTM_IDirect3DDevice9.cpp" - - - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::CheckDeviceState( HWND hWindow) -{ - return(m_pIDirect3DDevice9Ex->CheckDeviceState( hWindow)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::CheckResourceResidency( IDirect3DResource9 **ppResourceArray, UINT32 NumResources) -{ - return(m_pIDirect3DDevice9Ex->CheckResourceResidency( ppResourceArray, NumResources)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::ComposeRects( IDirect3DSurface9 *pSource, IDirect3DSurface9 *pDestination, IDirect3DVertexBuffer9 *pSrcRectDescriptors, UINT NumRects, IDirect3DVertexBuffer9 *pDstRectDescriptors, D3DCOMPOSERECTSOP Operation, INT XOffset, INT YOffset) -{ - return(m_pIDirect3DDevice9Ex->ComposeRects( pSource, pDestination, pSrcRectDescriptors, NumRects, pDstRectDescriptors, Operation, XOffset, YOffset)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx( UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) -{ - return(m_pIDirect3DDevice9Ex->CreateDepthStencilSurfaceEx( Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle, Usage)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx( UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) -{ - return(m_pIDirect3DDevice9Ex->CreateOffscreenPlainSurfaceEx( Width, Height, Format, Pool, ppSurface, pSharedHandle, Usage)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::CreateRenderTargetEx( UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) -{ - return(m_pIDirect3DDevice9Ex->CreateRenderTargetEx( Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle, Usage)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::GetDisplayModeEx( UINT iSwapChain, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) -{ - return(m_pIDirect3DDevice9Ex->GetDisplayModeEx( iSwapChain, pMode, pRotation)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::GetGPUThreadPriority( INT *pPriority) -{ - return(m_pIDirect3DDevice9Ex->GetGPUThreadPriority( pPriority)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::GetMaximumFrameLatency( UINT *pMaxLatency) -{ - return(m_pIDirect3DDevice9Ex->GetMaximumFrameLatency( pMaxLatency)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::PresentEx( const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion, DWORD dwFlags) -{ - return(m_pIDirect3DDevice9Ex->PresentEx( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::ResetEx( D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) -{ - return(m_pIDirect3DDevice9Ex->ResetEx( pPresentationParameters, pFullscreenDisplayMode)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::SetConvolutionMonoKernel( UINT Width, UINT Height, float *RowWeights, float *ColumnWeights) -{ - return(m_pIDirect3DDevice9Ex->SetConvolutionMonoKernel( Width, Height, RowWeights, ColumnWeights)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::SetGPUThreadPriority( INT pPriority) -{ - return(m_pIDirect3DDevice9Ex->SetGPUThreadPriority( pPriority)); -} - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::SetMaximumFrameLatency( UINT pMaxLatency) -{ - return(m_pIDirect3DDevice9Ex->SetMaximumFrameLatency( pMaxLatency)); -} - -/* -HRESULT __stdcall OTM_IDirect3DDevice9Ex::TestCooperativeLevel() -{ - return(m_pIDirect3DDevice9Ex->TestCooperativeLevel()); -} -*/ - -HRESULT __stdcall OTM_IDirect3DDevice9Ex::WaitForVBlank( UINT SwapChainIndex) -{ - return(m_pIDirect3DDevice9Ex->WaitForVBlank( SwapChainIndex)); -} - diff --git a/OTM_DX9/OTM_Main.h b/OTM_DX9/OTM_Main.h deleted file mode 100644 index 09184be..0000000 --- a/OTM_DX9/OTM_Main.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -This file is part of OpenTexMod. - - -OpenTexMod is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -OpenTexMod is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . -*/ - - - -#ifndef OTM_MAIN_H_ -#define OTM_MAIN_H_ - -#define WINVER _WIN32_WINNT_WINXP -#define _WIN32_WINNT _WIN32_WINNT_WINXP -#define _WIN32_WINDOWS _WIN32_WINNT_WINXP -#define NTDDI_VERSION NTDDI_WINXP -//#define NTDDI_LONGHORN NTDDI_WINXP -#define WIN32_LEAN_AND_MEAN - - -#include - -#include -#include - -#include -#include - - - - -#include "../OTM_GlobalDefines.h" -#include "../OTM_Error.h" -#include "OTM_Defines.h" -#include "OTM_DX9_dll.h" -#include "OTM_TextureFunction.h" - -#include "OTM_IDirect3D9.h" -#include "OTM_IDirect3D9Ex.h" - -#include "OTM_IDirect3DDevice9.h" -#include "OTM_IDirect3DDevice9Ex.h" - -#include "OTM_IDirect3DCubeTexture9.h" -#include "OTM_IDirect3DTexture9.h" -#include "OTM_IDirect3DVolumeTexture9.h" - -#include "OTM_ArrayHandler.h" -#include "OTM_TextureServer.h" -#include "OTM_TextureClient.h" - - -extern unsigned int gl_ErrorState; - -#endif diff --git a/OTM_DX9/OTM_TextureClient.h b/OTM_DX9/OTM_TextureClient.h deleted file mode 100644 index 44ba366..0000000 --- a/OTM_DX9/OTM_TextureClient.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -This file is part of OpenTexMod. - - -OpenTexMod is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -OpenTexMod is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . -*/ - - - -#ifndef OTM_TEXTUREHANDLER_HPP -#define OTM_TEXTUREHANDLER_HPP - -#include "OTM_IDirect3DTexture9.h" -#include "OTM_IDirect3DDevice9.h" -#include "..\OTM_Error.h" - - -class OTM_TextureServer; - -/* - * An object of this class is owned by each d3d9 device. - * functions called by the Server are called from the server thread instance. - * All other functions are called from the render thread instance of the game itself. - */ - -class OTM_TextureClient -{ -public: - OTM_TextureClient(OTM_TextureServer* server, IDirect3DDevice9* device); - ~OTM_TextureClient(void); - - int AddTexture( OTM_IDirect3DTexture9* tex); //called from OTM_IDirect3DDevice9::CreateTexture(...) or OTM_IDirect3DDevice9::BeginScene() - int AddTexture( OTM_IDirect3DVolumeTexture9* tex); //called from OTM_IDirect3DVolumeTexture9::CreateTexture(...) or OTM_IDirect3DDevice9::BeginScene() - int AddTexture( OTM_IDirect3DCubeTexture9* tex); //called from OTM_IDirect3DCubeTexture9::CreateTexture(...) or OTM_IDirect3DDevice9::BeginScene() - - int RemoveTexture( OTM_IDirect3DTexture9* tex); //called from OTM_IDirect3DTexture9::Release() - int RemoveTexture( OTM_IDirect3DVolumeTexture9* tex); //called from OTM_IDirect3DVolumeTexture9::Release() - int RemoveTexture( OTM_IDirect3DCubeTexture9* tex); //called from OTM_IDirect3DCubeTexture9::Release() - - int SaveAllTextures(bool val); //called from the Server - int SaveSingleTexture(bool val); //called from the Server - - int SetSaveDirectory( wchar_t *dir); //called from the Server - int SetGameName( wchar_t *dir); //called from the Server - - int SaveTexture(OTM_IDirect3DTexture9* pTexture); //called from OTM_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) - int SaveTexture(OTM_IDirect3DVolumeTexture9* pTexture); //called from OTM_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) - int SaveTexture(OTM_IDirect3DCubeTexture9* pTexture); //called from OTM_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) - - - - int SetKeyBack( int key) {if (key>0) KeyBack = key; return (RETURN_OK);} //called from the Server - int SetKeySave( int key) {if (key>0) KeySave = key; return (RETURN_OK);} //called from the Server - int SetKeyNext( int key) {if (key>0) KeyNext = key; return (RETURN_OK);} //called from the Server - - int SetFontColour( DWORD r, DWORD g, DWORD b) {FontColour = D3DCOLOR_ARGB(255, r,g,b); return (RETURN_OK);} //called from the Server - int SetTextureColour( DWORD r, DWORD g, DWORD b) {TextureColour = D3DCOLOR_ARGB(255, r,g,b); return (RETURN_OK);} //called from the Server - - - int AddUpdate(TextureFileStruct* update, int number); //called from the Server, client object must delete update array - int MergeUpdate(void); //called from OTM_IDirect3DDevice9::BeginScene() - - int LookUpToMod( OTM_IDirect3DTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) - int LookUpToMod( OTM_IDirect3DVolumeTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) - int LookUpToMod( OTM_IDirect3DCubeTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) - - OTM_TextureHandler OriginalTextures; // stores the pointer to the OTM_IDirect3DTexture9 objects created by the game - OTM_TextureHandler OriginalVolumeTextures; // stores the pointer to the OTM_IDirect3DVolumeTexture9 objects created by the game - OTM_TextureHandler OriginalCubeTextures; // stores the pointer to the OTM_IDirect3DCubeTexture9 objects created by the game - - bool BoolSaveAllTextures; - bool BoolSaveSingleTexture; - int KeyBack; - int KeySave; - int KeyNext; - - D3DCOLOR FontColour; - D3DCOLOR TextureColour; - -private: - OTM_TextureServer* Server; - IDirect3DDevice9* D3D9Device; - wchar_t SavePath[MAX_PATH]; - wchar_t GameName[MAX_PATH]; - - TextureFileStruct* Update; - int NumberOfUpdate; - - int LockMutex(); - int UnlockMutex(); - HANDLE Mutex; - - int NumberToMod; // number of texture to be modded - TextureFileStruct* FileToMod; // array which stores the file in memory and the hash of each texture to be modded - - - int LookUpToMod( MyTypeHash hash, int num_index_list, int *index_list); // called from LookUpToMod(...); - int LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DTexture9 **ppTexture); // called if a target texture is found - int LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DVolumeTexture9 **ppTexture); // called if a target texture is found - int LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DCubeTexture9 **ppTexture); // called if a target texture is found - - // and the corresponding fake texture should be loaded - - //MyTypeHash GetHash(unsigned char *str, int len); - //unsigned int GetCRC32(char *pcDatabuf, unsigned int ulDatalen); -}; - - - -#endif /* OTM_TEXTUREHANDLER_HPP_ */ diff --git a/OTM_DX9/makefile.gcc b/OTM_DX9/makefile.gcc deleted file mode 100644 index 8ea515c..0000000 --- a/OTM_DX9/makefile.gcc +++ /dev/null @@ -1,117 +0,0 @@ -ifdef NO_INJECTION - -ifdef ALPHA -precompiler_flag = /D "ALPHA" /D "NO_INJECTION" -else -precompiler_flag = /D "NO_INJECTION" -endif - -def_file = /DEF:"OTM_DX9_dll_NO_INJECTION.def" -obj_suff = NO_INJECTION.obj -dll = d3d9.dll - -else - -ifdef DIRECT_INJECTION -ifdef ALPHA -precompiler_flag = /D "ALPHA" /D "DIRECT_INJECTION" -else -precompiler_flag = /D "DIRECT_INJECTION" -endif - -def_file = /DEF:"OTM_DX9_dll_DIRECT_INJECTION.def" -obj_suff = DI.obj -dll = OTM_d3d9_DI.dll - -else - -ifdef ALPHA -precompiler_flag = /D "ALPHA" /D "HOOK_INJECTION" -else -precompiler_flag = /D "HOOK_INJECTION" -endif - -def_file = /DEF:"OTM_DX9_dll_HOOK_INJECTION.def" -obj_suff = HOOK.obj -dll = OTM_d3d9_Hook.dll -endif -endif - - -CXX = cl -CLINK = link.exe -DEFINES = /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" -CFLAGS = /I "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /nologo /W3 /WX- /O2 ${DEFINES} ${precompiler_flag} /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t -LFLAGS = /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86" /DLL "Winmm.lib" "d3dx9.lib" "dxguid.lib" "user32.lib" "Kernel32.lib" ${def_file} /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO /NXCOMPAT:NO /MACHINE:X86 - -obj = obj -bin = bin - -objects = ${obj}\OTM_DX9_dll.${obj_suff} \ - ${obj}\OTM_IDirect3D9.${obj_suff} \ - ${obj}\OTM_IDirect3D9Ex.${obj_suff} \ - ${obj}\OTM_IDirect3DDevice9.${obj_suff} \ - ${obj}\OTM_IDirect3DDevice9Ex.${obj_suff} \ - ${obj}\OTM_TextureFunction.${obj_suff} \ - ${obj}\OTM_IDirect3DTexture9.${obj_suff} \ - ${obj}\OTM_IDirect3DVolumeTexture9.${obj_suff} \ - ${obj}\OTM_IDirect3DCubeTexture9.${obj_suff} \ - ${obj}\OTM_ArrayHandler.${obj_suff} \ - ${obj}\OTM_TextureClient.${obj_suff} \ - ${obj}\OTM_TextureServer.${obj_suff} - -headers = OTM_Main.h \ - OTM_Defines.h \ - OTM_DX9_dll.h \ - OTM_IDirect3D9.h \ - OTM_IDirect3DDevice9.h \ - OTM_TextureFunction.h \ - OTM_IDirect3DTexture9.h \ - OTM_IDirect3DVolumeTexture9.h \ - OTM_IDirect3DCubeTexture9.h \ - OTM_ArrayHandler.h \ - OTM_TextureClient.h \ - OTM_TextureServer.h - -${bin}\d3d9.dll: ${objects} - ${CLINK} ${LFLAGS} ${objects} /OUT:${bin}\${dll} - copy ${bin}\${dll} ..\OTM_GUI\bin\${dll} - -${obj}\OTM_DX9_dll.${obj_suff}: OTM_DX9_dll.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3D9.${obj_suff}: OTM_IDirect3D9.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3D9Ex.${obj_suff}: OTM_IDirect3D9Ex.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3DDevice9.${obj_suff}: OTM_IDirect3DDevice9.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3DDevice9Ex.${obj_suff}: OTM_IDirect3DDevice9Ex.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_TextureFunction.${obj_suff}: OTM_TextureFunction.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3DTexture9.${obj_suff}: OTM_IDirect3DTexture9.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3DVolumeTexture9.${obj_suff}: OTM_IDirect3DVolumeTexture9.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_IDirect3DCubeTexture9.${obj_suff}: OTM_IDirect3DCubeTexture9.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_ArrayHandler.${obj_suff}: OTM_ArrayHandler.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_TextureClient.${obj_suff}: OTM_TextureClient.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -${obj}\OTM_TextureServer.${obj_suff}: OTM_TextureServer.cpp ${headers} - ${CXX} ${CFLAGS} /c $< /Fo$@ - -clean: - del ${objects} ${bin}\${dll} \ No newline at end of file diff --git a/OTM_DX9/makefile.vc b/OTM_DX9/makefile.vc deleted file mode 100644 index 6e1049a..0000000 --- a/OTM_DX9/makefile.vc +++ /dev/null @@ -1,117 +0,0 @@ -!IFDEF NO_INJECTION - -!IFDEF ALPHA -precompiler_flag = /D "ALPHA" /D "NO_INJECTION" -!ELSE -precompiler_flag = /D "NO_INJECTION" -!ENDIF - -def_file = /DEF:"OTM_DX9_dll_NO_INJECTION.def" -obj_suff = NO_INJECTION.obj -dll = d3d9.dll - -!ELSE - -!IFDEF DIRECT_INJECTION -!IFDEF ALPHA -precompiler_flag = /D "ALPHA" /D "DIRECT_INJECTION" -!ELSE -precompiler_flag = /D "DIRECT_INJECTION" -!ENDIF - -def_file = /DEF:"OTM_DX9_dll_DIRECT_INJECTION.def" -obj_suff = DI.obj -dll = OTM_d3d9_DI.dll - -!ELSE - -!IFDEF ALPHA -precompiler_flag = /D "ALPHA" /D "HOOK_INJECTION" -!ELSE -precompiler_flag = /D "HOOK_INJECTION" -!ENDIF - -def_file = /DEF:"OTM_DX9_dll_HOOK_INJECTION.def" -obj_suff = HOOK.obj -dll = OTM_d3d9_Hook.dll - -!ENDIF - - -CXX = cl -CLINK = link.exe -DEFINES = /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" -CFLAGS = /I "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /nologo /W3 /WX- /O2 $(DEFINES) $(precompiler_flag) /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t -LFLAGS = /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86" /DLL "Winmm.lib" "d3dx9.lib" "dxguid.lib" "user32.lib" "Kernel32.lib" $(def_file) /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO /NXCOMPAT:NO /MACHINE:X86 - -obj = obj -bin = bin - -objects = $(obj)\OTM_DX9_dll.$(obj_suff) \ - $(obj)\OTM_IDirect3D9.$(obj_suff) \ - $(obj)\OTM_IDirect3D9Ex.$(obj_suff) \ - $(obj)\OTM_IDirect3DDevice9.$(obj_suff) \ - $(obj)\OTM_IDirect3DDevice9Ex.$(obj_suff) \ - $(obj)\OTM_TextureFunction.$(obj_suff) \ - $(obj)\OTM_IDirect3DTexture9.$(obj_suff) \ - $(obj)\OTM_IDirect3DVolumeTexture9.$(obj_suff) \ - $(obj)\OTM_IDirect3DCubeTexture9.$(obj_suff) \ - $(obj)\OTM_ArrayHandler.$(obj_suff) \ - $(obj)\OTM_TextureClient.$(obj_suff) \ - $(obj)\OTM_TextureServer.$(obj_suff) - -headers = OTM_Main.h \ - OTM_Defines.h \ - OTM_DX9_dll.h \ - OTM_IDirect3D9.h \ - OTM_IDirect3DDevice9.h \ - OTM_TextureFunction.h \ - OTM_IDirect3DTexture9.h \ - OTM_IDirect3DVolumeTexture9.h \ - OTM_IDirect3DCubeTexture9.h \ - OTM_ArrayHandler.h \ - OTM_TextureClient.h \ - OTM_TextureServer.h - -$(bin)\d3d9.dll: $(objects) - $(CLINK) $(LFLAGS) $(objects) /OUT:$(bin)\$(dll) - copy $(bin)\$(dll) ..\OTM_GUI\bin\$(dll) - -$(obj)\OTM_DX9_dll.$(obj_suff): OTM_DX9_dll.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_DX9_dll.cpp - -$(obj)\OTM_IDirect3D9.$(obj_suff): OTM_IDirect3D9.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3D9.cpp - -$(obj)\OTM_IDirect3D9Ex.$(obj_suff): OTM_IDirect3D9Ex.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3D9Ex.cpp - -$(obj)\OTM_IDirect3DDevice9.$(obj_suff): OTM_IDirect3DDevice9.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3DDevice9.cpp - -$(obj)\OTM_IDirect3DDevice9Ex.$(obj_suff): OTM_IDirect3DDevice9Ex.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3DDevice9Ex.cpp - -$(obj)\OTM_TextureFunction.$(obj_suff): OTM_TextureFunction.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_TextureFunction.cpp - -$(obj)\OTM_IDirect3DTexture9.$(obj_suff): OTM_IDirect3DTexture9.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3DTexture9.cpp - -$(obj)\OTM_IDirect3DVolumeTexture9.$(obj_suff): OTM_IDirect3DVolumeTexture9.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3DVolumeTexture9.cpp - -$(obj)\OTM_IDirect3DCubeTexture9.$(obj_suff): OTM_IDirect3DCubeTexture9.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_IDirect3DCubeTexture9.cpp - -$(obj)\OTM_ArrayHandler.$(obj_suff): OTM_ArrayHandler.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_ArrayHandler.cpp - -$(obj)\OTM_TextureClient.$(obj_suff): OTM_TextureClient.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_TextureClient.cpp - -$(obj)\OTM_TextureServer.$(obj_suff): OTM_TextureServer.cpp $(headers) - $(CXX) $(CFLAGS) /c /Fo$@ OTM_TextureServer.cpp - -clean: - del $(objects) $(bin)\$(dll) \ No newline at end of file diff --git a/OTM_GUI/OTM.ico b/OTM_GUI/OTM.ico deleted file mode 100644 index d04d250..0000000 Binary files a/OTM_GUI/OTM.ico and /dev/null differ diff --git a/OTM_GUI/OTM.rc b/OTM_GUI/OTM.rc deleted file mode 100644 index bd6ec5f..0000000 --- a/OTM_GUI/OTM.rc +++ /dev/null @@ -1 +0,0 @@ -MAINICON ICON "OTM.ico" \ No newline at end of file diff --git a/uMod_DX9/makefile.gcc b/uMod_DX9/makefile.gcc new file mode 100644 index 0000000..22617f1 --- /dev/null +++ b/uMod_DX9/makefile.gcc @@ -0,0 +1,117 @@ +ifdef NI + +ifdef ALPHA +precompiler_flag = /D "ALPHA" /D "NO_INJECTION" +else +precompiler_flag = /D "NO_INJECTION" +endif + +def_file = /DEF:"uMod_DX9_dll_NO_INJECTION.def" +obj_suff = NO_INJECTION.obj +dll = d3d9.dll + +else + +ifdef DI +ifdef ALPHA +precompiler_flag = /D "ALPHA" /D "DIRECT_INJECTION" +else +precompiler_flag = /D "DIRECT_INJECTION" +endif + +def_file = /DEF:"uMod_DX9_dll_DIRECT_INJECTION.def" +obj_suff = DI.obj +dll = uMod_d3d9_DI.dll + +else + +ifdef ALPHA +precompiler_flag = /D "ALPHA" /D "HOOK_INJECTION" +else +precompiler_flag = /D "HOOK_INJECTION" +endif + +def_file = /DEF:"uMod_DX9_dll_HOOK_INJECTION.def" +obj_suff = HI.obj +dll = uMod_d3d9_HIdll +endif +endif + + +CXX = cl +CLINK = link.exe +DEFINES = /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" +CFLAGS = /I "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /nologo /W3 /WX- /O2 ${DEFINES} ${precompiler_flag} /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t +LFLAGS = /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86" /DLL "Winmm.lib" "d3dx9.lib" "dxguid.lib" "user32.lib" "Kernel32.lib" ${def_file} /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO /NXCOMPAT:NO /MACHINE:X86 + +obj = obj +bin = bin + +objects = ${obj}\uMod_DX9_dll.${obj_suff} \ + ${obj}\uMod_IDirect3D9.${obj_suff} \ + ${obj}\uMod_IDirect3D9Ex.${obj_suff} \ + ${obj}\uMod_IDirect3DDevice9.${obj_suff} \ + ${obj}\uMod_IDirect3DDevice9Ex.${obj_suff} \ + ${obj}\uMod_TextureFunction.${obj_suff} \ + ${obj}\uMod_IDirect3DTexture9.${obj_suff} \ + ${obj}\uMod_IDirect3DVolumeTexture9.${obj_suff} \ + ${obj}\uMod_IDirect3DCubeTexture9.${obj_suff} \ + ${obj}\uMod_ArrayHandler.${obj_suff} \ + ${obj}\uMod_TextureClient.${obj_suff} \ + ${obj}\uMod_TextureServer.${obj_suff} + +headers = uMod_Main.h \ + uMod_Defines.h \ + uMod_DX9_dll.h \ + uMod_IDirect3D9.h \ + uMod_IDirect3DDevice9.h \ + uMod_TextureFunction.h \ + uMod_IDirect3DTexture9.h \ + uMod_IDirect3DVolumeTexture9.h \ + uMod_IDirect3DCubeTexture9.h \ + uMod_ArrayHandler.h \ + uMod_TextureClient.h \ + uMod_TextureServer.h + +${bin}\d3d9.dll: ${objects} + ${CLINK} ${LFLAGS} ${objects} /OUT:${bin}\${dll} + copy ${bin}\${dll} ..\uMod_GUI\bin\${dll} + +${obj}\uMod_DX9_dll.${obj_suff}: uMod_DX9_dll.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3D9.${obj_suff}: uMod_IDirect3D9.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3D9Ex.${obj_suff}: uMod_IDirect3D9Ex.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3DDevice9.${obj_suff}: uMod_IDirect3DDevice9.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3DDevice9Ex.${obj_suff}: uMod_IDirect3DDevice9Ex.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_TextureFunction.${obj_suff}: uMod_TextureFunction.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3DTexture9.${obj_suff}: uMod_IDirect3DTexture9.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3DVolumeTexture9.${obj_suff}: uMod_IDirect3DVolumeTexture9.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_IDirect3DCubeTexture9.${obj_suff}: uMod_IDirect3DCubeTexture9.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_ArrayHandler.${obj_suff}: uMod_ArrayHandler.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_TextureClient.${obj_suff}: uMod_TextureClient.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +${obj}\uMod_TextureServer.${obj_suff}: uMod_TextureServer.cpp ${headers} + ${CXX} ${CFLAGS} /c $< /Fo$@ + +clean: + del ${objects} ${bin}\${dll} \ No newline at end of file diff --git a/uMod_DX9/makefile.vc b/uMod_DX9/makefile.vc new file mode 100644 index 0000000..0e129a5 --- /dev/null +++ b/uMod_DX9/makefile.vc @@ -0,0 +1,117 @@ +!IFDEF NI + +!IFDEF ALPHA +precompiler_flag = /D "ALPHA" /D "NO_INJECTION" +!ELSE +precompiler_flag = /D "NO_INJECTION" +!ENDIF + +def_file = /DEF:"uMod_DX9_dll_NO_INJECTION.def" +obj_suff = NO_INJECTION.obj +dll = d3d9.dll + +!ELSE + +!IFDEF DI +!IFDEF ALPHA +precompiler_flag = /D "ALPHA" /D "DIRECT_INJECTION" +!ELSE +precompiler_flag = /D "DIRECT_INJECTION" +!ENDIF + +def_file = /DEF:"uMod_DX9_dll_DIRECT_INJECTION.def" +obj_suff = DI.obj +dll = uMod_d3d9_DI.dll + +!ELSE + +!IFDEF ALPHA +precompiler_flag = /D "ALPHA" /D "HOOK_INJECTION" +!ELSE +precompiler_flag = /D "HOOK_INJECTION" +!ENDIF + +def_file = /DEF:"uMod_DX9_dll_HOOK_INJECTION.def" +obj_suff = HOOK.obj +dll = uMod_d3d9_Hook.dll + +!ENDIF + + +CXX = cl +CLINK = link.exe +DEFINES = /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" +CFLAGS = /I "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /nologo /W3 /WX- /O2 $(DEFINES) $(precompiler_flag) /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t +LFLAGS = /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86" /DLL "Winmm.lib" "d3dx9.lib" "dxguid.lib" "user32.lib" "Kernel32.lib" $(def_file) /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE:NO /NXCOMPAT:NO /MACHINE:X86 + +obj = obj +bin = bin + +objects = $(obj)\uMod_DX9_dll.$(obj_suff) \ + $(obj)\uMod_IDirect3D9.$(obj_suff) \ + $(obj)\uMod_IDirect3D9Ex.$(obj_suff) \ + $(obj)\uMod_IDirect3DDevice9.$(obj_suff) \ + $(obj)\uMod_IDirect3DDevice9Ex.$(obj_suff) \ + $(obj)\uMod_TextureFunction.$(obj_suff) \ + $(obj)\uMod_IDirect3DTexture9.$(obj_suff) \ + $(obj)\uMod_IDirect3DVolumeTexture9.$(obj_suff) \ + $(obj)\uMod_IDirect3DCubeTexture9.$(obj_suff) \ + $(obj)\uMod_ArrayHandler.$(obj_suff) \ + $(obj)\uMod_TextureClient.$(obj_suff) \ + $(obj)\uMod_TextureServer.$(obj_suff) + +headers = uMod_Main.h \ + uMod_Defines.h \ + uMod_DX9_dll.h \ + uMod_IDirect3D9.h \ + uMod_IDirect3DDevice9.h \ + uMod_TextureFunction.h \ + uMod_IDirect3DTexture9.h \ + uMod_IDirect3DVolumeTexture9.h \ + uMod_IDirect3DCubeTexture9.h \ + uMod_ArrayHandler.h \ + uMod_TextureClient.h \ + uMod_TextureServer.h + +$(bin)\d3d9.dll: $(objects) + $(CLINK) $(LFLAGS) $(objects) /OUT:$(bin)\$(dll) + copy $(bin)\$(dll) ..\uMod_GUI\bin\$(dll) + +$(obj)\uMod_DX9_dll.$(obj_suff): uMod_DX9_dll.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_DX9_dll.cpp + +$(obj)\uMod_IDirect3D9.$(obj_suff): uMod_IDirect3D9.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3D9.cpp + +$(obj)\uMod_IDirect3D9Ex.$(obj_suff): uMod_IDirect3D9Ex.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3D9Ex.cpp + +$(obj)\uMod_IDirect3DDevice9.$(obj_suff): uMod_IDirect3DDevice9.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3DDevice9.cpp + +$(obj)\uMod_IDirect3DDevice9Ex.$(obj_suff): uMod_IDirect3DDevice9Ex.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3DDevice9Ex.cpp + +$(obj)\uMod_TextureFunction.$(obj_suff): uMod_TextureFunction.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_TextureFunction.cpp + +$(obj)\uMod_IDirect3DTexture9.$(obj_suff): uMod_IDirect3DTexture9.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3DTexture9.cpp + +$(obj)\uMod_IDirect3DVolumeTexture9.$(obj_suff): uMod_IDirect3DVolumeTexture9.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3DVolumeTexture9.cpp + +$(obj)\uMod_IDirect3DCubeTexture9.$(obj_suff): uMod_IDirect3DCubeTexture9.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_IDirect3DCubeTexture9.cpp + +$(obj)\uMod_ArrayHandler.$(obj_suff): uMod_ArrayHandler.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_ArrayHandler.cpp + +$(obj)\uMod_TextureClient.$(obj_suff): uMod_TextureClient.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_TextureClient.cpp + +$(obj)\uMod_TextureServer.$(obj_suff): uMod_TextureServer.cpp $(headers) + $(CXX) $(CFLAGS) /c /Fo$@ uMod_TextureServer.cpp + +clean: + del $(objects) $(bin)\$(dll) \ No newline at end of file diff --git a/OTM_DX9/OTM_ArrayHandler.cpp b/uMod_DX9/uMod_ArrayHandler.cpp similarity index 65% rename from OTM_DX9/OTM_ArrayHandler.cpp rename to uMod_DX9/uMod_ArrayHandler.cpp index bf76607..add6aca 100644 --- a/OTM_DX9/OTM_ArrayHandler.cpp +++ b/uMod_DX9/uMod_ArrayHandler.cpp @@ -1,41 +1,41 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_FileHandler::OTM_FileHandler(void) +uMod_FileHandler::uMod_FileHandler(void) { - Message("OTM_FileHandler(void): %lu\n", this); + Message("uMod_FileHandler(void): %lu\n", this); Number = 0; FieldCounter = 0; Files = NULL; } -OTM_FileHandler::~OTM_FileHandler(void) +uMod_FileHandler::~uMod_FileHandler(void) { - Message("~OTM_FileHandler(void): %lu\n", this); + Message("~uMod_FileHandler(void): %lu\n", this); if (Files!=NULL) { for (int i=0; iReference>=0) return (RETURN_UPDATE_ALLREADY_ADDED); @@ -56,7 +56,7 @@ int OTM_FileHandler::Add(TextureFileStruct* file) try {temp = new TextureFileStruct**[FieldCounter+10];} catch (...) { - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_TEXTURE; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_TEXTURE; return (RETURN_NO_MEMORY); } @@ -76,7 +76,7 @@ int OTM_FileHandler::Add(TextureFileStruct* file) catch (...) { Files[Number/FieldLength] = NULL; - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_TEXTURE; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_TEXTURE; return (RETURN_NO_MEMORY); } } @@ -88,10 +88,10 @@ int OTM_FileHandler::Add(TextureFileStruct* file) } -int OTM_FileHandler::Remove(TextureFileStruct* file) +int uMod_FileHandler::Remove(TextureFileStruct* file) { - Message("OTM_FileHandler::Remove(%lu): %lu\n", file, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + Message("uMod_FileHandler::Remove(%lu): %lu\n", file, this); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); int ref = file->Reference; if (ref<0) return (RETURN_OK); // returning if no Reference is set diff --git a/OTM_DX9/OTM_ArrayHandler.h b/uMod_DX9/uMod_ArrayHandler.h similarity index 64% rename from OTM_DX9/OTM_ArrayHandler.h rename to uMod_DX9/uMod_ArrayHandler.h index d43ae6e..428323b 100644 --- a/OTM_DX9/OTM_ArrayHandler.h +++ b/uMod_DX9/uMod_ArrayHandler.h @@ -1,28 +1,28 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_FIELDHANDLER_H_ -#define OTM_FIELDHANDLER_H_ +#ifndef uMod_FIELDHANDLER_H_ +#define uMod_FIELDHANDLER_H_ -#include "..\OTM_GlobalDefines.h" -#include "OTM_IDirect3DTexture9.h" +#include "..\uMod_GlobalDefines.h" +#include "uMod_IDirect3DTexture9.h" typedef struct { @@ -37,11 +37,11 @@ typedef struct -class OTM_FileHandler // array to store TextureFileStruct +class uMod_FileHandler // array to store TextureFileStruct { public: - OTM_FileHandler(void); - ~OTM_FileHandler(void); + uMod_FileHandler(void); + ~uMod_FileHandler(void); int Add( TextureFileStruct* file); int Remove( TextureFileStruct* file); @@ -60,11 +60,11 @@ protected: template -class OTM_TextureHandler // array to store OTM_IDirect3DTexture9, OTM_IDirect3DVolumeTexture9 or OTM_IDirect3DCubeTexture9 +class uMod_TextureHandler // array to store uMod_IDirect3DTexture9, uMod_IDirect3DVolumeTexture9 or uMod_IDirect3DCubeTexture9 { public: - OTM_TextureHandler(void); - ~OTM_TextureHandler(void); + uMod_TextureHandler(void); + ~uMod_TextureHandler(void); int Add( T* texture); int Remove( T* texture); @@ -92,9 +92,9 @@ private: template -OTM_TextureHandler::OTM_TextureHandler(void) +uMod_TextureHandler::uMod_TextureHandler(void) { - Message("OTM_TextureHandler(void): %lu\n", this); + Message("uMod_TextureHandler(void): %lu\n", this); Number = 0; FieldCounter = 0; @@ -102,9 +102,9 @@ OTM_TextureHandler::OTM_TextureHandler(void) } template -OTM_TextureHandler::~OTM_TextureHandler(void) +uMod_TextureHandler::~uMod_TextureHandler(void) { - Message("~OTM_TextureHandler(void): %lu\n", this); + Message("~uMod_TextureHandler(void): %lu\n", this); if (Textures!=NULL) { for (int i=0; i::~OTM_TextureHandler(void) } template -int OTM_TextureHandler::Add(T* pTexture) +int uMod_TextureHandler::Add(T* pTexture) { - Message("OTM_TextureHandler::Add( %lu): %lu\n", pTexture, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + Message("uMod_TextureHandler::Add( %lu): %lu\n", pTexture, this); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); if (pTexture->Reference>=0) return (RETURN_TEXTURE_ALLREADY_ADDED); @@ -126,7 +126,7 @@ int OTM_TextureHandler::Add(T* pTexture) try {temp = new T**[FieldCounter+10];} catch (...) { - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_TEXTURE; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_TEXTURE; return (RETURN_NO_MEMORY); } @@ -146,7 +146,7 @@ int OTM_TextureHandler::Add(T* pTexture) catch (...) { Textures[Number/FieldLength]=NULL; - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_TEXTURE; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_TEXTURE; return (RETURN_NO_MEMORY); } } @@ -159,10 +159,10 @@ int OTM_TextureHandler::Add(T* pTexture) template -int OTM_TextureHandler::Remove(T* pTexture) //will be called, if a texture is completely released +int uMod_TextureHandler::Remove(T* pTexture) //will be called, if a texture is completely released { - Message("OTM_TextureHandler::Remove( %lu): %lu\n", pTexture, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + Message("uMod_TextureHandler::Remove( %lu): %lu\n", pTexture, this); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); int ref = pTexture->Reference; if (ref<0) return (RETURN_OK); // returning if no TextureHandlerRef is set @@ -180,4 +180,4 @@ int OTM_TextureHandler::Remove(T* pTexture) //will be called, if a texture is -#endif /* OTM_FIELDHANDLER_H_ */ +#endif /* uMod_FIELDHANDLER_H_ */ diff --git a/OTM_DX9/OTM_DX9_dll.cpp b/uMod_DX9/uMod_DX9_dll.cpp similarity index 83% rename from OTM_DX9/OTM_DX9_dll.cpp rename to uMod_DX9/uMod_DX9_dll.cpp index 14ac0c1..805f294 100644 --- a/OTM_DX9/OTM_DX9_dll.cpp +++ b/uMod_DX9/uMod_DX9_dll.cpp @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -25,7 +25,7 @@ along with OpenTexMod. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" //#include "detours.h" //#include "detourxs/detourxs/detourxs.h" @@ -38,7 +38,7 @@ along with OpenTexMod. If not, see . */ HINSTANCE gl_hOriginalDll = NULL; HINSTANCE gl_hThisInstance = NULL; -OTM_TextureServer* gl_TextureServer = NULL; +uMod_TextureServer* gl_TextureServer = NULL; HANDLE gl_ServerThread = NULL; typedef IDirect3D9 *(APIENTRY *Direct3DCreate9_type)(UINT); @@ -112,7 +112,7 @@ void InitInstance(HINSTANCE hModule) OpenMessage(); Message("InitInstance: %lu\n", hModule); - gl_TextureServer = new OTM_TextureServer(game); //create the server which listen on the pipe and prepare the update for the texture clients + gl_TextureServer = new uMod_TextureServer(game); //create the server which listen on the pipe and prepare the update for the texture clients LoadOriginalDll(); @@ -122,14 +122,14 @@ void InitInstance(HINSTANCE hModule) if (Direct3DCreate9_fn!=NULL) { Message("Detour: Direct3DCreate9\n"); - Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*)Direct3DCreate9_fn, (BYTE*)OTM_Direct3DCreate9, 5); + Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*)Direct3DCreate9_fn, (BYTE*)uMod_Direct3DCreate9, 5); } Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type) GetProcAddress(gl_hOriginalDll, "Direct3DCreate9Ex"); if (Direct3DCreate9Ex_fn!=NULL) { Message("Detour: Direct3DCreate9Ex\n"); - Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*)Direct3DCreate9Ex_fn, (BYTE*)OTM_Direct3DCreate9Ex, 7); + Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*)Direct3DCreate9Ex_fn, (BYTE*)uMod_Direct3DCreate9Ex, 7); } #endif @@ -214,8 +214,8 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) //Create originale IDirect3D9 object IDirect3D9 *pIDirect3D9_orig = D3DCreate9_fn(SDKVersion); - //create our OTM_IDirect3D9 object - OTM_IDirect3D9 *pIDirect3D9 = new OTM_IDirect3D9( pIDirect3D9_orig, gl_TextureServer); + //create our uMod_IDirect3D9 object + uMod_IDirect3D9 *pIDirect3D9 = new uMod_IDirect3D9( pIDirect3D9_orig, gl_TextureServer); // Return pointer to our object instead of "real one" return (pIDirect3D9); @@ -243,8 +243,8 @@ HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex **ppD3D) HRESULT ret = D3DCreate9Ex_fn( SDKVersion, &pIDirect3D9Ex_orig); if (ret!=S_OK) return (ret); - //create our OTM_IDirect3D9 object - OTM_IDirect3D9Ex *pIDirect3D9Ex = new OTM_IDirect3D9Ex( pIDirect3D9Ex_orig, gl_TextureServer); + //create our uMod_IDirect3D9 object + uMod_IDirect3D9Ex *pIDirect3D9Ex = new uMod_IDirect3D9Ex( pIDirect3D9Ex_orig, gl_TextureServer); ppD3D = &pIDirect3D9Ex_orig; // Return pointer to our object instead of "real one" return (ret); @@ -269,9 +269,9 @@ bool HookThisProgram( wchar_t *ret) //this function always return true, it is ne * We inject the dll into the game, thus we retour the original Direct3DCreate9 function to our MyDirect3DCreate9 function */ -IDirect3D9 *APIENTRY OTM_Direct3DCreate9(UINT SDKVersion) +IDirect3D9 *APIENTRY uMod_Direct3DCreate9(UINT SDKVersion) { - Message("OTM_Direct3DCreate9: original %lu, OTM %lu\n", Direct3DCreate9_fn, OTM_Direct3DCreate9); + Message("uMod_Direct3DCreate9: original %lu, uMod %lu\n", Direct3DCreate9_fn, uMod_Direct3DCreate9); // in the Internet are many tutorials for detouring functions and all of them will work without the following 5 marked lines // but somehow, for me it only works, if I retour the function and calling afterward the original function @@ -298,26 +298,26 @@ IDirect3D9 *APIENTRY OTM_Direct3DCreate9(UINT SDKVersion) pIDirect3D9_orig = Direct3DCreate9_fn(SDKVersion); //creating the original IDirect3D9 object } else return (NULL); - OTM_IDirect3D9 *pIDirect3D9; + uMod_IDirect3D9 *pIDirect3D9; if (pIDirect3D9_orig) { - pIDirect3D9 = new OTM_IDirect3D9( pIDirect3D9_orig, gl_TextureServer); //creating our OTM_IDirect3D9 object + pIDirect3D9 = new uMod_IDirect3D9( pIDirect3D9_orig, gl_TextureServer); //creating our uMod_IDirect3D9 object } // we detour again - Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*) Direct3DCreate9_fn, (BYTE*)OTM_Direct3DCreate9,5); + Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*) Direct3DCreate9_fn, (BYTE*)uMod_Direct3DCreate9,5); /* if (Direct3DCreate9Ex_fn!=NULL) { - Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*) Direct3DCreate9Ex_fn, (BYTE*)OTM_Direct3DCreate9Ex,7); + Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*) Direct3DCreate9Ex_fn, (BYTE*)uMod_Direct3DCreate9Ex,7); } */ return (pIDirect3D9); //return our object instead of the "real one" } -HRESULT APIENTRY OTM_Direct3DCreate9Ex( UINT SDKVersion, IDirect3D9Ex **ppD3D) +HRESULT APIENTRY uMod_Direct3DCreate9Ex( UINT SDKVersion, IDirect3D9Ex **ppD3D) { - Message( "OTM_Direct3DCreate9Ex: original %lu, OTM %lu\n", Direct3DCreate9Ex_fn, OTM_Direct3DCreate9Ex); + Message( "uMod_Direct3DCreate9Ex: original %lu, uMod %lu\n", Direct3DCreate9Ex_fn, uMod_Direct3DCreate9Ex); // in the Internet are many tutorials for detouring functions and all of them will work without the following 5 marked lines // but somehow, for me it only works, if I retour the function and calling afterward the original function @@ -346,20 +346,20 @@ HRESULT APIENTRY OTM_Direct3DCreate9Ex( UINT SDKVersion, IDirect3D9Ex **ppD3D) if (ret!=S_OK) return (ret); - OTM_IDirect3D9Ex *pIDirect3D9Ex; + uMod_IDirect3D9Ex *pIDirect3D9Ex; if (pIDirect3D9Ex_orig) { - pIDirect3D9Ex = new OTM_IDirect3D9Ex( pIDirect3D9Ex_orig, gl_TextureServer); //creating our OTM_IDirect3D9 object + pIDirect3D9Ex = new uMod_IDirect3D9Ex( pIDirect3D9Ex_orig, gl_TextureServer); //creating our uMod_IDirect3D9 object } // we detour again /* if (Direct3DCreate9_fn!=NULL) { - Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*) Direct3DCreate9_fn, (BYTE*)OTM_Direct3DCreate9,5); + Direct3DCreate9_fn = (Direct3DCreate9_type)DetourFunc( (BYTE*) Direct3DCreate9_fn, (BYTE*)uMod_Direct3DCreate9,5); } */ - Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*) Direct3DCreate9Ex_fn, (BYTE*)OTM_Direct3DCreate9Ex,7); + Direct3DCreate9Ex_fn = (Direct3DCreate9Ex_type)DetourFunc( (BYTE*) Direct3DCreate9Ex_fn, (BYTE*)uMod_Direct3DCreate9Ex,7); ppD3D = (IDirect3D9Ex**) &pIDirect3D9Ex; //return our object instead of the "real one" return (ret); } @@ -376,7 +376,7 @@ bool HookThisProgram( wchar_t *ret) FILE* file; wchar_t *app_path = _wgetenv( L"APPDATA"); //asc for the user application directory wchar_t file_name[MAX_PATH]; - swprintf_s( file_name, MAX_PATH, L"%ls\\%ls\\%ls", app_path, OTM_APP_DIR, OTM_APP_DX9); + swprintf_s( file_name, MAX_PATH, L"%ls\\%ls\\%ls", app_path, uMod_APP_DIR, uMod_APP_DX9); if (_wfopen_s( &file, file_name, L"rt,ccs=UTF-16LE")) return (false); // open the file in utf-16 LE mode diff --git a/OTM_DX9/OTM_DX9_dll.h b/uMod_DX9/uMod_DX9_dll.h similarity index 64% rename from OTM_DX9/OTM_DX9_dll.h rename to uMod_DX9/uMod_DX9_dll.h index d8d26cf..5295c33 100644 --- a/OTM_DX9/OTM_DX9_dll.h +++ b/uMod_DX9/uMod_DX9_dll.h @@ -1,25 +1,25 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_DX9_DLL_H_ -#define OTM_DX9_DLL_H_ +#ifndef uMod_DX9_DLL_H_ +#define uMod_DX9_DLL_H_ void InitInstance(HINSTANCE hModule); void ExitInstance(void); @@ -33,8 +33,8 @@ DWORD WINAPI ServerThread( LPVOID lpParam); void *DetourFunc(BYTE *src, const BYTE *dst, const int len); bool RetourFunc(BYTE *src, BYTE *restore, const int len); -IDirect3D9 *APIENTRY OTM_Direct3DCreate9(UINT SDKVersion); -HRESULT APIENTRY OTM_Direct3DCreate9Ex( UINT SDKVersion, IDirect3D9Ex **ppD3D); +IDirect3D9 *APIENTRY uMod_Direct3DCreate9(UINT SDKVersion); +HRESULT APIENTRY uMod_Direct3DCreate9Ex( UINT SDKVersion, IDirect3D9Ex **ppD3D); #ifdef HOOK_INJECTION LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam); diff --git a/uMod_DX9/uMod_DX9_dll_DIRECT_INJECTION.def b/uMod_DX9/uMod_DX9_dll_DIRECT_INJECTION.def new file mode 100644 index 0000000..7a0a69c --- /dev/null +++ b/uMod_DX9/uMod_DX9_dll_DIRECT_INJECTION.def @@ -0,0 +1,5 @@ +LIBRARY "uMod_d3d9_DI" +EXPORTS + uMod_Direct3DCreate9 @1 + uMod_Direct3DCreate9Ex @2 + Nothing @3 \ No newline at end of file diff --git a/uMod_DX9/uMod_DX9_dll_HOOK_INJECTION.def b/uMod_DX9/uMod_DX9_dll_HOOK_INJECTION.def new file mode 100644 index 0000000..a5cc70c --- /dev/null +++ b/uMod_DX9/uMod_DX9_dll_HOOK_INJECTION.def @@ -0,0 +1,6 @@ +LIBRARY "uMod_d3d9_Hook" +EXPORTS + uMod_Direct3DCreate9 @1 + uMod_Direct3DCreate9Ex @2 + InstallHook @3 + RemoveHook @4 \ No newline at end of file diff --git a/OTM_DX9/OTM_DX9_dll_NO_INJECTION.def b/uMod_DX9/uMod_DX9_dll_NO_INJECTION.def similarity index 100% rename from OTM_DX9/OTM_DX9_dll_NO_INJECTION.def rename to uMod_DX9/uMod_DX9_dll_NO_INJECTION.def diff --git a/OTM_DX9/OTM_Defines.h b/uMod_DX9/uMod_Defines.h similarity index 66% rename from OTM_DX9/OTM_Defines.h rename to uMod_DX9/uMod_Defines.h index 314ea27..6f1d8ea 100644 --- a/OTM_DX9/OTM_Defines.h +++ b/uMod_DX9/uMod_Defines.h @@ -1,25 +1,25 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_DEFINES_H_ -#define OTM_DEFINES_H_ +#ifndef uMod_DEFINES_H_ +#define uMod_DEFINES_H_ #ifdef ALPHA @@ -28,7 +28,7 @@ along with OpenTexMod. If not, see . extern FILE *gl_File; #define Message(...) {if (gl_File!=NULL) {fprintf( gl_File, __VA_ARGS__); fflush(gl_File);}} -#define OpenMessage(...) {if (fopen_s( &gl_File, "OTM_log.txt", "wt")) gl_File=NULL; else fprintf( gl_File, "R21: 0000000\n");} +#define OpenMessage(...) {if (fopen_s( &gl_File, "uMod_log.txt", "wt")) gl_File=NULL; else fprintf( gl_File, "R21: 0000000\n");} #define CloseMessage(...) {if (gl_File!=NULL) fclose(gl_File);} @@ -57,4 +57,4 @@ typedef LONG HRESULT; #endif -#endif /* OTM_DEFINES_H_ */ +#endif /* uMod_DEFINES_H_ */ diff --git a/OTM_DX9/OTM_IDirect3D9.cpp b/uMod_DX9/uMod_IDirect3D9.cpp similarity index 50% rename from OTM_DX9/OTM_IDirect3D9.cpp rename to uMod_DX9/uMod_IDirect3D9.cpp index fe1c3c5..3f86b77 100644 --- a/OTM_DX9/OTM_IDirect3D9.cpp +++ b/uMod_DX9/uMod_IDirect3D9.cpp @@ -1,44 +1,44 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" #ifndef PRE_MESSAGE -#define PRE_MESSAGE "OTM_IDirect3D9" +#define PRE_MESSAGE "uMod_IDirect3D9" #endif -OTM_IDirect3D9::OTM_IDirect3D9( IDirect3D9 *pOriginal, OTM_TextureServer* server) +uMod_IDirect3D9::uMod_IDirect3D9( IDirect3D9 *pOriginal, uMod_TextureServer* server) { Message( PRE_MESSAGE "::" PRE_MESSAGE "( %lu, %lu): %lu\n", pOriginal, server, this); m_pIDirect3D9 = pOriginal; - OTM_Server = server; + uMod_Server = server; } -OTM_IDirect3D9::~OTM_IDirect3D9(void) +uMod_IDirect3D9::~uMod_IDirect3D9(void) { Message( PRE_MESSAGE "::~" PRE_MESSAGE "(): %lu\n", this); } -HRESULT __stdcall OTM_IDirect3D9::QueryInterface(REFIID riid, void** ppvObj) +HRESULT __stdcall uMod_IDirect3D9::QueryInterface(REFIID riid, void** ppvObj) { *ppvObj = NULL; @@ -55,12 +55,12 @@ HRESULT __stdcall OTM_IDirect3D9::QueryInterface(REFIID riid, void** ppvObj) return (hRes); } -ULONG __stdcall OTM_IDirect3D9::AddRef(void) +ULONG __stdcall uMod_IDirect3D9::AddRef(void) { return(m_pIDirect3D9->AddRef()); } -ULONG __stdcall OTM_IDirect3D9::Release(void) +ULONG __stdcall uMod_IDirect3D9::Release(void) { // call original routine ULONG count = m_pIDirect3D9->Release(); @@ -74,78 +74,78 @@ ULONG __stdcall OTM_IDirect3D9::Release(void) return(count); } -HRESULT __stdcall OTM_IDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) +HRESULT __stdcall uMod_IDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) { return(m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction)); } -UINT __stdcall OTM_IDirect3D9::GetAdapterCount(void) +UINT __stdcall uMod_IDirect3D9::GetAdapterCount(void) { return(m_pIDirect3D9->GetAdapterCount()); } -HRESULT __stdcall OTM_IDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) +HRESULT __stdcall uMod_IDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) { return(m_pIDirect3D9->GetAdapterIdentifier(Adapter,Flags,pIdentifier)); } -UINT __stdcall OTM_IDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) +UINT __stdcall uMod_IDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) { return(m_pIDirect3D9->GetAdapterModeCount(Adapter, Format)); } -HRESULT __stdcall OTM_IDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) +HRESULT __stdcall uMod_IDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) { return(m_pIDirect3D9->EnumAdapterModes(Adapter,Format,Mode,pMode)); } -HRESULT __stdcall OTM_IDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) +HRESULT __stdcall uMod_IDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) { return(m_pIDirect3D9->GetAdapterDisplayMode(Adapter,pMode)); } -HRESULT __stdcall OTM_IDirect3D9::CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) +HRESULT __stdcall uMod_IDirect3D9::CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) { return(m_pIDirect3D9->CheckDeviceType(iAdapter,DevType,DisplayFormat,BackBufferFormat,bWindowed)); } -HRESULT __stdcall OTM_IDirect3D9::CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) +HRESULT __stdcall uMod_IDirect3D9::CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) { return(m_pIDirect3D9->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat)); } -HRESULT __stdcall OTM_IDirect3D9::CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) +HRESULT __stdcall uMod_IDirect3D9::CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) { return(m_pIDirect3D9->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType,pQualityLevels)); } -HRESULT __stdcall OTM_IDirect3D9::CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) +HRESULT __stdcall uMod_IDirect3D9::CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) { return(m_pIDirect3D9->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat)); } -HRESULT __stdcall OTM_IDirect3D9::CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) +HRESULT __stdcall uMod_IDirect3D9::CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) { return(m_pIDirect3D9->CheckDeviceFormatConversion(Adapter,DeviceType,SourceFormat,TargetFormat)); } -HRESULT __stdcall OTM_IDirect3D9::GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) +HRESULT __stdcall uMod_IDirect3D9::GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) { return(m_pIDirect3D9->GetDeviceCaps(Adapter,DeviceType,pCaps)); } -HMONITOR __stdcall OTM_IDirect3D9::GetAdapterMonitor(UINT Adapter) +HMONITOR __stdcall uMod_IDirect3D9::GetAdapterMonitor(UINT Adapter) { return(m_pIDirect3D9->GetAdapterMonitor(Adapter)); } -HRESULT __stdcall OTM_IDirect3D9::CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) +HRESULT __stdcall uMod_IDirect3D9::CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) { Message( PRE_MESSAGE "::CreateDevice(): %lu\n", this); // we intercept this call and provide our own "fake" Device Object HRESULT hres = m_pIDirect3D9->CreateDevice( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); - OTM_IDirect3DDevice9 *pIDirect3DDevice9 = new OTM_IDirect3DDevice9(*ppReturnedDeviceInterface, OTM_Server); + uMod_IDirect3DDevice9 *pIDirect3DDevice9 = new uMod_IDirect3DDevice9(*ppReturnedDeviceInterface, uMod_Server); // store our pointer (the fake one) for returning it to the calling program *ppReturnedDeviceInterface = pIDirect3DDevice9; diff --git a/OTM_DX9/OTM_IDirect3D9.h b/uMod_DX9/uMod_IDirect3D9.h similarity index 78% rename from OTM_DX9/OTM_IDirect3D9.h rename to uMod_DX9/uMod_IDirect3D9.h index 0b5036a..b6ff69b 100644 --- a/OTM_DX9/OTM_IDirect3D9.h +++ b/uMod_DX9/uMod_IDirect3D9.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -24,20 +24,20 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3D9_H_ -#define OTM_IDirect3D9_H_ +#ifndef uMod_IDirect3D9_H_ +#define uMod_IDirect3D9_H_ #include #include -#include "OTM_TextureServer.h" -#include "OTM_TextureClient.h" +#include "uMod_TextureServer.h" +#include "uMod_TextureClient.h" -class OTM_IDirect3D9 : public IDirect3D9 +class uMod_IDirect3D9 : public IDirect3D9 { public: - OTM_IDirect3D9(IDirect3D9 *pOriginal, OTM_TextureServer *server); - virtual ~OTM_IDirect3D9(void); + uMod_IDirect3D9(IDirect3D9 *pOriginal, uMod_TextureServer *server); + virtual ~uMod_IDirect3D9(void); // The original DX9 function definitions HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); @@ -60,7 +60,7 @@ public: private: IDirect3D9 *m_pIDirect3D9; - OTM_TextureServer* OTM_Server; + uMod_TextureServer* uMod_Server; }; #endif diff --git a/uMod_DX9/uMod_IDirect3D9Ex.cpp b/uMod_DX9/uMod_IDirect3D9Ex.cpp new file mode 100644 index 0000000..bba337f --- /dev/null +++ b/uMod_DX9/uMod_IDirect3D9Ex.cpp @@ -0,0 +1,69 @@ +/* +This file is part of Universal Modding Engine. + + +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ + + + + + +#include "uMod_Main.h" + + + +#define IDirect3D9 IDirect3D9Ex +#define uMod_IDirect3D9 uMod_IDirect3D9Ex +#define m_pIDirect3D9 m_pIDirect3D9Ex +#define PRE_MESSAGE "uMod_IDirect3D9Ex" + +#include "uMod_IDirect3D9.cpp" + + +HRESULT __stdcall uMod_IDirect3D9Ex::CreateDeviceEx( UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3DDevice9Ex **ppReturnedDeviceInterface) +{ + Message( "uMod_IDirect3D9Ex::CreateDeviceEx: %lu\n", this); + // we intercept this call and provide our own "fake" Device Object + HRESULT hres = m_pIDirect3D9Ex->CreateDeviceEx( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface); + + uMod_IDirect3DDevice9Ex *pIDirect3DDevice9Ex = new uMod_IDirect3DDevice9Ex(*ppReturnedDeviceInterface, uMod_Server); + + // store our pointer (the fake one) for returning it to the calling program + *ppReturnedDeviceInterface = pIDirect3DDevice9Ex; + + return(hres); + return (m_pIDirect3D9Ex->CreateDeviceEx( Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface)); +} + +HRESULT __stdcall uMod_IDirect3D9Ex::EnumAdapterModesEx( UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter, UINT Mode, D3DDISPLAYMODEEX *pMode) +{ + return (m_pIDirect3D9Ex->EnumAdapterModesEx( Adapter, pFilter, Mode, pMode)); +} + +HRESULT __stdcall uMod_IDirect3D9Ex::GetAdapterDisplayModeEx( UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) +{ + return (m_pIDirect3D9Ex->GetAdapterDisplayModeEx( Adapter, pMode, pRotation)); +} + +HRESULT __stdcall uMod_IDirect3D9Ex::GetAdapterLUID( UINT Adapter, LUID *pLUID) +{ + return (m_pIDirect3D9Ex->GetAdapterLUID( Adapter, pLUID)); +} + +UINT __stdcall uMod_IDirect3D9Ex::GetAdapterModeCountEx( UINT Adapter, const D3DDISPLAYMODEFILTER *pFilter) +{ + return (m_pIDirect3D9Ex->GetAdapterModeCountEx( Adapter, pFilter)); +} + diff --git a/OTM_DX9/OTM_IDirect3D9Ex.h b/uMod_DX9/uMod_IDirect3D9Ex.h similarity index 81% rename from OTM_DX9/OTM_IDirect3D9Ex.h rename to uMod_DX9/uMod_IDirect3D9Ex.h index 0db8c60..aab671c 100644 --- a/OTM_DX9/OTM_IDirect3D9Ex.h +++ b/uMod_DX9/uMod_IDirect3D9Ex.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -24,20 +24,20 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3D9Ex_H_ -#define OTM_IDirect3D9Ex_H_ +#ifndef uMod_IDirect3D9Ex_H_ +#define uMod_IDirect3D9Ex_H_ #include #include -#include "OTM_TextureServer.h" -#include "OTM_TextureClient.h" +#include "uMod_TextureServer.h" +#include "uMod_TextureClient.h" -class OTM_IDirect3D9Ex : public IDirect3D9Ex +class uMod_IDirect3D9Ex : public IDirect3D9Ex { public: - OTM_IDirect3D9Ex( IDirect3D9Ex *pOriginal, OTM_TextureServer *server); - virtual ~OTM_IDirect3D9Ex(void); + uMod_IDirect3D9Ex( IDirect3D9Ex *pOriginal, uMod_TextureServer *server); + virtual ~uMod_IDirect3D9Ex(void); // The original DX9 function definitions HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); @@ -67,7 +67,7 @@ public: private: IDirect3D9Ex *m_pIDirect3D9Ex; - OTM_TextureServer* OTM_Server; + uMod_TextureServer* uMod_Server; }; #endif diff --git a/OTM_DX9/OTM_IDirect3DCubeTexture9.cpp b/uMod_DX9/uMod_IDirect3DCubeTexture9.cpp similarity index 62% rename from OTM_DX9/OTM_IDirect3DCubeTexture9.cpp rename to uMod_DX9/uMod_IDirect3DCubeTexture9.cpp index 98aebe9..169ff96 100644 --- a/OTM_DX9/OTM_IDirect3DCubeTexture9.cpp +++ b/uMod_DX9/uMod_IDirect3DCubeTexture9.cpp @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -22,18 +22,18 @@ along with OpenTexMod. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::QueryInterface(REFIID riid, void** ppvObj) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::QueryInterface(REFIID riid, void** ppvObj) { if (riid==IID_IDirect3D9) { // This function should never be called with IID_IDirect3D9 by the game // thus this call comes from our own dll to ask for the texture type - // 0x01000000L == OTM_IDirect3DTexture9 - // 0x01000001L == OTM_IDirect3DVolumeTexture9 - // 0x01000002L == OTM_IDirect3DCubeTexture9 + // 0x01000000L == uMod_IDirect3DTexture9 + // 0x01000001L == uMod_IDirect3DVolumeTexture9 + // 0x01000002L == uMod_IDirect3DCubeTexture9 *ppvObj = this; return (0x01000002L); @@ -53,7 +53,7 @@ HRESULT APIENTRY OTM_IDirect3DCubeTexture9::QueryInterface(REFIID riid, void** p } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DCubeTexture9::AddRef() +ULONG APIENTRY uMod_IDirect3DCubeTexture9::AddRef() { if (FAKE) return (1); //bug, this case should never happen if (CrossRef_D3Dtex!=NULL) @@ -64,9 +64,9 @@ ULONG APIENTRY OTM_IDirect3DCubeTexture9::AddRef() } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DCubeTexture9::Release() +ULONG APIENTRY uMod_IDirect3DCubeTexture9::Release() { - Message("OTM_IDirect3DCubeTexture9::Release(): %lu\n", this); + Message("uMod_IDirect3DCubeTexture9::Release(): %lu\n", this); void *cpy; long ret = m_D3Ddev->QueryInterface( IID_IDirect3DTexture9, &cpy); @@ -81,18 +81,18 @@ ULONG APIENTRY OTM_IDirect3DCubeTexture9::Release() { if (CrossRef_D3Dtex!=NULL) //if this texture is switched with a fake texture { - OTM_IDirect3DCubeTexture9 *fake_texture = CrossRef_D3Dtex; + uMod_IDirect3DCubeTexture9 *fake_texture = CrossRef_D3Dtex; count = fake_texture->m_D3Dtex->Release(); //release the original texture if (count==0) //if texture is released we switch the textures back { UnswitchTextures(this); if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetSingleCubeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetSingleCubeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleCubeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleCubeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } } } @@ -108,13 +108,13 @@ ULONG APIENTRY OTM_IDirect3DCubeTexture9::Release() // the hash of a non existing texture would be calculated if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedCubeTexture()==this) ((OTM_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedCubeTexture( NULL); - else ((OTM_IDirect3DDevice9*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedCubeTexture()==this) ((uMod_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedCubeTexture( NULL); + else ((uMod_IDirect3DDevice9*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedCubeTexture()==this) ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedCubeTexture( NULL); - else ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedCubeTexture()==this) ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedCubeTexture( NULL); + else ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } delete(this); @@ -122,113 +122,113 @@ ULONG APIENTRY OTM_IDirect3DCubeTexture9::Release() return (count); } -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::GetDevice(IDirect3DDevice9** ppDevice) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::GetDevice(IDirect3DDevice9** ppDevice) { *ppDevice = m_D3Ddev; return D3D_OK; } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); return (m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); return (m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::FreePrivateData(REFGUID refguid) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::FreePrivateData(REFGUID refguid) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->FreePrivateData(refguid)); return (m_D3Dtex->FreePrivateData(refguid)); } -DWORD APIENTRY OTM_IDirect3DCubeTexture9::SetPriority(DWORD PriorityNew) +DWORD APIENTRY uMod_IDirect3DCubeTexture9::SetPriority(DWORD PriorityNew) { return (m_D3Dtex->SetPriority(PriorityNew)); } -DWORD APIENTRY OTM_IDirect3DCubeTexture9::GetPriority() +DWORD APIENTRY uMod_IDirect3DCubeTexture9::GetPriority() { return (m_D3Dtex->GetPriority()); } -void APIENTRY OTM_IDirect3DCubeTexture9::PreLoad() +void APIENTRY uMod_IDirect3DCubeTexture9::PreLoad() { m_D3Dtex->PreLoad(); } -D3DRESOURCETYPE APIENTRY OTM_IDirect3DCubeTexture9::GetType() +D3DRESOURCETYPE APIENTRY uMod_IDirect3DCubeTexture9::GetType() { return (m_D3Dtex->GetType()); } -DWORD APIENTRY OTM_IDirect3DCubeTexture9::SetLOD(DWORD LODNew) +DWORD APIENTRY uMod_IDirect3DCubeTexture9::SetLOD(DWORD LODNew) { return (m_D3Dtex->SetLOD(LODNew)); } -DWORD APIENTRY OTM_IDirect3DCubeTexture9::GetLOD() +DWORD APIENTRY uMod_IDirect3DCubeTexture9::GetLOD() { return (m_D3Dtex->GetLOD()); } -DWORD APIENTRY OTM_IDirect3DCubeTexture9::GetLevelCount() +DWORD APIENTRY uMod_IDirect3DCubeTexture9::GetLevelCount() { return (m_D3Dtex->GetLevelCount()); } -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) { return (m_D3Dtex->SetAutoGenFilterType(FilterType)); } -D3DTEXTUREFILTERTYPE APIENTRY OTM_IDirect3DCubeTexture9::GetAutoGenFilterType() +D3DTEXTUREFILTERTYPE APIENTRY uMod_IDirect3DCubeTexture9::GetAutoGenFilterType() { return (m_D3Dtex->GetAutoGenFilterType()); } -void APIENTRY OTM_IDirect3DCubeTexture9::GenerateMipSubLevels() +void APIENTRY uMod_IDirect3DCubeTexture9::GenerateMipSubLevels() { m_D3Dtex->GenerateMipSubLevels(); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::AddDirtyRect(D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::AddDirtyRect(D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->AddDirtyRect( FaceType, pDirtyRect)); return (m_D3Dtex->AddDirtyRect( FaceType, pDirtyRect)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetLevelDesc(Level, pDesc)); return (m_D3Dtex->GetLevelDesc(Level, pDesc)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::GetCubeMapSurface(D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9 **ppCubeMapSurface) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::GetCubeMapSurface(D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9 **ppCubeMapSurface) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetCubeMapSurface( FaceType, Level, ppCubeMapSurface)); return (m_D3Dtex->GetCubeMapSurface( FaceType, Level, ppCubeMapSurface)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::LockRect( D3DCUBEMAP_FACES FaceType, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::LockRect( D3DCUBEMAP_FACES FaceType, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->LockRect( FaceType, Level, pLockedRect, pRect, Flags)); return (m_D3Dtex->LockRect( FaceType, Level, pLockedRect, pRect, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DCubeTexture9::UnlockRect( D3DCUBEMAP_FACES FaceType, UINT Level) +HRESULT APIENTRY uMod_IDirect3DCubeTexture9::UnlockRect( D3DCUBEMAP_FACES FaceType, UINT Level) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->UnlockRect( FaceType, Level)); return (m_D3Dtex->UnlockRect( FaceType, Level)); @@ -236,7 +236,7 @@ HRESULT APIENTRY OTM_IDirect3DCubeTexture9::UnlockRect( D3DCUBEMAP_FACES FaceTyp -int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) +int uMod_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) { hash=0u; if (FAKE) return (RETURN_BAD_ARGUMENT); @@ -251,37 +251,37 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) if (pTexture->GetLevelDesc(0, &desc)!=D3D_OK) //get the format and the size of the texture { - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: GetLevelDesc \n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: GetLevelDesc \n"); return (RETURN_GetLevelDesc_FAILED); } - Message("OTM_IDirect3DCubeTexture9::GetHash() (%d %d) %d\n", desc.Width, desc.Height, desc.Format); + Message("uMod_IDirect3DCubeTexture9::GetHash() (%d %d) %d\n", desc.Width, desc.Height, desc.Format); /* if (desc.Pool==D3DPOOL_DEFAULT) //get the raw data of the texture { - //Message("OTM_IDirect3DCubeTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); + //Message("uMod_IDirect3DCubeTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); IDirect3DSurface9 *pSurfaceLevel_orig = NULL; if (pTexture->GetSurfaceLevel( 0, &pSurfaceLevel_orig)!=D3D_OK) { - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) { - //Message("OTM_IDirect3DCubeTexture9::GetHash() MultiSampleType\n"); + //Message("uMod_IDirect3DCubeTexture9::GetHash() MultiSampleType\n"); if (D3D_OK!=m_D3Ddev->CreateRenderTarget( desc.Width, desc.Height, desc.Format, D3DMULTISAMPLE_NONE, 0, FALSE, &pResolvedSurface, NULL )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } if (D3D_OK!=m_D3Ddev->StretchRect( pSurfaceLevel_orig, NULL, pResolvedSurface, NULL, D3DTEXF_NONE )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } @@ -293,7 +293,7 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) { pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); return (RETURN_TEXTURE_NOT_LOADED); } @@ -302,7 +302,7 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } pSurfaceLevel_orig->Release(); @@ -311,7 +311,7 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) { if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } } @@ -319,16 +319,16 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) */ if (pTexture->LockRect( D3DCUBEMAP_FACE_POSITIVE_X, 0, &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: LockRect 1\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: LockRect 1\n"); if (pTexture->GetCubeMapSurface( D3DCUBEMAP_FACE_POSITIVE_X, 0, &pResolvedSurface)!=D3D_OK) { - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: GetSurfaceLevel\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: GetSurfaceLevel\n"); return (RETURN_LockRect_FAILED); } if (pResolvedSurface->LockRect( &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { pResolvedSurface->Release(); - Message("OTM_IDirect3DCubeTexture9::GetHash() Failed: LockRect 2\n"); + Message("uMod_IDirect3DCubeTexture9::GetHash() Failed: LockRect 2\n"); return (RETURN_LockRect_FAILED); } } @@ -357,7 +357,7 @@ int OTM_IDirect3DCubeTexture9::GetHash(MyTypeHash &hash) pTexture->UnlockRect( D3DCUBEMAP_FACE_POSITIVE_X, 0); //unlock the raw data } - Message("OTM_IDirect3DCubeTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); + Message("uMod_IDirect3DCubeTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); return (RETURN_OK); } diff --git a/OTM_DX9/OTM_IDirect3DCubeTexture9.h b/uMod_DX9/uMod_IDirect3DCubeTexture9.h similarity index 74% rename from OTM_DX9/OTM_IDirect3DCubeTexture9.h rename to uMod_DX9/uMod_IDirect3DCubeTexture9.h index 5272afd..67678a1 100644 --- a/OTM_DX9/OTM_IDirect3DCubeTexture9.h +++ b/uMod_DX9/uMod_IDirect3DCubeTexture9.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ @@ -25,24 +25,24 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3DCubeTexture9_H -#define OTM_IDirect3DCubeTexture9_H +#ifndef uMod_IDirect3DCubeTexture9_H +#define uMod_IDirect3DCubeTexture9_H #include #include -#include "OTM_Defines.h" +#include "uMod_Defines.h" -interface OTM_IDirect3DCubeTexture9 : public IDirect3DCubeTexture9 +interface uMod_IDirect3DCubeTexture9 : public IDirect3DCubeTexture9 { - OTM_IDirect3DCubeTexture9(IDirect3DCubeTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) + uMod_IDirect3DCubeTexture9(IDirect3DCubeTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) { m_D3Dtex = *ppTex; //Texture which will be displayed and will be passed to the game m_D3Ddev = pIDirect3DDevice9; //device pointer CrossRef_D3Dtex = NULL; //cross reference - // fake texture: store the pointer to the original OTM_IDirect3DCubeTexture9 object, needed if a fake texture is unselected + // fake texture: store the pointer to the original uMod_IDirect3DCubeTexture9 object, needed if a fake texture is unselected // original texture: stores the pointer to the fake texture object, is needed if original texture is deleted, // thus the fake texture can also be deleted Reference = -1; //need for fast deleting @@ -52,7 +52,7 @@ interface OTM_IDirect3DCubeTexture9 : public IDirect3DCubeTexture9 // callback interface IDirect3DCubeTexture9 *m_D3Dtex; - OTM_IDirect3DCubeTexture9 *CrossRef_D3Dtex; + uMod_IDirect3DCubeTexture9 *CrossRef_D3Dtex; IDirect3DDevice9 *m_D3Ddev; int Reference; MyTypeHash Hash; @@ -89,9 +89,9 @@ interface OTM_IDirect3DCubeTexture9 : public IDirect3DCubeTexture9 -inline void UnswitchTextures(OTM_IDirect3DCubeTexture9 *pTexture) +inline void UnswitchTextures(uMod_IDirect3DCubeTexture9 *pTexture) { - OTM_IDirect3DCubeTexture9* CrossRef = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DCubeTexture9* CrossRef = pTexture->CrossRef_D3Dtex; if (CrossRef!=NULL) { // switch textures back @@ -105,7 +105,7 @@ inline void UnswitchTextures(OTM_IDirect3DCubeTexture9 *pTexture) } } -inline int SwitchTextures( OTM_IDirect3DCubeTexture9 *pTexture1, OTM_IDirect3DCubeTexture9 *pTexture2) +inline int SwitchTextures( uMod_IDirect3DCubeTexture9 *pTexture1, uMod_IDirect3DCubeTexture9 *pTexture2) { if (pTexture1->m_D3Ddev == pTexture2->m_D3Ddev && pTexture1->CrossRef_D3Dtex == NULL && pTexture2->CrossRef_D3Dtex == NULL) { diff --git a/OTM_DX9/OTM_IDirect3DDevice9.cpp b/uMod_DX9/uMod_IDirect3DDevice9.cpp similarity index 55% rename from OTM_DX9/OTM_IDirect3DDevice9.cpp rename to uMod_DX9/uMod_IDirect3DDevice9.cpp index 6dcf84f..ee61a96 100644 --- a/OTM_DX9/OTM_IDirect3DDevice9.cpp +++ b/uMod_DX9/uMod_IDirect3DDevice9.cpp @@ -1,38 +1,38 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" #ifndef RETURN_QueryInterface #define RETURN_QueryInterface 0x01000000L #endif #ifndef PRE_MESSAGE -#define PRE_MESSAGE "OTM_IDirect3DDevice9" +#define PRE_MESSAGE "uMod_IDirect3DDevice9" #endif -int OTM_IDirect3DDevice9::CreateSingleTexture(void) +int uMod_IDirect3DDevice9::CreateSingleTexture(void) { - if (SingleTexture!=NULL && SingleVolumeTexture!=NULL && SingleCubeTexture!=NULL && TextureColour==OTM_Client->TextureColour) return (RETURN_OK); - TextureColour = OTM_Client->TextureColour; + if (SingleTexture!=NULL && SingleVolumeTexture!=NULL && SingleCubeTexture!=NULL && TextureColour==uMod_Client->TextureColour) return (RETURN_OK); + TextureColour = uMod_Client->TextureColour; if (SingleTexture==NULL) //create texture { if( D3D_OK != CreateTexture(8, 8, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, (IDirect3DTexture9**) &SingleTexture, NULL)) @@ -128,12 +128,12 @@ int OTM_IDirect3DDevice9::CreateSingleTexture(void) return (RETURN_OK); } -OTM_IDirect3DDevice9::OTM_IDirect3DDevice9( IDirect3DDevice9* pOriginal, OTM_TextureServer* server) +uMod_IDirect3DDevice9::uMod_IDirect3DDevice9( IDirect3DDevice9* pOriginal, uMod_TextureServer* server) { Message( PRE_MESSAGE "::" PRE_MESSAGE "( %lu, %lu): %lu\n", pOriginal, server, this); - OTM_Server = server; - OTM_Client = new OTM_TextureClient( OTM_Server, this); //get a new texture client for this device + uMod_Server = server; + uMod_Client = new uMod_TextureClient( uMod_Server, this); //get a new texture client for this device LastCreatedTexture = NULL; LastCreatedVolumeTexture = NULL; @@ -148,15 +148,15 @@ OTM_IDirect3DDevice9::OTM_IDirect3DDevice9( IDirect3DDevice9* pOriginal, OTM_Tex SingleVolumeTexture = NULL; SingleCubeTexture = NULL; OSD_Font = NULL; - OTM_Reference = 1; + uMod_Reference = 1; } -OTM_IDirect3DDevice9::~OTM_IDirect3DDevice9(void) +uMod_IDirect3DDevice9::~uMod_IDirect3DDevice9(void) { Message( PRE_MESSAGE "::~" PRE_MESSAGE "(): %lu\n", this); } -HRESULT OTM_IDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) +HRESULT uMod_IDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) { // check if original dll can provide interface. then send *our* address if (riid==IID_IDirect3DTexture9) @@ -172,23 +172,23 @@ HRESULT OTM_IDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) if (*ppvObj == m_pIDirect3DDevice9) { - OTM_Reference++; //increasing our counter + uMod_Reference++; //increasing our counter *ppvObj = this; } return (hRes); } -ULONG OTM_IDirect3DDevice9::AddRef(void) +ULONG uMod_IDirect3DDevice9::AddRef(void) { - OTM_Reference++; //increasing our counter - Message("%lu = " PRE_MESSAGE "::AddRef(): %lu\n", OTM_Reference, this); + uMod_Reference++; //increasing our counter + Message("%lu = " PRE_MESSAGE "::AddRef(): %lu\n", uMod_Reference, this); return (m_pIDirect3DDevice9->AddRef()); } -ULONG OTM_IDirect3DDevice9::Release(void) +ULONG uMod_IDirect3DDevice9::Release(void) { - if (--OTM_Reference==0) //if our counter drops to zero, the real device will be deleted, so we clean up before + if (--uMod_Reference==0) //if our counter drops to zero, the real device will be deleted, so we clean up before { // we must not release the fake textures, cause they are released if the target textures are released // and the target textures are released by the game. @@ -198,216 +198,216 @@ ULONG OTM_IDirect3DDevice9::Release(void) if (SingleCubeTexture!=NULL) SingleCubeTexture->Release(); //this is the only texture we must release by ourself if (OSD_Font!=NULL) OSD_Font->Release(); - if (OTM_Client!=NULL) delete OTM_Client; //must be deleted at the end, because other releases might call a function of this object + if (uMod_Client!=NULL) delete uMod_Client; //must be deleted at the end, because other releases might call a function of this object - OTM_Client = NULL; + uMod_Client = NULL; SingleTexture = NULL; OSD_Font = NULL; } ULONG count = m_pIDirect3DDevice9->Release(); Message("%lu = " PRE_MESSAGE "::Release(): %lu\n", count, this); - if (OTM_Reference!=count) //bug + if (uMod_Reference!=count) //bug { - Message("Error in " PRE_MESSAGE "::Release(): %lu!=%lu\n", OTM_Reference, count); + Message("Error in " PRE_MESSAGE "::Release(): %lu!=%lu\n", uMod_Reference, count); } if (count==0u) delete(this); return (count); } -HRESULT OTM_IDirect3DDevice9::TestCooperativeLevel(void) +HRESULT uMod_IDirect3DDevice9::TestCooperativeLevel(void) { return(m_pIDirect3DDevice9->TestCooperativeLevel()); } -UINT OTM_IDirect3DDevice9::GetAvailableTextureMem(void) +UINT uMod_IDirect3DDevice9::GetAvailableTextureMem(void) { return(m_pIDirect3DDevice9->GetAvailableTextureMem()); } -HRESULT OTM_IDirect3DDevice9::EvictManagedResources(void) +HRESULT uMod_IDirect3DDevice9::EvictManagedResources(void) { return(m_pIDirect3DDevice9->EvictManagedResources()); } -HRESULT OTM_IDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) +HRESULT uMod_IDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) { return(m_pIDirect3DDevice9->GetDirect3D(ppD3D9)); } -HRESULT OTM_IDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) +HRESULT uMod_IDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) { return(m_pIDirect3DDevice9->GetDeviceCaps(pCaps)); } -HRESULT OTM_IDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode) +HRESULT uMod_IDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode) { return(m_pIDirect3DDevice9->GetDisplayMode(iSwapChain, pMode)); } -HRESULT OTM_IDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) +HRESULT uMod_IDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) { return(m_pIDirect3DDevice9->GetCreationParameters(pParameters)); } -HRESULT OTM_IDirect3DDevice9::SetCursorProperties(UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) +HRESULT uMod_IDirect3DDevice9::SetCursorProperties(UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) { return(m_pIDirect3DDevice9->SetCursorProperties(XHotSpot,YHotSpot,pCursorBitmap)); } -void OTM_IDirect3DDevice9::SetCursorPosition(int X,int Y,DWORD Flags) +void uMod_IDirect3DDevice9::SetCursorPosition(int X,int Y,DWORD Flags) { m_pIDirect3DDevice9->SetCursorPosition(X,Y,Flags); } -BOOL OTM_IDirect3DDevice9::ShowCursor(BOOL bShow) +BOOL uMod_IDirect3DDevice9::ShowCursor(BOOL bShow) { return(m_pIDirect3DDevice9->ShowCursor(bShow)); } -HRESULT OTM_IDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) +HRESULT uMod_IDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) { return(m_pIDirect3DDevice9->CreateAdditionalSwapChain(pPresentationParameters,pSwapChain)); } -HRESULT OTM_IDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) +HRESULT uMod_IDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) { return(m_pIDirect3DDevice9->GetSwapChain(iSwapChain,pSwapChain)); } -UINT OTM_IDirect3DDevice9::GetNumberOfSwapChains(void) +UINT uMod_IDirect3DDevice9::GetNumberOfSwapChains(void) { return(m_pIDirect3DDevice9->GetNumberOfSwapChains()); } -HRESULT OTM_IDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) +HRESULT uMod_IDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) { if(OSD_Font!=NULL) {OSD_Font->Release(); OSD_Font=NULL;} //the game will crashes if the font is not released before the game is minimized! return(m_pIDirect3DDevice9->Reset(pPresentationParameters)); } -HRESULT OTM_IDirect3DDevice9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) +HRESULT uMod_IDirect3DDevice9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) { return (m_pIDirect3DDevice9->Present( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion)); } -HRESULT OTM_IDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) +HRESULT uMod_IDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) { return(m_pIDirect3DDevice9->GetBackBuffer(iSwapChain,iBackBuffer,Type,ppBackBuffer)); } -HRESULT OTM_IDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) +HRESULT uMod_IDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) { return(m_pIDirect3DDevice9->GetRasterStatus(iSwapChain,pRasterStatus)); } -HRESULT OTM_IDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) +HRESULT uMod_IDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) { return(m_pIDirect3DDevice9->SetDialogBoxMode(bEnableDialogs)); } -void OTM_IDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) +void uMod_IDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) { (m_pIDirect3DDevice9->SetGammaRamp(iSwapChain,Flags,pRamp)); } -void OTM_IDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp) +void uMod_IDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp) { (m_pIDirect3DDevice9->GetGammaRamp(iSwapChain,pRamp)); } -HRESULT OTM_IDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) { //create real texture - //Message("OTM_IDirect3DDevice9::CreateTexture()\n"); + //Message("uMod_IDirect3DDevice9::CreateTexture()\n"); HRESULT ret = (m_pIDirect3DDevice9->CreateTexture(Width,Height,Levels,Usage,Format,Pool,ppTexture,pSharedHandle)); if(ret != D3D_OK) return (ret); //create fake texture - OTM_IDirect3DTexture9 *texture = new OTM_IDirect3DTexture9( ppTexture, this); + uMod_IDirect3DTexture9 *texture = new uMod_IDirect3DTexture9( ppTexture, this); if (texture) *ppTexture = texture; if (LastCreatedTexture!=NULL) //if a texture was loaded before, hopefully this texture contains now the data, so we can add it { - if ( OTM_Client!=NULL) OTM_Client->AddTexture( LastCreatedTexture); + if ( uMod_Client!=NULL) uMod_Client->AddTexture( LastCreatedTexture); } LastCreatedTexture = texture; return (ret); } -HRESULT OTM_IDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) { //create real texture - //Message("OTM_IDirect3DDevice9::CreateVolumeTexture()\n"); + //Message("uMod_IDirect3DDevice9::CreateVolumeTexture()\n"); HRESULT ret = (m_pIDirect3DDevice9->CreateVolumeTexture(Width,Height,Depth, Levels,Usage,Format,Pool,ppVolumeTexture,pSharedHandle)); if(ret != D3D_OK) return (ret); //create fake texture - OTM_IDirect3DVolumeTexture9 *texture = new OTM_IDirect3DVolumeTexture9( ppVolumeTexture, this); + uMod_IDirect3DVolumeTexture9 *texture = new uMod_IDirect3DVolumeTexture9( ppVolumeTexture, this); if (texture) *ppVolumeTexture = texture; if (LastCreatedVolumeTexture!=NULL) //if a texture was loaded before, hopefully this texture contains now the data, so we can add it { - if ( OTM_Client!=NULL) OTM_Client->AddTexture( LastCreatedVolumeTexture); + if ( uMod_Client!=NULL) uMod_Client->AddTexture( LastCreatedVolumeTexture); } LastCreatedVolumeTexture = texture; return (ret); } -HRESULT OTM_IDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) { //create real texture - //Message("OTM_IDirect3DDevice9::CreateCubeTexture()\n"); + //Message("uMod_IDirect3DDevice9::CreateCubeTexture()\n"); HRESULT ret = (m_pIDirect3DDevice9->CreateCubeTexture(EdgeLength, Levels,Usage,Format,Pool,ppCubeTexture,pSharedHandle)); if(ret != D3D_OK) return (ret); //create fake texture - OTM_IDirect3DCubeTexture9 *texture = new OTM_IDirect3DCubeTexture9( ppCubeTexture, this); + uMod_IDirect3DCubeTexture9 *texture = new uMod_IDirect3DCubeTexture9( ppCubeTexture, this); if (texture) *ppCubeTexture = texture; if (LastCreatedCubeTexture!=NULL) //if a texture was loaded before, hopefully this texture contains now the data, so we can add it { - if ( OTM_Client!=NULL) OTM_Client->AddTexture( LastCreatedCubeTexture); + if ( uMod_Client!=NULL) uMod_Client->AddTexture( LastCreatedCubeTexture); } LastCreatedCubeTexture = texture; return (ret); } -HRESULT OTM_IDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) { return(m_pIDirect3DDevice9->CreateVertexBuffer(Length,Usage,FVF,Pool,ppVertexBuffer,pSharedHandle)); } -HRESULT OTM_IDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) { return(m_pIDirect3DDevice9->CreateIndexBuffer(Length,Usage,Format,Pool,ppIndexBuffer,pSharedHandle)); } -HRESULT OTM_IDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) { return(m_pIDirect3DDevice9->CreateRenderTarget(Width,Height,Format,MultiSample,MultisampleQuality,Lockable,ppSurface,pSharedHandle)); } -HRESULT OTM_IDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) { return(m_pIDirect3DDevice9->CreateDepthStencilSurface(Width,Height,Format,MultiSample,MultisampleQuality,Discard,ppSurface,pSharedHandle)); } -HRESULT OTM_IDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) +HRESULT uMod_IDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) { return(m_pIDirect3DDevice9->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint)); } -HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) +HRESULT uMod_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) { Message( PRE_MESSAGE "::UpdateTexture( %lu, %lu): %lu\n", pSourceTexture, pDestinationTexture, this); // we must pass the real texture objects - OTM_IDirect3DTexture9* pSource = NULL; - OTM_IDirect3DVolumeTexture9* pSourceVolume = NULL; - OTM_IDirect3DCubeTexture9* pSourceCube = NULL; + uMod_IDirect3DTexture9* pSource = NULL; + uMod_IDirect3DVolumeTexture9* pSourceVolume = NULL; + uMod_IDirect3DCubeTexture9* pSourceCube = NULL; IDirect3DBaseTexture9* cpy; if( pSourceTexture != NULL ) { @@ -417,14 +417,14 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur case 0x01000000L: { MyTypeHash hash; - pSource = (OTM_IDirect3DTexture9*)(pSourceTexture); + pSource = (uMod_IDirect3DTexture9*)(pSourceTexture); if (pSource->GetHash( hash) == RETURN_OK) { if (hash != pSource->Hash) // this hash has changed !! { pSource->Hash = hash; if (pSource->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSource); - OTM_Client->LookUpToMod( pSource); + uMod_Client->LookUpToMod( pSource); } } else if (pSource->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSource); // we better unswitch @@ -437,14 +437,14 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur case 0x01000001L: { MyTypeHash hash; - pSourceVolume = (OTM_IDirect3DVolumeTexture9*)(pSourceTexture); + pSourceVolume = (uMod_IDirect3DVolumeTexture9*)(pSourceTexture); if (pSourceVolume->GetHash( hash) == RETURN_OK) { if (hash != pSourceVolume->Hash) // this hash has changed !! { pSourceVolume->Hash = hash; if (pSourceVolume->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSourceVolume); - OTM_Client->LookUpToMod( pSourceVolume); + uMod_Client->LookUpToMod( pSourceVolume); } } else if (pSourceVolume->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSourceVolume); // we better unswitch @@ -457,14 +457,14 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur case 0x01000002L: { MyTypeHash hash; - pSourceCube = (OTM_IDirect3DCubeTexture9*)(pSourceTexture); + pSourceCube = (uMod_IDirect3DCubeTexture9*)(pSourceTexture); if (pSourceCube->GetHash( hash) == RETURN_OK) { if (hash != pSourceCube->Hash) // this hash has changed !! { pSourceCube->Hash = hash; if (pSourceCube->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSourceCube); - OTM_Client->LookUpToMod( pSourceCube); + uMod_Client->LookUpToMod( pSourceCube); } } else if (pSourceCube->CrossRef_D3Dtex!=NULL) UnswitchTextures(pSourceCube); // we better unswitch @@ -487,7 +487,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur { case 0x01000000L: { - OTM_IDirect3DTexture9* pDest = (OTM_IDirect3DTexture9*)(pDestinationTexture); + uMod_IDirect3DTexture9* pDest = (uMod_IDirect3DTexture9*)(pDestinationTexture); if (pSource!=NULL && pDest->Hash!=pSource->Hash) { @@ -495,7 +495,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur UnswitchTextures(pDest); if (pSource->CrossRef_D3Dtex!=NULL) { - OTM_IDirect3DTexture9 *cpy = pSource->CrossRef_D3Dtex; + uMod_IDirect3DTexture9 *cpy = pSource->CrossRef_D3Dtex; UnswitchTextures(pSource); SwitchTextures( cpy, pDest); } @@ -506,7 +506,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur } case 0x01000001L: { - OTM_IDirect3DVolumeTexture9* pDest = (OTM_IDirect3DVolumeTexture9*)(pDestinationTexture); + uMod_IDirect3DVolumeTexture9* pDest = (uMod_IDirect3DVolumeTexture9*)(pDestinationTexture); if (pSourceVolume!=NULL && pDest->Hash!=pSourceVolume->Hash) { @@ -514,7 +514,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur UnswitchTextures(pDest); if (pSourceVolume->CrossRef_D3Dtex!=NULL) { - OTM_IDirect3DVolumeTexture9 *cpy = pSourceVolume->CrossRef_D3Dtex; + uMod_IDirect3DVolumeTexture9 *cpy = pSourceVolume->CrossRef_D3Dtex; UnswitchTextures(pSourceVolume); SwitchTextures( cpy, pDest); } @@ -525,7 +525,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur } case 0x01000002L: { - OTM_IDirect3DCubeTexture9* pDest = (OTM_IDirect3DCubeTexture9*)(pDestinationTexture); + uMod_IDirect3DCubeTexture9* pDest = (uMod_IDirect3DCubeTexture9*)(pDestinationTexture); if (pSourceCube!=NULL && pDest->Hash!=pSourceCube->Hash) { @@ -533,7 +533,7 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur UnswitchTextures(pDest); if (pSourceCube->CrossRef_D3Dtex!=NULL) { - OTM_IDirect3DCubeTexture9 *cpy = pSourceCube->CrossRef_D3Dtex; + uMod_IDirect3DCubeTexture9 *cpy = pSourceCube->CrossRef_D3Dtex; UnswitchTextures(pSourceCube); SwitchTextures( cpy, pDest); } @@ -547,74 +547,74 @@ HRESULT OTM_IDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTextur return(m_pIDirect3DDevice9->UpdateTexture(pSourceTexture,pDestinationTexture)); } -HRESULT OTM_IDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) +HRESULT uMod_IDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) { return(m_pIDirect3DDevice9->GetRenderTargetData(pRenderTarget,pDestSurface)); } -HRESULT OTM_IDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface) +HRESULT uMod_IDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface) { return(m_pIDirect3DDevice9->GetFrontBufferData(iSwapChain,pDestSurface)); } -HRESULT OTM_IDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) +HRESULT uMod_IDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) { return(m_pIDirect3DDevice9->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter)); } -HRESULT OTM_IDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) +HRESULT uMod_IDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) { return(m_pIDirect3DDevice9->ColorFill(pSurface,pRect,color)); } -HRESULT OTM_IDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) +HRESULT uMod_IDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) { return(m_pIDirect3DDevice9->CreateOffscreenPlainSurface(Width,Height,Format,Pool,ppSurface,pSharedHandle)); } -HRESULT OTM_IDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) +HRESULT uMod_IDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) { return(m_pIDirect3DDevice9->SetRenderTarget(RenderTargetIndex,pRenderTarget)); } -HRESULT OTM_IDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) +HRESULT uMod_IDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) { return(m_pIDirect3DDevice9->GetRenderTarget(RenderTargetIndex,ppRenderTarget)); } -HRESULT OTM_IDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) +HRESULT uMod_IDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) { return(m_pIDirect3DDevice9->SetDepthStencilSurface(pNewZStencil)); } -HRESULT OTM_IDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) +HRESULT uMod_IDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) { return(m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface)); } -HRESULT OTM_IDirect3DDevice9::BeginScene(void) +HRESULT uMod_IDirect3DDevice9::BeginScene(void) { - //if ( OTM_Client!=NULL) // this if condition is senseless, since an exception is raised if the client could not be created + //if ( uMod_Client!=NULL) // this if condition is senseless, since an exception is raised if the client could not be created { if (LastCreatedTexture!=NULL) // add the last created texture { - OTM_Client->AddTexture( LastCreatedTexture); + uMod_Client->AddTexture( LastCreatedTexture); } if (LastCreatedVolumeTexture!=NULL) // add the last created texture { - OTM_Client->AddTexture( LastCreatedVolumeTexture); + uMod_Client->AddTexture( LastCreatedVolumeTexture); } if (LastCreatedCubeTexture!=NULL) // add the last created texture { - OTM_Client->AddTexture( LastCreatedCubeTexture); + uMod_Client->AddTexture( LastCreatedCubeTexture); } - OTM_Client->MergeUpdate(); // merge an update, if present + uMod_Client->MergeUpdate(); // merge an update, if present - if (OTM_Client->BoolSaveSingleTexture) + if (uMod_Client->BoolSaveSingleTexture) { if (CreateSingleTexture()==0) { - if (OTM_Client->KeyBack>0 && (GetAsyncKeyState( OTM_Client->KeyBack ) &1) ) //ask for the status of the back key + if (uMod_Client->KeyBack>0 && (GetAsyncKeyState( uMod_Client->KeyBack ) &1) ) //ask for the status of the back key { UnswitchTextures( SingleTexture); // can be called, even if texture is not switched UnswitchTextures( SingleVolumeTexture); // can be called, even if texture is not switched @@ -627,13 +627,13 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) switch (SingleTextureMod) { case 0: - CounterSaveSingleTexture = OTM_Client->OriginalTextures.GetNumber() - 1; + CounterSaveSingleTexture = uMod_Client->OriginalTextures.GetNumber() - 1; break; case 1: - CounterSaveSingleTexture = OTM_Client->OriginalVolumeTextures.GetNumber() - 1; + CounterSaveSingleTexture = uMod_Client->OriginalVolumeTextures.GetNumber() - 1; break; case 2: - CounterSaveSingleTexture = OTM_Client->OriginalCubeTextures.GetNumber() - 1; + CounterSaveSingleTexture = uMod_Client->OriginalCubeTextures.GetNumber() - 1; break; } } @@ -643,38 +643,38 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) switch (SingleTextureMod) { case 0: - SwitchTextures( SingleTexture, OTM_Client->OriginalTextures[CounterSaveSingleTexture]); - SingleTexture->Hash = OTM_Client->OriginalTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleTexture, uMod_Client->OriginalTextures[CounterSaveSingleTexture]); + SingleTexture->Hash = uMod_Client->OriginalTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; case 1: - SwitchTextures( SingleVolumeTexture, OTM_Client->OriginalVolumeTextures[CounterSaveSingleTexture]); - SingleVolumeTexture->Hash = OTM_Client->OriginalVolumeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleVolumeTexture, uMod_Client->OriginalVolumeTextures[CounterSaveSingleTexture]); + SingleVolumeTexture->Hash = uMod_Client->OriginalVolumeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; case 2: - SwitchTextures( SingleCubeTexture, OTM_Client->OriginalCubeTextures[CounterSaveSingleTexture]); - SingleCubeTexture->Hash = OTM_Client->OriginalCubeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleCubeTexture, uMod_Client->OriginalCubeTextures[CounterSaveSingleTexture]); + SingleCubeTexture->Hash = uMod_Client->OriginalCubeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; } } } - if (OTM_Client->KeySave>0 && (GetAsyncKeyState( OTM_Client->KeySave ) &1) ) //ask for the status of the save key + if (uMod_Client->KeySave>0 && (GetAsyncKeyState( uMod_Client->KeySave ) &1) ) //ask for the status of the save key { switch (SingleTextureMod) { case 0: - OTM_Client->SaveTexture( SingleTexture); //after switching the SingleTexture holds the pointer to the original texture object + uMod_Client->SaveTexture( SingleTexture); //after switching the SingleTexture holds the pointer to the original texture object break; case 1: - OTM_Client->SaveTexture( SingleVolumeTexture); //after switching the SingleTexture holds the pointer to the original texture object + uMod_Client->SaveTexture( SingleVolumeTexture); //after switching the SingleTexture holds the pointer to the original texture object break; case 2: - OTM_Client->SaveTexture( SingleCubeTexture); //after switching the SingleTexture holds the pointer to the original texture object + uMod_Client->SaveTexture( SingleCubeTexture); //after switching the SingleTexture holds the pointer to the original texture object break; } } - if (OTM_Client->KeyNext>0 && (GetAsyncKeyState( OTM_Client->KeyNext ) &1) ) //ask for the status of the next key + if (uMod_Client->KeyNext>0 && (GetAsyncKeyState( uMod_Client->KeyNext ) &1) ) //ask for the status of the next key { UnswitchTextures( SingleTexture); // can be called, even if texture is not switched UnswitchTextures( SingleVolumeTexture); // can be called, even if texture is not switched @@ -687,13 +687,13 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) switch (SingleTextureMod) { case 0: - num = OTM_Client->OriginalTextures.GetNumber(); + num = uMod_Client->OriginalTextures.GetNumber(); break; case 1: - num = OTM_Client->OriginalVolumeTextures.GetNumber(); + num = uMod_Client->OriginalVolumeTextures.GetNumber(); break; case 2: - num = OTM_Client->OriginalCubeTextures.GetNumber(); + num = uMod_Client->OriginalCubeTextures.GetNumber(); break; } if (++CounterSaveSingleTexture>=num) @@ -702,13 +702,13 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) switch (SingleTextureMod) { case 0: - CounterSaveSingleTexture = OTM_Client->OriginalTextures.GetNumber()>0 ? 0 : - 1; + CounterSaveSingleTexture = uMod_Client->OriginalTextures.GetNumber()>0 ? 0 : - 1; break; case 1: - CounterSaveSingleTexture = OTM_Client->OriginalVolumeTextures.GetNumber()>0 ? 0 : - 1; + CounterSaveSingleTexture = uMod_Client->OriginalVolumeTextures.GetNumber()>0 ? 0 : - 1; break; case 2: - CounterSaveSingleTexture = OTM_Client->OriginalCubeTextures.GetNumber()>0 ? 0 : - 1; + CounterSaveSingleTexture = uMod_Client->OriginalCubeTextures.GetNumber()>0 ? 0 : - 1; break; } } @@ -719,16 +719,16 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) switch (SingleTextureMod) { case 0: - SwitchTextures( SingleTexture, OTM_Client->OriginalTextures[CounterSaveSingleTexture]); - SingleTexture->Hash = OTM_Client->OriginalTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleTexture, uMod_Client->OriginalTextures[CounterSaveSingleTexture]); + SingleTexture->Hash = uMod_Client->OriginalTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; case 1: - SwitchTextures( SingleVolumeTexture, OTM_Client->OriginalVolumeTextures[CounterSaveSingleTexture]); - SingleVolumeTexture->Hash = OTM_Client->OriginalVolumeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleVolumeTexture, uMod_Client->OriginalVolumeTextures[CounterSaveSingleTexture]); + SingleVolumeTexture->Hash = uMod_Client->OriginalVolumeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; case 2: - SwitchTextures( SingleCubeTexture, OTM_Client->OriginalCubeTextures[CounterSaveSingleTexture]); - SingleCubeTexture->Hash = OTM_Client->OriginalCubeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display + SwitchTextures( SingleCubeTexture, uMod_Client->OriginalCubeTextures[CounterSaveSingleTexture]); + SingleCubeTexture->Hash = uMod_Client->OriginalCubeTextures[CounterSaveSingleTexture]->Hash; //set the hash for the display break; } } @@ -740,9 +740,9 @@ HRESULT OTM_IDirect3DDevice9::BeginScene(void) return (m_pIDirect3DDevice9->BeginScene()); } -HRESULT OTM_IDirect3DDevice9::EndScene(void) +HRESULT uMod_IDirect3DDevice9::EndScene(void) { - if ( /*OTM_Client!=NULL &&*/ OTM_Client->BoolSaveSingleTexture && SingleTexture!=NULL && SingleVolumeTexture!=NULL && SingleCubeTexture!=NULL) + if ( /*uMod_Client!=NULL &&*/ uMod_Client->BoolSaveSingleTexture && SingleTexture!=NULL && SingleVolumeTexture!=NULL && SingleCubeTexture!=NULL) { if (OSD_Font==NULL) // create the font { @@ -759,30 +759,30 @@ HRESULT OTM_IDirect3DDevice9::EndScene(void) { case 0: { - if (SingleTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "normal texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, OTM_Client->OriginalTextures.GetNumber(), SingleTexture->Hash); + if (SingleTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "normal texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, uMod_Client->OriginalTextures.GetNumber(), SingleTexture->Hash); else { - if (OTM_Client->OriginalTextures.GetNumber()>0) sprintf_s( buffer, 100, "normal texture: nothing selected (1..%d)", OTM_Client->OriginalTextures.GetNumber()); + if (uMod_Client->OriginalTextures.GetNumber()>0) sprintf_s( buffer, 100, "normal texture: nothing selected (1..%d)", uMod_Client->OriginalTextures.GetNumber()); else sprintf_s( buffer, 100, "normal texture: nothing loaded"); } break; } case 1: { - if (SingleVolumeTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "volume texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, OTM_Client->OriginalVolumeTextures.GetNumber(), SingleVolumeTexture->Hash); + if (SingleVolumeTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "volume texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, uMod_Client->OriginalVolumeTextures.GetNumber(), SingleVolumeTexture->Hash); else { - if (OTM_Client->OriginalVolumeTextures.GetNumber()>0) sprintf_s( buffer, 100, "volume texture: nothing selected (1..%d)", OTM_Client->OriginalVolumeTextures.GetNumber()); + if (uMod_Client->OriginalVolumeTextures.GetNumber()>0) sprintf_s( buffer, 100, "volume texture: nothing selected (1..%d)", uMod_Client->OriginalVolumeTextures.GetNumber()); else sprintf_s( buffer, 100, "volume texture: nothing loaded"); } break; } case 2: { - if (SingleCubeTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "cube texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, OTM_Client->OriginalCubeTextures.GetNumber(), SingleCubeTexture->Hash); + if (SingleCubeTexture->CrossRef_D3Dtex!=NULL) sprintf_s( buffer, 100, "cube texture: %4d (1..%d): %#lX", CounterSaveSingleTexture+1, uMod_Client->OriginalCubeTextures.GetNumber(), SingleCubeTexture->Hash); else { - if (OTM_Client->OriginalCubeTextures.GetNumber()>0) sprintf_s( buffer, 100, "cube texture: nothing selected (1..%d)", OTM_Client->OriginalCubeTextures.GetNumber()); + if (uMod_Client->OriginalCubeTextures.GetNumber()>0) sprintf_s( buffer, 100, "cube texture: nothing selected (1..%d)", uMod_Client->OriginalCubeTextures.GetNumber()); else sprintf_s( buffer, 100, "cube texture: nothing loaded"); } break; @@ -795,122 +795,122 @@ HRESULT OTM_IDirect3DDevice9::EndScene(void) rct.right=0; //size of box is calculated automatically (DT_NOCLIP) rct.top=viewport.Y + 10; rct.bottom=0; //size of box is calculated automatically (DT_NOCLIP) - OSD_Font->DrawTextA(NULL, buffer, -1, &rct, DT_NOCLIP, OTM_Client->FontColour); + OSD_Font->DrawTextA(NULL, buffer, -1, &rct, DT_NOCLIP, uMod_Client->FontColour); } return(m_pIDirect3DDevice9->EndScene()); } -HRESULT OTM_IDirect3DDevice9::Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) +HRESULT uMod_IDirect3DDevice9::Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) { return(m_pIDirect3DDevice9->Clear(Count,pRects,Flags,Color,Z,Stencil)); } -HRESULT OTM_IDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) +HRESULT uMod_IDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) { return(m_pIDirect3DDevice9->SetTransform(State,pMatrix)); } -HRESULT OTM_IDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) +HRESULT uMod_IDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) { return(m_pIDirect3DDevice9->GetTransform(State,pMatrix)); } -HRESULT OTM_IDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) +HRESULT uMod_IDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) { return(m_pIDirect3DDevice9->MultiplyTransform(State,pMatrix)); } -HRESULT OTM_IDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) +HRESULT uMod_IDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) { return(m_pIDirect3DDevice9->SetViewport(pViewport)); } -HRESULT OTM_IDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) +HRESULT uMod_IDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) { return(m_pIDirect3DDevice9->GetViewport(pViewport)); } -HRESULT OTM_IDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) +HRESULT uMod_IDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) { return(m_pIDirect3DDevice9->SetMaterial(pMaterial)); } -HRESULT OTM_IDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) +HRESULT uMod_IDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) { return(m_pIDirect3DDevice9->GetMaterial(pMaterial)); } -HRESULT OTM_IDirect3DDevice9::SetLight(DWORD Index,CONST D3DLIGHT9* pLight) +HRESULT uMod_IDirect3DDevice9::SetLight(DWORD Index,CONST D3DLIGHT9* pLight) { return(m_pIDirect3DDevice9->SetLight(Index,pLight)); } -HRESULT OTM_IDirect3DDevice9::GetLight(DWORD Index,D3DLIGHT9* pLight) +HRESULT uMod_IDirect3DDevice9::GetLight(DWORD Index,D3DLIGHT9* pLight) { return(m_pIDirect3DDevice9->GetLight(Index,pLight)); } -HRESULT OTM_IDirect3DDevice9::LightEnable(DWORD Index,BOOL Enable) +HRESULT uMod_IDirect3DDevice9::LightEnable(DWORD Index,BOOL Enable) { return(m_pIDirect3DDevice9->LightEnable(Index,Enable)); } -HRESULT OTM_IDirect3DDevice9::GetLightEnable(DWORD Index,BOOL* pEnable) +HRESULT uMod_IDirect3DDevice9::GetLightEnable(DWORD Index,BOOL* pEnable) { return(m_pIDirect3DDevice9->GetLightEnable(Index, pEnable)); } -HRESULT OTM_IDirect3DDevice9::SetClipPlane(DWORD Index,CONST float* pPlane) +HRESULT uMod_IDirect3DDevice9::SetClipPlane(DWORD Index,CONST float* pPlane) { return(m_pIDirect3DDevice9->SetClipPlane(Index, pPlane)); } -HRESULT OTM_IDirect3DDevice9::GetClipPlane(DWORD Index,float* pPlane) +HRESULT uMod_IDirect3DDevice9::GetClipPlane(DWORD Index,float* pPlane) { return(m_pIDirect3DDevice9->GetClipPlane(Index,pPlane)); } -HRESULT OTM_IDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State,DWORD Value) +HRESULT uMod_IDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State,DWORD Value) { return(m_pIDirect3DDevice9->SetRenderState(State, Value)); } -HRESULT OTM_IDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue) +HRESULT uMod_IDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue) { return(m_pIDirect3DDevice9->GetRenderState(State, pValue)); } -HRESULT OTM_IDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) +HRESULT uMod_IDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) { return(m_pIDirect3DDevice9->CreateStateBlock(Type,ppSB)); } -HRESULT OTM_IDirect3DDevice9::BeginStateBlock(void) +HRESULT uMod_IDirect3DDevice9::BeginStateBlock(void) { return(m_pIDirect3DDevice9->BeginStateBlock()); } -HRESULT OTM_IDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) +HRESULT uMod_IDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) { return(m_pIDirect3DDevice9->EndStateBlock(ppSB)); } -HRESULT OTM_IDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) +HRESULT uMod_IDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) { return(m_pIDirect3DDevice9->SetClipStatus(pClipStatus)); } -HRESULT OTM_IDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) +HRESULT uMod_IDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) { return(m_pIDirect3DDevice9->GetClipStatus( pClipStatus)); } -HRESULT OTM_IDirect3DDevice9::GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture) +HRESULT uMod_IDirect3DDevice9::GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture) { return(m_pIDirect3DDevice9->GetTexture(Stage,ppTexture)); } -HRESULT OTM_IDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) +HRESULT uMod_IDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) { // we must pass the real texture objects // if (dev != this) this texture was not initialized through our device and is thus no fake texture object @@ -923,285 +923,285 @@ HRESULT OTM_IDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTe switch (ret) { case 0x01000000L: - pTexture = ((OTM_IDirect3DTexture9*)(pTexture))->m_D3Dtex; break; + pTexture = ((uMod_IDirect3DTexture9*)(pTexture))->m_D3Dtex; break; case 0x01000001L: - pTexture = ((OTM_IDirect3DVolumeTexture9*)(pTexture))->m_D3Dtex; break; + pTexture = ((uMod_IDirect3DVolumeTexture9*)(pTexture))->m_D3Dtex; break; case 0x01000002L: - pTexture = ((OTM_IDirect3DCubeTexture9*)(pTexture))->m_D3Dtex; break; + pTexture = ((uMod_IDirect3DCubeTexture9*)(pTexture))->m_D3Dtex; break; default: break; // this is no fake texture and QueryInterface failed, because IDirect3DBaseTexture9 object cannot be a IDirect3D9 object ;) } } /* - if (pTexture != NULL && ((OTM_IDirect3DTexture9*)(pTexture))->GetDevice(&dev) == D3D_OK) + if (pTexture != NULL && ((uMod_IDirect3DTexture9*)(pTexture))->GetDevice(&dev) == D3D_OK) { - if(dev == this) pTexture = ((OTM_IDirect3DTexture9*)(pTexture))->m_D3Dtex; + if(dev == this) pTexture = ((uMod_IDirect3DTexture9*)(pTexture))->m_D3Dtex; } */ return (m_pIDirect3DDevice9->SetTexture(Stage, pTexture)); } -HRESULT OTM_IDirect3DDevice9::GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) +HRESULT uMod_IDirect3DDevice9::GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) { return(m_pIDirect3DDevice9->GetTextureStageState(Stage,Type, pValue)); } -HRESULT OTM_IDirect3DDevice9::SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) +HRESULT uMod_IDirect3DDevice9::SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) { return(m_pIDirect3DDevice9->SetTextureStageState(Stage,Type,Value)); } -HRESULT OTM_IDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) +HRESULT uMod_IDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) { return(m_pIDirect3DDevice9->GetSamplerState(Sampler,Type, pValue)); } -HRESULT OTM_IDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) +HRESULT uMod_IDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) { return(m_pIDirect3DDevice9->SetSamplerState(Sampler,Type,Value)); } -HRESULT OTM_IDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) +HRESULT uMod_IDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) { return(m_pIDirect3DDevice9->ValidateDevice( pNumPasses)); } -HRESULT OTM_IDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries) +HRESULT uMod_IDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries) { return(m_pIDirect3DDevice9->SetPaletteEntries(PaletteNumber, pEntries)); } -HRESULT OTM_IDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries) +HRESULT uMod_IDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries) { return(m_pIDirect3DDevice9->GetPaletteEntries(PaletteNumber, pEntries)); } -HRESULT OTM_IDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) +HRESULT uMod_IDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) { return(m_pIDirect3DDevice9->SetCurrentTexturePalette(PaletteNumber)); } -HRESULT OTM_IDirect3DDevice9::GetCurrentTexturePalette(UINT *PaletteNumber) +HRESULT uMod_IDirect3DDevice9::GetCurrentTexturePalette(UINT *PaletteNumber) { return(m_pIDirect3DDevice9->GetCurrentTexturePalette(PaletteNumber)); } -HRESULT OTM_IDirect3DDevice9::SetScissorRect(CONST RECT* pRect) +HRESULT uMod_IDirect3DDevice9::SetScissorRect(CONST RECT* pRect) { return(m_pIDirect3DDevice9->SetScissorRect( pRect)); } -HRESULT OTM_IDirect3DDevice9::GetScissorRect( RECT* pRect) +HRESULT uMod_IDirect3DDevice9::GetScissorRect( RECT* pRect) { return(m_pIDirect3DDevice9->GetScissorRect( pRect)); } -HRESULT OTM_IDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) +HRESULT uMod_IDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) { return(m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware)); } -BOOL OTM_IDirect3DDevice9::GetSoftwareVertexProcessing(void) +BOOL uMod_IDirect3DDevice9::GetSoftwareVertexProcessing(void) { return(m_pIDirect3DDevice9->GetSoftwareVertexProcessing()); } -HRESULT OTM_IDirect3DDevice9::SetNPatchMode(float nSegments) +HRESULT uMod_IDirect3DDevice9::SetNPatchMode(float nSegments) { return(m_pIDirect3DDevice9->SetNPatchMode(nSegments)); } -float OTM_IDirect3DDevice9::GetNPatchMode(void) +float uMod_IDirect3DDevice9::GetNPatchMode(void) { return(m_pIDirect3DDevice9->GetNPatchMode()); } -HRESULT OTM_IDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) +HRESULT uMod_IDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) { return(m_pIDirect3DDevice9->DrawPrimitive(PrimitiveType,StartVertex,PrimitiveCount)); } -HRESULT OTM_IDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) +HRESULT uMod_IDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) { return(m_pIDirect3DDevice9->DrawIndexedPrimitive(PrimitiveType,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount)); } -HRESULT OTM_IDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) +HRESULT uMod_IDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) { return(m_pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType,PrimitiveCount,pVertexStreamZeroData,VertexStreamZeroStride)); } -HRESULT OTM_IDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) +HRESULT uMod_IDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) { return(m_pIDirect3DDevice9->DrawIndexedPrimitiveUP(PrimitiveType,MinVertexIndex,NumVertices,PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData,VertexStreamZeroStride)); } -HRESULT OTM_IDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) +HRESULT uMod_IDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) { return(m_pIDirect3DDevice9->ProcessVertices( SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags)); } -HRESULT OTM_IDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) +HRESULT uMod_IDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) { return(m_pIDirect3DDevice9->CreateVertexDeclaration( pVertexElements,ppDecl)); } -HRESULT OTM_IDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) +HRESULT uMod_IDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) { return(m_pIDirect3DDevice9->SetVertexDeclaration(pDecl)); } -HRESULT OTM_IDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) +HRESULT uMod_IDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) { return(m_pIDirect3DDevice9->GetVertexDeclaration(ppDecl)); } -HRESULT OTM_IDirect3DDevice9::SetFVF(DWORD FVF) +HRESULT uMod_IDirect3DDevice9::SetFVF(DWORD FVF) { return(m_pIDirect3DDevice9->SetFVF(FVF)); } -HRESULT OTM_IDirect3DDevice9::GetFVF(DWORD* pFVF) +HRESULT uMod_IDirect3DDevice9::GetFVF(DWORD* pFVF) { return(m_pIDirect3DDevice9->GetFVF(pFVF)); } -HRESULT OTM_IDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) +HRESULT uMod_IDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) { return(m_pIDirect3DDevice9->CreateVertexShader(pFunction,ppShader)); } -HRESULT OTM_IDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) +HRESULT uMod_IDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) { return(m_pIDirect3DDevice9->SetVertexShader(pShader)); } -HRESULT OTM_IDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) +HRESULT uMod_IDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) { return(m_pIDirect3DDevice9->GetVertexShader(ppShader)); } -HRESULT OTM_IDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +HRESULT uMod_IDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) { return(m_pIDirect3DDevice9->SetVertexShaderConstantF(StartRegister,pConstantData, Vector4fCount)); } -HRESULT OTM_IDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) +HRESULT uMod_IDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) { return(m_pIDirect3DDevice9->GetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount)); } -HRESULT OTM_IDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +HRESULT uMod_IDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) { return(m_pIDirect3DDevice9->SetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount)); } -HRESULT OTM_IDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount) +HRESULT uMod_IDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount) { return(m_pIDirect3DDevice9->GetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount)); } -HRESULT OTM_IDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +HRESULT uMod_IDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) { return(m_pIDirect3DDevice9->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount)); } -HRESULT OTM_IDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount) +HRESULT uMod_IDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount) { return(m_pIDirect3DDevice9->GetVertexShaderConstantB(StartRegister,pConstantData,BoolCount)); } -HRESULT OTM_IDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) +HRESULT uMod_IDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) { return(m_pIDirect3DDevice9->SetStreamSource(StreamNumber,pStreamData,OffsetInBytes,Stride)); } -HRESULT OTM_IDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride) +HRESULT uMod_IDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride) { return(m_pIDirect3DDevice9->GetStreamSource(StreamNumber,ppStreamData,OffsetInBytes,pStride)); } -HRESULT OTM_IDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider) +HRESULT uMod_IDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider) { return(m_pIDirect3DDevice9->SetStreamSourceFreq(StreamNumber,Divider)); } -HRESULT OTM_IDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider) +HRESULT uMod_IDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider) { return(m_pIDirect3DDevice9->GetStreamSourceFreq(StreamNumber,Divider)); } -HRESULT OTM_IDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) +HRESULT uMod_IDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) { return(m_pIDirect3DDevice9->SetIndices(pIndexData)); } -HRESULT OTM_IDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) +HRESULT uMod_IDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) { return(m_pIDirect3DDevice9->GetIndices(ppIndexData)); } -HRESULT OTM_IDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) +HRESULT uMod_IDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) { return(m_pIDirect3DDevice9->CreatePixelShader(pFunction,ppShader)); } -HRESULT OTM_IDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) +HRESULT uMod_IDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) { return(m_pIDirect3DDevice9->SetPixelShader(pShader)); } -HRESULT OTM_IDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) +HRESULT uMod_IDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) { return(m_pIDirect3DDevice9->GetPixelShader(ppShader)); } -HRESULT OTM_IDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +HRESULT uMod_IDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) { return(m_pIDirect3DDevice9->SetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount)); } -HRESULT OTM_IDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) +HRESULT uMod_IDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) { return(m_pIDirect3DDevice9->GetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount)); } -HRESULT OTM_IDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +HRESULT uMod_IDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) { return(m_pIDirect3DDevice9->SetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount)); } -HRESULT OTM_IDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount) +HRESULT uMod_IDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount) { return(m_pIDirect3DDevice9->GetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount)); } -HRESULT OTM_IDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +HRESULT uMod_IDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) { return(m_pIDirect3DDevice9->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount)); } -HRESULT OTM_IDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount) +HRESULT uMod_IDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount) { return(m_pIDirect3DDevice9->GetPixelShaderConstantB(StartRegister,pConstantData,BoolCount)); } -HRESULT OTM_IDirect3DDevice9::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) +HRESULT uMod_IDirect3DDevice9::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) { return(m_pIDirect3DDevice9->DrawRectPatch(Handle,pNumSegs, pRectPatchInfo)); } -HRESULT OTM_IDirect3DDevice9::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) +HRESULT uMod_IDirect3DDevice9::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) { return(m_pIDirect3DDevice9->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo)); } -HRESULT OTM_IDirect3DDevice9::DeletePatch(UINT Handle) +HRESULT uMod_IDirect3DDevice9::DeletePatch(UINT Handle) { return(m_pIDirect3DDevice9->DeletePatch(Handle)); } -HRESULT OTM_IDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) +HRESULT uMod_IDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) { return(m_pIDirect3DDevice9->CreateQuery(Type,ppQuery)); } diff --git a/OTM_DX9/OTM_IDirect3DDevice9.h b/uMod_DX9/uMod_IDirect3DDevice9.h similarity index 83% rename from OTM_DX9/OTM_IDirect3DDevice9.h rename to uMod_DX9/uMod_IDirect3DDevice9.h index 03db8d2..34d7be7 100644 --- a/OTM_DX9/OTM_IDirect3DDevice9.h +++ b/uMod_DX9/uMod_IDirect3DDevice9.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ @@ -25,21 +25,21 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3DDevice9_H_ -#define OTM_IDirect3DDevice9_H_ +#ifndef uMod_IDirect3DDevice9_H_ +#define uMod_IDirect3DDevice9_H_ #include #include -#include "OTM_IDirect3DTexture9.h" -#include "OTM_IDirect3DVolumeTexture9.h" -#include "OTM_IDirect3DCubeTexture9.h" +#include "uMod_IDirect3DTexture9.h" +#include "uMod_IDirect3DVolumeTexture9.h" +#include "uMod_IDirect3DCubeTexture9.h" -class OTM_IDirect3DDevice9 : public IDirect3DDevice9 +class uMod_IDirect3DDevice9 : public IDirect3DDevice9 { public: - OTM_IDirect3DDevice9(IDirect3DDevice9* pOriginal, OTM_TextureServer* server); - virtual ~OTM_IDirect3DDevice9(void); + uMod_IDirect3DDevice9(IDirect3DDevice9* pOriginal, uMod_TextureServer* server); + virtual ~uMod_IDirect3DDevice9(void); // START: The original DX9 function definitions HRESULT __stdcall QueryInterface (REFIID riid, void** ppvObj); @@ -165,21 +165,21 @@ public: - OTM_TextureClient* GetOTM_Client(void) {return (OTM_Client);} + uMod_TextureClient* GetuMod_Client(void) {return (uMod_Client);} - OTM_IDirect3DTexture9* GetLastCreatedTexture(void) {return (LastCreatedTexture);} - int SetLastCreatedTexture(OTM_IDirect3DTexture9* pTexture) {LastCreatedTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DTexture9* GetLastCreatedTexture(void) {return (LastCreatedTexture);} + int SetLastCreatedTexture(uMod_IDirect3DTexture9* pTexture) {LastCreatedTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DVolumeTexture9* GetLastCreatedVolumeTexture(void) {return (LastCreatedVolumeTexture);} - int SetLastCreatedVolumeTexture(OTM_IDirect3DVolumeTexture9* pTexture) {LastCreatedVolumeTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DVolumeTexture9* GetLastCreatedVolumeTexture(void) {return (LastCreatedVolumeTexture);} + int SetLastCreatedVolumeTexture(uMod_IDirect3DVolumeTexture9* pTexture) {LastCreatedVolumeTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DCubeTexture9* GetLastCreatedCubeTexture(void) {return (LastCreatedCubeTexture);} - int SetLastCreatedCubeTexture(OTM_IDirect3DCubeTexture9* pTexture) {LastCreatedCubeTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DCubeTexture9* GetLastCreatedCubeTexture(void) {return (LastCreatedCubeTexture);} + int SetLastCreatedCubeTexture(uMod_IDirect3DCubeTexture9* pTexture) {LastCreatedCubeTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DTexture9* GetSingleTexture(void) {return (SingleTexture);} - OTM_IDirect3DVolumeTexture9* GetSingleVolumeTexture(void) {return (SingleVolumeTexture);} - OTM_IDirect3DCubeTexture9* GetSingleCubeTexture(void) {return (SingleCubeTexture);} + uMod_IDirect3DTexture9* GetSingleTexture(void) {return (SingleTexture);} + uMod_IDirect3DVolumeTexture9* GetSingleVolumeTexture(void) {return (SingleVolumeTexture);} + uMod_IDirect3DCubeTexture9* GetSingleCubeTexture(void) {return (SingleCubeTexture);} private: @@ -187,23 +187,23 @@ public: IDirect3DDevice9* m_pIDirect3DDevice9; int CounterSaveSingleTexture; - OTM_IDirect3DTexture9* SingleTexture; - OTM_IDirect3DVolumeTexture9* SingleVolumeTexture; - OTM_IDirect3DCubeTexture9* SingleCubeTexture; + uMod_IDirect3DTexture9* SingleTexture; + uMod_IDirect3DVolumeTexture9* SingleVolumeTexture; + uMod_IDirect3DCubeTexture9* SingleCubeTexture; char SingleTextureMod; D3DCOLOR TextureColour; ID3DXFont *OSD_Font; //D3DCOLOR FontColour; - int OTM_Reference; + int uMod_Reference; - OTM_IDirect3DTexture9* LastCreatedTexture; - OTM_IDirect3DVolumeTexture9* LastCreatedVolumeTexture; - OTM_IDirect3DCubeTexture9* LastCreatedCubeTexture; + uMod_IDirect3DTexture9* LastCreatedTexture; + uMod_IDirect3DVolumeTexture9* LastCreatedVolumeTexture; + uMod_IDirect3DCubeTexture9* LastCreatedCubeTexture; - OTM_TextureServer* OTM_Server; - OTM_TextureClient* OTM_Client; + uMod_TextureServer* uMod_Server; + uMod_TextureClient* uMod_Client; }; #endif diff --git a/uMod_DX9/uMod_IDirect3DDevice9Ex.cpp b/uMod_DX9/uMod_IDirect3DDevice9Ex.cpp new file mode 100644 index 0000000..1cf90e7 --- /dev/null +++ b/uMod_DX9/uMod_IDirect3DDevice9Ex.cpp @@ -0,0 +1,116 @@ +/* +This file is part of Universal Modding Engine. + + +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ + + + +#include "uMod_Main.h" + +#define uMod_IDirect3DDevice9 uMod_IDirect3DDevice9Ex +#define IDirect3DDevice9 IDirect3DDevice9Ex +#define m_pIDirect3DDevice9 m_pIDirect3DDevice9Ex + +#define RETURN_QueryInterface 0x01000001L +#define PRE_MESSAGE "uMod_IDirect3DDevice9Ex" + + +#include "uMod_IDirect3DDevice9.cpp" + + + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::CheckDeviceState( HWND hWindow) +{ + return(m_pIDirect3DDevice9Ex->CheckDeviceState( hWindow)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::CheckResourceResidency( IDirect3DResource9 **ppResourceArray, UINT32 NumResources) +{ + return(m_pIDirect3DDevice9Ex->CheckResourceResidency( ppResourceArray, NumResources)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::ComposeRects( IDirect3DSurface9 *pSource, IDirect3DSurface9 *pDestination, IDirect3DVertexBuffer9 *pSrcRectDescriptors, UINT NumRects, IDirect3DVertexBuffer9 *pDstRectDescriptors, D3DCOMPOSERECTSOP Operation, INT XOffset, INT YOffset) +{ + return(m_pIDirect3DDevice9Ex->ComposeRects( pSource, pDestination, pSrcRectDescriptors, NumRects, pDstRectDescriptors, Operation, XOffset, YOffset)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx( UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) +{ + return(m_pIDirect3DDevice9Ex->CreateDepthStencilSurfaceEx( Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle, Usage)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx( UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) +{ + return(m_pIDirect3DDevice9Ex->CreateOffscreenPlainSurfaceEx( Width, Height, Format, Pool, ppSurface, pSharedHandle, Usage)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::CreateRenderTargetEx( UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) +{ + return(m_pIDirect3DDevice9Ex->CreateRenderTargetEx( Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle, Usage)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::GetDisplayModeEx( UINT iSwapChain, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) +{ + return(m_pIDirect3DDevice9Ex->GetDisplayModeEx( iSwapChain, pMode, pRotation)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::GetGPUThreadPriority( INT *pPriority) +{ + return(m_pIDirect3DDevice9Ex->GetGPUThreadPriority( pPriority)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::GetMaximumFrameLatency( UINT *pMaxLatency) +{ + return(m_pIDirect3DDevice9Ex->GetMaximumFrameLatency( pMaxLatency)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::PresentEx( const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion, DWORD dwFlags) +{ + return(m_pIDirect3DDevice9Ex->PresentEx( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::ResetEx( D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) +{ + return(m_pIDirect3DDevice9Ex->ResetEx( pPresentationParameters, pFullscreenDisplayMode)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::SetConvolutionMonoKernel( UINT Width, UINT Height, float *RowWeights, float *ColumnWeights) +{ + return(m_pIDirect3DDevice9Ex->SetConvolutionMonoKernel( Width, Height, RowWeights, ColumnWeights)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::SetGPUThreadPriority( INT pPriority) +{ + return(m_pIDirect3DDevice9Ex->SetGPUThreadPriority( pPriority)); +} + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::SetMaximumFrameLatency( UINT pMaxLatency) +{ + return(m_pIDirect3DDevice9Ex->SetMaximumFrameLatency( pMaxLatency)); +} + +/* +HRESULT __stdcall uMod_IDirect3DDevice9Ex::TestCooperativeLevel() +{ + return(m_pIDirect3DDevice9Ex->TestCooperativeLevel()); +} +*/ + +HRESULT __stdcall uMod_IDirect3DDevice9Ex::WaitForVBlank( UINT SwapChainIndex) +{ + return(m_pIDirect3DDevice9Ex->WaitForVBlank( SwapChainIndex)); +} + diff --git a/OTM_DX9/OTM_IDirect3DDevice9Ex.h b/uMod_DX9/uMod_IDirect3DDevice9Ex.h similarity index 85% rename from OTM_DX9/OTM_IDirect3DDevice9Ex.h rename to uMod_DX9/uMod_IDirect3DDevice9Ex.h index 6b16ef1..460542d 100644 --- a/OTM_DX9/OTM_IDirect3DDevice9Ex.h +++ b/uMod_DX9/uMod_IDirect3DDevice9Ex.h @@ -1,37 +1,37 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_IDirect3DDevice9Ex_H_ -#define OTM_IDirect3DDevice9Ex_H_ +#ifndef uMod_IDirect3DDevice9Ex_H_ +#define uMod_IDirect3DDevice9Ex_H_ #include #include -#include "OTM_IDirect3DTexture9.h" -#include "OTM_IDirect3DVolumeTexture9.h" -#include "OTM_IDirect3DCubeTexture9.h" +#include "uMod_IDirect3DTexture9.h" +#include "uMod_IDirect3DVolumeTexture9.h" +#include "uMod_IDirect3DCubeTexture9.h" -class OTM_IDirect3DDevice9Ex : public IDirect3DDevice9Ex +class uMod_IDirect3DDevice9Ex : public IDirect3DDevice9Ex { public: - OTM_IDirect3DDevice9Ex( IDirect3DDevice9Ex* pOriginal, OTM_TextureServer* server); - virtual ~OTM_IDirect3DDevice9Ex(void); + uMod_IDirect3DDevice9Ex( IDirect3DDevice9Ex* pOriginal, uMod_TextureServer* server); + virtual ~uMod_IDirect3DDevice9Ex(void); // START: The original DX9 function definitions HRESULT __stdcall QueryInterface (REFIID riid, void** ppvObj); @@ -177,21 +177,21 @@ public: // END: The original DX9 function definitions - OTM_TextureClient* GetOTM_Client(void) {return (OTM_Client);} + uMod_TextureClient* GetuMod_Client(void) {return (uMod_Client);} - OTM_IDirect3DTexture9* GetLastCreatedTexture(void) {return (LastCreatedTexture);} - int SetLastCreatedTexture(OTM_IDirect3DTexture9* pTexture) {LastCreatedTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DTexture9* GetLastCreatedTexture(void) {return (LastCreatedTexture);} + int SetLastCreatedTexture(uMod_IDirect3DTexture9* pTexture) {LastCreatedTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DVolumeTexture9* GetLastCreatedVolumeTexture(void) {return (LastCreatedVolumeTexture);} - int SetLastCreatedVolumeTexture(OTM_IDirect3DVolumeTexture9* pTexture) {LastCreatedVolumeTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DVolumeTexture9* GetLastCreatedVolumeTexture(void) {return (LastCreatedVolumeTexture);} + int SetLastCreatedVolumeTexture(uMod_IDirect3DVolumeTexture9* pTexture) {LastCreatedVolumeTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DCubeTexture9* GetLastCreatedCubeTexture(void) {return (LastCreatedCubeTexture);} - int SetLastCreatedCubeTexture(OTM_IDirect3DCubeTexture9* pTexture) {LastCreatedCubeTexture=pTexture; return (RETURN_OK);} + uMod_IDirect3DCubeTexture9* GetLastCreatedCubeTexture(void) {return (LastCreatedCubeTexture);} + int SetLastCreatedCubeTexture(uMod_IDirect3DCubeTexture9* pTexture) {LastCreatedCubeTexture=pTexture; return (RETURN_OK);} - OTM_IDirect3DTexture9* GetSingleTexture(void) {return (SingleTexture);} - OTM_IDirect3DVolumeTexture9* GetSingleVolumeTexture(void) {return (SingleVolumeTexture);} - OTM_IDirect3DCubeTexture9* GetSingleCubeTexture(void) {return (SingleCubeTexture);} + uMod_IDirect3DTexture9* GetSingleTexture(void) {return (SingleTexture);} + uMod_IDirect3DVolumeTexture9* GetSingleVolumeTexture(void) {return (SingleVolumeTexture);} + uMod_IDirect3DCubeTexture9* GetSingleCubeTexture(void) {return (SingleCubeTexture);} @@ -200,23 +200,23 @@ public: IDirect3DDevice9Ex* m_pIDirect3DDevice9Ex; int CounterSaveSingleTexture; - OTM_IDirect3DTexture9* SingleTexture; - OTM_IDirect3DVolumeTexture9* SingleVolumeTexture; - OTM_IDirect3DCubeTexture9* SingleCubeTexture; + uMod_IDirect3DTexture9* SingleTexture; + uMod_IDirect3DVolumeTexture9* SingleVolumeTexture; + uMod_IDirect3DCubeTexture9* SingleCubeTexture; char SingleTextureMod; D3DCOLOR TextureColour; ID3DXFont *OSD_Font; //D3DCOLOR FontColour; - int OTM_Reference; + int uMod_Reference; - OTM_IDirect3DTexture9* LastCreatedTexture; - OTM_IDirect3DVolumeTexture9* LastCreatedVolumeTexture; - OTM_IDirect3DCubeTexture9* LastCreatedCubeTexture; + uMod_IDirect3DTexture9* LastCreatedTexture; + uMod_IDirect3DVolumeTexture9* LastCreatedVolumeTexture; + uMod_IDirect3DCubeTexture9* LastCreatedCubeTexture; - OTM_TextureServer* OTM_Server; - OTM_TextureClient* OTM_Client; + uMod_TextureServer* uMod_Server; + uMod_TextureClient* uMod_Client; }; #endif diff --git a/OTM_DX9/OTM_IDirect3DTexture9.cpp b/uMod_DX9/uMod_IDirect3DTexture9.cpp similarity index 62% rename from OTM_DX9/OTM_IDirect3DTexture9.cpp rename to uMod_DX9/uMod_IDirect3DTexture9.cpp index 7e70be9..fa96ad1 100644 --- a/OTM_DX9/OTM_IDirect3DTexture9.cpp +++ b/uMod_DX9/uMod_IDirect3DTexture9.cpp @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -22,18 +22,18 @@ along with OpenTexMod. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::QueryInterface(REFIID riid, void** ppvObj) +HRESULT APIENTRY uMod_IDirect3DTexture9::QueryInterface(REFIID riid, void** ppvObj) { if (riid==IID_IDirect3D9) { // This function should never be called with IID_IDirect3D9 by the game // thus this call comes from our own dll to ask for the texture type - // 0x01000000L == OTM_IDirect3DTexture9 - // 0x01000001L == OTM_IDirect3DVolumeTexture9 - // 0x01000002L == OTM_IDirect3DCubeTexture9 + // 0x01000000L == uMod_IDirect3DTexture9 + // 0x01000001L == uMod_IDirect3DVolumeTexture9 + // 0x01000002L == uMod_IDirect3DCubeTexture9 *ppvObj = this; return (0x01000000L); @@ -53,7 +53,7 @@ HRESULT APIENTRY OTM_IDirect3DTexture9::QueryInterface(REFIID riid, void** ppvOb } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DTexture9::AddRef() +ULONG APIENTRY uMod_IDirect3DTexture9::AddRef() { if (FAKE) return (1); //bug, this case should never happen if (CrossRef_D3Dtex!=NULL) @@ -64,9 +64,9 @@ ULONG APIENTRY OTM_IDirect3DTexture9::AddRef() } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DTexture9::Release() +ULONG APIENTRY uMod_IDirect3DTexture9::Release() { - Message("OTM_IDirect3DTexture9::Release(): %lu\n", this); + Message("uMod_IDirect3DTexture9::Release(): %lu\n", this); void *cpy; long ret = m_D3Ddev->QueryInterface( IID_IDirect3DTexture9, &cpy); @@ -81,18 +81,18 @@ ULONG APIENTRY OTM_IDirect3DTexture9::Release() { if (CrossRef_D3Dtex!=NULL) //if this texture is switched with a fake texture { - OTM_IDirect3DTexture9 *fake_texture = CrossRef_D3Dtex; + uMod_IDirect3DTexture9 *fake_texture = CrossRef_D3Dtex; count = fake_texture->m_D3Dtex->Release(); //release the original texture if (count==0) //if texture is released we switch the textures back { UnswitchTextures(this); if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetSingleTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetSingleTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } } } @@ -108,136 +108,136 @@ ULONG APIENTRY OTM_IDirect3DTexture9::Release() // the hash of a non existing texture would be calculated if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedTexture()==this) ((OTM_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedTexture( NULL); - else ((OTM_IDirect3DDevice9*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedTexture()==this) ((uMod_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedTexture( NULL); + else ((uMod_IDirect3DDevice9*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedTexture()==this) ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedTexture( NULL); - else ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedTexture()==this) ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedTexture( NULL); + else ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } delete(this); } - Message("OTM_IDirect3DTexture9::Release() end: %lu\n", this); + Message("uMod_IDirect3DTexture9::Release() end: %lu\n", this); return (count); } -HRESULT APIENTRY OTM_IDirect3DTexture9::GetDevice(IDirect3DDevice9** ppDevice) +HRESULT APIENTRY uMod_IDirect3DTexture9::GetDevice(IDirect3DDevice9** ppDevice) { *ppDevice = m_D3Ddev; return D3D_OK; } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); return (m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) +HRESULT APIENTRY uMod_IDirect3DTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); return (m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::FreePrivateData(REFGUID refguid) +HRESULT APIENTRY uMod_IDirect3DTexture9::FreePrivateData(REFGUID refguid) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->FreePrivateData(refguid)); return (m_D3Dtex->FreePrivateData(refguid)); } -DWORD APIENTRY OTM_IDirect3DTexture9::SetPriority(DWORD PriorityNew) +DWORD APIENTRY uMod_IDirect3DTexture9::SetPriority(DWORD PriorityNew) { return (m_D3Dtex->SetPriority(PriorityNew)); } -DWORD APIENTRY OTM_IDirect3DTexture9::GetPriority() +DWORD APIENTRY uMod_IDirect3DTexture9::GetPriority() { return (m_D3Dtex->GetPriority()); } -void APIENTRY OTM_IDirect3DTexture9::PreLoad() +void APIENTRY uMod_IDirect3DTexture9::PreLoad() { m_D3Dtex->PreLoad(); } -D3DRESOURCETYPE APIENTRY OTM_IDirect3DTexture9::GetType() +D3DRESOURCETYPE APIENTRY uMod_IDirect3DTexture9::GetType() { return (m_D3Dtex->GetType()); } -DWORD APIENTRY OTM_IDirect3DTexture9::SetLOD(DWORD LODNew) +DWORD APIENTRY uMod_IDirect3DTexture9::SetLOD(DWORD LODNew) { return (m_D3Dtex->SetLOD(LODNew)); } -DWORD APIENTRY OTM_IDirect3DTexture9::GetLOD() +DWORD APIENTRY uMod_IDirect3DTexture9::GetLOD() { return (m_D3Dtex->GetLOD()); } -DWORD APIENTRY OTM_IDirect3DTexture9::GetLevelCount() +DWORD APIENTRY uMod_IDirect3DTexture9::GetLevelCount() { return (m_D3Dtex->GetLevelCount()); } -HRESULT APIENTRY OTM_IDirect3DTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) +HRESULT APIENTRY uMod_IDirect3DTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) { return (m_D3Dtex->SetAutoGenFilterType(FilterType)); } -D3DTEXTUREFILTERTYPE APIENTRY OTM_IDirect3DTexture9::GetAutoGenFilterType() +D3DTEXTUREFILTERTYPE APIENTRY uMod_IDirect3DTexture9::GetAutoGenFilterType() { return (m_D3Dtex->GetAutoGenFilterType()); } -void APIENTRY OTM_IDirect3DTexture9::GenerateMipSubLevels() +void APIENTRY uMod_IDirect3DTexture9::GenerateMipSubLevels() { m_D3Dtex->GenerateMipSubLevels(); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) +HRESULT APIENTRY uMod_IDirect3DTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetLevelDesc(Level, pDesc)); return (m_D3Dtex->GetLevelDesc(Level, pDesc)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::GetSurfaceLevel(UINT Level,IDirect3DSurface9** ppSurfaceLevel) +HRESULT APIENTRY uMod_IDirect3DTexture9::GetSurfaceLevel(UINT Level,IDirect3DSurface9** ppSurfaceLevel) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetSurfaceLevel(Level, ppSurfaceLevel)); return (m_D3Dtex->GetSurfaceLevel(Level, ppSurfaceLevel)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::LockRect(UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DTexture9::LockRect(UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->LockRect(Level, pLockedRect, pRect, Flags)); return (m_D3Dtex->LockRect(Level, pLockedRect, pRect, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::UnlockRect(UINT Level) +HRESULT APIENTRY uMod_IDirect3DTexture9::UnlockRect(UINT Level) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->UnlockRect(Level)); return (m_D3Dtex->UnlockRect(Level)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DTexture9::AddDirtyRect(CONST RECT* pDirtyRect) +HRESULT APIENTRY uMod_IDirect3DTexture9::AddDirtyRect(CONST RECT* pDirtyRect) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->AddDirtyRect(pDirtyRect)); return (m_D3Dtex->AddDirtyRect(pDirtyRect)); } -int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) +int uMod_IDirect3DTexture9::GetHash(MyTypeHash &hash) { hash=0u; if (FAKE) return (RETURN_BAD_ARGUMENT); @@ -252,37 +252,37 @@ int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) if (pTexture->GetLevelDesc(0, &desc)!=D3D_OK) //get the format and the size of the texture { - Message("OTM_IDirect3DTexture9::GetHash() Failed: GetLevelDesc \n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: GetLevelDesc \n"); return (RETURN_GetLevelDesc_FAILED); } - Message("OTM_IDirect3DTexture9::GetHash() (%d %d) %d\n", desc.Width, desc.Height, desc.Format); + Message("uMod_IDirect3DTexture9::GetHash() (%d %d) %d\n", desc.Width, desc.Height, desc.Format); if (desc.Pool==D3DPOOL_DEFAULT) //get the raw data of the texture { - //Message("OTM_IDirect3DTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); + //Message("uMod_IDirect3DTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); IDirect3DSurface9 *pSurfaceLevel_orig = NULL; if (pTexture->GetSurfaceLevel( 0, &pSurfaceLevel_orig)!=D3D_OK) { - Message("OTM_IDirect3DTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) { - //Message("OTM_IDirect3DTexture9::GetHash() MultiSampleType\n"); + //Message("uMod_IDirect3DTexture9::GetHash() MultiSampleType\n"); if (D3D_OK!=m_D3Ddev->CreateRenderTarget( desc.Width, desc.Height, desc.Format, D3DMULTISAMPLE_NONE, 0, FALSE, &pResolvedSurface, NULL )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } if (D3D_OK!=m_D3Ddev->StretchRect( pSurfaceLevel_orig, NULL, pResolvedSurface, NULL, D3DTEXF_NONE )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } @@ -293,7 +293,7 @@ int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) { pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); return (RETURN_TEXTURE_NOT_LOADED); } @@ -302,7 +302,7 @@ int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } pSurfaceLevel_orig->Release(); @@ -311,22 +311,22 @@ int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) { if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } } else if (pTexture->LockRect( 0, &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { - Message("OTM_IDirect3DTexture9::GetHash() Failed: LockRect 1\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: LockRect 1\n"); if (pTexture->GetSurfaceLevel(0, &pResolvedSurface)!=D3D_OK) { - Message("OTM_IDirect3DTexture9::GetHash() Failed: GetSurfaceLevel\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: GetSurfaceLevel\n"); return (RETURN_LockRect_FAILED); } if (pResolvedSurface->LockRect( &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { pResolvedSurface->Release(); - Message("OTM_IDirect3DTexture9::GetHash() Failed: LockRect 2\n"); + Message("uMod_IDirect3DTexture9::GetHash() Failed: LockRect 2\n"); return (RETURN_LockRect_FAILED); } } @@ -348,6 +348,6 @@ int OTM_IDirect3DTexture9::GetHash(MyTypeHash &hash) } else pTexture->UnlockRect(0); - Message("OTM_IDirect3DTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); + Message("uMod_IDirect3DTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); return (RETURN_OK); } diff --git a/OTM_DX9/OTM_IDirect3DTexture9.h b/uMod_DX9/uMod_IDirect3DTexture9.h similarity index 75% rename from OTM_DX9/OTM_IDirect3DTexture9.h rename to uMod_DX9/uMod_IDirect3DTexture9.h index 2f56a09..bef1bec 100644 --- a/OTM_DX9/OTM_IDirect3DTexture9.h +++ b/uMod_DX9/uMod_IDirect3DTexture9.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ @@ -25,24 +25,24 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3DTexture9_H -#define OTM_IDirect3DTexture9_H +#ifndef uMod_IDirect3DTexture9_H +#define uMod_IDirect3DTexture9_H #include #include -#include "OTM_Defines.h" +#include "uMod_Defines.h" -interface OTM_IDirect3DTexture9 : public IDirect3DTexture9 +interface uMod_IDirect3DTexture9 : public IDirect3DTexture9 { - OTM_IDirect3DTexture9(IDirect3DTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) + uMod_IDirect3DTexture9(IDirect3DTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) { m_D3Dtex = *ppTex; //Texture which will be displayed and will be passed to the game m_D3Ddev = pIDirect3DDevice9; //device pointer CrossRef_D3Dtex = NULL; //cross reference - // fake texture: store the pointer to the original OTM_IDirect3DTexture9 object, needed if a fake texture is unselected + // fake texture: store the pointer to the original uMod_IDirect3DTexture9 object, needed if a fake texture is unselected // original texture: stores the pointer to the fake texture object, is needed if original texture is deleted, // thus the fake texture can also be deleted Reference = -1; //need for fast deleting @@ -52,7 +52,7 @@ interface OTM_IDirect3DTexture9 : public IDirect3DTexture9 // callback interface IDirect3DTexture9 *m_D3Dtex; - OTM_IDirect3DTexture9 *CrossRef_D3Dtex; + uMod_IDirect3DTexture9 *CrossRef_D3Dtex; IDirect3DDevice9 *m_D3Ddev; int Reference; MyTypeHash Hash; @@ -87,9 +87,9 @@ interface OTM_IDirect3DTexture9 : public IDirect3DTexture9 -inline void UnswitchTextures(OTM_IDirect3DTexture9 *pTexture) +inline void UnswitchTextures(uMod_IDirect3DTexture9 *pTexture) { - OTM_IDirect3DTexture9* CrossRef = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DTexture9* CrossRef = pTexture->CrossRef_D3Dtex; if (CrossRef!=NULL) { // switch textures back @@ -103,7 +103,7 @@ inline void UnswitchTextures(OTM_IDirect3DTexture9 *pTexture) } } -inline int SwitchTextures( OTM_IDirect3DTexture9 *pTexture1, OTM_IDirect3DTexture9 *pTexture2) +inline int SwitchTextures( uMod_IDirect3DTexture9 *pTexture1, uMod_IDirect3DTexture9 *pTexture2) { if (pTexture1->m_D3Ddev == pTexture2->m_D3Ddev && pTexture1->CrossRef_D3Dtex == NULL && pTexture2->CrossRef_D3Dtex == NULL) { diff --git a/OTM_DX9/OTM_IDirect3DVolumeTexture9.cpp b/uMod_DX9/uMod_IDirect3DVolumeTexture9.cpp similarity index 62% rename from OTM_DX9/OTM_IDirect3DVolumeTexture9.cpp rename to uMod_DX9/uMod_IDirect3DVolumeTexture9.cpp index 0d69569..a9942eb 100644 --- a/OTM_DX9/OTM_IDirect3DVolumeTexture9.cpp +++ b/uMod_DX9/uMod_IDirect3DVolumeTexture9.cpp @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ /* @@ -22,17 +22,17 @@ along with OpenTexMod. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::QueryInterface(REFIID riid, void** ppvObj) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::QueryInterface(REFIID riid, void** ppvObj) { if (riid==IID_IDirect3D9) { // This function should never be called with IID_IDirect3D9 by the game // thus this call comes from our own dll to ask for the texture type - // 0x01000000L == OTM_IDirect3DTexture9 - // 0x01000001L == OTM_IDirect3DVolumeTexture9 - // 0x01000002L == OTM_IDirect3DCubeTexture9 + // 0x01000000L == uMod_IDirect3DTexture9 + // 0x01000001L == uMod_IDirect3DVolumeTexture9 + // 0x01000002L == uMod_IDirect3DCubeTexture9 *ppvObj = this; return (0x01000001L); @@ -52,7 +52,7 @@ HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::QueryInterface(REFIID riid, void** } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DVolumeTexture9::AddRef() +ULONG APIENTRY uMod_IDirect3DVolumeTexture9::AddRef() { if (FAKE) return (1); //bug, this case should never happen if (CrossRef_D3Dtex!=NULL) @@ -63,9 +63,9 @@ ULONG APIENTRY OTM_IDirect3DVolumeTexture9::AddRef() } //this function yields for the non switched texture object -ULONG APIENTRY OTM_IDirect3DVolumeTexture9::Release() +ULONG APIENTRY uMod_IDirect3DVolumeTexture9::Release() { - Message("OTM_IDirect3DVolumeTexture9::Release(): %lu\n", this); + Message("uMod_IDirect3DVolumeTexture9::Release(): %lu\n", this); void *cpy; long ret = m_D3Ddev->QueryInterface( IID_IDirect3DTexture9, &cpy); @@ -80,18 +80,18 @@ ULONG APIENTRY OTM_IDirect3DVolumeTexture9::Release() { if (CrossRef_D3Dtex!=NULL) //if this texture is switched with a fake texture { - OTM_IDirect3DVolumeTexture9 *fake_texture = CrossRef_D3Dtex; + uMod_IDirect3DVolumeTexture9 *fake_texture = CrossRef_D3Dtex; count = fake_texture->m_D3Dtex->Release(); //release the original texture if (count==0) //if texture is released we switch the textures back { UnswitchTextures(this); if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetSingleVolumeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetSingleVolumeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleVolumeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetSingleVolumeTexture()!=fake_texture) fake_texture->Release(); // we release the fake texture } } } @@ -107,13 +107,13 @@ ULONG APIENTRY OTM_IDirect3DVolumeTexture9::Release() // the hash of a non existing texture would be calculated if (ret == 0x01000000L) { - if (((OTM_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedVolumeTexture()==this) ((OTM_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedVolumeTexture( NULL); - else ((OTM_IDirect3DDevice9*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9*) m_D3Ddev)->GetLastCreatedVolumeTexture()==this) ((uMod_IDirect3DDevice9*) m_D3Ddev)->SetLastCreatedVolumeTexture( NULL); + else ((uMod_IDirect3DDevice9*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } else { - if (((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedVolumeTexture()==this) ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedVolumeTexture( NULL); - else ((OTM_IDirect3DDevice9Ex*) m_D3Ddev)->GetOTM_Client()->RemoveTexture(this); // remove this texture from the texture client + if (((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetLastCreatedVolumeTexture()==this) ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->SetLastCreatedVolumeTexture( NULL); + else ((uMod_IDirect3DDevice9Ex*) m_D3Ddev)->GetuMod_Client()->RemoveTexture(this); // remove this texture from the texture client } delete(this); @@ -121,79 +121,79 @@ ULONG APIENTRY OTM_IDirect3DVolumeTexture9::Release() return (count); } -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::GetDevice(IDirect3DDevice9** ppDevice) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::GetDevice(IDirect3DDevice9** ppDevice) { *ppDevice = m_D3Ddev; return D3D_OK; } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); return (m_D3Dtex->SetPrivateData(refguid, pData, SizeOfData, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); return (m_D3Dtex->GetPrivateData(refguid, pData, pSizeOfData)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::FreePrivateData(REFGUID refguid) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::FreePrivateData(REFGUID refguid) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->FreePrivateData(refguid)); return (m_D3Dtex->FreePrivateData(refguid)); } -DWORD APIENTRY OTM_IDirect3DVolumeTexture9::SetPriority(DWORD PriorityNew) +DWORD APIENTRY uMod_IDirect3DVolumeTexture9::SetPriority(DWORD PriorityNew) { return (m_D3Dtex->SetPriority(PriorityNew)); } -DWORD APIENTRY OTM_IDirect3DVolumeTexture9::GetPriority() +DWORD APIENTRY uMod_IDirect3DVolumeTexture9::GetPriority() { return (m_D3Dtex->GetPriority()); } -void APIENTRY OTM_IDirect3DVolumeTexture9::PreLoad() +void APIENTRY uMod_IDirect3DVolumeTexture9::PreLoad() { m_D3Dtex->PreLoad(); } -D3DRESOURCETYPE APIENTRY OTM_IDirect3DVolumeTexture9::GetType() +D3DRESOURCETYPE APIENTRY uMod_IDirect3DVolumeTexture9::GetType() { return (m_D3Dtex->GetType()); } -DWORD APIENTRY OTM_IDirect3DVolumeTexture9::SetLOD(DWORD LODNew) +DWORD APIENTRY uMod_IDirect3DVolumeTexture9::SetLOD(DWORD LODNew) { return (m_D3Dtex->SetLOD(LODNew)); } -DWORD APIENTRY OTM_IDirect3DVolumeTexture9::GetLOD() +DWORD APIENTRY uMod_IDirect3DVolumeTexture9::GetLOD() { return (m_D3Dtex->GetLOD()); } -DWORD APIENTRY OTM_IDirect3DVolumeTexture9::GetLevelCount() +DWORD APIENTRY uMod_IDirect3DVolumeTexture9::GetLevelCount() { return (m_D3Dtex->GetLevelCount()); } -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::SetAutoGenFilterType(D3DTEXTUREFILTERTYPE FilterType) { return (m_D3Dtex->SetAutoGenFilterType(FilterType)); } -D3DTEXTUREFILTERTYPE APIENTRY OTM_IDirect3DVolumeTexture9::GetAutoGenFilterType() +D3DTEXTUREFILTERTYPE APIENTRY uMod_IDirect3DVolumeTexture9::GetAutoGenFilterType() { return (m_D3Dtex->GetAutoGenFilterType()); } -void APIENTRY OTM_IDirect3DVolumeTexture9::GenerateMipSubLevels() +void APIENTRY uMod_IDirect3DVolumeTexture9::GenerateMipSubLevels() { m_D3Dtex->GenerateMipSubLevels(); } @@ -201,42 +201,42 @@ void APIENTRY OTM_IDirect3DVolumeTexture9::GenerateMipSubLevels() //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::AddDirtyBox(CONST D3DBOX *pDirtyBox) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::AddDirtyBox(CONST D3DBOX *pDirtyBox) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->AddDirtyBox(pDirtyBox)); return (m_D3Dtex->AddDirtyBox(pDirtyBox)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::GetLevelDesc(UINT Level, D3DVOLUME_DESC *pDesc) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::GetLevelDesc(UINT Level, D3DVOLUME_DESC *pDesc) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetLevelDesc(Level, pDesc)); return (m_D3Dtex->GetLevelDesc(Level, pDesc)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::GetVolumeLevel(UINT Level, IDirect3DVolume9 **ppVolumeLevel) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::GetVolumeLevel(UINT Level, IDirect3DVolume9 **ppVolumeLevel) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->GetVolumeLevel(Level, ppVolumeLevel)); return (m_D3Dtex->GetVolumeLevel(Level, ppVolumeLevel)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::LockBox(UINT Level, D3DLOCKED_BOX *pLockedVolume, CONST D3DBOX *pBox ,DWORD Flags) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::LockBox(UINT Level, D3DLOCKED_BOX *pLockedVolume, CONST D3DBOX *pBox ,DWORD Flags) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->LockBox(Level, pLockedVolume, pBox, Flags)); return (m_D3Dtex->LockBox(Level, pLockedVolume, pBox, Flags)); } //this function yields for the non switched texture object -HRESULT APIENTRY OTM_IDirect3DVolumeTexture9::UnlockBox(UINT Level) +HRESULT APIENTRY uMod_IDirect3DVolumeTexture9::UnlockBox(UINT Level) { if (CrossRef_D3Dtex!=NULL) return (CrossRef_D3Dtex->m_D3Dtex->UnlockBox(Level)); return (m_D3Dtex->UnlockBox(Level)); } -int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) +int uMod_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) { hash=0u; if (FAKE) return (RETURN_BAD_ARGUMENT); @@ -251,37 +251,37 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) if (pTexture->GetLevelDesc(0, &desc)!=D3D_OK) //get the format and the size of the texture { - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetLevelDesc \n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetLevelDesc \n"); return (RETURN_GetLevelDesc_FAILED); } - Message("OTM_IDirect3DVolumeTexture9::GetHash() (%d %d %d) %d\n", desc.Width, desc.Height, desc.Depth, desc.Format); + Message("uMod_IDirect3DVolumeTexture9::GetHash() (%d %d %d) %d\n", desc.Width, desc.Height, desc.Depth, desc.Format); /* if (desc.Pool==D3DPOOL_DEFAULT) //get the raw data of the texture { - //Message("OTM_IDirect3DVolumeTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); + //Message("uMod_IDirect3DVolumeTexture9::GetHash() (D3DPOOL_DEFAULT)\n"); IDirect3DSurface9 *pSurfaceLevel_orig = NULL; if (pTexture->GetSurfaceLevel( 0, &pSurfaceLevel_orig)!=D3D_OK) { - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel 1 (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } /* if (desc.MultiSampleType != D3DMULTISAMPLE_NONE) { - //Message("OTM_IDirect3DVolumeTexture9::GetHash() MultiSampleType\n"); + //Message("uMod_IDirect3DVolumeTexture9::GetHash() MultiSampleType\n"); if (D3D_OK!=m_D3Ddev->CreateRenderTarget( desc.Width, desc.Height, desc.Format, D3DMULTISAMPLE_NONE, 0, FALSE, &pResolvedSurface, NULL )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: CreateRenderTarget (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } if (D3D_OK!=m_D3Ddev->StretchRect( pSurfaceLevel_orig, NULL, pResolvedSurface, NULL, D3DTEXF_NONE )) { pSurfaceLevel_orig->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: StretchRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } @@ -294,12 +294,12 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) { pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: CreateTexture (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: CreateTexture (D3DPOOL_DEFAULT)\n"); return (RETURN_TEXTURE_NOT_LOADED); } if (pOffscreenTexture->GetSurfaceLevel( 0, &pOffscreenSurface)!=D3D_OK) { - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel 2 (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel 2 (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } @@ -309,7 +309,7 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); pOffscreenTexture->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } pSurfaceLevel_orig->Release(); @@ -319,7 +319,7 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); pOffscreenTexture->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } */ @@ -328,7 +328,7 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) { pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: CreateOffscreenPlainSurface (D3DPOOL_DEFAULT)\n"); return (RETURN_TEXTURE_NOT_LOADED); } @@ -337,7 +337,7 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) pSurfaceLevel_orig->Release(); if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetRenderTargetData (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } pSurfaceLevel_orig->Release(); @@ -346,7 +346,7 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) { if (pResolvedSurface!=NULL) pResolvedSurface->Release(); pOffscreenSurface->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: LockRect (D3DPOOL_DEFAULT)\n"); return (RETURN_LockRect_FAILED); } } @@ -354,16 +354,16 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) */ if (pTexture->LockBox( 0, &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: LockRect 1\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: LockRect 1\n"); if (pTexture->GetVolumeLevel(0, &pResolvedSurface)!=D3D_OK) { - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: GetSurfaceLevel\n"); return (RETURN_LockRect_FAILED); } if (pResolvedSurface->LockBox( &d3dlr, NULL, D3DLOCK_READONLY)!=D3D_OK) { pResolvedSurface->Release(); - Message("OTM_IDirect3DVolumeTexture9::GetHash() Failed: LockRect 2\n"); + Message("uMod_IDirect3DVolumeTexture9::GetHash() Failed: LockRect 2\n"); return (RETURN_LockRect_FAILED); } } @@ -380,6 +380,6 @@ int OTM_IDirect3DVolumeTexture9::GetHash(MyTypeHash &hash) } else pTexture->UnlockBox(0); - Message("OTM_IDirect3DVolumeTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); + Message("uMod_IDirect3DVolumeTexture9::GetHash() %#lX (%d %d) %d = %d\n", hash, desc.Width, desc.Height, desc.Format, size); return (RETURN_OK); } diff --git a/OTM_DX9/OTM_IDirect3DVolumeTexture9.h b/uMod_DX9/uMod_IDirect3DVolumeTexture9.h similarity index 73% rename from OTM_DX9/OTM_IDirect3DVolumeTexture9.h rename to uMod_DX9/uMod_IDirect3DVolumeTexture9.h index b1cf30b..0c2c81a 100644 --- a/OTM_DX9/OTM_IDirect3DVolumeTexture9.h +++ b/uMod_DX9/uMod_IDirect3DVolumeTexture9.h @@ -1,19 +1,19 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ @@ -25,24 +25,24 @@ along with OpenTexMod. If not, see . */ -#ifndef OTM_IDirect3DVolumeTexture9_H -#define OTM_IDirect3DVolumeTexture9_H +#ifndef uMod_IDirect3DVolumeTexture9_H +#define uMod_IDirect3DVolumeTexture9_H #include #include -#include "OTM_Defines.h" +#include "uMod_Defines.h" -interface OTM_IDirect3DVolumeTexture9 : public IDirect3DVolumeTexture9 +interface uMod_IDirect3DVolumeTexture9 : public IDirect3DVolumeTexture9 { - OTM_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) + uMod_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 **ppTex, IDirect3DDevice9 *pIDirect3DDevice9) { m_D3Dtex = *ppTex; //Texture which will be displayed and will be passed to the game m_D3Ddev = pIDirect3DDevice9; //device pointer CrossRef_D3Dtex = NULL; //cross reference - // fake texture: store the pointer to the original OTM_IDirect3DVolumeTexture9 object, needed if a fake texture is unselected + // fake texture: store the pointer to the original uMod_IDirect3DVolumeTexture9 object, needed if a fake texture is unselected // original texture: stores the pointer to the fake texture object, is needed if original texture is deleted, // thus the fake texture can also be deleted Reference = -1; //need for fast deleting @@ -52,7 +52,7 @@ interface OTM_IDirect3DVolumeTexture9 : public IDirect3DVolumeTexture9 // callback interface IDirect3DVolumeTexture9 *m_D3Dtex; - OTM_IDirect3DVolumeTexture9 *CrossRef_D3Dtex; + uMod_IDirect3DVolumeTexture9 *CrossRef_D3Dtex; IDirect3DDevice9 *m_D3Ddev; int Reference; MyTypeHash Hash; @@ -88,9 +88,9 @@ interface OTM_IDirect3DVolumeTexture9 : public IDirect3DVolumeTexture9 -inline void UnswitchTextures(OTM_IDirect3DVolumeTexture9 *pTexture) +inline void UnswitchTextures(uMod_IDirect3DVolumeTexture9 *pTexture) { - OTM_IDirect3DVolumeTexture9* CrossRef = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DVolumeTexture9* CrossRef = pTexture->CrossRef_D3Dtex; if (CrossRef!=NULL) { // switch textures back @@ -104,7 +104,7 @@ inline void UnswitchTextures(OTM_IDirect3DVolumeTexture9 *pTexture) } } -inline int SwitchTextures( OTM_IDirect3DVolumeTexture9 *pTexture1, OTM_IDirect3DVolumeTexture9 *pTexture2) +inline int SwitchTextures( uMod_IDirect3DVolumeTexture9 *pTexture1, uMod_IDirect3DVolumeTexture9 *pTexture2) { if (pTexture1->m_D3Ddev == pTexture2->m_D3Ddev && pTexture1->CrossRef_D3Dtex == NULL && pTexture2->CrossRef_D3Dtex == NULL) { diff --git a/uMod_DX9/uMod_Main.h b/uMod_DX9/uMod_Main.h new file mode 100644 index 0000000..6655982 --- /dev/null +++ b/uMod_DX9/uMod_Main.h @@ -0,0 +1,66 @@ +/* +This file is part of Universal Modding Engine. + + +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ + + + +#ifndef uMod_MAIN_H_ +#define uMod_MAIN_H_ + +#define WINVER _WIN32_WINNT_WINXP +#define _WIN32_WINNT _WIN32_WINNT_WINXP +#define _WIN32_WINDOWS _WIN32_WINNT_WINXP +#define NTDDI_VERSION NTDDI_WINXP +//#define NTDDI_LONGHORN NTDDI_WINXP +#define WIN32_LEAN_AND_MEAN + + +#include + +#include +#include + +#include +#include + + + + +#include "../uMod_GlobalDefines.h" +#include "../uMod_Error.h" +#include "uMod_Defines.h" +#include "uMod_DX9_dll.h" +#include "uMod_TextureFunction.h" + +#include "uMod_IDirect3D9.h" +#include "uMod_IDirect3D9Ex.h" + +#include "uMod_IDirect3DDevice9.h" +#include "uMod_IDirect3DDevice9Ex.h" + +#include "uMod_IDirect3DCubeTexture9.h" +#include "uMod_IDirect3DTexture9.h" +#include "uMod_IDirect3DVolumeTexture9.h" + +#include "uMod_ArrayHandler.h" +#include "uMod_TextureServer.h" +#include "uMod_TextureClient.h" + + +extern unsigned int gl_ErrorState; + +#endif diff --git a/OTM_DX9/OTM_TextureClient.cpp b/uMod_DX9/uMod_TextureClient.cpp similarity index 71% rename from OTM_DX9/OTM_TextureClient.cpp rename to uMod_DX9/uMod_TextureClient.cpp index 574a00b..594eb09 100644 --- a/OTM_DX9/OTM_TextureClient.cpp +++ b/uMod_DX9/uMod_TextureClient.cpp @@ -1,29 +1,29 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_TextureClient::OTM_TextureClient(OTM_TextureServer* server, IDirect3DDevice9* device) +uMod_TextureClient::uMod_TextureClient(uMod_TextureServer* server, IDirect3DDevice9* device) { - Message("OTM_TextureClient::OTM_TextureClient(void): %lu\n", this); + Message("uMod_TextureClient::uMod_TextureClient(void): %lu\n", this); Server = server; D3D9Device = device; BoolSaveAllTextures = false; @@ -58,9 +58,9 @@ OTM_TextureClient::OTM_TextureClient(OTM_TextureServer* server, IDirect3DDevice9 TextureColour = D3DCOLOR_ARGB(255,0,255,0); } -OTM_TextureClient::~OTM_TextureClient(void) +uMod_TextureClient::~uMod_TextureClient(void) { - Message("OTM_TextureClient::~OTM_TextureClient(void): %lu\n", this); + Message("uMod_TextureClient::~uMod_TextureClient(void): %lu\n", this); if (Server!=NULL) Server->RemoveClient(this); if (Mutex!=NULL) CloseHandle(Mutex); @@ -74,16 +74,16 @@ OTM_TextureClient::~OTM_TextureClient(void) } -int OTM_TextureClient::AddTexture( OTM_IDirect3DTexture9* pTexture) +int uMod_TextureClient::AddTexture( uMod_IDirect3DTexture9* pTexture) { void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice if (pTexture->FAKE) return (RETURN_OK); // this is a fake texture - Message("OTM_TextureClient::AddTexture( %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); + Message("uMod_TextureClient::AddTexture( %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); MyTypeHash hash; if (int ret = pTexture->GetHash( hash)) return (ret); @@ -92,23 +92,23 @@ int OTM_TextureClient::AddTexture( OTM_IDirect3DTexture9* pTexture) if (BoolSaveAllTextures) SaveTexture(pTexture); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); OriginalTextures.Add( pTexture); // add the texture to the list of original texture return (LookUpToMod(pTexture)); // check if this texture should be modded } -int OTM_TextureClient::AddTexture( OTM_IDirect3DVolumeTexture9* pTexture) +int uMod_TextureClient::AddTexture( uMod_IDirect3DVolumeTexture9* pTexture) { void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice if (pTexture->FAKE) return (RETURN_OK); // this is a fake texture - Message("OTM_TextureClient::AddTexture( Volume: %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); + Message("uMod_TextureClient::AddTexture( Volume: %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); MyTypeHash hash; if (int ret = pTexture->GetHash( hash)) return (ret); @@ -117,23 +117,23 @@ int OTM_TextureClient::AddTexture( OTM_IDirect3DVolumeTexture9* pTexture) if (BoolSaveAllTextures) SaveTexture(pTexture); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); OriginalVolumeTextures.Add( pTexture); // add the texture to the list of original texture return (LookUpToMod(pTexture)); // check if this texture should be modded } -int OTM_TextureClient::AddTexture( OTM_IDirect3DCubeTexture9* pTexture) +int uMod_TextureClient::AddTexture( uMod_IDirect3DCubeTexture9* pTexture) { void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice if (pTexture->FAKE) return (RETURN_OK); // this is a fake texture - Message("OTM_TextureClient::AddTexture( Cube: %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); + Message("uMod_TextureClient::AddTexture( Cube: %lu): %lu (thread: %lu)\n", pTexture, this, GetCurrentThreadId()); MyTypeHash hash; if (int ret = pTexture->GetHash( hash)) return (ret); @@ -142,7 +142,7 @@ int OTM_TextureClient::AddTexture( OTM_IDirect3DCubeTexture9* pTexture) if (BoolSaveAllTextures) SaveTexture(pTexture); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); OriginalCubeTextures.Add( pTexture); // add the texture to the list of original texture @@ -151,11 +151,11 @@ int OTM_TextureClient::AddTexture( OTM_IDirect3DCubeTexture9* pTexture) -int OTM_TextureClient::RemoveTexture( OTM_IDirect3DTexture9* pTexture) // is called from a texture, if it is finally released +int uMod_TextureClient::RemoveTexture( uMod_IDirect3DTexture9* pTexture) // is called from a texture, if it is finally released { - Message("OTM_TextureClient::RemoveTexture( %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::RemoveTexture( %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); if (pTexture->FAKE) { // we need to set the corresponding FileToMod[X].pTexture to NULL, to avoid a link to a non existing texture object @@ -178,11 +178,11 @@ int OTM_TextureClient::RemoveTexture( OTM_IDirect3DTexture9* pTexture) // is cal return (RETURN_OK); } -int OTM_TextureClient::RemoveTexture( OTM_IDirect3DVolumeTexture9* pTexture) // is called from a texture, if it is finally released +int uMod_TextureClient::RemoveTexture( uMod_IDirect3DVolumeTexture9* pTexture) // is called from a texture, if it is finally released { - Message("OTM_TextureClient::RemoveTexture( Volume %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::RemoveTexture( Volume %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); if (pTexture->FAKE) { // we need to set the corresponding FileToMod[X].pTexture to NULL, to avoid a link to a non existing texture object @@ -205,11 +205,11 @@ int OTM_TextureClient::RemoveTexture( OTM_IDirect3DVolumeTexture9* pTexture) // return (RETURN_OK); } -int OTM_TextureClient::RemoveTexture( OTM_IDirect3DCubeTexture9* pTexture) // is called from a texture, if it is finally released +int uMod_TextureClient::RemoveTexture( uMod_IDirect3DCubeTexture9* pTexture) // is called from a texture, if it is finally released { - Message("OTM_TextureClient::RemoveTexture( Cube %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::RemoveTexture( Cube %lu, %#lX): %lu\n", pTexture, pTexture->Hash, this); - if (gl_ErrorState & OTM_ERROR_FATAL) return (RETURN_FATAL_ERROR); + if (gl_ErrorState & uMod_ERROR_FATAL) return (RETURN_FATAL_ERROR); if (pTexture->FAKE) { // we need to set the corresponding FileToMod[X].pTexture to NULL, to avoid a link to a non existing texture object @@ -233,23 +233,23 @@ int OTM_TextureClient::RemoveTexture( OTM_IDirect3DCubeTexture9* pTexture) // is } -int OTM_TextureClient::SaveAllTextures(bool val) +int uMod_TextureClient::SaveAllTextures(bool val) { - Message("OTM_TextureClient::SaveAllTextures( %d): %lu\n", val, this); + Message("uMod_TextureClient::SaveAllTextures( %d): %lu\n", val, this); BoolSaveAllTextures=val; return (RETURN_OK); } -int OTM_TextureClient::SaveSingleTexture(bool val) +int uMod_TextureClient::SaveSingleTexture(bool val) { - Message("OTM_TextureClient::SaveSingleTexture( %d): %lu\n", val, this); + Message("uMod_TextureClient::SaveSingleTexture( %d): %lu\n", val, this); if (BoolSaveSingleTexture && !val) //if BoolSaveSingleTexture is set to false and was previously true we switch the SingleTexture back { - OTM_IDirect3DTexture9* pTexture; + uMod_IDirect3DTexture9* pTexture; void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) pTexture = ((OTM_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); //this texture must no be added twice - else pTexture = ((OTM_IDirect3DDevice9Ex*) D3D9Device)->GetSingleTexture(); //this texture must no be added twice + if (ret == 0x01000000L) pTexture = ((uMod_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); //this texture must no be added twice + else pTexture = ((uMod_IDirect3DDevice9Ex*) D3D9Device)->GetSingleTexture(); //this texture must no be added twice if (pTexture!=NULL) UnswitchTextures(pTexture); } @@ -258,9 +258,9 @@ int OTM_TextureClient::SaveSingleTexture(bool val) } -int OTM_TextureClient::SetSaveDirectory( wchar_t *dir) +int uMod_TextureClient::SetSaveDirectory( wchar_t *dir) { - Message("OTM_TextureClient::SetSaveDirectory( %ls): %lu\n", dir, this); + Message("uMod_TextureClient::SetSaveDirectory( %ls): %lu\n", dir, this); int i = 0; for (i=0; iHash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} + if (SavePath[0]==0) {Message("uMod_TextureClient::SaveTexture( %#lX, %lu): %lu, SavePath not set\n", pTexture->Hash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} wchar_t file[MAX_PATH]; if (GameName[0]) swprintf_s( file, MAX_PATH, L"%ls\\%ls_T_%#lX.dds", SavePath, GameName, pTexture->Hash); else swprintf_s( file, MAX_PATH, L"%ls\\T_%#lX.dds", SavePath, pTexture->Hash); - Message("OTM_TextureClient::SaveTexture( %ls): %lu\n", file, this); + Message("uMod_TextureClient::SaveTexture( %ls): %lu\n", file, this); if (D3D_OK!=D3DXSaveTextureToFileW( file, D3DXIFF_DDS, pTexture->m_D3Dtex, NULL)) return (RETURN_TEXTURE_NOT_SAVED); return (RETURN_OK); } -int OTM_TextureClient::SaveTexture(OTM_IDirect3DVolumeTexture9* pTexture) +int uMod_TextureClient::SaveTexture(uMod_IDirect3DVolumeTexture9* pTexture) { if (pTexture==NULL) return (RETURN_BAD_ARGUMENT); - if (SavePath[0]==0) {Message("OTM_TextureClient::SaveTexture( %#lX, %lu): %lu, SavePath not set\n", pTexture->Hash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} + if (SavePath[0]==0) {Message("uMod_TextureClient::SaveTexture( %#lX, %lu): %lu, SavePath not set\n", pTexture->Hash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} wchar_t file[MAX_PATH]; if (GameName[0]) swprintf_s( file, MAX_PATH, L"%ls\\%ls_V_%#lX.dds", SavePath, GameName, pTexture->Hash); else swprintf_s( file, MAX_PATH, L"%ls\\V_%#lX.dds", SavePath, pTexture->Hash); - Message("OTM_TextureClient::SaveTexture( %ls): %lu\n", file, this); + Message("uMod_TextureClient::SaveTexture( %ls): %lu\n", file, this); if (D3D_OK!=D3DXSaveTextureToFileW( file, D3DXIFF_DDS, pTexture->m_D3Dtex, NULL)) return (RETURN_TEXTURE_NOT_SAVED); return (RETURN_OK); } -int OTM_TextureClient::SaveTexture(OTM_IDirect3DCubeTexture9* pTexture) +int uMod_TextureClient::SaveTexture(uMod_IDirect3DCubeTexture9* pTexture) { if (pTexture==NULL) return (RETURN_BAD_ARGUMENT); - if (SavePath[0]==0) {Message("OTM_TextureClient::SaveTexture( %#lX, %lu): %lu, SavePath not set\n", pTexture->Hash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} + if (SavePath[0]==0) {Message("uMod_TextureClient::SaveTexture( %#lX, %lu): %lu, SavePath not set\n", pTexture->Hash, pTexture->m_D3Dtex, this); return (RETURN_TEXTURE_NOT_SAVED);} wchar_t file[MAX_PATH]; if (GameName[0]) swprintf_s( file, MAX_PATH, L"%ls\\%ls_C_%#lX.dds", SavePath, GameName, pTexture->Hash); else swprintf_s( file, MAX_PATH, L"%ls\\C_%#lX.dds", SavePath, pTexture->Hash); - Message("OTM_TextureClient::SaveTexture( %ls): %lu\n", file, this); + Message("uMod_TextureClient::SaveTexture( %ls): %lu\n", file, this); if (D3D_OK!=D3DXSaveTextureToFileW( file, D3DXIFF_DDS, pTexture->m_D3Dtex, NULL)) return (RETURN_TEXTURE_NOT_SAVED); return (RETURN_OK); @@ -333,10 +333,10 @@ int OTM_TextureClient::SaveTexture(OTM_IDirect3DCubeTexture9* pTexture) -int OTM_TextureClient::AddUpdate(TextureFileStruct* update, int number) //client must delete the update array +int uMod_TextureClient::AddUpdate(TextureFileStruct* update, int number) //client must delete the update array { Message("AddUpdate( %lu, %d): %lu\n", update, number, this); - if (int ret = LockMutex()) {gl_ErrorState |= OTM_ERROR_TEXTURE; return (ret);} + if (int ret = LockMutex()) {gl_ErrorState |= uMod_ERROR_TEXTURE; return (ret);} if (Update!=NULL) delete [] Update; Update = update; NumberOfUpdate = number; @@ -345,10 +345,10 @@ int OTM_TextureClient::AddUpdate(TextureFileStruct* update, int number) //clien -int OTM_TextureClient::MergeUpdate(void) +int uMod_TextureClient::MergeUpdate(void) { if (NumberOfUpdate<0) {return (RETURN_OK);} - if (int ret = LockMutex()) {gl_ErrorState |= OTM_ERROR_TEXTURE ; return (ret);} + if (int ret = LockMutex()) {gl_ErrorState |= uMod_ERROR_TEXTURE ; return (ret);} Message("MergeUpdate(): %lu\n", this); @@ -404,12 +404,12 @@ int OTM_TextureClient::MergeUpdate(void) { case 0x01000000L: { - OTM_IDirect3DTexture9 *pTexture = (OTM_IDirect3DTexture9*) FileToMod[pos_old].Textures[i];// - OTM_IDirect3DTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DTexture9 *pTexture = (uMod_IDirect3DTexture9*) FileToMod[pos_old].Textures[i];// + uMod_IDirect3DTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; pTexture->Release(); i--; //after the Release of the old fake texture FileToMod[pos_old].Textures[i] is overwritten by entries with index greater than i - OTM_IDirect3DTexture9 *fake_Texture; + uMod_IDirect3DTexture9 *fake_Texture; if (int ret = LoadTexture( & (Update[pos_new]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pRefTexture)) { @@ -425,12 +425,12 @@ int OTM_TextureClient::MergeUpdate(void) } case 0x01000001L: { - OTM_IDirect3DVolumeTexture9 *pTexture = (OTM_IDirect3DVolumeTexture9*) FileToMod[pos_old].Textures[i];// - OTM_IDirect3DVolumeTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DVolumeTexture9 *pTexture = (uMod_IDirect3DVolumeTexture9*) FileToMod[pos_old].Textures[i];// + uMod_IDirect3DVolumeTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; pTexture->Release(); i--; //after the Release of the old fake texture FileToMod[pos_old].Textures[i] is overwritten by entries with index greater than i - OTM_IDirect3DVolumeTexture9 *fake_Texture; + uMod_IDirect3DVolumeTexture9 *fake_Texture; if (int ret = LoadTexture( & (Update[pos_new]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pRefTexture)) { @@ -446,12 +446,12 @@ int OTM_TextureClient::MergeUpdate(void) } case 0x01000002L: { - OTM_IDirect3DCubeTexture9 *pTexture = (OTM_IDirect3DCubeTexture9*) FileToMod[pos_old].Textures[i];// - OTM_IDirect3DCubeTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; + uMod_IDirect3DCubeTexture9 *pTexture = (uMod_IDirect3DCubeTexture9*) FileToMod[pos_old].Textures[i];// + uMod_IDirect3DCubeTexture9 *pRefTexture = pTexture->CrossRef_D3Dtex; pTexture->Release(); i--; //after the Release of the old fake texture FileToMod[pos_old].Textures[i] is overwritten by entries with index greater than i - OTM_IDirect3DCubeTexture9 *fake_Texture; + uMod_IDirect3DCubeTexture9 *fake_Texture; if (int ret = LoadTexture( & (Update[pos_new]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pRefTexture)) { @@ -506,7 +506,7 @@ int OTM_TextureClient::MergeUpdate(void) * thus Update[to_lookup[pos]].Hash is also sorted ascending! */ /* - OTM_IDirect3DTexture9 *single_texture = ((OTM_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); + uMod_IDirect3DTexture9 *single_texture = ((uMod_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); if (num_to_lookup>0) { int num = OriginalTextures.GetNumber(); @@ -550,11 +550,11 @@ int OTM_TextureClient::MergeUpdate(void) { if (OriginalTextures[i]->CrossRef_D3Dtex!=NULL) UnswitchTextures(OriginalTextures[i]); // this texture was switched with the single texture - OTM_IDirect3DTexture9 *fake_Texture; + uMod_IDirect3DTexture9 *fake_Texture; if (int ret = LoadTexture( & (Update[index]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, OriginalTextures[i])) { - Message("OTM_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); + Message("uMod_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); fake_Texture->Release(); } else @@ -588,11 +588,11 @@ int OTM_TextureClient::MergeUpdate(void) if (num_to_lookup>0) { - OTM_IDirect3DTexture9* single_texture; + uMod_IDirect3DTexture9* single_texture; void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) single_texture = ((OTM_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); //this texture must no be added twice - else single_texture = ((OTM_IDirect3DDevice9Ex*) D3D9Device)->GetSingleTexture(); //this texture must no be added twice + if (ret == 0x01000000L) single_texture = ((uMod_IDirect3DDevice9*)D3D9Device)->GetSingleTexture(); //this texture must no be added twice + else single_texture = ((uMod_IDirect3DDevice9Ex*) D3D9Device)->GetSingleTexture(); //this texture must no be added twice int num = OriginalTextures.GetNumber(); for (int i=0; iCrossRef_D3Dtex==NULL || OriginalTextures[i]->CrossRef_D3Dtex==single_texture) @@ -601,9 +601,9 @@ int OTM_TextureClient::MergeUpdate(void) LookUpToMod( OriginalTextures[i], num_to_lookup, to_lookup); } - OTM_IDirect3DVolumeTexture9 *single_volume_texture; - if (ret == 0x01000000L) single_volume_texture = ((OTM_IDirect3DDevice9*)D3D9Device)->GetSingleVolumeTexture(); //this texture must no be added twice - else single_volume_texture = ((OTM_IDirect3DDevice9Ex*) D3D9Device)->GetSingleVolumeTexture(); //this texture must no be added twice + uMod_IDirect3DVolumeTexture9 *single_volume_texture; + if (ret == 0x01000000L) single_volume_texture = ((uMod_IDirect3DDevice9*)D3D9Device)->GetSingleVolumeTexture(); //this texture must no be added twice + else single_volume_texture = ((uMod_IDirect3DDevice9Ex*) D3D9Device)->GetSingleVolumeTexture(); //this texture must no be added twice num = OriginalVolumeTextures.GetNumber(); for (int i=0; iCrossRef_D3Dtex==NULL || OriginalVolumeTextures[i]->CrossRef_D3Dtex==single_volume_texture) { @@ -611,9 +611,9 @@ int OTM_TextureClient::MergeUpdate(void) LookUpToMod( OriginalVolumeTextures[i], num_to_lookup, to_lookup); } - OTM_IDirect3DCubeTexture9 *single_cube_texture; - if (ret == 0x01000000L) single_cube_texture = ((OTM_IDirect3DDevice9*)D3D9Device)->GetSingleCubeTexture(); //this texture must no be added twice - else single_cube_texture = ((OTM_IDirect3DDevice9Ex*) D3D9Device)->GetSingleCubeTexture(); //this texture must no be added twice + uMod_IDirect3DCubeTexture9 *single_cube_texture; + if (ret == 0x01000000L) single_cube_texture = ((uMod_IDirect3DDevice9*)D3D9Device)->GetSingleCubeTexture(); //this texture must no be added twice + else single_cube_texture = ((uMod_IDirect3DDevice9Ex*) D3D9Device)->GetSingleCubeTexture(); //this texture must no be added twice num = OriginalCubeTextures.GetNumber(); for (int i=0; iCrossRef_D3Dtex==NULL || OriginalCubeTextures[i]->CrossRef_D3Dtex==single_cube_texture) { @@ -631,14 +631,14 @@ int OTM_TextureClient::MergeUpdate(void) -int OTM_TextureClient::LockMutex(void) +int uMod_TextureClient::LockMutex(void) { - if (( gl_ErrorState & (OTM_ERROR_FATAL | OTM_ERROR_MUTEX) )) return (RETURN_NO_MUTEX); + if (( gl_ErrorState & (uMod_ERROR_FATAL | uMod_ERROR_MUTEX) )) return (RETURN_NO_MUTEX); if (WAIT_OBJECT_0!=WaitForSingleObject( Mutex, 100)) return (RETURN_MUTEX_LOCK); //waiting 100ms, to wait infinite pass INFINITE return (RETURN_OK); } -int OTM_TextureClient::UnlockMutex(void) +int uMod_TextureClient::UnlockMutex(void) { if (ReleaseMutex(Mutex)==0) return (RETURN_MUTEX_UNLOCK); return (RETURN_OK); @@ -648,7 +648,7 @@ int OTM_TextureClient::UnlockMutex(void) -int OTM_TextureClient::LookUpToMod( MyTypeHash hash, int num_index_list, int *index_list) +int uMod_TextureClient::LookUpToMod( MyTypeHash hash, int num_index_list, int *index_list) { if(NumberToMod>0) { @@ -708,18 +708,18 @@ int OTM_TextureClient::LookUpToMod( MyTypeHash hash, int num_index_list, int *in return (-1); } -int OTM_TextureClient::LookUpToMod( OTM_IDirect3DTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures +int uMod_TextureClient::LookUpToMod( uMod_IDirect3DTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures { - Message("OTM_TextureClient::LookUpToMod( %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::LookUpToMod( %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); if (pTexture->CrossRef_D3Dtex!=NULL) return (RETURN_OK); // bug, this texture is already switched int index = LookUpToMod( pTexture->Hash, num_index_list, index_list); if (index>=0) { - OTM_IDirect3DTexture9 *fake_Texture; + uMod_IDirect3DTexture9 *fake_Texture; if (int ret = LoadTexture( & (FileToMod[index]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pTexture)) { - Message("OTM_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); + Message("uMod_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); fake_Texture->Release(); } else @@ -737,18 +737,18 @@ int OTM_TextureClient::LookUpToMod( OTM_IDirect3DTexture9* pTexture, int num_ind return (RETURN_OK); } -int OTM_TextureClient::LookUpToMod( OTM_IDirect3DVolumeTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures +int uMod_TextureClient::LookUpToMod( uMod_IDirect3DVolumeTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures { - Message("OTM_TextureClient::LookUpToMod( Volume %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::LookUpToMod( Volume %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); if (pTexture->CrossRef_D3Dtex!=NULL) return (RETURN_OK); // bug, this texture is already switched int index = LookUpToMod( pTexture->Hash, num_index_list, index_list); if (index>=0) { - OTM_IDirect3DVolumeTexture9 *fake_Texture; + uMod_IDirect3DVolumeTexture9 *fake_Texture; if (int ret = LoadTexture( & (FileToMod[index]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pTexture)) { - Message("OTM_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); + Message("uMod_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); fake_Texture->Release(); } else @@ -766,18 +766,18 @@ int OTM_TextureClient::LookUpToMod( OTM_IDirect3DVolumeTexture9* pTexture, int n return (RETURN_OK); } -int OTM_TextureClient::LookUpToMod( OTM_IDirect3DCubeTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures +int uMod_TextureClient::LookUpToMod( uMod_IDirect3DCubeTexture9* pTexture, int num_index_list, int *index_list) // should only be called for original textures { - Message("OTM_TextureClient::LookUpToMod( Cube %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); + Message("uMod_TextureClient::LookUpToMod( Cube %lu): hash: %#lX, %lu\n", pTexture, pTexture->Hash, this); if (pTexture->CrossRef_D3Dtex!=NULL) return (RETURN_OK); // bug, this texture is already switched int index = LookUpToMod( pTexture->Hash, num_index_list, index_list); if (index>=0) { - OTM_IDirect3DCubeTexture9 *fake_Texture; + uMod_IDirect3DCubeTexture9 *fake_Texture; if (int ret = LoadTexture( & (FileToMod[index]), &fake_Texture)) return (ret); if (SwitchTextures( fake_Texture, pTexture)) { - Message("OTM_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); + Message("uMod_TextureClient::LookUpToMod(): textures not switched %#lX\n", FileToMod[index].Hash); fake_Texture->Release(); } else @@ -798,7 +798,7 @@ int OTM_TextureClient::LookUpToMod( OTM_IDirect3DCubeTexture9* pTexture, int num -int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DTexture9 **ppTexture) // to load fake texture from a file in memory +int uMod_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DTexture9 **ppTexture) // to load fake texture from a file in memory { Message("LoadTexture( %lu, %lu, %#lX): %lu\n", file_in_memory, ppTexture, file_in_memory->Hash, this); if (D3D_OK != D3DXCreateTextureFromFileInMemoryEx( D3D9Device, file_in_memory->pData, file_in_memory->Size, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, (IDirect3DTexture9 **) ppTexture)) @@ -811,14 +811,14 @@ int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDire void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedTexture(NULL); //this texture must no be added twice Message("LoadTexture( %lu, %#lX): DONE\n", *ppTexture, file_in_memory->Hash); return (RETURN_OK); } -int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DVolumeTexture9 **ppTexture) // to load fake texture from a file in memory +int uMod_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DVolumeTexture9 **ppTexture) // to load fake texture from a file in memory { Message("LoadTexture( Volume %lu, %lu, %#lX): %lu\n", file_in_memory, ppTexture, file_in_memory->Hash, this); if (D3D_OK != D3DXCreateVolumeTextureFromFileInMemoryEx( D3D9Device, file_in_memory->pData, file_in_memory->Size, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, (IDirect3DVolumeTexture9 **) ppTexture)) @@ -831,14 +831,14 @@ int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDire void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedVolumeTexture(NULL); //this texture must no be added twice Message("LoadTexture( Volume %lu, %#lX): DONE\n", *ppTexture, file_in_memory->Hash); return (RETURN_OK); } -int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDirect3DCubeTexture9 **ppTexture) // to load fake texture from a file in memory +int uMod_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DCubeTexture9 **ppTexture) // to load fake texture from a file in memory { Message("LoadTexture( Cube %lu, %lu, %#lX): %lu\n", file_in_memory, ppTexture, file_in_memory->Hash, this); if (D3D_OK != D3DXCreateCubeTextureFromFileInMemoryEx( D3D9Device, file_in_memory->pData, file_in_memory->Size, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, (IDirect3DCubeTexture9 **) ppTexture)) @@ -851,8 +851,8 @@ int OTM_TextureClient::LoadTexture( TextureFileStruct* file_in_memory, OTM_IDire void *cpy; long ret = D3D9Device->QueryInterface( IID_IDirect3DTexture9, &cpy); - if (ret == 0x01000000L) ((OTM_IDirect3DDevice9*)D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice - else ((OTM_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice + if (ret == 0x01000000L) ((uMod_IDirect3DDevice9*)D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice + else ((uMod_IDirect3DDevice9Ex*) D3D9Device)->SetLastCreatedCubeTexture(NULL); //this texture must no be added twice Message("LoadTexture( Cube %lu, %#lX): DONE\n", *ppTexture, file_in_memory->Hash); return (RETURN_OK); diff --git a/uMod_DX9/uMod_TextureClient.h b/uMod_DX9/uMod_TextureClient.h new file mode 100644 index 0000000..861490d --- /dev/null +++ b/uMod_DX9/uMod_TextureClient.h @@ -0,0 +1,121 @@ +/* +This file is part of Universal Modding Engine. + + +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ + + + +#ifndef uMod_TEXTUREHANDLER_HPP +#define uMod_TEXTUREHANDLER_HPP + +#include "uMod_IDirect3DTexture9.h" +#include "uMod_IDirect3DDevice9.h" +#include "..\uMod_Error.h" + + +class uMod_TextureServer; + +/* + * An object of this class is owned by each d3d9 device. + * functions called by the Server are called from the server thread instance. + * All other functions are called from the render thread instance of the game itself. + */ + +class uMod_TextureClient +{ +public: + uMod_TextureClient(uMod_TextureServer* server, IDirect3DDevice9* device); + ~uMod_TextureClient(void); + + int AddTexture( uMod_IDirect3DTexture9* tex); //called from uMod_IDirect3DDevice9::CreateTexture(...) or uMod_IDirect3DDevice9::BeginScene() + int AddTexture( uMod_IDirect3DVolumeTexture9* tex); //called from uMod_IDirect3DVolumeTexture9::CreateTexture(...) or uMod_IDirect3DDevice9::BeginScene() + int AddTexture( uMod_IDirect3DCubeTexture9* tex); //called from uMod_IDirect3DCubeTexture9::CreateTexture(...) or uMod_IDirect3DDevice9::BeginScene() + + int RemoveTexture( uMod_IDirect3DTexture9* tex); //called from uMod_IDirect3DTexture9::Release() + int RemoveTexture( uMod_IDirect3DVolumeTexture9* tex); //called from uMod_IDirect3DVolumeTexture9::Release() + int RemoveTexture( uMod_IDirect3DCubeTexture9* tex); //called from uMod_IDirect3DCubeTexture9::Release() + + int SaveAllTextures(bool val); //called from the Server + int SaveSingleTexture(bool val); //called from the Server + + int SetSaveDirectory( wchar_t *dir); //called from the Server + int SetGameName( wchar_t *dir); //called from the Server + + int SaveTexture(uMod_IDirect3DTexture9* pTexture); //called from uMod_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) + int SaveTexture(uMod_IDirect3DVolumeTexture9* pTexture); //called from uMod_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) + int SaveTexture(uMod_IDirect3DCubeTexture9* pTexture); //called from uMod_IDirect3DDevice9::BeginScene() (save button) or from AddTexture(...) (SaveAllTextures) + + + + int SetKeyBack( int key) {if (key>0) KeyBack = key; return (RETURN_OK);} //called from the Server + int SetKeySave( int key) {if (key>0) KeySave = key; return (RETURN_OK);} //called from the Server + int SetKeyNext( int key) {if (key>0) KeyNext = key; return (RETURN_OK);} //called from the Server + + int SetFontColour( DWORD r, DWORD g, DWORD b) {FontColour = D3DCOLOR_ARGB(255, r,g,b); return (RETURN_OK);} //called from the Server + int SetTextureColour( DWORD r, DWORD g, DWORD b) {TextureColour = D3DCOLOR_ARGB(255, r,g,b); return (RETURN_OK);} //called from the Server + + + int AddUpdate(TextureFileStruct* update, int number); //called from the Server, client object must delete update array + int MergeUpdate(void); //called from uMod_IDirect3DDevice9::BeginScene() + + int LookUpToMod( uMod_IDirect3DTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) + int LookUpToMod( uMod_IDirect3DVolumeTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) + int LookUpToMod( uMod_IDirect3DCubeTexture9* pTexture, int num_index_list=0, int *index_list=NULL); // called at the end AddTexture(...) and from Device->UpdateTexture(...) + + uMod_TextureHandler OriginalTextures; // stores the pointer to the uMod_IDirect3DTexture9 objects created by the game + uMod_TextureHandler OriginalVolumeTextures; // stores the pointer to the uMod_IDirect3DVolumeTexture9 objects created by the game + uMod_TextureHandler OriginalCubeTextures; // stores the pointer to the uMod_IDirect3DCubeTexture9 objects created by the game + + bool BoolSaveAllTextures; + bool BoolSaveSingleTexture; + int KeyBack; + int KeySave; + int KeyNext; + + D3DCOLOR FontColour; + D3DCOLOR TextureColour; + +private: + uMod_TextureServer* Server; + IDirect3DDevice9* D3D9Device; + wchar_t SavePath[MAX_PATH]; + wchar_t GameName[MAX_PATH]; + + TextureFileStruct* Update; + int NumberOfUpdate; + + int LockMutex(); + int UnlockMutex(); + HANDLE Mutex; + + int NumberToMod; // number of texture to be modded + TextureFileStruct* FileToMod; // array which stores the file in memory and the hash of each texture to be modded + + + int LookUpToMod( MyTypeHash hash, int num_index_list, int *index_list); // called from LookUpToMod(...); + int LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DTexture9 **ppTexture); // called if a target texture is found + int LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DVolumeTexture9 **ppTexture); // called if a target texture is found + int LoadTexture( TextureFileStruct* file_in_memory, uMod_IDirect3DCubeTexture9 **ppTexture); // called if a target texture is found + + // and the corresponding fake texture should be loaded + + //MyTypeHash GetHash(unsigned char *str, int len); + //unsigned int GetCRC32(char *pcDatabuf, unsigned int ulDatalen); +}; + + + +#endif /* uMod_TEXTUREHANDLER_HPP_ */ diff --git a/OTM_DX9/OTM_TextureFunction.cpp b/uMod_DX9/uMod_TextureFunction.cpp similarity index 58% rename from OTM_DX9/OTM_TextureFunction.cpp rename to uMod_DX9/uMod_TextureFunction.cpp index 82886e1..24a009a 100644 --- a/OTM_DX9/OTM_TextureFunction.cpp +++ b/uMod_DX9/uMod_TextureFunction.cpp @@ -1,12 +1,23 @@ /* - * OTM_TextureFunction.cpp - * - * Created on: 28.10.2011 - * Author: marts - */ +This file is part of Universal Modding Engine. -#include "OTM_Main.h" +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ + + +#include "uMod_Main.h" /* MyTypeHash GetHash(unsigned char *str, int len) // estimate the hash diff --git a/OTM_DX9/OTM_TextureFunction.h b/uMod_DX9/uMod_TextureFunction.h similarity index 85% rename from OTM_DX9/OTM_TextureFunction.h rename to uMod_DX9/uMod_TextureFunction.h index da027fe..c371a34 100644 --- a/OTM_DX9/OTM_TextureFunction.h +++ b/uMod_DX9/uMod_TextureFunction.h @@ -1,12 +1,22 @@ /* - * OTM_TextureFunction.h - * - * Created on: 28.10.2011 - * Author: marts - */ +This file is part of Universal Modding Engine. -#ifndef OTM_TEXTUREFUNCTION_H_ -#define OTM_TEXTUREFUNCTION_H_ + +Universal Modding Engine is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Universal Modding Engine is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Universal Modding Engine. If not, see . +*/ +#ifndef uMod_TEXTUREFUNCTION_H_ +#define uMod_TEXTUREFUNCTION_H_ unsigned int GetCRC32( char *pcDatabuf, unsigned int ulDatalen); @@ -134,4 +144,4 @@ inline int GetBitsFromFormat(D3DFORMAT format) } } -#endif /* OTM_TEXTUREFUNCTION_H_ */ +#endif /* uMod_TEXTUREFUNCTION_H_ */ diff --git a/OTM_DX9/OTM_TextureServer.cpp b/uMod_DX9/uMod_TextureServer.cpp similarity index 79% rename from OTM_DX9/OTM_TextureServer.cpp rename to uMod_DX9/uMod_TextureServer.cpp index 8e84ae0..de09672 100644 --- a/OTM_DX9/OTM_TextureServer.cpp +++ b/uMod_DX9/uMod_TextureServer.cpp @@ -1,28 +1,28 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_TextureServer::OTM_TextureServer(wchar_t *game) +uMod_TextureServer::uMod_TextureServer(wchar_t *game) { - Message("OTM_TextureServer(void): %lu\n", this); + Message("uMod_TextureServer(void): %lu\n", this); Mutex = CreateMutex(NULL, false, NULL); @@ -61,9 +61,9 @@ OTM_TextureServer::OTM_TextureServer(wchar_t *game) Pipe.Out = INVALID_HANDLE_VALUE; } -OTM_TextureServer::~OTM_TextureServer(void) +uMod_TextureServer::~uMod_TextureServer(void) { - Message("~OTM_TextureServer(void): %lu\n", this); + Message("~uMod_TextureServer(void): %lu\n", this); if (Mutex != NULL) CloseHandle(Mutex); //delete the files in memory @@ -79,17 +79,17 @@ OTM_TextureServer::~OTM_TextureServer(void) Pipe.Out = INVALID_HANDLE_VALUE; } -int OTM_TextureServer::AddClient(OTM_TextureClient *client, TextureFileStruct** update, int* number) // called from a client +int uMod_TextureServer::AddClient(uMod_TextureClient *client, TextureFileStruct** update, int* number) // called from a client { Message("AddClient(%lu): %lu\n", client, this); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } - // the following functions must not change the original OTM_IDirect3DDevice9 object - // somehow on game start some OTM_IDirect3DDevice9 object are created, which must rest unchanged!! + // the following functions must not change the original uMod_IDirect3DDevice9 object + // somehow on game start some uMod_IDirect3DDevice9 object are created, which must rest unchanged!! // these objects are released and are not used for rendering client->SetGameName(GameName); client->SaveAllTextures(BoolSaveAllTextures); @@ -120,11 +120,11 @@ int OTM_TextureServer::AddClient(OTM_TextureClient *client, TextureFileStruct** if (NumberOfClients == LenghtOfClients) //allocate more memory { - OTM_TextureClient** temp = NULL; - try {temp = new OTM_TextureClient*[LenghtOfClients + 10];} + uMod_TextureClient** temp = NULL; + try {temp = new uMod_TextureClient*[LenghtOfClients + 10];} catch (...) { - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_SERVER; if (int ret = UnlockMutex()) return (ret); return (RETURN_NO_MEMORY); } @@ -138,12 +138,12 @@ int OTM_TextureServer::AddClient(OTM_TextureClient *client, TextureFileStruct** return (UnlockMutex()); } -int OTM_TextureServer::RemoveClient(OTM_TextureClient *client) // called from a client +int uMod_TextureServer::RemoveClient(uMod_TextureClient *client) // called from a client { Message("RemoveClient(%lu): %lu\n", client); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } @@ -156,9 +156,9 @@ int OTM_TextureServer::RemoveClient(OTM_TextureClient *client) // called from a return (UnlockMutex()); } -int OTM_TextureServer::AddFile( char* buffer, unsigned int size, MyTypeHash hash, bool force) // called from Mainloop() +int uMod_TextureServer::AddFile( char* buffer, unsigned int size, MyTypeHash hash, bool force) // called from Mainloop() { - Message("OTM_TextureServer::AddFile( %lu %lu, %#lX, %d): %lu\n", buffer, size, hash, force, this); + Message("uMod_TextureServer::AddFile( %lu %lu, %#lX, %d): %lu\n", buffer, size, hash, force, this); TextureFileStruct* temp = NULL; @@ -203,7 +203,7 @@ int OTM_TextureServer::AddFile( char* buffer, unsigned int size, MyTypeHash has { if (!new_file) CurrentMod.Remove( temp); // if this is a not a new file it is in the list of the CurrentMod delete temp; - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_SERVER; return (RETURN_NO_MEMORY); } @@ -223,10 +223,10 @@ int OTM_TextureServer::AddFile( char* buffer, unsigned int size, MyTypeHash has else return (RETURN_OK); } -int OTM_TextureServer::AddFile(wchar_t* file_name, MyTypeHash hash, bool force) // called from Mainloop +int uMod_TextureServer::AddFile(wchar_t* file_name, MyTypeHash hash, bool force) // called from Mainloop // this functions does the same, but loads the file content from disk { - Message("OTM_TextureServer::AddFile( %ls, %#lX, %d): %lu\n", file_name, hash, force, this); + Message("uMod_TextureServer::AddFile( %ls, %#lX, %d): %lu\n", file_name, hash, force, this); TextureFileStruct* temp = NULL; @@ -282,7 +282,7 @@ int OTM_TextureServer::AddFile(wchar_t* file_name, MyTypeHash hash, bool force) { if (!new_file) CurrentMod.Remove( temp); delete temp; - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_SERVER; return (RETURN_NO_MEMORY); } int result = fread(temp->pData, 1, size, file); @@ -308,7 +308,7 @@ int OTM_TextureServer::AddFile(wchar_t* file_name, MyTypeHash hash, bool force) else return (RETURN_OK); } -int OTM_TextureServer::RemoveFile(MyTypeHash hash) // called from Mainloop() +int uMod_TextureServer::RemoveFile(MyTypeHash hash) // called from Mainloop() { Message("RemoveFile( %lu): %lu\n", hash, this); @@ -322,14 +322,14 @@ int OTM_TextureServer::RemoveFile(MyTypeHash hash) // called from Mainloop() return (RETURN_OK); } -int OTM_TextureServer::SaveAllTextures(bool val) // called from Mainloop() +int uMod_TextureServer::SaveAllTextures(bool val) // called from Mainloop() { if (BoolSaveAllTextures == val) return (RETURN_OK); BoolSaveAllTextures = val; if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } for (int i = 0; i < NumberOfClients; i++) @@ -339,14 +339,14 @@ int OTM_TextureServer::SaveAllTextures(bool val) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SaveSingleTexture(bool val) // called from Mainloop() +int uMod_TextureServer::SaveSingleTexture(bool val) // called from Mainloop() { if (BoolSaveSingleTexture == val) return (RETURN_OK); BoolSaveSingleTexture = val; if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } for (int i = 0; i < NumberOfClients; i++) @@ -356,9 +356,9 @@ int OTM_TextureServer::SaveSingleTexture(bool val) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetSaveDirectory(wchar_t *dir) // called from Mainloop() +int uMod_TextureServer::SetSaveDirectory(wchar_t *dir) // called from Mainloop() { - Message("OTM_TextureServer::SetSaveDirectory( %ls): %lu\n", dir, this); + Message("uMod_TextureServer::SetSaveDirectory( %ls): %lu\n", dir, this); int i = 0; for (i = 0; i < MAX_PATH && (dir[i]); i++) SavePath[i] = dir[i]; if (i == MAX_PATH) @@ -370,7 +370,7 @@ int OTM_TextureServer::SetSaveDirectory(wchar_t *dir) // called from Mainloop() if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } for (int i = 0; i < NumberOfClients; i++) @@ -380,12 +380,12 @@ int OTM_TextureServer::SetSaveDirectory(wchar_t *dir) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetKeyBack(int key) // called from Mainloop() +int uMod_TextureServer::SetKeyBack(int key) // called from Mainloop() { if (KeyBack == key || KeySave == key || KeyNext == key) return (RETURN_OK); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } KeyBack = key; @@ -396,12 +396,12 @@ int OTM_TextureServer::SetKeyBack(int key) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetKeySave(int key) // called from Mainloop() +int uMod_TextureServer::SetKeySave(int key) // called from Mainloop() { if (KeyBack == key || KeySave == key || KeyNext == key) return (RETURN_OK); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } KeySave = key; @@ -412,12 +412,12 @@ int OTM_TextureServer::SetKeySave(int key) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetKeyNext(int key) // called from Mainloop() +int uMod_TextureServer::SetKeyNext(int key) // called from Mainloop() { if (KeyBack == key || KeySave == key || KeyNext == key) return (RETURN_OK); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } KeyNext = key; @@ -428,19 +428,19 @@ int OTM_TextureServer::SetKeyNext(int key) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetFontColour(DWORD colour) // called from Mainloop() +int uMod_TextureServer::SetFontColour(DWORD colour) // called from Mainloop() { if (colour==0u) return (RETURN_OK); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } FontColour = colour; DWORD r = (FontColour>>16)&0xFF; DWORD g = (FontColour>>8)&0xFF; DWORD b = (FontColour)&0xFF; - Message("OTM_TextureServer::SetFontColour( %u %u %u): %lu\n", r ,g ,b, this); + Message("uMod_TextureServer::SetFontColour( %u %u %u): %lu\n", r ,g ,b, this); for (int i = 0; i < NumberOfClients; i++) { Clients[i]->SetFontColour( r, g, b); @@ -448,19 +448,19 @@ int OTM_TextureServer::SetFontColour(DWORD colour) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::SetTextureColour(DWORD colour) // called from Mainloop() +int uMod_TextureServer::SetTextureColour(DWORD colour) // called from Mainloop() { if (colour==0u) return (RETURN_OK); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_SERVER; return (ret); } TextureColour = colour; DWORD r = (TextureColour>>16)&0xFF; DWORD g = (TextureColour>>8)&0xFF; DWORD b = (TextureColour)&0xFF; - Message("OTM_TextureServer::SetTextureColour( %u %u %u): %lu\n", r ,g ,b, this); + Message("uMod_TextureServer::SetTextureColour( %u %u %u): %lu\n", r ,g ,b, this); for (int i = 0; i < NumberOfClients; i++) { Clients[i]->SetTextureColour( r, g, b); @@ -468,12 +468,12 @@ int OTM_TextureServer::SetTextureColour(DWORD colour) // called from Mainloop() return (UnlockMutex()); } -int OTM_TextureServer::PropagateUpdate(OTM_TextureClient* client) // called from Mainloop(), send the update to all clients +int uMod_TextureServer::PropagateUpdate(uMod_TextureClient* client) // called from Mainloop(), send the update to all clients { Message("PropagateUpdate(%lu): %lu\n", client, this); if (int ret = LockMutex()) { - gl_ErrorState |= OTM_ERROR_TEXTURE; + gl_ErrorState |= uMod_ERROR_TEXTURE; return (ret); } if (client != NULL) @@ -515,7 +515,7 @@ int TextureFileStruct_Compare( const void * elem1, const void * elem2 ) return (0); } -int OTM_TextureServer::PrepareUpdate(TextureFileStruct** update, int* number) // called from the PropagateUpdate() and AddClient. +int uMod_TextureServer::PrepareUpdate(TextureFileStruct** update, int* number) // called from the PropagateUpdate() and AddClient. // Prepare an update for one client. The allocated memory must deleted by the client. { Message("PrepareUpdate(%lu, %d): %lu\n", update, number, this); @@ -527,7 +527,7 @@ int OTM_TextureServer::PrepareUpdate(TextureFileStruct** update, int* number) // try {temp = new TextureFileStruct[num];} catch (...) { - gl_ErrorState |= OTM_ERROR_MEMORY | OTM_ERROR_SERVER; + gl_ErrorState |= uMod_ERROR_MEMORY | uMod_ERROR_SERVER; return (RETURN_NO_MEMORY); } @@ -542,20 +542,20 @@ int OTM_TextureServer::PrepareUpdate(TextureFileStruct** update, int* number) // } #undef cpy_file_struct -int OTM_TextureServer::LockMutex(void) +int uMod_TextureServer::LockMutex(void) { - if (( gl_ErrorState & (OTM_ERROR_FATAL | OTM_ERROR_MUTEX) )) return (RETURN_NO_MUTEX); + if (( gl_ErrorState & (uMod_ERROR_FATAL | uMod_ERROR_MUTEX) )) return (RETURN_NO_MUTEX); if (WAIT_OBJECT_0!=WaitForSingleObject( Mutex, 100)) return (RETURN_MUTEX_LOCK); //waiting 100ms, to wait infinite pass INFINITE return (RETURN_OK); } -int OTM_TextureServer::UnlockMutex(void) +int uMod_TextureServer::UnlockMutex(void) { if (ReleaseMutex( Mutex) == 0) return (RETURN_MUTEX_UNLOCK); return (RETURN_OK); } -int OTM_TextureServer::MainLoop(void) // run as a separated thread +int uMod_TextureServer::MainLoop(void) // run as a separated thread { Message("MainLoop: begin\n"); if (Pipe.In == INVALID_HANDLE_VALUE) return (RETURN_PIPE_NOT_OPENED); @@ -699,11 +699,11 @@ int OTM_TextureServer::MainLoop(void) // run as a separated thread return (RETURN_OK); } -int OTM_TextureServer::OpenPipe(wchar_t *game) // called from InitInstance() +int uMod_TextureServer::OpenPipe(wchar_t *game) // called from InitInstance() { Message("OpenPipe: Out\n") // open first outgoing pipe !! - Pipe.Out = CreateFileW(PIPE_Game2OTM, // pipe name + Pipe.Out = CreateFileW(PIPE_Game2uMod, // pipe name GENERIC_WRITE, // write access 0, // no sharing NULL, // default security attributes @@ -718,12 +718,12 @@ int OTM_TextureServer::OpenPipe(wchar_t *game) // called from InitInstance() while (game[len]) len++; len++; //to send also the zero unsigned long num; - //send name of this game to OTM_GUI + //send name of this game to uMod_GUI WriteFile(Pipe.Out, (const void*) game, len * sizeof(wchar_t), &num, NULL); // now we can open the pipe for reading Message("OpenPipe: In\n"); - Pipe.In = CreateFileW(PIPE_OTM2Game, // pipe name + Pipe.In = CreateFileW(PIPE_uMod2Game, // pipe name GENERIC_READ, // read access 0, // no sharing NULL, // default security attributes @@ -742,7 +742,7 @@ int OTM_TextureServer::OpenPipe(wchar_t *game) // called from InitInstance() return (RETURN_OK); } -int OTM_TextureServer::ClosePipe(void) //called from ExitInstance, this must be done, otherwise the Mainloop will wait endless on the ReadFile() +int uMod_TextureServer::ClosePipe(void) //called from ExitInstance, this must be done, otherwise the Mainloop will wait endless on the ReadFile() { Message("ClosePipe:\n"); diff --git a/OTM_DX9/OTM_TextureServer.h b/uMod_DX9/uMod_TextureServer.h similarity index 69% rename from OTM_DX9/OTM_TextureServer.h rename to uMod_DX9/uMod_TextureServer.h index 171beaf..8a31580 100644 --- a/OTM_DX9/OTM_TextureServer.h +++ b/uMod_DX9/uMod_TextureServer.h @@ -1,28 +1,27 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ +#ifndef uMod_TEXTURESERVER_H_ +#define uMod_TEXTURESERVER_H_ -#ifndef OTM_TEXTURESERVER_H_ -#define OTM_TEXTURESERVER_H_ - -#include "../OTM_GlobalDefines.h" -#include "OTM_ArrayHandler.h" +#include "../uMod_GlobalDefines.h" +#include "uMod_ArrayHandler.h" /* @@ -35,16 +34,16 @@ along with OpenTexMod. If not, see . */ -class OTM_TextureClient; +class uMod_TextureClient; -class OTM_TextureServer +class uMod_TextureServer { public: - OTM_TextureServer(wchar_t *name); - ~OTM_TextureServer(void); + uMod_TextureServer(wchar_t *name); + ~uMod_TextureServer(void); - int AddClient(OTM_TextureClient *client, TextureFileStruct** update, int* number); // called from a Client - int RemoveClient(OTM_TextureClient *client); // called from a Client + int AddClient(uMod_TextureClient *client, TextureFileStruct** update, int* number); // called from a Client + int RemoveClient(uMod_TextureClient *client); // called from a Client int OpenPipe(wchar_t *name); // called on initialization of our d3d9 fake dll int ClosePipe(void); // called on exit of our d3d9 fake dll @@ -77,7 +76,7 @@ private: wchar_t SavePath[MAX_PATH]; wchar_t GameName[MAX_PATH]; - int PropagateUpdate(OTM_TextureClient* client=NULL); // called from Mainloop() if texture are loaded or removed + int PropagateUpdate(uMod_TextureClient* client=NULL); // called from Mainloop() if texture are loaded or removed int PrepareUpdate(TextureFileStruct** update, int* number); // called from PropagateUpdate() and AddClient() // generate a copy of the current texture to be modded // the file content of the textures are not copied, the clients get the pointer to the file content @@ -98,14 +97,14 @@ private: PipeStruct Pipe; - OTM_TextureClient** Clients; + uMod_TextureClient** Clients; int NumberOfClients; int LenghtOfClients; - OTM_FileHandler CurrentMod; // hold the file content of texture - OTM_FileHandler OldMod; // hold the file content of texture which were added previously but are not needed any more + uMod_FileHandler CurrentMod; // hold the file content of texture + uMod_FileHandler OldMod; // hold the file content of texture which were added previously but are not needed any more // this is needed, because a texture clients might not have merged the last update and thus hold pointers to the file content of old textures }; -#endif /* OTM_TEXTURESERVER_H_ */ +#endif /* uMod_TEXTURESERVER_H_ */ diff --git a/OTM_Error.h b/uMod_Error.h similarity index 61% rename from OTM_Error.h rename to uMod_Error.h index f7adbce..d7a790e 100644 --- a/OTM_Error.h +++ b/uMod_Error.h @@ -1,24 +1,24 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_ERROR_H_ -#define OTM_ERROR_H_ +#ifndef uMod_ERROR_H_ +#define uMod_ERROR_H_ // define return values, a value less than zero indicates an error @@ -55,19 +55,19 @@ along with OpenTexMod. If not, see . // define error states -#define OTM_ERROR_FATAL 1u -#define OTM_ERROR_MUTEX 1u<<1 -#define OTM_ERROR_PIPE 1u<<2 -#define OTM_ERROR_MEMORY 1u<<3 -#define OTM_ERROR_TEXTURE 1u<<4 -#define OTM_ERROR_MULTIPLE_IDirect3D9 1u<<5 -#define OTM_ERROR_MULTIPLE_IDirect3DDevice9 1u<<6 -#define OTM_ERROR_UPDATE 1u<<7 -#define OTM_ERROR_SERVER 1u<<8 +#define uMod_ERROR_FATAL 1u +#define uMod_ERROR_MUTEX 1u<<1 +#define uMod_ERROR_PIPE 1u<<2 +#define uMod_ERROR_MEMORY 1u<<3 +#define uMod_ERROR_TEXTURE 1u<<4 +#define uMod_ERROR_MULTIPLE_IDirect3D9 1u<<5 +#define uMod_ERROR_MULTIPLE_IDirect3DDevice9 1u<<6 +#define uMod_ERROR_UPDATE 1u<<7 +#define uMod_ERROR_SERVER 1u<<8 -#endif /* OTM_ERROR_H_ */ +#endif /* uMod_ERROR_H_ */ diff --git a/OTM_GUI/bin/README_Deutsch.txt b/uMod_GUI/bin/README_Deutsch.txt similarity index 76% rename from OTM_GUI/bin/README_Deutsch.txt rename to uMod_GUI/bin/README_Deutsch.txt index e6027d1..8400e22 100644 --- a/OTM_GUI/bin/README_Deutsch.txt +++ b/uMod_GUI/bin/README_Deutsch.txt @@ -5,18 +5,18 @@ Warnung: Du verwendest diese Programm auf eigene Gefahr hin! 2) Spiele können detektieren, ob sie verändert werden, daher riskierst du einen Bann deines online Accounts. 3) Dies ist eine open-source Projekt. Der Code kann von jedem erhalten, verändert - und kompiliert werden. Lade OpenTexMod nur von offiziellen Quellen runter, + und kompiliert werden. Lade Universal Modding Engine nur von offiziellen Quellen runter, denen du vertraust. Lade es selbst runter und verwende keine Versionen, die du von Team- oder Gildenmitgliedern geschickt bekommen hast. http://code.google.com/p/texmod/downloads/list -OpenTexMod verwendet die D3DX9_43.dll (32bit). Wegen den EULA kann diese dll nicht mit OpenTexMod -mit geliefert werden. Wenn diese dll auf deinem System nicht installiert ist, wird dich OpenTexMod -darauf hinweisen. +Universal Modding Engine verwendet die D3DX9_43.dll (32bit). Wegen den EULA kann +diese dll nicht mit Universal Modding Engine mit geliefert werden. Wenn diese dll auf +deinem System nicht installiert ist, wird dich Universal Modding Engine darauf hinweisen. -Was kann OpenTexMod beta V1.0? +Was kann Universal Modding Engine (uMod) beta V1.0? -einzelne Texturen aus einem Spiel extrahieren und speichern (Die Zieltextur kann im Spiel geändert werden.) -alle Texturen aus einem Spiel extrahieren und speichern @@ -47,21 +47,21 @@ in der GUI angezeigt. Wenn du einzelne Dateien lädst, sollten diese dem Wildcard "*_hash.dds" entsprechen. -Wie interagiert OpenTexMod mit den Spielen? +Wie interagiert Universal Modding Engine mit den Spielen? -OpenTexMod klingt sich zwischen die Verbindung vom Spiel und DirectX ein. -Das verlangt, dass OpenTexMod bereits vor dem Spiel gestartet wird. +Universal Modding Engine klingt sich zwischen die Verbindung vom Spiel und DirectX ein. +Das verlangt, dass Universal Modding Engine bereits vor dem Spiel gestartet wird. -Die GUI von OpenTexMod fungiert als Server. Ein Spiel, in das sich erfolgreich +Die GUI von Universal Modding Engine fungiert als Server. Ein Spiel, in das sich erfolgreich eingeklingt wurde, verbindet sich beim Programmstart mit dem Server. -Die GUI von OpenTexMod kann mehrere Spiele gleichzeitig verwalten. +Die GUI von Universal Modding Engine kann mehrere Spiele gleichzeitig verwalten. Jede Instanz eines Spieles wird auch separat gehandhabt (wenn ein Spiel mehrfach gestartet wird). -Wie bekomme ich OpenTexMod zum laufen? +Wie bekomme ich Universal Modding Engine zum laufen? -Es gibt drei Wege wie OpenTexMod sich in die DirectX Verbindung einklinken kann: +Es gibt drei Wege wie uMod sich in die DirectX Verbindung einklinken kann: (Benutze NICHT mehrere Methoden gleichzeitig!) 1) Füge die Spiel-exe über das Menü "Einstellungen->Spiel hinzufügen" hinzu. @@ -74,7 +74,7 @@ Es gibt drei Wege wie OpenTexMod sich in die DirectX Verbindung einklinken kann: "Einstellungen->Sarte Spiel durch OTM (mit Kommandozeile)". Das Spiel startet sofort. -3) Kopiere die d3d9.dll (vom OpenTexMod Verzeichnis) in das Spiele Verzeichnis. +3) Kopiere die d3d9.dll (vom uMod Verzeichnis) in das Spiele Verzeichnis. Einige Spiele laden eine dll zuerst aus dem eigenen Verzeichnis bevor sie im Systemverzeichnis suchen. Nur für diese Spiele wird diese Methode funktionieren. WARNUNG: Kopiere diese dll niemals in das Systemverzeichnis!! @@ -82,10 +82,10 @@ Es gibt drei Wege wie OpenTexMod sich in die DirectX Verbindung einklinken kann: bekannte Probleme: Guild Wars Wenn du dich für die erste oder dritte Methode entschieden hast, starte einfach -OpenTexMod und danach das Spiel. Starte das Spiel in beiden Fällen NICHT über -OpenTexMod . +Universal Modding Engine und danach das Spiel. Starte das Spiel in beiden Fällen NICHT über +Universal Modding Engine . -Wenn das Spiel startet und alles glatt läuft, öffnet sich sofort ein neuer Tab in OpenTexMod. +Wenn das Spiel startet und alles glatt läuft, öffnet sich sofort ein neuer Tab in uMod. In diesem Tab kannst du nun das Spiel modden. Drücke den "Update" Button um die Einstellungen an das Spiel zu senden. Du kannst deine aktuellen Einstellungen auch als ein Template speichern. Ein Template kann auch als Standard eingestellt werden. @@ -106,9 +106,9 @@ Entladen) wird durchgef Ziel-Textur machen sollen. -Wie bekommt man OpenTexMod mit Steam zum Laufen? +Wie bekommt man Universal Modding Engine mit Steam zum Laufen? -OpenTexMod schaut auf den Namen und auf das Verzeichnis der ausgeführten Spiel-exe. +uMod schaut auf den Namen und auf das Verzeichnis der ausgeführten Spiel-exe. Daher solltest du nicht die steam.exe sondern die Spiel.exe hinzufügen. z.B.: C:\Steam\SteamApps\acoount_name\portal\hl2.exe Wenn du die entsprechende exe nicht findest, kannst du das Spiel normal starten und diff --git a/OTM_GUI/bin/README_English.txt b/uMod_GUI/bin/README_English.txt similarity index 69% rename from OTM_GUI/bin/README_English.txt rename to uMod_GUI/bin/README_English.txt index 383009a..e57d922 100644 --- a/OTM_GUI/bin/README_English.txt +++ b/uMod_GUI/bin/README_English.txt @@ -4,15 +4,16 @@ WARNING: You use this program at your own risk! 2) Games can detected if they are modified, so you might risk a ban of your online account! 3) This is an open-source project. The code can be retrieved, modified and compiled - by everyone. Download OpenTexMod only from sources you trust! + by everyone. Download Universal Modding Engine only from sources you trust! Download it by your self and don't use versions, send to you by team or guild members! http://code.google.com/p/texmod/downloads/list -OpenTexMod uses the D3DX9_43.dll (32bit). Due to the EULA this dll cannot be delivered together with OpenTexMod . -If D3DX9_43.dll is not installed on your system, OpenTexMod will give you a hint at program start. +Universal Modding Engine uses the D3DX9_43.dll (32bit). Due to the EULA this dll +cannot be delivered together with Universal Modding Engine . If D3DX9_43.dll is not +installed on your system, Universal Modding Engine will give you a hint at program start. -What can OpenTexMod beta V1.0? +What can Universal Modding Engine (uMod) beta V1.0? -extract and save single textures from a DX9 game (the target texture can be toggled in the game) -extract and save all textures from a DX9 game @@ -41,21 +42,21 @@ in the GUI. If you load single files, they should match the wildcard "*_hash.dds" -How does OpenTexMod interact with the game? +How does Universal Modding Engine interact with the game? -OpenTexMod intercept the connection between the game and DirectX. -It is required, that OpenTexMod is running before the game is started. +Universal Modding Engine intercept the connection between the game and DirectX. +It is required, that Universal Modding Engine is running before the game is started. -The GUI of OpenTexMod act as a server. A game which is successfully -intercepted with the OpenTexMod-dll will connect on program start to the server. -The GUI of OpenTexMod can handle multiple games at the same time. It will +The GUI of Universal Modding Engine act as a server. A game which is successfully +intercepted with the Universal Modding Engine-dll will connect on program start to the server. +The GUI of Universal Modding Engine can handle multiple games at the same time. It will also process each instance of a game as separate process (if the same game was started more than once). -How to get OpenTexMod work? +How to get Universal Modding Engine work? -There are three ways how OpenTexMod can intercept the DirectX connection: +There are three ways how Universal Modding Engine can intercept the DirectX connection: (Do NOT use more than one method simultaneously!) 1) Add the games-binary through the menu "Main->Add game" @@ -63,22 +64,22 @@ There are three ways how OpenTexMod can intercept the DirectX connection: known problems: Guild Wars (Win XP) -2) Start the game directly through OTM though the menu - "Main->Start game through OTM" or - "Main->Start game through OTM (with command line)". +2) Start the game directly through uMod though the menu + "Main->Start game through uMod" or + "Main->Start game through uMod (with command line)". The game start immediately. -3) Copy the d3d9.dll (from the OpenTexMod directory) into the game directory. +3) Copy the d3d9.dll (from the Universal Modding Engine directory) into the game directory. Some games load a dll first from their own directory before they look up the system directory. Only for these games this method will work. WARNING: never copy this dll into your system directory!! known problems: Guild Wars -If you have chosen the first or third method, you simply start OpenTexMod -and afterwards the game. Do NOT start the game through OpenTexMod. +If you have chosen the first or third method, you simply start Universal Modding Engine +and afterwards the game. Do NOT start the game through Universal Modding Engine. -If the game starts and all works fine, a new tab opens immediately in OpenTexMod. +If the game starts and all works fine, a new tab opens immediately in uMod. In this tab you can now mod the game. Press the "update" button to commit the changes to the game. You can also save your current settings as a template. One template can be set as default for a game, which will be loaded and @@ -97,9 +98,9 @@ mod-texture of the first file in the list is taken into account. The action of t to do with their mod-textures. -How to get OpenTexMod work together with Steam? +How to get Universal Modding Engine work together with Steam? -OpenTexMod looks for the name and the path of the executed binary. +Universal Modding Engine looks for the name and the path of the executed binary. Thus you shall not add the steam.exe but rather the game.exe e.g.: C:\Steam\SteamApps\acoount_name\portal\hl2.exe If you cannot find the exe, just start the game and use the TaskManager diff --git a/OTM_GUI/bin/languages/Example_OTM_LanguagePack_English.txt b/uMod_GUI/bin/languages/Example_uMod_LanguagePack_English.txt similarity index 83% rename from OTM_GUI/bin/languages/Example_OTM_LanguagePack_English.txt rename to uMod_GUI/bin/languages/Example_uMod_LanguagePack_English.txt index b45f574..9aba258 100644 --- a/OTM_GUI/bin/languages/Example_OTM_LanguagePack_English.txt +++ b/uMod_GUI/bin/languages/Example_uMod_LanguagePack_English.txt @@ -2,11 +2,11 @@ If you have created a language package and would like to add to the officially d Email address and support can be found at http://code.google.com/p/texmod/ -The file name must match the wildcard OTM_LanguagePack_NAMEOFLANGUAGE.txt +The file name must match the wildcard uMod_LanguagePack_NAMEOFLANGUAGE.txt Format of an entry is divided into 3 parts: 1) Keyword directly followed by a colon, 2) message, and 3) end symbol "|" Restriction of the the message: do not use "|" within a message!! -You can also use utf-16LE encoding, but you have to label the file as OTM_LanguagePackU_NAMEOFLANGUAGE.txt +You can also use utf-16LE encoding, but you have to label the file as uMod_LanguagePackU_NAMEOFLANGUAGE.txt comments must start with an "#" and must end with | @@ -31,7 +31,7 @@ Message3 line2| There is no need to include all keywords, since English is loaded each time as default and afterwards the entries are replaced. -English itself is compiled into the OTM_GUI.exe, thus there exists no OTM_LanguagePack_English.txt. +English itself is compiled into the uMod_GUI.exe, thus there exists no uMod_LanguagePack_English.txt. The following list is an example of how an English package would look like (maybe not all keywords are present). @@ -42,8 +42,8 @@ Help| MenuAbout: About| MenuAcknowledgement:Acknowledgement| -MenuStartGame:Start game through OTM| -MenuStartGameCMD :Start game through OTM (with command line)| +MenuStartGame:Start game through uMod| +MenuStartGameCMD :Start game through uMod (with command line)| MenuUseHook:Use global hook| MenuAddGame: Add game| @@ -90,7 +90,7 @@ Select the games to be deleted.| GameAlreadyAdded: Game has been already added.| ExitGameAnyway: -Closing OpenTexMod while a game is running might lead to a crash of the game. +Closing Universal Modding Engine while a game is running might lead to a crash of the game. Exit anyway?| NoComment: No comment.| @@ -111,7 +111,7 @@ Please install the newest DirectX End-User Runtime Web Installer.| Error_FktNotFound: Could not load function out of dll. The dll injection won't work.| -Error_AlreadyRunning:An other instance of OpenTexMod is already running.| +Error_AlreadyRunning:An other instance of Universal Modding Engine is already running.| Error_Send: Could not send to game.| Error_KeyTwice: diff --git a/OTM_GUI/bin/languages/OTM_LanguagePackU_Deutsch.txt b/uMod_GUI/bin/languages/uMod_LanguagePackU_Deutsch.txt similarity index 89% rename from OTM_GUI/bin/languages/OTM_LanguagePackU_Deutsch.txt rename to uMod_GUI/bin/languages/uMod_LanguagePackU_Deutsch.txt index 1ecd2ee..d90d6a3 100644 Binary files a/OTM_GUI/bin/languages/OTM_LanguagePackU_Deutsch.txt and b/uMod_GUI/bin/languages/uMod_LanguagePackU_Deutsch.txt differ diff --git a/OTM_GUI/bin/languages/OTM_LanguagePackU_Russian.txt b/uMod_GUI/bin/languages/uMod_LanguagePackU_Russian.txt similarity index 86% rename from OTM_GUI/bin/languages/OTM_LanguagePackU_Russian.txt rename to uMod_GUI/bin/languages/uMod_LanguagePackU_Russian.txt index c3b2a33..3a3fc98 100644 Binary files a/OTM_GUI/bin/languages/OTM_LanguagePackU_Russian.txt and b/uMod_GUI/bin/languages/uMod_LanguagePackU_Russian.txt differ diff --git a/OTM_GUI/config.gcc b/uMod_GUI/config.gcc similarity index 100% rename from OTM_GUI/config.gcc rename to uMod_GUI/config.gcc diff --git a/OTM_GUI/config.vc b/uMod_GUI/config.vc similarity index 100% rename from OTM_GUI/config.vc rename to uMod_GUI/config.vc diff --git a/OTM_GUI/makefile.gcc b/uMod_GUI/makefile.gcc similarity index 83% rename from OTM_GUI/makefile.gcc rename to uMod_GUI/makefile.gcc index d49e840..eb90f0c 100644 --- a/OTM_GUI/makefile.gcc +++ b/uMod_GUI/makefile.gcc @@ -30,19 +30,19 @@ MINIMAL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(__THREADSFLAG) \ $(__DLLFLAG_p) -DNOPCH $(__RTTIFLAG_5) \ $(__EXCEPTIONSFLAG_6) -Wno-ctor-dtor-privacy $(CPPFLAGS) $(CXXFLAGS) MINIMAL_OBJECTS = \ - $(OBJS)\OTM_rc.o \ + $(OBJS)\uMod_rc.o \ $(OBJS)\unzip.o \ - $(OBJS)\OTM_DirectInjection.o \ - $(OBJS)\OTM_GUI.o \ - $(OBJS)\OTM_GameInfo.o \ - $(OBJS)\OTM_GamePage.o \ - $(OBJS)\OTM_Server.o \ - $(OBJS)\OTM_Client.o \ - $(OBJS)\OTM_File.o \ - $(OBJS)\OTM_Sender.o \ - $(OBJS)\OTM_Settings.o \ - $(OBJS)\OTM_AddTexture.o \ - $(OBJS)\OTM_Language.o + $(OBJS)\uMod_DirectInjection.o \ + $(OBJS)\uMod_GUI.o \ + $(OBJS)\uMod_GameInfo.o \ + $(OBJS)\uMod_GamePage.o \ + $(OBJS)\uMod_Server.o \ + $(OBJS)\uMod_Client.o \ + $(OBJS)\uMod_File.o \ + $(OBJS)\uMod_Sender.o \ + $(OBJS)\uMod_Settings.o \ + $(OBJS)\uMod_AddTexture.o \ + $(OBJS)\uMod_Language.o ### Conditionally set variables: ### @@ -227,53 +227,53 @@ $(OBJS_exe): ### Targets: ### -all: $(OBJS_exe)\OpenTexMod.exe +all: $(OBJS_exe)\uMod.exe clean: -if exist $(OBJS)\*.o del $(OBJS)\*.o -if exist $(OBJS)\*.d del $(OBJS)\*.d - -if exist $(OBJS_exe)\OpenTexMod.exe del $(OBJS_exe)\OpenTexMod.exe + -if exist $(OBJS_exe)\uMod.exe del $(OBJS_exe)\uMod.exe -$(OBJS_exe)\OpenTexMod.exe: $(MINIMAL_OBJECTS) $(OBJS)\OTM_rc.o +$(OBJS_exe)\uMod.exe: $(MINIMAL_OBJECTS) $(OBJS)\uMod_rc.o $(CXX) -o $@ $(MINIMAL_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -$(OBJS)\OTM_rc.o: OTM.rc OTM.ico +$(OBJS)\uMod_rc.o: uMod.rc uMod.ico windres --use-temp-file -i $< -o $@ $(OBJS)\unzip.o: ./unzip.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_DirectInjection.o: ./OTM_DirectInjection.cpp +$(OBJS)\uMod_DirectInjection.o: ./uMod_DirectInjection.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_GUI.o: ./OTM_GUI.cpp +$(OBJS)\uMod_GUI.o: ./uMod_GUI.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_GameInfo.o: ./OTM_GameInfo.cpp +$(OBJS)\uMod_GameInfo.o: ./uMod_GameInfo.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_GamePage.o: ./OTM_GamePage.cpp +$(OBJS)\uMod_GamePage.o: ./uMod_GamePage.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_Server.o: ./OTM_Server.cpp +$(OBJS)\uMod_Server.o: ./uMod_Server.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_Client.o: ./OTM_Client.cpp +$(OBJS)\uMod_Client.o: ./uMod_Client.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_File.o: ./OTM_File.cpp +$(OBJS)\uMod_File.o: ./uMod_File.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_Sender.o: ./OTM_Sender.cpp +$(OBJS)\uMod_Sender.o: ./uMod_Sender.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_Settings.o: ./OTM_Settings.cpp +$(OBJS)\uMod_Settings.o: ./uMod_Settings.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_AddTexture.o: ./OTM_AddTexture.cpp +$(OBJS)\uMod_AddTexture.o: ./uMod_AddTexture.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< -$(OBJS)\OTM_Language.o: ./OTM_Language.cpp +$(OBJS)\uMod_Language.o: ./uMod_Language.cpp $(CXX) -c -o $@ $(MINIMAL_CXXFLAGS) $(CPPDEPS) $< diff --git a/OTM_GUI/makefile.vc b/uMod_GUI/makefile.vc similarity index 78% rename from OTM_GUI/makefile.vc rename to uMod_GUI/makefile.vc index ec5d282..94e7dae 100644 --- a/OTM_GUI/makefile.vc +++ b/uMod_GUI/makefile.vc @@ -24,7 +24,7 @@ LIBDIRNAME = \ SETUPHDIR = \ $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG) MINIMAL_CXXFLAGS = /M$(__RUNTIME_LIBS_10)$(__DEBUGRUNTIME_4) /DWIN32 \ - $(__DEBUGINFO_0) /Fd$(OBJS)\OTM_GUI.pdb $(____DEBUGRUNTIME_3_p) \ + $(__DEBUGINFO_0) /Fd$(OBJS)\uMod_GUI.pdb $(____DEBUGRUNTIME_3_p) \ $(__OPTIMIZEFLAG_6) $(__NO_VC_CRTDBG_p) /D__WXMSW__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) \ @@ -34,19 +34,19 @@ MINIMAL_CXXFLAGS = /M$(__RUNTIME_LIBS_10)$(__DEBUGRUNTIME_4) /DWIN32 \ $(CPPFLAGS) $(CXXFLAGS) MINIMAL_OBJECTS = \ $(OBJS)\unzip.obj \ - $(OBJS)\OTM_DirectInjection.obj \ - $(OBJS)\OTM_GUI.obj \ - $(OBJS)\OTM_GameInfo.obj \ - $(OBJS)\OTM_GamePage.obj \ - $(OBJS)\OTM_Server.obj \ - $(OBJS)\OTM_Client.obj \ - $(OBJS)\OTM_File.obj \ - $(OBJS)\OTM_Sender.obj \ - $(OBJS)\OTM_Settings.obj \ - $(OBJS)\OTM_AddTexture.obj \ - $(OBJS)\OTM_Language.obj + $(OBJS)\uMod_DirectInjection.obj \ + $(OBJS)\uMod_GUI.obj \ + $(OBJS)\uMod_GameInfo.obj \ + $(OBJS)\uMod_GamePage.obj \ + $(OBJS)\uMod_Server.obj \ + $(OBJS)\uMod_Client.obj \ + $(OBJS)\uMod_File.obj \ + $(OBJS)\uMod_Sender.obj \ + $(OBJS)\uMod_Settings.obj \ + $(OBJS)\uMod_AddTexture.obj \ + $(OBJS)\uMod_Language.obj MINIMAL_RESOURCES = \ - $(OBJS)\OTM_GUI.res + $(OBJS)\uMod_GUI.res ### Conditionally set variables: ### @@ -343,23 +343,23 @@ $(OBJS): ### Targets: ### -all: $(OBJS_exe)\OpenTexMod.exe +all: $(OBJS_exe)\uMod.exe clean: -if exist $(OBJS)\*.obj del $(OBJS)\*.obj -if exist $(OBJS)\*.res del $(OBJS)\*.res -if exist $(OBJS)\*.pch del $(OBJS)\*.pch - -if exist $(OBJS_exe)\OTM_GUI.exe del $(OBJS_exe)\OpenTexMod.exe - -if exist $(OBJS_exe)\OTM_GUI.ilk del $(OBJS_exe)\OTM_GUI.ilk - -if exist $(OBJS_exe)\OTM_GUI.pdb del $(OBJS_exe)\OTM_GUI.pdb + -if exist $(OBJS_exe)\uMod_GUI.exe del $(OBJS_exe)\uMod.exe + -if exist $(OBJS_exe)\uMod_GUI.ilk del $(OBJS_exe)\uMod_GUI.ilk + -if exist $(OBJS_exe)\uMod_GUI.pdb del $(OBJS_exe)\uMod_GUI.pdb -$(OBJS_exe)\OpenTexMod.exe: $(MINIMAL_OBJECTS) $(OBJS)\OTM_GUI.res - link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\OTM_GUI.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<< +$(OBJS_exe)\uMod.exe: $(MINIMAL_OBJECTS) $(OBJS)\uMod_GUI.res + link /NOLOGO /OUT:$@ $(__DEBUGINFO_1) /pdb:"$(OBJS)\uMod_GUI.pdb" $(__DEBUGINFO_2) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:WINDOWS $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) @<< $(MINIMAL_OBJECTS) $(MINIMAL_RESOURCES) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib wininet.lib << -$(OBJS)\OTM_GUI.res: OTM.rc - rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) $(__NO_VC_CRTDBG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) /i $(SETUPHDIR) /i . $(__DLLFLAG_p_1) /d _WINDOWS /d NOPCH OTM.rc +$(OBJS)\uMod_GUI.res: uMod.rc + rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_3_p_1) $(__NO_VC_CRTDBG_p_1) /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) $(__MSLU_DEFINE_p_1) /i $(SETUPHDIR) /i . $(__DLLFLAG_p_1) /d _WINDOWS /d NOPCH uMod.rc #$(OBJS)\display_display.obj: .\display.cpp # $(CXX) /c /nologo /TP /Fo$@ $(DISPLAY_CXXFLAGS) .\display.cpp @@ -367,35 +367,35 @@ $(OBJS)\OTM_GUI.res: OTM.rc $(OBJS)\unzip.obj: .\unzip.cpp $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\unzip.cpp -$(OBJS)\OTM_DirectInjection.obj: .\OTM_DirectInjection.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_DirectInjection.cpp +$(OBJS)\uMod_DirectInjection.obj: .\uMod_DirectInjection.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_DirectInjection.cpp -$(OBJS)\OTM_GUI.obj: .\OTM_GUI.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_GUI.cpp +$(OBJS)\uMod_GUI.obj: .\uMod_GUI.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_GUI.cpp -$(OBJS)\OTM_GameInfo.obj: .\OTM_GameInfo.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_GameInfo.cpp +$(OBJS)\uMod_GameInfo.obj: .\uMod_GameInfo.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_GameInfo.cpp -$(OBJS)\OTM_GamePage.obj: .\OTM_GamePage.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_GamePage.cpp +$(OBJS)\uMod_GamePage.obj: .\uMod_GamePage.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_GamePage.cpp -$(OBJS)\OTM_Server.obj: .\OTM_Server.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_Server.cpp +$(OBJS)\uMod_Server.obj: .\uMod_Server.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_Server.cpp -$(OBJS)\OTM_Client.obj: .\OTM_Client.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_Client.cpp +$(OBJS)\uMod_Client.obj: .\uMod_Client.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_Client.cpp -$(OBJS)\OTM_File.obj: .\OTM_File.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_File.cpp +$(OBJS)\uMod_File.obj: .\uMod_File.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_File.cpp -$(OBJS)\OTM_Sender.obj: .\OTM_Sender.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_Sender.cpp +$(OBJS)\uMod_Sender.obj: .\uMod_Sender.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_Sender.cpp -$(OBJS)\OTM_Settings.obj: .\OTM_Settings.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_Settings.cpp +$(OBJS)\uMod_Settings.obj: .\uMod_Settings.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_Settings.cpp -$(OBJS)\OTM_AddTexture.obj: .\OTM_AddTexture.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_AddTexture.cpp +$(OBJS)\uMod_AddTexture.obj: .\uMod_AddTexture.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_AddTexture.cpp -$(OBJS)\OTM_Language.obj: .\OTM_Language.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\OTM_Language.cpp +$(OBJS)\uMod_Language.obj: .\uMod_Language.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MINIMAL_CXXFLAGS) .\uMod_Language.cpp diff --git a/uMod_GUI/uMod.ico b/uMod_GUI/uMod.ico new file mode 100644 index 0000000..610925e Binary files /dev/null and b/uMod_GUI/uMod.ico differ diff --git a/uMod_GUI/uMod.rc b/uMod_GUI/uMod.rc new file mode 100644 index 0000000..dc27e22 --- /dev/null +++ b/uMod_GUI/uMod.rc @@ -0,0 +1 @@ +MAINICON ICON "uMod.ico" \ No newline at end of file diff --git a/OTM_GUI/OTM_AddTexture.cpp b/uMod_GUI/uMod_AddTexture.cpp similarity index 84% rename from OTM_GUI/OTM_AddTexture.cpp rename to uMod_GUI/uMod_AddTexture.cpp index d7674e8..7a4fb2a 100644 --- a/OTM_GUI/OTM_AddTexture.cpp +++ b/uMod_GUI/uMod_AddTexture.cpp @@ -1,24 +1,24 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" diff --git a/OTM_GUI/OTM_AddTexture.h b/uMod_GUI/uMod_AddTexture.h similarity index 64% rename from OTM_GUI/OTM_AddTexture.h rename to uMod_GUI/uMod_AddTexture.h index 2ecbf68..bc4f55d 100644 --- a/OTM_GUI/OTM_AddTexture.h +++ b/uMod_GUI/uMod_AddTexture.h @@ -1,26 +1,26 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_ADDTEXTURE_H_ -#define OTM_ADDTEXTURE_H_ +#ifndef uMod_ADDTEXTURE_H_ +#define uMod_ADDTEXTURE_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" class AddTextureClass { @@ -51,4 +51,4 @@ public: -#endif /* OTM_ADDTEXTURE_H_ */ +#endif /* uMod_ADDTEXTURE_H_ */ diff --git a/OTM_GUI/OTM_Client.cpp b/uMod_GUI/uMod_Client.cpp similarity index 74% rename from OTM_GUI/OTM_Client.cpp rename to uMod_GUI/uMod_Client.cpp index fba10b4..4d99934 100644 --- a/OTM_GUI/OTM_Client.cpp +++ b/uMod_GUI/uMod_Client.cpp @@ -1,33 +1,33 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_Client::OTM_Client( PipeStruct &pipe, OTM_Frame *frame) : wxThread(wxTHREAD_JOINABLE) +uMod_Client::uMod_Client( PipeStruct &pipe, uMod_Frame *frame) : wxThread(wxTHREAD_JOINABLE) { Pipe.In = pipe.In; Pipe.Out = pipe.Out; MainFrame = frame; } -OTM_Client::~OTM_Client(void) +uMod_Client::~uMod_Client(void) { if (Pipe.Out != INVALID_HANDLE_VALUE) { @@ -43,7 +43,7 @@ OTM_Client::~OTM_Client(void) } } -void* OTM_Client::Entry(void) +void* uMod_Client::Entry(void) { char buffer[SMALL_BUFSIZE]; while (1) @@ -84,7 +84,7 @@ void* OTM_Client::Entry(void) CloseHandle(Pipe.Out); Pipe.Out = INVALID_HANDLE_VALUE; - OTM_Event event( OTM_EVENT_TYPE, ID_Delete_Game); + uMod_Event event( uMod_EVENT_TYPE, ID_Delete_Game); event.SetClient(this); wxPostEvent( MainFrame, event); diff --git a/OTM_GUI/OTM_Client.h b/uMod_GUI/uMod_Client.h similarity index 57% rename from OTM_GUI/OTM_Client.h rename to uMod_GUI/uMod_Client.h index 5f74619..328b560 100644 --- a/OTM_GUI/OTM_Client.h +++ b/uMod_GUI/uMod_Client.h @@ -1,37 +1,37 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_CLIENT_H_ -#define OTM_CLIENT_H_ +#ifndef uMod_CLIENT_H_ +#define uMod_CLIENT_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" // an object of this class is created for each running game // it reads out of the incoming pipe (it must run as thread) // if the pipe is closed (Game is canceled) it send a messeage to the main thread // it should read the error state from the dll, but this is not yet implemented -class OTM_Client : public wxThread +class uMod_Client : public wxThread { public: - OTM_Client( PipeStruct &pipe, OTM_Frame *frame); - virtual ~OTM_Client(void); + uMod_Client( PipeStruct &pipe, uMod_Frame *frame); + virtual ~uMod_Client(void); void* Entry(void); @@ -39,7 +39,7 @@ public: PipeStruct Pipe; private: - OTM_Frame *MainFrame; + uMod_Frame *MainFrame; }; -#endif /* OTM_CLIENT_H_ */ +#endif /* uMod_CLIENT_H_ */ diff --git a/OTM_GUI/OTM_DirectInjection.cpp b/uMod_GUI/uMod_DirectInjection.cpp similarity index 95% rename from OTM_GUI/OTM_DirectInjection.cpp rename to uMod_GUI/uMod_DirectInjection.cpp index 699600f..21ed3b0 100644 --- a/OTM_GUI/OTM_DirectInjection.cpp +++ b/uMod_GUI/uMod_DirectInjection.cpp @@ -1,21 +1,22 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ + /* * * Drew_Benton @@ -23,7 +24,7 @@ along with OpenTexMod. If not, see . * */ -#include "OTM_Main.h" +#include "uMod_Main.h" /***************************************************************************************************/ // Function: // Inject diff --git a/OTM_GUI/OTM_DirectInjection.h b/uMod_GUI/uMod_DirectInjection.h similarity index 54% rename from OTM_GUI/OTM_DirectInjection.h rename to uMod_GUI/uMod_DirectInjection.h index c142e48..d491a3c 100644 --- a/OTM_GUI/OTM_DirectInjection.h +++ b/uMod_GUI/uMod_DirectInjection.h @@ -1,27 +1,27 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_INJECTDIRECTLY_H_ -#define OTM_INJECTDIRECTLY_H_ +#ifndef uMod_INJECTDIRECTLY_H_ +#define uMod_INJECTDIRECTLY_H_ void Inject(HANDLE hProcess, const wchar_t* dllname, const char* funcname); -#endif /* OTM_INJECTDIRECTLY_H_ */ +#endif /* uMod_INJECTDIRECTLY_H_ */ diff --git a/OTM_GUI/OTM_Event.cpp b/uMod_GUI/uMod_Event.cpp similarity index 55% rename from OTM_GUI/OTM_Event.cpp rename to uMod_GUI/uMod_Event.cpp index de0fa8b..bffc0ca 100644 --- a/OTM_GUI/OTM_Event.cpp +++ b/uMod_GUI/uMod_Event.cpp @@ -1,23 +1,23 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" diff --git a/OTM_GUI/OTM_Event.h b/uMod_GUI/uMod_Event.h similarity index 54% rename from OTM_GUI/OTM_Event.h rename to uMod_GUI/uMod_Event.h index 8b68801..5c09fe9 100644 --- a/OTM_GUI/OTM_Event.h +++ b/uMod_GUI/uMod_Event.h @@ -1,47 +1,47 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_EVENTTYPE_H_ -#define OTM_EVENTTYPE_H_ -#include "OTM_Client.h" -#include "OTM_Main.h" +#ifndef uMod_EVENTTYPE_H_ +#define uMod_EVENTTYPE_H_ +#include "uMod_Client.h" +#include "uMod_Main.h" //we need our own event to pass send some arguments from the server or the client thread to the main thread BEGIN_DECLARE_EVENT_TYPES() -DECLARE_EVENT_TYPE( OTM_EVENT_TYPE, -1) +DECLARE_EVENT_TYPE( uMod_EVENT_TYPE, -1) END_DECLARE_EVENT_TYPES() -class OTM_Event : public wxCommandEvent +class uMod_Event : public wxCommandEvent { public: - OTM_Event( wxEventType commandType = OTM_EVENT_TYPE, int id = 0 ) + uMod_Event( wxEventType commandType = uMod_EVENT_TYPE, int id = 0 ) : wxCommandEvent(commandType, id) { } - virtual ~OTM_Event(void) {} + virtual ~uMod_Event(void) {} // You *must* copy here the data to be transported - OTM_Event( const OTM_Event &event ) - : wxCommandEvent(event) { this->SetText( event.GetText()); PipeIn=((OTM_Event&)event).GetPipeIn(); PipeOut=((OTM_Event&)event).GetPipeOut(); Name=((OTM_Event&)event).GetName(); Client=((OTM_Event&)event).GetClient();} + uMod_Event( const uMod_Event &event ) + : wxCommandEvent(event) { this->SetText( event.GetText()); PipeIn=((uMod_Event&)event).GetPipeIn(); PipeOut=((uMod_Event&)event).GetPipeOut(); Name=((uMod_Event&)event).GetName(); Client=((uMod_Event&)event).GetClient();} // Required for sending with wxPostEvent() - wxEvent* Clone() const { return new OTM_Event(*this); } + wxEvent* Clone() const { return new uMod_Event(*this); } wxString GetText() const { return m_Text; } void SetText( const wxString& text ) { m_Text = text; } @@ -49,22 +49,22 @@ public: wxString GetName(void) {return Name;} HANDLE GetPipeIn(void) {return PipeIn;} HANDLE GetPipeOut(void) {return PipeOut;} - OTM_Client * GetClient(void) {return Client;} + uMod_Client * GetClient(void) {return Client;} void SetName( wxString name) {Name=name;} void SetPipeIn( HANDLE pipe) {PipeIn=pipe;} void SetPipeOut( HANDLE pipe) {PipeOut=pipe;} - void SetClient( OTM_Client *client) {Client=client;} + void SetClient( uMod_Client *client) {Client=client;} private: wxString Name; HANDLE PipeIn; HANDLE PipeOut; - OTM_Client *Client; + uMod_Client *Client; wxString m_Text; }; -#endif /* OTM_EVENTTYPE_H_ */ +#endif /* uMod_EVENTTYPE_H_ */ diff --git a/OTM_GUI/OTM_File.cpp b/uMod_GUI/uMod_File.cpp similarity index 88% rename from OTM_GUI/OTM_File.cpp rename to uMod_GUI/uMod_File.cpp index 0d39c4c..ff4ab77 100644 --- a/OTM_GUI/OTM_File.cpp +++ b/uMod_GUI/uMod_File.cpp @@ -1,26 +1,26 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" #include "unzip.h" -OTM_File::OTM_File(void) +uMod_File::uMod_File(void) { Loaded=false; XORed=false; @@ -29,7 +29,7 @@ OTM_File::OTM_File(void) FileLen=0u; } -OTM_File::OTM_File(const wxString &file) +uMod_File::uMod_File(const wxString &file) { Loaded=false; XORed=false; @@ -40,13 +40,13 @@ OTM_File::OTM_File(const wxString &file) } -OTM_File::~OTM_File(void) +uMod_File::~uMod_File(void) { if (FileInMemory!=NULL) delete [] FileInMemory; } -bool OTM_File::FileSupported(void) +bool uMod_File::FileSupported(void) { wxString file_type = FileName.AfterLast( '.'); if (file_type == L"zip") return true; @@ -57,7 +57,7 @@ bool OTM_File::FileSupported(void) } -int OTM_File::GetComment( wxString &tool_tip) +int uMod_File::GetComment( wxString &tool_tip) { wxString file_type = FileName.AfterLast( '.'); if (file_type == L"zip") @@ -76,7 +76,7 @@ int OTM_File::GetComment( wxString &tool_tip) return 0; } -int OTM_File::GetContent( AddTextureClass &tex, bool add) +int uMod_File::GetContent( AddTextureClass &tex, bool add) { wxString file_type = FileName.AfterLast( '.'); if (file_type == L"zip") @@ -104,7 +104,7 @@ int OTM_File::GetContent( AddTextureClass &tex, bool add) } } -int OTM_File::ReadFile(void) +int uMod_File::ReadFile(void) { if (Loaded) return 0; XORed=false; @@ -135,7 +135,7 @@ int OTM_File::ReadFile(void) -int OTM_File::UnXOR(void) +int uMod_File::UnXOR(void) { if (XORed) return 0; /* @@ -178,7 +178,7 @@ int OTM_File::UnXOR(void) -int OTM_File::GetCommentZip( wxString &tool_tip) +int uMod_File::GetCommentZip( wxString &tool_tip) { if (int ret = ReadFile()) return ret; @@ -207,7 +207,7 @@ int OTM_File::GetCommentZip( wxString &tool_tip) return 0; } -int OTM_File::GetCommentTpf( wxString &tool_tip) +int uMod_File::GetCommentTpf( wxString &tool_tip) { if (int ret = ReadFile()) return ret; @@ -225,7 +225,7 @@ int OTM_File::GetCommentTpf( wxString &tool_tip) -int OTM_File::AddFile( AddTextureClass &tex, bool add) +int uMod_File::AddFile( AddTextureClass &tex, bool add) { tex.SetSize(1); unsigned long temp_hash; @@ -250,7 +250,7 @@ int OTM_File::AddFile( AddTextureClass &tex, bool add) return 0; } -int OTM_File::AddZip( AddTextureClass &tex, bool add, bool tpf) +int uMod_File::AddZip( AddTextureClass &tex, bool add, bool tpf) { if (int ret = ReadFile()) return ret; @@ -274,7 +274,7 @@ int OTM_File::AddZip( AddTextureClass &tex, bool add, bool tpf) } -int OTM_File::AddContent( const char* pw, AddTextureClass &tex, bool add) +int uMod_File::AddContent( const char* pw, AddTextureClass &tex, bool add) { // Thats is really nasty code, but atm I am happy that it works. I should try an other unzip api, // This one seems to behave very strange. diff --git a/OTM_GUI/OTM_File.h b/uMod_GUI/uMod_File.h similarity index 68% rename from OTM_GUI/OTM_File.h rename to uMod_GUI/uMod_File.h index 67da74c..f2e4ac2 100644 --- a/OTM_GUI/OTM_File.h +++ b/uMod_GUI/uMod_File.h @@ -1,32 +1,32 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_FILE_H_ -#define OTM_FILE_H_ +#ifndef uMod_FILE_H_ +#define uMod_FILE_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" -class OTM_File +class uMod_File { public: - OTM_File(void); - OTM_File(const wxString &file); - ~OTM_File(void); + uMod_File(void); + uMod_File(const wxString &file); + ~uMod_File(void); bool FileSupported(void); @@ -59,4 +59,4 @@ private: }; -#endif /* OTM_FILE_H_ */ +#endif /* uMod_FILE_H_ */ diff --git a/OTM_GUI/OTM_GUI.cpp b/uMod_GUI/uMod_GUI.cpp similarity index 75% rename from OTM_GUI/OTM_GUI.cpp rename to uMod_GUI/uMod_GUI.cpp index 8a5ade3..38f7e62 100644 --- a/OTM_GUI/OTM_GUI.cpp +++ b/uMod_GUI/uMod_GUI.cpp @@ -1,26 +1,26 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" @@ -28,38 +28,38 @@ along with OpenTexMod. If not, see . #ifndef __CDT_PARSER__ -DEFINE_EVENT_TYPE(OTM_EVENT_TYPE) +DEFINE_EVENT_TYPE(uMod_EVENT_TYPE) -BEGIN_EVENT_TABLE(OTM_Frame, wxFrame) - EVT_CLOSE(OTM_Frame::OnClose) +BEGIN_EVENT_TABLE(uMod_Frame, wxFrame) + EVT_CLOSE(uMod_Frame::OnClose) - EVT_BUTTON(ID_Button_Open, OTM_Frame::OnButtonOpen) - EVT_BUTTON(ID_Button_Path, OTM_Frame::OnButtonPath) - EVT_BUTTON(ID_Button_Update, OTM_Frame::OnButtonUpdate) - EVT_BUTTON(ID_Button_Reload, OTM_Frame::OnButtonReload) + EVT_BUTTON(ID_Button_Open, uMod_Frame::OnButtonOpen) + EVT_BUTTON(ID_Button_Path, uMod_Frame::OnButtonPath) + EVT_BUTTON(ID_Button_Update, uMod_Frame::OnButtonUpdate) + EVT_BUTTON(ID_Button_Reload, uMod_Frame::OnButtonReload) - EVT_MENU(ID_Menu_Help, OTM_Frame::OnMenuHelp) - EVT_MENU(ID_Menu_About, OTM_Frame::OnMenuAbout) - EVT_MENU(ID_Menu_Acknowledgement, OTM_Frame::OnMenuAcknowledgement) + EVT_MENU(ID_Menu_Help, uMod_Frame::OnMenuHelp) + EVT_MENU(ID_Menu_About, uMod_Frame::OnMenuAbout) + EVT_MENU(ID_Menu_Acknowledgement, uMod_Frame::OnMenuAcknowledgement) - EVT_MENU(ID_Menu_StartGame, OTM_Frame::OnMenuStartGame) - EVT_MENU(ID_Menu_StartGameCMD, OTM_Frame::OnMenuStartGame) + EVT_MENU(ID_Menu_StartGame, uMod_Frame::OnMenuStartGame) + EVT_MENU(ID_Menu_StartGameCMD, uMod_Frame::OnMenuStartGame) - EVT_MENU(ID_Menu_AddGame, OTM_Frame::OnMenuAddGame) - EVT_MENU(ID_Menu_DeleteGame, OTM_Frame::OnMenuDeleteGame) - EVT_MENU(ID_Menu_UseHook, OTM_Frame::OnMenuUseHook) + EVT_MENU(ID_Menu_AddGame, uMod_Frame::OnMenuAddGame) + EVT_MENU(ID_Menu_DeleteGame, uMod_Frame::OnMenuDeleteGame) + EVT_MENU(ID_Menu_UseHook, uMod_Frame::OnMenuUseHook) - EVT_MENU(ID_Menu_LoadTemplate, OTM_Frame::OnMenuOpenTemplate) - EVT_MENU(ID_Menu_SaveTemplate, OTM_Frame::OnMenuSaveTemplate) - EVT_MENU(ID_Menu_SaveTemplateAs, OTM_Frame::OnMenuSaveTemplateAs) - EVT_MENU(ID_Menu_SetDefaultTemplate, OTM_Frame::OnMenuSetDefaultTemplate) + EVT_MENU(ID_Menu_LoadTemplate, uMod_Frame::OnMenuOpenTemplate) + EVT_MENU(ID_Menu_SaveTemplate, uMod_Frame::OnMenuSaveTemplate) + EVT_MENU(ID_Menu_SaveTemplateAs, uMod_Frame::OnMenuSaveTemplateAs) + EVT_MENU(ID_Menu_SetDefaultTemplate, uMod_Frame::OnMenuSetDefaultTemplate) - EVT_MENU(ID_Menu_Lang, OTM_Frame::OnMenuLanguage) - EVT_MENU(ID_Menu_Exit, OTM_Frame::OnMenuExit) + EVT_MENU(ID_Menu_Lang, uMod_Frame::OnMenuLanguage) + EVT_MENU(ID_Menu_Exit, uMod_Frame::OnMenuExit) - EVT_COMMAND (ID_Add_Game, OTM_EVENT_TYPE, OTM_Frame::OnAddGame) - EVT_COMMAND (ID_Delete_Game, OTM_EVENT_TYPE, OTM_Frame::OnDeleteGame) + EVT_COMMAND (ID_Add_Game, uMod_EVENT_TYPE, uMod_Frame::OnAddGame) + EVT_COMMAND (ID_Delete_Game, uMod_EVENT_TYPE, uMod_Frame::OnDeleteGame) END_EVENT_TABLE() IMPLEMENT_APP(MyApp) @@ -73,30 +73,30 @@ MyApp::~MyApp(void) bool MyApp::OnInit(void) { - OTM_Settings set; + uMod_Settings set; set.Load(); - Language = new OTM_Language(set.Language); - CheckForSingleRun = CreateMutex( NULL, true, L"Global\\OTM_CheckForSingleRun"); + Language = new uMod_Language(set.Language); + CheckForSingleRun = CreateMutex( NULL, true, L"Global\\uMod_CheckForSingleRun"); if (ERROR_ALREADY_EXISTS == GetLastError()) { wxMessageBox( Language->Error_AlreadyRunning, "ERROR", wxOK|wxICON_ERROR); return false; } - OTM_Frame *frame = new OTM_Frame( OTM_VERSION, set); + uMod_Frame *frame = new uMod_Frame( uMod_VERSION, set); SetTopWindow( frame ); return true; } -OTM_Frame::OTM_Frame(const wxString& title, OTM_Settings &set) +uMod_Frame::uMod_Frame(const wxString& title, uMod_Settings &set) : wxFrame((wxFrame *)NULL, -1, title, wxPoint(set.XPos,set.YPos), wxSize(set.XSize,set.YSize)), Settings(set) { SetIcon(wxICON(MAINICON)); H_DX9_DLL = NULL; - Server = new OTM_Server( this); + Server = new uMod_Server( this); Server->Create(); Server->Run(); @@ -165,12 +165,22 @@ OTM_Frame::OTM_Frame(const wxString& title, OTM_Settings &set) LoadTemplate(); Show( true ); + + { + HMODULE dll = LoadLibraryW( L"D3DX9_43.dll"); + if (dll==NULL) + { + wxMessageBox( Language->Error_D3DX9NotFound, "ERROR", wxOK|wxICON_ERROR); + } + else FreeLibrary(dll); + } + if (Settings.UseHook) InstallHook(); } -OTM_Frame::~OTM_Frame(void) +uMod_Frame::~uMod_Frame(void) { - if (Server!=(OTM_Server*)0) + if (Server!=(uMod_Server*)0) { KillServer(); Server->Wait(); @@ -188,9 +198,9 @@ OTM_Frame::~OTM_Frame(void) Settings.Save(); } -int OTM_Frame::KillServer(void) +int uMod_Frame::KillServer(void) { - HANDLE pipe = CreateFileW( PIPE_Game2OTM,// pipe name + HANDLE pipe = CreateFileW( PIPE_Game2uMod,// pipe name GENERIC_WRITE, 0, // no sharing NULL, // default security attributes @@ -212,7 +222,7 @@ int OTM_Frame::KillServer(void) -void OTM_Frame::OnAddGame( wxCommandEvent &event) +void uMod_Frame::OnAddGame( wxCommandEvent &event) { if (NumberOfGames>=MaxNumberOfGames) { @@ -224,13 +234,13 @@ void OTM_Frame::OnAddGame( wxCommandEvent &event) MaxNumberOfGames += 10; } - wxString name = ((OTM_Event&)event).GetName(); + wxString name = ((uMod_Event&)event).GetName(); PipeStruct pipe; - pipe.In = ((OTM_Event&)event).GetPipeIn(); - pipe.Out = ((OTM_Event&)event).GetPipeOut(); + pipe.In = ((uMod_Event&)event).GetPipeIn(); + pipe.Out = ((uMod_Event&)event).GetPipeOut(); - OTM_Client *client = new OTM_Client( pipe, this); + uMod_Client *client = new uMod_Client( pipe, this); client->Create(); client->Run(); @@ -242,7 +252,7 @@ void OTM_Frame::OnAddGame( wxCommandEvent &event) break; } - OTM_GamePage *page = new OTM_GamePage( Notebook, name, save_file, client->Pipe); + uMod_GamePage *page = new uMod_GamePage( Notebook, name, save_file, client->Pipe); if (page->LastError.Len()>0) { wxMessageBox(page->LastError, "ERROR", wxOK|wxICON_ERROR); @@ -258,9 +268,9 @@ void OTM_Frame::OnAddGame( wxCommandEvent &event) NumberOfGames++; } -void OTM_Frame::OnDeleteGame( wxCommandEvent &event) +void uMod_Frame::OnDeleteGame( wxCommandEvent &event) { - OTM_Client *client = ((OTM_Event&)event).GetClient(); + uMod_Client *client = ((uMod_Event&)event).GetClient(); for (int i=0; iDeletePage(i); @@ -273,7 +283,7 @@ void OTM_Frame::OnDeleteGame( wxCommandEvent &event) } -void OTM_Frame::OnClose(wxCloseEvent& event) +void uMod_Frame::OnClose(wxCloseEvent& event) { if (event.CanVeto() && NumberOfGames>0) { @@ -283,10 +293,10 @@ void OTM_Frame::OnClose(wxCloseEvent& event) Destroy(); } -void OTM_Frame::OnButtonOpen(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnButtonOpen(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; @@ -303,10 +313,10 @@ void OTM_Frame::OnButtonOpen(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnButtonPath(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnButtonPath(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; wxString dir = wxDirSelector( Language->ChooseDir, page->GetSavePath()); @@ -316,10 +326,10 @@ void OTM_Frame::OnButtonPath(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnButtonUpdate(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnButtonUpdate(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; if (page->UpdateGame()) { @@ -328,10 +338,10 @@ void OTM_Frame::OnButtonUpdate(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnButtonReload(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnButtonReload(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; if (page->ReloadGame()) { @@ -343,10 +353,10 @@ void OTM_Frame::OnButtonReload(wxCommandEvent& WXUNUSED(event)) -void OTM_Frame::OnMenuOpenTemplate(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuOpenTemplate(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; @@ -365,10 +375,10 @@ void OTM_Frame::OnMenuOpenTemplate(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuSaveTemplate(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuSaveTemplate(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; wxString file_name = page->GetTemplateName(); @@ -389,10 +399,10 @@ void OTM_Frame::OnMenuSaveTemplate(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuSaveTemplateAs(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuSaveTemplateAs(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; @@ -409,10 +419,10 @@ void OTM_Frame::OnMenuSaveTemplateAs(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuSetDefaultTemplate(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuSetDefaultTemplate(wxCommandEvent& WXUNUSED(event)) { if (Notebook->GetPageCount()==0) return; - OTM_GamePage *page = (OTM_GamePage*) Notebook->GetCurrentPage(); + uMod_GamePage *page = (uMod_GamePage*) Notebook->GetCurrentPage(); if (page==NULL) return; wxString exe = page->GetExeName(); @@ -438,7 +448,7 @@ void OTM_Frame::OnMenuSetDefaultTemplate(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuLanguage(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuLanguage(wxCommandEvent& WXUNUSED(event)) { wxArrayString lang; Language->GetLanguages( lang); @@ -481,18 +491,18 @@ void OTM_Frame::OnMenuLanguage(wxCommandEvent& WXUNUSED(event)) int num = Notebook->GetPageCount(); for (int i=0; iGetPage(i); + uMod_GamePage* page = (uMod_GamePage*) Notebook->GetPage(i); page->UpdateLanguage(); } } } -void OTM_Frame::OnMenuExit(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuExit(wxCommandEvent& WXUNUSED(event)) { Close(); } -void OTM_Frame::OnMenuHelp(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuHelp(wxCommandEvent& WXUNUSED(event)) { wxString help; if (Language->GetHelpMessage( help)) @@ -505,25 +515,24 @@ void OTM_Frame::OnMenuHelp(wxCommandEvent& WXUNUSED(event)) wxMessageBox( help, Language->MenuHelp, wxOK); } -void OTM_Frame::OnMenuAbout(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg << OTM_VERSION << " by ROTA\nhttp://code.google.com/p/texmod/"; + msg << uMod_VERSION << "\n\nProject members:\n\nROTA (developer)\nKing Brace Blane (PR)\n\nhttp://code.google.com/p/texmod/"; wxMessageBox( msg, "Info", wxOK); } -void OTM_Frame::OnMenuAcknowledgement(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuAcknowledgement(wxCommandEvent& WXUNUSED(event)) { - wxString title; - title << OTM_VERSION << " by ROTA"; wxString msg; - msg << "RS for coding the original TexMod and for information about the used hashing algorithm\n"; - msg << "EvilAlex for translation into Russian and bug fixing\n"; - msg << "King Brace Blane for a tutorial video on YouTube and bug fixing"; - wxMessageBox( msg, title, wxOK); + msg << "King Brace Blane and ROTA thank:\n\n"; + msg << "RS for coding the original TexMod and for information about the used hashing algorithm\n\n"; + msg << "EvilAlex for translation into Russian and bug fixing"; + //msg << "King Brace Blane for a tutorial video on YouTube and bug fixing"; + wxMessageBox( msg, Language->MenuAcknowledgement, wxOK); } -void OTM_Frame::OnMenuStartGame(wxCommandEvent& event) +void uMod_Frame::OnMenuStartGame(wxCommandEvent& event) { bool use_cmd = false; if (event.GetId() == ID_Menu_StartGameCMD) use_cmd = true; @@ -600,13 +609,13 @@ void OTM_Frame::OnMenuStartGame(wxCommandEvent& event) wxString dll = wxGetCwd(); - dll.Append( L"\\" OTM_d3d9_DI_dll); + dll.Append( L"\\" uMod_d3d9_DI_dll); Inject(pi.hProcess, dll.wc_str(), "Nothing"); ResumeThread(pi.hThread); } -void OTM_Frame::OnMenuUseHook(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuUseHook(wxCommandEvent& WXUNUSED(event)) { bool use_hook = MenuMain->IsChecked(ID_Menu_UseHook); @@ -630,7 +639,7 @@ void OTM_Frame::OnMenuUseHook(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuAddGame(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuAddGame(wxCommandEvent& WXUNUSED(event)) { wxString file_name = wxFileSelector( Language->ChooseGame, "", "", "exe", "binary (*.exe)|*.exe", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if ( !file_name.empty() ) @@ -654,7 +663,7 @@ void OTM_Frame::OnMenuAddGame(wxCommandEvent& WXUNUSED(event)) } } -void OTM_Frame::OnMenuDeleteGame(wxCommandEvent& WXUNUSED(event)) +void uMod_Frame::OnMenuDeleteGame(wxCommandEvent& WXUNUSED(event)) { wxArrayInt selections; wxArrayString array; @@ -682,12 +691,12 @@ void OTM_Frame::OnMenuDeleteGame(wxCommandEvent& WXUNUSED(event)) -int OTM_Frame::GetHookedGames( wxArrayString &array) +int uMod_Frame::GetHookedGames( wxArrayString &array) { wxFile file; wxString name; wchar_t *app_path = _wgetenv( L"APPDATA"); - name.Printf("%ls\\%ls\\%ls", app_path, OTM_APP_DIR, OTM_APP_DX9); + name.Printf("%ls\\%ls\\%ls", app_path, uMod_APP_DIR, uMod_APP_DX9); if (!file.Access(name, wxFile::read)) {LastError << Language->Error_FileOpen << "\n" << name; return -1;} file.Open(name, wxFile::read); @@ -725,19 +734,19 @@ int OTM_Frame::GetHookedGames( wxArrayString &array) return 0; } -int OTM_Frame::SetHookedGames( const wxArrayString &array) +int uMod_Frame::SetHookedGames( const wxArrayString &array) { wxFile file; wxString name; wchar_t *app_path = _wgetenv( L"APPDATA"); - name.Printf("%ls\\%ls", app_path, OTM_APP_DIR); + name.Printf("%ls\\%ls", app_path, uMod_APP_DIR); if (! wxDir::Exists(name)) { wxDir::Make(name); } - name.Printf("%ls\\%ls\\%ls", app_path, OTM_APP_DIR, OTM_APP_DX9); + name.Printf("%ls\\%ls\\%ls", app_path, uMod_APP_DIR, uMod_APP_DX9); file.Open(name, wxFile::write); if (!file.IsOpened()) {LastError << Language->Error_FileOpen << "\n" << name ; return -1;} wxString content; @@ -753,8 +762,8 @@ int OTM_Frame::SetHookedGames( const wxArrayString &array) return 0; } -#define DI_FILE "OTM_DI_Games.txt" -int OTM_Frame::GetInjectedGames( wxArrayString &games, wxArrayString &cmd) +#define DI_FILE "uMod_DI_Games.txt" +int uMod_Frame::GetInjectedGames( wxArrayString &games, wxArrayString &cmd) { wxFile file; @@ -800,7 +809,7 @@ int OTM_Frame::GetInjectedGames( wxArrayString &games, wxArrayString &cmd) return 0; } -int OTM_Frame::SetInjectedGames( wxArrayString &games, wxArrayString &cmd) +int uMod_Frame::SetInjectedGames( wxArrayString &games, wxArrayString &cmd) { wxFile file; @@ -820,9 +829,9 @@ int OTM_Frame::SetInjectedGames( wxArrayString &games, wxArrayString &cmd) } -#define SAVE_FILE "OTM_SaveFiles.txt" +#define SAVE_FILE "uMod_SaveFiles.txt" -int OTM_Frame::LoadTemplate(void) +int uMod_Frame::LoadTemplate(void) { wxFile file; if (!file.Access(SAVE_FILE, wxFile::read)) {LastError << Language->Error_FileOpen << "\n" << SAVE_FILE; return -1;} @@ -872,7 +881,7 @@ int OTM_Frame::LoadTemplate(void) return 0; } -int OTM_Frame::SaveTemplate(void) +int uMod_Frame::SaveTemplate(void) { wxFile file; file.Open(SAVE_FILE, wxFile::write); @@ -892,11 +901,11 @@ int OTM_Frame::SaveTemplate(void) -void OTM_Frame::InstallHook(void) +void uMod_Frame::InstallHook(void) { if (H_DX9_DLL==NULL) { - H_DX9_DLL = LoadLibraryW(OTM_d3d9_Hook_dll); + H_DX9_DLL = LoadLibraryW(uMod_d3d9_Hook_dll); if (H_DX9_DLL!=NULL) { typedef void (*fkt_typ)(void); @@ -909,7 +918,7 @@ void OTM_Frame::InstallHook(void) FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error_msg, 0, NULL ); wxString temp = Language->Error_DLLNotFound; - temp << "\n" << OTM_d3d9_Hook_dll; + temp << "\n" << uMod_d3d9_Hook_dll; temp << "\n" << error_msg << "Code: " << error; wxMessageBox( temp, "ERROR", wxOK); } @@ -921,14 +930,14 @@ void OTM_Frame::InstallHook(void) FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error_msg, 0, NULL ); wxString temp = Language->Error_DLLNotFound; - temp << "\n" << OTM_d3d9_Hook_dll; + temp << "\n" << uMod_d3d9_Hook_dll; temp << "\n" << error_msg << "Code: " << error; wxMessageBox(temp, "ERROR", wxOK|wxICON_ERROR); } } } -void OTM_Frame::RemoveHook(void) +void uMod_Frame::RemoveHook(void) { if (H_DX9_DLL!=NULL) { diff --git a/OTM_GUI/OTM_GUI.h b/uMod_GUI/uMod_GUI.h similarity index 78% rename from OTM_GUI/OTM_GUI.h rename to uMod_GUI/uMod_GUI.h index 5a9b7fd..24f6db4 100644 --- a/OTM_GUI/OTM_GUI.h +++ b/uMod_GUI/uMod_GUI.h @@ -1,34 +1,34 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_GUI_H_ -#define OTM_GUI_H_ +#ifndef uMod_GUI_H_ +#define uMod_GUI_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" -class OTM_Frame : public wxFrame +class uMod_Frame : public wxFrame { public: - OTM_Frame(const wxString& title, OTM_Settings &set); - ~OTM_Frame(void); + uMod_Frame(const wxString& title, uMod_Settings &set); + ~uMod_Frame(void); @@ -64,7 +64,7 @@ public: private: - OTM_Settings Settings; + uMod_Settings Settings; int KillServer(void); int GetHookedGames( wxArrayString &array); int SetHookedGames( const wxArrayString &array); @@ -72,7 +72,7 @@ private: int GetInjectedGames( wxArrayString &games, wxArrayString &cmd); int SetInjectedGames( wxArrayString &games, wxArrayString &cmd); - OTM_Server *Server; + uMod_Server *Server; wxNotebook *Notebook; @@ -93,7 +93,7 @@ private: int NumberOfGames; int MaxNumberOfGames; - OTM_Client **Clients; + uMod_Client **Clients; int LoadTemplate(void); int SaveTemplate(void); diff --git a/OTM_GUI/OTM_GameInfo.cpp b/uMod_GUI/uMod_GameInfo.cpp similarity index 85% rename from OTM_GUI/OTM_GameInfo.cpp rename to uMod_GUI/uMod_GameInfo.cpp index 863a1a9..7a5699c 100644 --- a/OTM_GUI/OTM_GameInfo.cpp +++ b/uMod_GUI/uMod_GameInfo.cpp @@ -1,28 +1,28 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_GameInfo::OTM_GameInfo(void) +uMod_GameInfo::uMod_GameInfo(void) { Checked = NULL; NumberOfChecked = 0; @@ -31,12 +31,12 @@ OTM_GameInfo::OTM_GameInfo(void) } -OTM_GameInfo::~OTM_GameInfo(void) +uMod_GameInfo::~uMod_GameInfo(void) { if (Checked!=NULL) delete [] Checked; } -void OTM_GameInfo::Init(void) +void uMod_GameInfo::Init(void) { SaveSingleTexture = false; SaveAllTextures = false; @@ -52,7 +52,7 @@ void OTM_GameInfo::Init(void) Files.Empty(); } -int OTM_GameInfo::SaveToFile( const wxString &file_name) +int uMod_GameInfo::SaveToFile( const wxString &file_name) { wxFile file; @@ -115,7 +115,7 @@ int OTM_GameInfo::SaveToFile( const wxString &file_name) } -int OTM_GameInfo::LoadFromFile( const wxString &file_name) +int uMod_GameInfo::LoadFromFile( const wxString &file_name) { Init(); if (file_name.Len()==0) return -1; @@ -261,13 +261,13 @@ int OTM_GameInfo::LoadFromFile( const wxString &file_name) } -int OTM_GameInfo::GetChecked( bool* array, int num) const +int uMod_GameInfo::GetChecked( bool* array, int num) const { for (int i=0; iLengthOfChecked) { @@ -281,29 +281,29 @@ int OTM_GameInfo::SetChecked( bool* array, int num) return 0; } -int OTM_GameInfo::SetSaveSingleTexture(bool val) +int uMod_GameInfo::SetSaveSingleTexture(bool val) { SaveSingleTexture = val; return 0; } -int OTM_GameInfo::SetSaveAllTextures(bool val) +int uMod_GameInfo::SetSaveAllTextures(bool val) { SaveAllTextures = val; return 0; } -void OTM_GameInfo::SetFiles(const wxArrayString &files) +void uMod_GameInfo::SetFiles(const wxArrayString &files) { Files = files; } -void OTM_GameInfo::GetFiles( wxArrayString &files) const +void uMod_GameInfo::GetFiles( wxArrayString &files) const { files = Files; } -OTM_GameInfo& OTM_GameInfo::operator = (const OTM_GameInfo &rhs) +uMod_GameInfo& uMod_GameInfo::operator = (const uMod_GameInfo &rhs) { SaveSingleTexture = rhs.SaveSingleTexture; SaveAllTextures = rhs.SaveAllTextures; diff --git a/OTM_GUI/OTM_GameInfo.h b/uMod_GUI/uMod_GameInfo.h similarity index 80% rename from OTM_GUI/OTM_GameInfo.h rename to uMod_GUI/uMod_GameInfo.h index e32017d..e4bb1b5 100644 --- a/OTM_GUI/OTM_GameInfo.h +++ b/uMod_GUI/uMod_GameInfo.h @@ -1,34 +1,34 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_GAME_H_ -#define OTM_GAME_H_ -#include "OTM_Main.h" +#ifndef uMod_GAME_H_ +#define uMod_GAME_H_ +#include "uMod_Main.h" //this class is intended as a storing object for each game // one should ad an assignment operator, loading and saving default values, ... -class OTM_GameInfo +class uMod_GameInfo { public: - OTM_GameInfo(void); - ~OTM_GameInfo(void); + uMod_GameInfo(void); + ~uMod_GameInfo(void); void Init(void); @@ -73,7 +73,7 @@ public: int SetSavePath(const wxString &path) {SavePath=path; return 0;} wxString GetSavePath(void) const {return SavePath;} - OTM_GameInfo& operator = (const OTM_GameInfo &rhs); + uMod_GameInfo& operator = (const uMod_GameInfo &rhs); private: @@ -98,4 +98,4 @@ private: }; -#endif /* OTM_SERVER_H_ */ +#endif /* uMod_SERVER_H_ */ diff --git a/OTM_GUI/OTM_GamePage.cpp b/uMod_GUI/uMod_GamePage.cpp similarity index 83% rename from OTM_GUI/OTM_GamePage.cpp rename to uMod_GUI/uMod_GamePage.cpp index 7b4ec07..34b330a 100644 --- a/OTM_GUI/OTM_GamePage.cpp +++ b/uMod_GUI/uMod_GamePage.cpp @@ -1,25 +1,25 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_GamePage::OTM_GamePage( wxNotebook *parent, const wxString &exe, const wxString &save, PipeStruct &pipe) +uMod_GamePage::uMod_GamePage( wxNotebook *parent, const wxString &exe, const wxString &save, PipeStruct &pipe) : wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL), Sender(pipe) { ExeName = exe; @@ -110,13 +110,13 @@ OTM_GamePage::OTM_GamePage( wxNotebook *parent, const wxString &exe, const wxStr if (TemplateName.Len()>0) LoadTemplate(TemplateName); } -OTM_GamePage::~OTM_GamePage(void) +uMod_GamePage::~uMod_GamePage(void) { for (int i=0; iTextCtrlSavePath; save_path << path; @@ -136,7 +136,7 @@ int OTM_GamePage::SetSavePath( const wxString &path) } -int OTM_GamePage::AddTexture( const wxString &file_name) +int uMod_GamePage::AddTexture( const wxString &file_name) { if (NumberOfEntry>=MaxNumberOfEntry) { @@ -147,7 +147,7 @@ int OTM_GamePage::AddTexture( const wxString &file_name) if (GetMoreMemory( CheckButtonDelete, MaxNumberOfEntry, MaxNumberOfEntry+1024)) {LastError = Language->Error_Memory; return -1;} MaxNumberOfEntry+=1024; } - OTM_File file( file_name); + uMod_File file( file_name); if (!file.FileSupported()) {LastError << Language->Error_FileNotSupported << "\n" << file_name; return -1;} wxString tool_tip; @@ -162,14 +162,14 @@ int OTM_GamePage::AddTexture( const wxString &file_name) button_txt[0] = 8657; button_txt[1] = 0; CheckButtonUp[NumberOfEntry] = new wxButton( this, ID_Button_Texture+3*NumberOfEntry, button_txt, wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonUp, this, ID_Button_Texture+3*NumberOfEntry); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonUp, this, ID_Button_Texture+3*NumberOfEntry); button_txt[0] = 8659; CheckButtonDown[NumberOfEntry] = new wxButton( this, ID_Button_Texture+3*NumberOfEntry+1, button_txt, wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDown, this, ID_Button_Texture+3*NumberOfEntry+1); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDown, this, ID_Button_Texture+3*NumberOfEntry+1); CheckButtonDelete[NumberOfEntry] = new wxButton( this, ID_Button_Texture+3*NumberOfEntry+2, L"X", wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDelete, this, ID_Button_Texture+3*NumberOfEntry+2); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDelete, this, ID_Button_Texture+3*NumberOfEntry+2); CheckBoxHSizers[NumberOfEntry]->Add( (wxWindow*) CheckBoxes[NumberOfEntry], 1, wxEXPAND, 0); CheckBoxHSizers[NumberOfEntry]->Add( (wxWindow*) CheckButtonUp[NumberOfEntry], 0, wxEXPAND, 0); @@ -185,7 +185,7 @@ int OTM_GamePage::AddTexture( const wxString &file_name) return UpdateGame(); } -int OTM_GamePage::GetSettings(void) +int uMod_GamePage::GetSettings(void) { int key_back = ChoiceKeyBack->GetSelection(); int key_save = ChoiceKeySave->GetSelection(); @@ -233,7 +233,7 @@ int OTM_GamePage::GetSettings(void) return 0; } -int OTM_GamePage::UpdateGame(void) +int uMod_GamePage::UpdateGame(void) { if (int ret = GetSettings()) return ret; @@ -250,7 +250,7 @@ int OTM_GamePage::UpdateGame(void) } -int OTM_GamePage::ReloadGame(void) +int uMod_GamePage::ReloadGame(void) { if (int ret = GetSettings()) return ret; @@ -266,7 +266,7 @@ int OTM_GamePage::ReloadGame(void) return 0; } -int OTM_GamePage::SaveTemplate( const wxString &file_name) +int uMod_GamePage::SaveTemplate( const wxString &file_name) { if (int ret = GetSettings()) return ret; if (int ret = Game.SaveToFile( file_name)) @@ -284,7 +284,7 @@ int OTM_GamePage::SaveTemplate( const wxString &file_name) return 0; } -int OTM_GamePage::LoadTemplate( const wxString &file_name) +int uMod_GamePage::LoadTemplate( const wxString &file_name) { if (Game.LoadFromFile(file_name)) return -1; TemplateName = file_name; @@ -345,9 +345,9 @@ int OTM_GamePage::LoadTemplate( const wxString &file_name) for (int i=new_NumberOfEntry; iDetach( (wxWindow*) CheckBoxes[i]); @@ -375,14 +375,14 @@ int OTM_GamePage::LoadTemplate( const wxString &file_name) button_txt[1] = 0; CheckButtonUp[i] = new wxButton( this, ID_Button_Texture+3*i, button_txt, wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonUp, this, ID_Button_Texture+3*i); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonUp, this, ID_Button_Texture+3*i); button_txt[0] = 8659; CheckButtonDown[i] = new wxButton( this, ID_Button_Texture+3*i+1, button_txt, wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDown, this, ID_Button_Texture+3*i+1); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDown, this, ID_Button_Texture+3*i+1); CheckButtonDelete[i] = new wxButton( this, ID_Button_Texture+3*i+2, L"X", wxDefaultPosition, wxSize(24,24)); - Bind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDelete, this, ID_Button_Texture+3*i+2); + Bind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDelete, this, ID_Button_Texture+3*i+2); CheckBoxHSizers[i]->Add( (wxWindow*) CheckBoxes[i], 1, wxEXPAND, 0); CheckBoxHSizers[i]->Add( (wxWindow*) CheckButtonUp[i], 0, wxEXPAND, 0); @@ -399,7 +399,7 @@ int OTM_GamePage::LoadTemplate( const wxString &file_name) return 0; } -int OTM_GamePage::SetColour( wxTextCtrl** txt, int *colour) +int uMod_GamePage::SetColour( wxTextCtrl** txt, int *colour) { wxString temp; for (int i=0; i<3; i++) @@ -411,7 +411,7 @@ int OTM_GamePage::SetColour( wxTextCtrl** txt, int *colour) return 0; } -int OTM_GamePage::GetColour( wxTextCtrl* txt, int def) +int uMod_GamePage::GetColour( wxTextCtrl* txt, int def) { wxString temp = txt->GetValue(); long colour; @@ -425,7 +425,7 @@ int OTM_GamePage::GetColour( wxTextCtrl* txt, int def) } -void OTM_GamePage::OnButtonUp(wxCommandEvent& event) +void uMod_GamePage::OnButtonUp(wxCommandEvent& event) { int id = (event.GetId() - ID_Button_Texture)/3; if (id <=0 || id>= NumberOfEntry) return; @@ -448,7 +448,7 @@ void OTM_GamePage::OnButtonUp(wxCommandEvent& event) } -void OTM_GamePage::OnButtonDown(wxCommandEvent& event) +void uMod_GamePage::OnButtonDown(wxCommandEvent& event) { int id = (event.GetId() - ID_Button_Texture-1)/3; if (id <0 || id>= NumberOfEntry-1) return; @@ -470,7 +470,7 @@ void OTM_GamePage::OnButtonDown(wxCommandEvent& event) CheckBoxes[id+1]->SetToolTip(cpy_str); } -void OTM_GamePage::OnButtonDelete(wxCommandEvent& event) +void uMod_GamePage::OnButtonDelete(wxCommandEvent& event) { int id = (event.GetId() - ID_Button_Texture-2)/3; if (id <0 || id>= NumberOfEntry) return; @@ -488,9 +488,9 @@ void OTM_GamePage::OnButtonDelete(wxCommandEvent& event) NumberOfEntry--; - Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonUp, this, ID_Button_Texture+3*NumberOfEntry); - Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDown, this, ID_Button_Texture+3*NumberOfEntry+1); - Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &OTM_GamePage::OnButtonDelete, this, ID_Button_Texture+3*NumberOfEntry+2); + Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonUp, this, ID_Button_Texture+3*NumberOfEntry); + Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDown, this, ID_Button_Texture+3*NumberOfEntry+1); + Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &uMod_GamePage::OnButtonDelete, this, ID_Button_Texture+3*NumberOfEntry+2); CheckBoxHSizers[NumberOfEntry]->Detach( (wxWindow*) CheckBoxes[NumberOfEntry]); @@ -508,7 +508,7 @@ void OTM_GamePage::OnButtonDelete(wxCommandEvent& event) } -int OTM_GamePage::UpdateLanguage(void) +int uMod_GamePage::UpdateLanguage(void) { TextKeyBack->SetValue( Language->KeyBack); TextKeySave->SetValue( Language->KeySave); diff --git a/OTM_GUI/OTM_GamePage.h b/uMod_GUI/uMod_GamePage.h similarity index 73% rename from OTM_GUI/OTM_GamePage.h rename to uMod_GUI/uMod_GamePage.h index f1785dc..d1bc27e 100644 --- a/OTM_GUI/OTM_GamePage.h +++ b/uMod_GUI/uMod_GamePage.h @@ -1,33 +1,33 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_GAMEPAGE_H_ -#define OTM_GAMEPAGE_H_ -#include "OTM_Main.h" +#ifndef uMod_GAMEPAGE_H_ +#define uMod_GAMEPAGE_H_ +#include "uMod_Main.h" // this page is opened if a game is started. -class OTM_GamePage : public wxScrolledWindow +class uMod_GamePage : public wxScrolledWindow { public: - OTM_GamePage( wxNotebook *parent, const wxString &exe, const wxString &save, PipeStruct &pipe); - virtual ~OTM_GamePage(void); + uMod_GamePage( wxNotebook *parent, const wxString &exe, const wxString &save, PipeStruct &pipe); + virtual ~uMod_GamePage(void); int AddTexture( const wxString &file_name); @@ -95,13 +95,13 @@ private: wxArrayString Files; - OTM_GameInfo Game; - OTM_GameInfo GameOld; + uMod_GameInfo Game; + uMod_GameInfo GameOld; - OTM_Sender Sender; + uMod_Sender Sender; //DECLARE_EVENT_TABLE(); }; -#endif /* OTM_GAMEPAGE_H_ */ +#endif /* uMod_GAMEPAGE_H_ */ diff --git a/OTM_GUI/OTM_Language.cpp b/uMod_GUI/uMod_Language.cpp similarity index 90% rename from OTM_GUI/OTM_Language.cpp rename to uMod_GUI/uMod_Language.cpp index 283ad84..7fbc7f9 100644 --- a/OTM_GUI/OTM_Language.cpp +++ b/uMod_GUI/uMod_Language.cpp @@ -1,34 +1,34 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_Language *Language = NULL; +uMod_Language *Language = NULL; -OTM_Language::OTM_Language(void) +uMod_Language::uMod_Language(void) { LoadDefault(); LoadKeys(); } -OTM_Language::OTM_Language(const wxString &name) +uMod_Language::uMod_Language(const wxString &name) { LoadLanguage(name); LoadKeys(); @@ -36,13 +36,13 @@ OTM_Language::OTM_Language(const wxString &name) } -int OTM_Language::GetLanguages(wxArrayString &lang) +int uMod_Language::GetLanguages(wxArrayString &lang) { wxArrayString files; wxString dir = wxGetCwd(); dir << "/languages"; - wxDir::GetAllFiles( dir, &files, "OTM_LanguagePack_*.txt"); - wxDir::GetAllFiles( dir, &files, "OTM_LanguagePackU_*.txt"); + wxDir::GetAllFiles( dir, &files, "uMod_LanguagePack_*.txt"); + wxDir::GetAllFiles( dir, &files, "uMod_LanguagePackU_*.txt"); lang.Empty(); lang.Alloc(files.GetCount()+1); lang.Add("English"); @@ -62,7 +62,7 @@ int OTM_Language::GetLanguages(wxArrayString &lang) } -int OTM_Language::GetHelpMessage(wxString &help) +int uMod_Language::GetHelpMessage(wxString &help) { wxString file; file << "README_" << CurrentLanguage << ".txt"; @@ -117,13 +117,13 @@ if ( command == #target ) \ target = msg; \ } else -int OTM_Language::LoadLanguage(const wxString &name) +int uMod_Language::LoadLanguage(const wxString &name) { LoadDefault(); if (name=="English") return 0; wxString file_name; - file_name << "languages/OTM_LanguagePack_" << name << ".txt"; + file_name << "languages/uMod_LanguagePack_" << name << ".txt"; bool utf16=false; wxFile dat; @@ -131,7 +131,7 @@ int OTM_Language::LoadLanguage(const wxString &name) { utf16=true; file_name.Empty(); - file_name << "languages/OTM_LanguagePackU_" << name << ".txt"; + file_name << "languages/uMod_LanguagePackU_" << name << ".txt"; if (!dat.Access(file_name, wxFile::read)){LastError << Error_FileOpen <<"\n" << file_name; return -1;} } dat.Open(file_name, wxFile::read); @@ -222,6 +222,7 @@ int OTM_Language::LoadLanguage(const wxString &name) CheckEntry( command, msg, Error_RemoveHook) CheckEntry( command, msg, Error_FileNotSupported) CheckEntry( command, msg, Error_FktNotFound) + CheckEntry( command, msg, Error_D3DX9NotFound) CheckEntry( command, msg, Error_DLLNotFound) CheckEntry( command, msg, Error_AlreadyRunning) CheckEntry( command, msg, Error_Send) @@ -252,7 +253,7 @@ int OTM_Language::LoadLanguage(const wxString &name) #undef CheckEntry -int OTM_Language::LoadDefault(void) +int uMod_Language::LoadDefault(void) { CurrentLanguage="English"; @@ -261,8 +262,8 @@ int OTM_Language::LoadDefault(void) MenuAbout = "About"; MenuAcknowledgement = "Acknowledgement"; - MenuStartGame = "Start game through OTM"; - MenuStartGameCMD = "Start game through OTM (with command line)"; + MenuStartGame = "Start game through uMod"; + MenuStartGameCMD = "Start game through uMod (with command line)"; MenuUseHook = "Use global hook"; MenuAddGame = "Add game"; @@ -306,6 +307,7 @@ int OTM_Language::LoadDefault(void) Error_RemoveHook = "Removing the Hook while a game is running might lead to crash."; Error_FileNotSupported = "This file type is not supported:\n"; + Error_D3DX9NotFound = "The D3DX9_43.dll (32bit) is not available on your system.\nPlease install the newest DirectX End-User Runtime Installer."; Error_DLLNotFound = "Could not load the dll.\nThe dll injection won't work.\nThis might happen if D3DX9_43.dll (32bit) is not installed on your system.\nPlease install the newest DirectX End-User Runtime Web Installer."; Error_FktNotFound = "Could not load function out of dll.\nThe dll injection won't work."; Error_AlreadyRunning = "An other instance of OpenTexMod is already running."; @@ -341,7 +343,7 @@ int OTM_Language::LoadDefault(void) KeyStrings.Add( name ); \ KeyValues.Add( key ); \ } -int OTM_Language::LoadKeys(void) +int uMod_Language::LoadKeys(void) { KeyStrings.Empty(); KeyValues.Empty(); diff --git a/OTM_GUI/OTM_Language.h b/uMod_GUI/uMod_Language.h similarity index 79% rename from OTM_GUI/OTM_Language.h rename to uMod_GUI/uMod_Language.h index 420052e..3967d49 100644 --- a/OTM_GUI/OTM_Language.h +++ b/uMod_GUI/uMod_Language.h @@ -1,31 +1,31 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_LANGUAGE_H_ -#define OTM_LANGUAGE_H_ +#ifndef uMod_LANGUAGE_H_ +#define uMod_LANGUAGE_H_ -class OTM_Language +class uMod_Language { public: - OTM_Language(void); - OTM_Language(const wxString &name); + uMod_Language(void); + uMod_Language(const wxString &name); int LoadLanguage(const wxString &name); @@ -82,6 +82,7 @@ public: wxString Error_FileNotSupported; wxString Error_FktNotFound; + wxString Error_D3DX9NotFound; wxString Error_DLLNotFound; wxString Error_AlreadyRunning; @@ -121,7 +122,7 @@ private: }; -extern OTM_Language *Language; +extern uMod_Language *Language; -#endif /* OTM_LANGUAGE_H_ */ +#endif /* uMod_LANGUAGE_H_ */ diff --git a/OTM_GUI/OTM_Main.h b/uMod_GUI/uMod_Main.h similarity index 73% rename from OTM_GUI/OTM_Main.h rename to uMod_GUI/uMod_Main.h index 203d4cd..9a15bfe 100644 --- a/OTM_GUI/OTM_Main.h +++ b/uMod_GUI/uMod_Main.h @@ -1,25 +1,25 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_MAIN_H_ -#define OTM_MAIN_H_ +#ifndef uMod_MAIN_H_ +#define uMod_MAIN_H_ // I use eclipse and somehow i need these define or many of the wx classes are unknown to the CDT parser @@ -67,11 +67,11 @@ along with OpenTexMod. If not, see . //#include -#include "../OTM_GlobalDefines.h" -#include "../OTM_Error.h" +#include "../uMod_GlobalDefines.h" +#include "../uMod_Error.h" -class OTM_Frame; +class uMod_Frame; #define MAX_TEXTURES 1024 enum @@ -101,22 +101,22 @@ enum ID_Button_Texture, //this entry must be the last!! }; -#define ABORT_SERVER L"OTM_Abort_Server" -#define OTM_d3d9_Hook_dll L"OTM_d3d9_Hook.dll" -#define OTM_d3d9_DI_dll L"OTM_d3d9_DI.dll" +#define ABORT_SERVER L"uMod_Abort_Server" +#define uMod_d3d9_Hook_dll L"uMod_d3d9_HI.dll" +#define uMod_d3d9_DI_dll L"uMod_d3d9_DI.dll" -#include "OTM_AddTexture.h" -#include "OTM_Settings.h" -#include "OTM_Language.h" -#include "OTM_Event.h" -#include "OTM_Client.h" -#include "OTM_GameInfo.h" -#include "OTM_File.h" -#include "OTM_Sender.h" -#include "OTM_Server.h" -#include "OTM_GamePage.h" -#include "OTM_DirectInjection.h" -#include "OTM_GUI.h" +#include "uMod_AddTexture.h" +#include "uMod_Settings.h" +#include "uMod_Language.h" +#include "uMod_Event.h" +#include "uMod_Client.h" +#include "uMod_GameInfo.h" +#include "uMod_File.h" +#include "uMod_Sender.h" +#include "uMod_Server.h" +#include "uMod_GamePage.h" +#include "uMod_DirectInjection.h" +#include "uMod_GUI.h" template diff --git a/OTM_GUI/OTM_Sender.cpp b/uMod_GUI/uMod_Sender.cpp similarity index 88% rename from OTM_GUI/OTM_Sender.cpp rename to uMod_GUI/uMod_Sender.cpp index 68c15d4..6c38f5b 100644 --- a/OTM_GUI/OTM_Sender.cpp +++ b/uMod_GUI/uMod_Sender.cpp @@ -1,27 +1,27 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_Sender::OTM_Sender(PipeStruct &pipe) : Pipe(pipe) +uMod_Sender::uMod_Sender(PipeStruct &pipe) : Pipe(pipe) { OldTextures = NULL; OldTexturesNum = 0; @@ -29,13 +29,13 @@ OTM_Sender::OTM_Sender(PipeStruct &pipe) : Pipe(pipe) catch (...) {Buffer=NULL;} } -OTM_Sender::~OTM_Sender(void) +uMod_Sender::~uMod_Sender(void) { if (Buffer!=NULL) delete [] Buffer; } -int OTM_Sender::Send( const OTM_GameInfo &game, const OTM_GameInfo &game_old, bool force, wxArrayString *comments) +int uMod_Sender::Send( const uMod_GameInfo &game, const uMod_GameInfo &game_old, bool force, wxArrayString *comments) { LastError.Empty(); int key = game.GetKeyBack(); @@ -109,7 +109,7 @@ int OTM_Sender::Send( const OTM_GameInfo &game, const OTM_GameInfo &game_old, bo //reload everything for (int i=0; i. +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_SENDER_H_ -#define OTM_SENDER_H_ +#ifndef uMod_SENDER_H_ +#define uMod_SENDER_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" -// an object of this class is owned by each OTM_GamePage object. It act as sender ^^ -class OTM_Sender +// an object of this class is owned by each uMod_GamePage object. It act as sender ^^ +class uMod_Sender { public: - OTM_Sender(PipeStruct &pipe); - ~OTM_Sender(void); + uMod_Sender(PipeStruct &pipe); + ~uMod_Sender(void); - int Send( const OTM_GameInfo &game, const OTM_GameInfo &game_old, bool force=false, wxArrayString *comments=NULL); + int Send( const uMod_GameInfo &game, const uMod_GameInfo &game_old, bool force=false, wxArrayString *comments=NULL); wxString LastError; @@ -60,4 +60,4 @@ private: }; -#endif /* OTM_SENDER_H_ */ +#endif /* uMod_SENDER_H_ */ diff --git a/OTM_GUI/OTM_Server.cpp b/uMod_GUI/uMod_Server.cpp similarity index 81% rename from OTM_GUI/OTM_Server.cpp rename to uMod_GUI/uMod_Server.cpp index 092d1e9..6aacf63 100644 --- a/OTM_GUI/OTM_Server.cpp +++ b/uMod_GUI/uMod_Server.cpp @@ -1,39 +1,38 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ - -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_Server::OTM_Server(OTM_Frame *frame) : wxThread(wxTHREAD_JOINABLE) +uMod_Server::uMod_Server(uMod_Frame *frame) : wxThread(wxTHREAD_JOINABLE) { MainFrame = frame; } -OTM_Server::~OTM_Server(void) +uMod_Server::~uMod_Server(void) { } -void* OTM_Server::Entry(void) +void* uMod_Server::Entry(void) { bool fConnected = false; HANDLE pipe_in; @@ -48,7 +47,7 @@ void* OTM_Server::Entry(void) Beep(600,100); */ pipe_in = CreateNamedPipeW( - PIPE_Game2OTM, // pipe name + PIPE_Game2uMod, // pipe name PIPE_ACCESS_INBOUND, // read access PIPE_TYPE_BYTE | // byte type pipe PIPE_WAIT, // blocking mode @@ -60,7 +59,7 @@ void* OTM_Server::Entry(void) if (pipe_in == INVALID_HANDLE_VALUE) return NULL; pipe_out = CreateNamedPipeW( - PIPE_OTM2Game, // pipe name + PIPE_uMod2Game, // pipe name PIPE_ACCESS_OUTBOUND, // write access PIPE_TYPE_BYTE | // byte type pipe PIPE_WAIT, // blocking mode @@ -111,7 +110,7 @@ void* OTM_Server::Entry(void) true : (GetLastError() == ERROR_PIPE_CONNECTED); if (fConnected) { - OTM_Event event( OTM_EVENT_TYPE, ID_Add_Game); + uMod_Event event( uMod_EVENT_TYPE, ID_Add_Game); event.SetName(name); event.SetPipeIn(pipe_in); event.SetPipeOut(pipe_out); diff --git a/OTM_GUI/OTM_Server.h b/uMod_GUI/uMod_Server.h similarity index 54% rename from OTM_GUI/OTM_Server.h rename to uMod_GUI/uMod_Server.h index a1eb98c..a651d2f 100644 --- a/OTM_GUI/OTM_Server.h +++ b/uMod_GUI/uMod_Server.h @@ -1,45 +1,45 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_SERVER_H_ -#define OTM_SERVER_H_ -#include "OTM_Main.h" +#ifndef uMod_SERVER_H_ +#define uMod_SERVER_H_ +#include "uMod_Main.h" // an object of this class should be created only once // it waits for incomming connections (a starting game) // and if so, it send a message to the mainthread -// Note the server thread can only be killed, if one connect to it and send "OTM_ABORT" as game name -class OTM_Server : public wxThread +// Note the server thread can only be killed, if one connect to it and send "uMod_ABORT" as game name +class uMod_Server : public wxThread { public: - OTM_Server(OTM_Frame *frame); - virtual ~OTM_Server(void); + uMod_Server(uMod_Frame *frame); + virtual ~uMod_Server(void); void* Entry(void); private: - OTM_Frame *MainFrame; + uMod_Frame *MainFrame; }; -#endif /* OTM_SERVER_H_ */ +#endif /* uMod_SERVER_H_ */ diff --git a/OTM_GUI/OTM_Settings.cpp b/uMod_GUI/uMod_Settings.cpp similarity index 81% rename from OTM_GUI/OTM_Settings.cpp rename to uMod_GUI/uMod_Settings.cpp index 0c40b3b..f37a26e 100644 --- a/OTM_GUI/OTM_Settings.cpp +++ b/uMod_GUI/uMod_Settings.cpp @@ -1,37 +1,37 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#include "OTM_Main.h" +#include "uMod_Main.h" -OTM_Settings::OTM_Settings(void) +uMod_Settings::uMod_Settings(void) { XSize = 600; YSize = 400; XPos = -1; YPos = -1; - UseHook = true; + UseHook = false; Language = "English"; } -OTM_Settings::OTM_Settings(OTM_Settings &set) +uMod_Settings::uMod_Settings(uMod_Settings &set) { XSize = set.XSize; YSize = set.YSize; @@ -42,9 +42,9 @@ OTM_Settings::OTM_Settings(OTM_Settings &set) } -#define SETTINGS_FILE "OTM_Settings.txt" +#define SETTINGS_FILE "uMod_Settings.txt" -int OTM_Settings::Load(void) +int uMod_Settings::Load(void) { wxFile file; @@ -121,7 +121,7 @@ int OTM_Settings::Load(void) return 0; } -int OTM_Settings::Save(void) +int uMod_Settings::Save(void) { wxFile file; file.Open(SETTINGS_FILE, wxFile::write); diff --git a/OTM_GUI/OTM_Settings.h b/uMod_GUI/uMod_Settings.h similarity index 51% rename from OTM_GUI/OTM_Settings.h rename to uMod_GUI/uMod_Settings.h index 316d759..caa4080 100644 --- a/OTM_GUI/OTM_Settings.h +++ b/uMod_GUI/uMod_Settings.h @@ -1,33 +1,33 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_SETTINGS_H_ -#define OTM_SETTINGS_H_ +#ifndef uMod_SETTINGS_H_ +#define uMod_SETTINGS_H_ -#include "OTM_Main.h" +#include "uMod_Main.h" -class OTM_Settings +class uMod_Settings { public: - OTM_Settings(void); - OTM_Settings(OTM_Settings &set); + uMod_Settings(void); + uMod_Settings(uMod_Settings &set); int XSize, YSize; @@ -41,4 +41,4 @@ public: }; -#endif /* OTM_SETTINGS_H_ */ +#endif /* uMod_SETTINGS_H_ */ diff --git a/OTM_GUI/unzip.cpp b/uMod_GUI/unzip.cpp similarity index 100% rename from OTM_GUI/unzip.cpp rename to uMod_GUI/unzip.cpp diff --git a/OTM_GUI/unzip.h b/uMod_GUI/unzip.h similarity index 100% rename from OTM_GUI/unzip.h rename to uMod_GUI/unzip.h diff --git a/OTM_GUI/zip.cpp b/uMod_GUI/zip.cpp similarity index 100% rename from OTM_GUI/zip.cpp rename to uMod_GUI/zip.cpp diff --git a/OTM_GUI/zip.h b/uMod_GUI/zip.h similarity index 100% rename from OTM_GUI/zip.h rename to uMod_GUI/zip.h diff --git a/OTM_GlobalDefines.h b/uMod_GlobalDefines.h similarity index 64% rename from OTM_GlobalDefines.h rename to uMod_GlobalDefines.h index cea88c2..909e8ba 100644 --- a/OTM_GlobalDefines.h +++ b/uMod_GlobalDefines.h @@ -1,23 +1,23 @@ /* -This file is part of OpenTexMod. +This file is part of Universal Modding Engine. -OpenTexMod is free software: you can redistribute it and/or modify +Universal Modding Engine is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -OpenTexMod is distributed in the hope that it will be useful, +Universal Modding Engine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with OpenTexMod. If not, see . +along with Universal Modding Engine. If not, see . */ -#ifndef OTM_GlobalDefines_H_ -#define OTM_GlobalDefines_H_ +#ifndef uMod_GlobalDefines_H_ +#define uMod_GlobalDefines_H_ //#define MyTypeHash DWORD64 #define MyTypeHash DWORD32 @@ -39,12 +39,12 @@ typedef struct } PipeStruct; -#define OTM_APP_DX9 L"OTM_DX9.txt" -#define OTM_APP_DIR L"OpenTexMod" -#define OTM_VERSION L"OpenTexMod V 1.0 beta" +#define uMod_APP_DX9 L"uMod_DX9.txt" +#define uMod_APP_DIR L"uMod" +#define uMod_VERSION L"uMod V 1.0 beta" -#define PIPE_OTM2Game L"\\\\.\\pipe\\OTM2Game" -#define PIPE_Game2OTM L"\\\\.\\pipe\\Game2OTM" +#define PIPE_uMod2Game L"\\\\.\\pipe\\uMod2Game" +#define PIPE_Game2uMod L"\\\\.\\pipe\\Game2uMod" #define CONTROL_ADD_TEXTURE 1 #define CONTROL_FORCE_RELOAD_TEXTURE 2