-
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
528 changed files
with
118,486 additions
and
100,201 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,50 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: game_sa/CDirectorySA.cpp | ||
* | ||
* Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
* | ||
*****************************************************************************/ | ||
|
||
#include "StdInc.h" | ||
#include "CDirectorySA.h" | ||
|
||
DirectoryInfoSA* CDirectorySAInterface::GetModelEntry(std::uint16_t modelId) | ||
{ | ||
if (m_nNumEntries <= 0) | ||
return nullptr; | ||
|
||
DirectoryInfoSA* entry = m_pEntries + modelId; | ||
|
||
if (!entry) | ||
return nullptr; | ||
|
||
return entry; | ||
} | ||
|
||
bool CDirectorySAInterface::SetModelStreamingSize(std::uint16_t modelId, std::uint16_t size) | ||
{ | ||
DirectoryInfoSA* entry = GetModelEntry(modelId); | ||
|
||
if (!entry) | ||
return false; | ||
|
||
if (entry->m_nStreamingSize == size) | ||
return false; | ||
|
||
entry->m_nStreamingSize = size; | ||
return true; | ||
} | ||
|
||
|
||
std::uint16_t CDirectorySAInterface::GetModelStreamingSize(std::uint16_t modelId) | ||
{ | ||
DirectoryInfoSA* entry = GetModelEntry(modelId); | ||
|
||
if (!entry) | ||
return 0; | ||
|
||
return entry->m_nStreamingSize; | ||
} |
This file contains 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,33 @@ | ||
/***************************************************************************** | ||
* | ||
* PROJECT: Multi Theft Auto | ||
* LICENSE: See LICENSE in the top level directory | ||
* FILE: game_sa/CDirectorySA.h | ||
* | ||
* Multi Theft Auto is available from https://www.multitheftauto.com/ | ||
* | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
struct DirectoryInfoSA | ||
{ | ||
std::uint32_t m_nOffset; | ||
std::uint16_t m_nStreamingSize; | ||
std::uint16_t m_nSizeInArchive; | ||
char m_szName[24]; | ||
}; | ||
|
||
class CDirectorySAInterface | ||
{ | ||
public: | ||
DirectoryInfoSA* GetModelEntry(std::uint16_t modelId); | ||
bool SetModelStreamingSize(std::uint16_t modelId, std::uint16_t size); | ||
std::uint16_t GetModelStreamingSize(std::uint16_t modelId); | ||
|
||
private: | ||
DirectoryInfoSA* m_pEntries{}; | ||
std::uint32_t m_nCapacity{}; | ||
std::uint32_t m_nNumEntries{}; | ||
bool m_bOwnsEntries{}; | ||
}; |
This file contains 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 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 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 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
Oops, something went wrong.