Skip to content

Commit

Permalink
Fix caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueNightHawk committed Dec 25, 2022
1 parent a8c405e commit 867b616
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cl_dll/StudioModelRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,9 @@ void CStudioModelRenderer::SetupModelExtraData(void)
{
m_pCurretExtraData = &m_ExtraData[m_pRenderModel->name];

if (StudioReadData())
return;

if (m_pCurretExtraData->submodels.size() > 0)
return;

Expand Down Expand Up @@ -2049,6 +2052,8 @@ void CStudioModelRenderer::SetupModelExtraData(void)
}

gEngfuncs.Con_Printf("Done (%d polys, %d edges)\n", facecounter, edgecounter);

StudioWriteData();
}

/*
Expand Down Expand Up @@ -2322,8 +2327,7 @@ void CStudioModelRenderer::StudioWriteData(void)
size_t i;
char szFile[256];

if (!std::filesystem::exists((std::string) "./" + gEngfuncs.pfnGetGameDirectory() + "/models/shadowcache"))
std::filesystem::create_directory((std::string) "./" + gEngfuncs.pfnGetGameDirectory() + "/models/shadowcache");
// std::filesystem::create_directory((std::string) "./" + gEngfuncs.pfnGetGameDirectory() + "/models/shadowcache");

std::string filename(m_pRenderModel->name);
sprintf(szFile, "%s/%s/%s.dat", gEngfuncs.pfnGetGameDirectory(), "models/shadowcache", filename.substr(0, filename.rfind('.')).c_str() + 7);
Expand Down
2 changes: 1 addition & 1 deletion filecopy.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off

rem Set this path to your mod directory. You can use environment variables to avoid hardcoding the path if your team members have different install locations.
set mod_directory=E:\SteamLibrary\steamapps\common\Half-Life/hlu_sdl3
set mod_directory=E:\SteamLibrary\steamapps\common\Half-Life\hlu_stencilhack

rem Input paths may end with a backslash which will be interpreted as an escape character when passed into robocopy, so this needs to be escaped.
set source=%~1
Expand Down
2 changes: 1 addition & 1 deletion projects/vs2022/hl_cdll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ cmd /c ""$(ProjectDir)..\..\filecopy.bat" "$(OutDir)" "cl_dlls" "$(TargetName).p
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>..\..\utils\vgui\lib\win32_vc6\vgui.lib;wsock32.lib;..\..lib\public\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>..\..\utils\vgui\lib\win32_vc6\vgui.lib;wsock32.lib;..\..\lib\public\SDL2.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<BaseAddress>
</BaseAddress>
<DelayLoadDLLs>
Expand Down

0 comments on commit 867b616

Please sign in to comment.