File tree Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Expand file tree Collapse file tree 2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ #include " StdInc.h"
2+ #include " CDirectorySA.h"
3+
4+ DirectoryInfo* CDirectorySA::GetModelEntry (ushort modelId)
5+ {
6+ if (m_nNumEntries <= 0 )
7+ return nullptr ;
8+
9+ DirectoryInfo* entry = m_pEntries + modelId;
10+
11+ if (!entry)
12+ return nullptr ;
13+
14+ return entry;
15+ }
16+
17+ bool CDirectorySA::SetModelStreamingSize (ushort modelId, uint16 size)
18+ {
19+ DirectoryInfo* entry = GetModelEntry (modelId);
20+
21+ if (!entry)
22+ return false ;
23+
24+ if (entry->m_nStreamingSize == size)
25+ return false ;
26+
27+ entry->m_nStreamingSize = size;
28+ return true ;
29+ }
30+
31+
32+ uint16 CDirectorySA::GetModelStreamingSize (ushort modelId)
33+ {
34+ DirectoryInfo* entry = GetModelEntry (modelId);
35+
36+ if (!entry)
37+ return false ;
38+
39+ return entry->m_nStreamingSize ;
40+ }
Original file line number Diff line number Diff line change 1+ #include < SharedUtil.IntTypes.h>
2+
3+ struct DirectoryInfo
4+ {
5+ uint32 m_nOffset;
6+ uint16 m_nStreamingSize;
7+ uint16 m_nSizeInArchive;
8+ char m_szName[24 ];
9+ };
10+
11+ class CDirectorySA
12+ {
13+ public:
14+ DirectoryInfo* GetModelEntry (ushort modelId);
15+ bool SetModelStreamingSize (ushort modelId, uint16 size);
16+ uint16 GetModelStreamingSize (ushort modelId);
17+
18+ private:
19+ DirectoryInfo* m_pEntries{};
20+ uint32 m_nCapacity{};
21+ uint32 m_nNumEntries{};
22+ bool m_bOwnsEntries{};
23+ };
You can’t perform that action at this time.
0 commit comments