#include <PTRB.h>
Definition at line 53 of file PTRB.h.
◆ PTRBSections()
Definition at line 286 of file PTRB.h.
287 : m_eEndianess( a_eEndianess )
288 {}
◆ ~PTRBSections()
PTRBSections::~PTRBSections |
( |
| ) |
|
|
inline |
◆ begin()
Definition at line 329 of file PTRB.h.
329{ return m_Stacks.begin(); }
◆ CreateStream() [1/2]
Definition at line 1010 of file PTRB.h.
1011{
1012 PTRBSections::MemoryStream* stack = new PTRBSections::MemoryStream( m_Stacks.size(), m_eEndianess );
1013 m_Stacks.push_back( stack );
1014 return stack;
1015}
◆ CreateStream() [2/2]
Definition at line 1017 of file PTRB.h.
1018{
1019 PTRBSections::MemoryStream* stack = new PTRBSections::MemoryStream( *pStream );
1020 stack->
SetIndex( m_Stacks.size() );
1021 m_Stacks.push_back( stack );
1022 return stack;
1023}
TUINT32 SetIndex(TUINT32 index)
◆ DeleteStack()
Definition at line 1025 of file PTRB.h.
1026{
1027 auto result = std::find( m_Stacks.begin(), m_Stacks.end(), pStream );
1028
1029 if ( result != m_Stacks.end() )
1030 {
1032
1033 m_Stacks.erase( result );
1034 delete pStream;
1035
1036
1038 for ( auto it = m_Stacks.begin(); it != m_Stacks.end(); it++ )
1039 {
1040 auto stack = *it;
1042 }
1043
1045 }
1046 else
1047 {
1049 }
1050}
void UpdateSymbolsIndexes(PTRBSections::MemoryStream *pStream, TUINT32 newIndex)
void RemoveAllWithStackIndex(TINT stackIndex)
◆ end()
Definition at line 330 of file PTRB.h.
330{ return m_Stacks.end(); }
◆ GetStack()
Definition at line 1052 of file PTRB.h.
1053{
1055 return m_Stacks[ index ];
1056}
TUINT GetStackCount() const
◆ GetStackCount()
TUINT PTRBSections::GetStackCount |
( |
| ) |
const |
|
inline |
Definition at line 304 of file PTRB.h.
305 {
306 return m_Stacks.size();
307 }
◆ Read()
Definition at line 1103 of file PTRB.h.
1104{
1105 m_eEndianess = eEndianess;
1106
1107 for ( auto stack : m_Stacks )
1108 {
1109 TUINT expectedSize = stack->GetExpectedSize();
1110
1111 if ( expectedSize > 0 )
1112 {
1113 stack->GrowBuffer( expectedSize );
1114
1115 if ( compressed )
1116 {
1117 Toshi::TCompress::ms_bIsBigEndian = ( eEndianess ==
Endianess_Big );
1118 ttsfi.ReadCompressed( stack->GetBuffer(), expectedSize );
1119 }
1120 else
1121 {
1122 ttsfi.ReadRaw( stack->GetBuffer(), expectedSize );
1123 }
1124
1125 stack->Seek( expectedSize );
1126 stack->SetExpectedSize( 0 );
1127 }
1128 }
1129}
◆ Reset()
void PTRBSections::Reset |
( |
| ) |
|
|
inline |
Definition at line 295 of file PTRB.h.
296 {
297 for ( auto stack : m_Stacks )
298 delete stack;
299
300 m_Stacks.clear();
302 }
◆ SetEndianess()
Definition at line 309 of file PTRB.h.
310 {
311 if ( m_Stacks.size() == 0 )
312 {
313 m_eEndianess = a_eEndianess;
315 }
316
318 }
◆ Write()
void PTRBSections::Write |
( |
Toshi::TTSFO & | ttsfo, |
|
|
TBOOL | compress ) |
|
inline |
Definition at line 1058 of file PTRB.h.
1059{
1061 TUINT count = m_Stacks.size();
1062
1063 if ( compress )
1064 {
1065 if ( count > 1 )
1066 {
1067 TTRACE(
"Compressing progress: 0%\n" );
1068 }
1069 else
1070 {
1071 TTRACE(
"Started BTEC compression...\n" );
1072 }
1073 }
1074
1075 for ( auto stack : m_Stacks )
1076 {
1077 stack->Unlink();
1078
1079 if ( compress )
1080 {
1081 ttsfo.WriteCompressed( stack->GetBuffer(), stack->GetUsedSize() );
1082 ready += 1;
1083
1084 if ( count > 1 )
1085 {
1086 TTRACE(
"Compressing progress: %.1f\n", (
double)ready / count * 100 );
1087 }
1088 else
1089 {
1090 TTRACE(
"BTEC compression completed...\n" );
1091 }
1092 }
1093 else
1094 {
1095 ttsfo.WriteRaw( stack->GetBuffer(), stack->GetUsedSize() );
1096 }
1097
1098 ttsfo.WriteAlignmentPad();
1099 stack->Link();
1100 }
1101}
The documentation for this class was generated from the following file:
- D:/_dev/OpenBarnyard/Source/Toshi/Source/Plugins/PTRB.h