Permalink
Browse files

New Loading screen + Texture Hook bugfix

  • Loading branch information...
1 parent a4bd946 commit 83c660d192e20768103bd826bf4a9ec4ff75ac89 @roby65 roby65 committed Feb 16, 2013
View
@@ -9,3 +9,4 @@ docs
/source/vaultgui/CEGUI/cegui/Makefile.in
/source/vaultgui/CEGUI/cegui/src
/source/vaultgui/CEGUI/cegui/CEGUI.pc.in
+/source/vaultgui/HookedTextures/loading2.dds
@@ -332,7 +332,8 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemory_Hook(LPDIRECT3DDEVICE9 pDevice,
sprintf(tmp,"0x%x D3DXCreateTextureFromFileInMemory %s",_ReturnAddress(),lastTextureLoadedBackup);
SendToLog(tmp);
- TextureHooking::hookTextureIfNecessary((char*)lastTextureLoadedBackup,(char**)&pSrcData,(int*)&SrcDataSize);
+ if(gData.textureHookingDone)
+ TextureHooking::hookTextureIfNecessary((char*)lastTextureLoadedBackup,(char**)&pSrcData,(int*)&SrcDataSize);
HRESULT ret=D3DXCreateTextureFromFileInMemory_Original(pDevice,pSrcData,SrcDataSize,ppTexture);
TextureHooking::registerTexture((char*)lastTextureLoadedBackup,*ppTexture);
Oops, something went wrong.
@@ -3,6 +3,7 @@
#include "common.h"
#include "HookedTextures\Text_Loading.h"
+#include "HookedTextures\Text_Loading_2.h"
#include "TextureHooking.h"
namespace TextureHooking
@@ -13,20 +14,39 @@ namespace TextureHooking
void hookTextureIfNecessary(char* path,char** data,int* size)
{
+ static int textureHookCount=0;
if(!path)
return;
//textures\interface\loading\loading_screen
if(strnicmp(path,"textures\\interface\\loading\\loading_screen",strlen("textures\\interface\\loading\\loading_screen"))==0)
{
- (*data)=(char*)loading_dds;
- (*size)=loading_dds_size;
+ if(textureHookCount%2==1)
+ {
+ (*data)=(char*)loading_dds;
+ (*size)=loading_dds_size;
+ }
+ else
+ {
+ (*data)=(char*)loading2_dds;
+ (*size)=loading2_dds_size;
+ }
SendToLog("Hooked!");
+ textureHookCount++;
}
if(strnicmp(path,"textures\\interface\\loading\\loading_background",strlen("textures\\interface\\loading\\loading_background"))==0)
{
- (*data)=(char*)loading_dds;
- (*size)=loading_dds_size;
+ if(textureHookCount%2==1)
+ {
+ (*data)=(char*)loading_dds;
+ (*size)=loading_dds_size;
+ }
+ else
+ {
+ (*data)=(char*)loading2_dds;
+ (*size)=loading2_dds_size;
+ }
+ textureHookCount++;
SendToLog("Hooked!");
}
Binary file not shown.
@@ -15,6 +15,7 @@ struct globalData
bool disableKeyboardInput;
bool disableMouseInput;
bool gameReady;
+ bool textureHookingDone;
int lastChatTextTick;
};
@@ -109,13 +109,15 @@ BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser
loadTextureJmp=0x089E810;
HookCall((BYTE*)0x87BCA9,(BYTE*)loadTextureHook,5);
SendToLog("Texture Loading Hooked in Fallout 3");
+ gData.textureHookingDone=true;
}
//FNV
if(*((unsigned char*)0xE68BA9)==0xE8)
{
loadTextureJmp=0xAA1070;
HookCall((BYTE*)0xE68BA9,(BYTE*)loadTextureHook,5);
SendToLog("Texture Loading Hooked in Fallout NV");
+ gData.textureHookingDone=true;
}
//HookCall((BYTE*)0x871E28,(BYTE*)playerPointerHook,6);

0 comments on commit 83c660d

Please sign in to comment.