File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed
mods/deathmatch/logic/luadefs Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,11 @@ void CStreamingSA::ReinitStreaming()
153
153
reinitStreaming ();
154
154
}
155
155
156
+ void CStreamingSA::MakeSpaceFor (std::uint32_t memoryToCleanInBytes)
157
+ {
158
+ (reinterpret_cast <void (__cdecl*)(std::uint32_t )>(0x40E120 ))(memoryToCleanInBytes);
159
+ }
160
+
156
161
std::uint32_t CStreamingSA::GetMemoryUsed () const
157
162
{
158
163
return *reinterpret_cast <std::uint32_t *>(0x8E4CB4 );
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class CStreamingSA : public CStreaming
29
29
void RequestSpecialModel (DWORD model, const char * szTexture, DWORD channel);
30
30
void ReinitStreaming ();
31
31
CStreamingInfo* GetStreamingInfoFromModelId (uint32 id);
32
+ void MakeSpaceFor (std::uint32_t memoryToCleanInBytes) override ;
32
33
std::uint32_t GetMemoryUsed () const override ;
33
34
34
35
private:
Original file line number Diff line number Diff line change 12
12
#include " StdInc.h"
13
13
#include < lua/CLuaFunctionParser.h>
14
14
15
+ void EngineStreamingFreeUpMemory (std::uint32_t bytes)
16
+ {
17
+ g_pGame->GetStreaming ()->MakeSpaceFor (bytes);
18
+ }
19
+
15
20
std::uint32_t EngineStreamingGetUsedMemory ()
16
21
{
17
22
return g_pGame->GetStreaming ()->GetMemoryUsed ();
@@ -56,7 +61,7 @@ void CLuaEngineDefs::LoadFunctions()
56
61
{" engineGetObjectGroupPhysicalProperty" , EngineGetObjectGroupPhysicalProperty},
57
62
{" engineRestoreObjectGroupPhysicalProperties" , EngineRestoreObjectGroupPhysicalProperties},
58
63
{" engineRestreamWorld" , ArgumentParser<EngineRestreamWorld>},
59
-
64
+ { " engineStreamingFreeUpMemory " , ArgumentParser<EngineStreamingFreeUpMemory>},
60
65
{" engineStreamingGetUsedMemory" , ArgumentParser<EngineStreamingGetUsedMemory>},
61
66
62
67
// CLuaCFunctions::AddFunction ( "engineReplaceMatchingAtomics", EngineReplaceMatchingAtomics );
Original file line number Diff line number Diff line change @@ -48,5 +48,6 @@ class CStreaming
48
48
virtual void RequestSpecialModel (DWORD model, const char * szTexture, DWORD channel) = 0;
49
49
virtual CStreamingInfo* GetStreamingInfoFromModelId (uint32 id) = 0;
50
50
virtual void ReinitStreaming () = 0;
51
+ virtual void MakeSpaceFor (std::uint32_t memoryToCleanInBytes) = 0;
51
52
virtual std::uint32_t GetMemoryUsed () const = 0;
52
53
};
You can’t perform that action at this time.
0 commit comments