Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 19, 2024
1 parent fcf6e63 commit 8b50b5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions Plugins/CaptionMod/BaseUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ void CBaseUIProxy::Shutdown(void)
{
ClientVGUI_Shutdown();

//TODO: why???
//if (g_iEngineType != ENGINE_GOLDSRC_HL25)
GameUI_UninstallHooks();

//GameUI.dll and vgui2.dll will be unloaded by engine!CBaseUI::Shutdown
Expand Down
18 changes: 9 additions & 9 deletions Plugins/CaptionMod/ClientVGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ EXPOSE_SINGLE_INTERFACE(NewClientVGUI, IClientVGUI, CLIENTVGUI_INTERFACE_VERSION

HMODULE g_hVGui1 = NULL;

void *vgui_TextImage_paint_orig = NULL;
void **vftable_TextImage = NULL;
void **vftable_Color = NULL;
void * g_vgui_TextImage_paint_orig = NULL;
void ** g_vftable_TextImage = NULL;
void **g_vftable_Color = NULL;

class vgui1_IColor
{
Expand All @@ -273,6 +273,7 @@ class vgui1_Color
public:
vgui1_Color()
{
vftable = g_vftable_Color;
color[0] = 0;
color[1] = 0;
color[2] = 0;
Expand Down Expand Up @@ -349,10 +350,10 @@ void __fastcall vgui_TextImage_paint(vgui1_TextImage *pthis, int, void *panel)
{
qboolean isNonANSI = false;

char *p = pthis->text;
auto p = pthis->text;
while (*p)
{
if (*p < 0 || *p > 127) {
if ((*p) < 0 || (*p) > 127) {
isNonANSI = true;
break;
}
Expand All @@ -363,7 +364,6 @@ void __fastcall vgui_TextImage_paint(vgui1_TextImage *pthis, int, void *panel)
{
vgui1_Color color;
memset(&color, 0, sizeof(color));
color.vftable = vftable_Color;
pthis2->getColor(&color);

int r, g, b, a;
Expand Down Expand Up @@ -423,10 +423,10 @@ void VGUI1_InstallHook(void)

if (g_hVGui1)
{
vftable_TextImage = (void **)GetProcAddress(g_hVGui1, "??_7TextImage@vgui@@6B@");
vftable_Color = (void **)GetProcAddress(g_hVGui1, "??_7Color@vgui@@6B@");
g_vftable_TextImage = (void **)GetProcAddress(g_hVGui1, "??_7TextImage@vgui@@6B@");
g_vftable_Color = (void **)GetProcAddress(g_hVGui1, "??_7Color@vgui@@6B@");

gPrivateFuncs.vgui_TextImage_paint = (decltype(gPrivateFuncs.vgui_TextImage_paint))vftable_TextImage[22];
gPrivateFuncs.vgui_TextImage_paint = (decltype(gPrivateFuncs.vgui_TextImage_paint))g_vftable_TextImage[22];

Install_InlineHook(vgui_TextImage_paint);
}
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Renderer/gl_portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ portal_vbo_t *R_PreparePortalVBO(void *ClientPortalManager, void * ClientPortal,
}
else
{
auto polyItor = VBOCache->SurfaceSet.find(surfIndex);
auto itor = VBOCache->SurfaceSet.find(surfIndex);

if (polyItor == VBOCache->SurfaceSet.end())
if (itor == VBOCache->SurfaceSet.end())
{
VBOCache->SurfaceSet.emplace(surfIndex);

Expand Down

0 comments on commit 8b50b5a

Please sign in to comment.