-
-
Notifications
You must be signed in to change notification settings - Fork 502
Make engineRestreamWorld more aggressive #3685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
botder
merged 7 commits into
multitheftauto:master
from
TheNormalnij:TheNormalnij/aggresive_restream
Dec 30, 2024
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5dd0aa0
Make engineRestreamWorld more aggressive
TheNormalnij f40b69f
Merge remote-tracking branch 'mta_main/master' into TheNormalnij/aggr…
TheNormalnij c171223
small fix
TheNormalnij 55b65f1
Merge branch 'master' into TheNormalnij/aggresive_restream
TheNormalnij 58247b8
Extract TXD pool class
TheNormalnij a4d7aac
Better checks
TheNormalnij 516d81f
Merge branch 'master' into TheNormalnij/aggresive_restream
TheNormalnij File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /***************************************************************************** | ||
| * | ||
| * PROJECT: Multi Theft Auto | ||
| * LICENSE: See LICENSE in the top level directory | ||
| * | ||
| * Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
| * | ||
| *****************************************************************************/ | ||
|
|
||
| #include "StdInc.h" | ||
| #include "CTxdPoolSA.h" | ||
| #include "CGameSA.h" | ||
| #include "CKeyGenSA.h" | ||
|
|
||
| extern CGameSA* pGame; | ||
|
|
||
| CTxdPoolSA::CTxdPoolSA() | ||
| { | ||
| m_ppTxdPoolInterface = (CPoolSAInterface<CTextureDictonarySAInterface>**)0xC8800C; | ||
| } | ||
|
|
||
| std::uint32_t CTxdPoolSA::AllocateTextureDictonarySlot(std::uint32_t uiSlotId, std::string& strTxdName) | ||
| { | ||
| CTextureDictonarySAInterface* pTxd = (*m_ppTxdPoolInterface)->AllocateAt(uiSlotId); | ||
| if (!pTxd) | ||
| return -1; | ||
|
|
||
| strTxdName.resize(24); | ||
|
|
||
| pTxd->usUsagesCount = 0; | ||
| pTxd->hash = pGame->GetKeyGen()->GetUppercaseKey(strTxdName.c_str()); | ||
| pTxd->rwTexDictonary = nullptr; | ||
| pTxd->usParentIndex = -1; | ||
|
|
||
| return (*m_ppTxdPoolInterface)->GetObjectIndex(pTxd); | ||
| } | ||
|
|
||
| void CTxdPoolSA::RemoveTextureDictonarySlot(std::uint32_t uiTxdId) | ||
| { | ||
| if (!(*m_ppTxdPoolInterface)->IsContains(uiTxdId)) | ||
| return; | ||
|
|
||
| typedef std::uint32_t(__cdecl * Function_TxdReleaseSlot)(std::uint32_t uiTxdId); | ||
TheNormalnij marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ((Function_TxdReleaseSlot)(0x731E90))(uiTxdId); | ||
|
|
||
| (*m_ppTxdPoolInterface)->Release(uiTxdId); | ||
| } | ||
|
|
||
| bool CTxdPoolSA::IsFreeTextureDictonarySlot(std::uint32_t uiTxdId) | ||
| { | ||
| return (*m_ppTxdPoolInterface)->IsEmpty(uiTxdId); | ||
| } | ||
|
|
||
| std::uint16_t CTxdPoolSA::GetFreeTextureDictonarySlot() | ||
| { | ||
| return (*m_ppTxdPoolInterface)->GetFreeSlot(); | ||
| } | ||
|
|
||
| std::uint16_t CTxdPoolSA::GetRefsCount(std::uint16_t slot) const | ||
| { | ||
| CTextureDictonarySAInterface* pTxd = (*m_ppTxdPoolInterface)->GetObject(slot); | ||
| if (!pTxd) | ||
| return -1; | ||
|
|
||
| return pTxd->usUsagesCount; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /***************************************************************************** | ||
| * | ||
| * PROJECT: Multi Theft Auto | ||
| * LICENSE: See LICENSE in the top level directory | ||
| * | ||
| * Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
| * | ||
| *****************************************************************************/ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <game/CTxdPool.h> | ||
| #include "CPoolSAInterface.h" | ||
| #include "CBuildingSA.h" | ||
| #include "CTextureDictonarySA.h" | ||
|
|
||
| class CTxdPoolSA final : public CTxdPool | ||
| { | ||
| public: | ||
| CTxdPoolSA(); | ||
| ~CTxdPoolSA() = default; | ||
|
|
||
| std::uint32_t AllocateTextureDictonarySlot(std::uint32_t uiSlotID, std::string& strTxdName); | ||
| void RemoveTextureDictonarySlot(std::uint32_t uiTxdId); | ||
| bool IsFreeTextureDictonarySlot(std::uint32_t uiTxdId); | ||
|
|
||
| std::uint16_t GetFreeTextureDictonarySlot(); | ||
TheNormalnij marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| std::uint16_t GetRefsCount(std::uint16_t slot) const; | ||
|
|
||
| private: | ||
| CPoolSAInterface<CTextureDictonarySAInterface>** m_ppTxdPoolInterface; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /***************************************************************************** | ||
| * | ||
| * PROJECT: Multi Theft Auto | ||
| * LICENSE: See LICENSE in the top level directory | ||
| * | ||
| * Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
| * | ||
| *****************************************************************************/ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "Common.h" | ||
|
|
||
| class CTxdPool | ||
| { | ||
| public: | ||
| virtual std::uint32_t AllocateTextureDictonarySlot(std::uint32_t uiSlotID, std::string& strTxdName) = 0; | ||
| virtual void RemoveTextureDictonarySlot(std::uint32_t uiTxdID) = 0; | ||
| virtual bool IsFreeTextureDictonarySlot(std::uint32_t uiTxdID) = 0; | ||
|
|
||
| virtual std::uint16_t GetFreeTextureDictonarySlot() = 0; | ||
| virtual std::uint16_t GetRefsCount(std::uint16_t slot) const = 0; | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.