Skip to content

Commit

Permalink
Fix broken particle texture. (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 6, 2024
1 parent cb8815e commit 2bc0e2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 13 additions & 4 deletions Plugins/Renderer/gl_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6240,7 +6240,6 @@ void R_FillAddress(void)
auto pinst = (cs_insn *)inst;

if (!particletexture &&
g_iEngineType == ENGINE_SVENGINE &&
pinst->id == X86_INS_PUSH &&
pinst->detail->x86.op_count == 1 &&
pinst->detail->x86.operands[0].type == X86_OP_MEM &&
Expand All @@ -6251,8 +6250,8 @@ void R_FillAddress(void)
{
particletexture = (decltype(particletexture))pinst->detail->x86.operands[0].mem.disp;
}
else if (!particletexture &&
g_iEngineType != ENGINE_SVENGINE &&

if (!particletexture &&
pinst->id == X86_INS_MOV &&
pinst->detail->x86.op_count == 2 &&
pinst->detail->x86.operands[0].type == X86_OP_REG &&
Expand All @@ -6262,7 +6261,17 @@ void R_FillAddress(void)
(PUCHAR)pinst->detail->x86.operands[1].mem.disp > (PUCHAR)g_dwEngineDataBase &&
(PUCHAR)pinst->detail->x86.operands[1].mem.disp < (PUCHAR)g_dwEngineDataBase + g_dwEngineDataSize)
{
particletexture = (decltype(particletexture))pinst->detail->x86.operands[1].mem.disp;
//Skip this shit
//.text:101EBCA6 A1 F4 36 32 10 mov eax, ___security_cookie
//.text:101EBCAB 33 C5 xor eax, ebp
if (address[instLen] == 0x33 && address[instLen + 1] == 0xC5)
{

}
else
{
particletexture = (decltype(particletexture))pinst->detail->x86.operands[1].mem.disp;
}
}

if (!active_particles &&
Expand Down
10 changes: 5 additions & 5 deletions Plugins/Renderer/gl_rmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,11 +1608,11 @@ void GL_Init(void)
return;
}

if (!GLEW_VERSION_4_3)
{
g_pMetaHookAPI->SysError("OpenGL 4.3 is not supported!\nRequirement: Nvidia GeForce 400 series and newer / AMD Radeon HD 5000 Series and newer / Intel HD Graphics in Intel Haswell and newer.\n");
return;
}
//if (!GLEW_VERSION_4_3)
//{
//g_pMetaHookAPI->SysError("OpenGL 4.3 is not supported!\nRequirement: Nvidia GeForce 400 series and newer / AMD Radeon HD 5000 Series and newer / Intel HD Graphics in Intel Haswell and newer.\n");
//return;
//}

//No vanilla detail texture support
(*detTexSupported) = false;
Expand Down

0 comments on commit 2bc0e2e

Please sign in to comment.