-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
2 changed files
with
63 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "StdInc.h" | ||
#include "CDirectorySA.h" | ||
|
||
DirectoryInfo* CDirectorySA::GetModelEntry(ushort modelId) | ||
{ | ||
if (m_nNumEntries <= 0) | ||
return nullptr; | ||
|
||
DirectoryInfo* entry = m_pEntries + modelId; | ||
|
||
if (!entry) | ||
return nullptr; | ||
|
||
return entry; | ||
} | ||
|
||
bool CDirectorySA::SetModelStreamingSize(ushort modelId, uint16 size) | ||
{ | ||
DirectoryInfo* entry = GetModelEntry(modelId); | ||
|
||
if (!entry) | ||
return false; | ||
|
||
if (entry->m_nStreamingSize == size) | ||
return false; | ||
|
||
entry->m_nStreamingSize = size; | ||
return true; | ||
} | ||
|
||
|
||
uint16 CDirectorySA::GetModelStreamingSize(ushort modelId) | ||
{ | ||
DirectoryInfo* entry = GetModelEntry(modelId); | ||
|
||
if (!entry) | ||
return false; | ||
|
||
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,23 @@ | ||
#include <SharedUtil.IntTypes.h> | ||
|
||
struct DirectoryInfo | ||
{ | ||
uint32 m_nOffset; | ||
uint16 m_nStreamingSize; | ||
uint16 m_nSizeInArchive; | ||
char m_szName[24]; | ||
}; | ||
|
||
class CDirectorySA | ||
{ | ||
public: | ||
DirectoryInfo* GetModelEntry(ushort modelId); | ||
bool SetModelStreamingSize(ushort modelId, uint16 size); | ||
uint16 GetModelStreamingSize(ushort modelId); | ||
|
||
private: | ||
DirectoryInfo* m_pEntries{}; | ||
uint32 m_nCapacity{}; | ||
uint32 m_nNumEntries{}; | ||
bool m_bOwnsEntries{}; | ||
}; |