MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / headerLoad

Method headerLoad

Source/PC/Resource_PC_CD.cpp:112–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool cResource_PC_CD::headerLoad() {
113 const uint8* Data = mData->data();
114
115 if(!Data)
116 return false;
117
118 uint16 ptrEnd = readLE<uint16>( Data );
119
120 mFiles.clear();
121
122 for( uint16 ptr = 4; ptr != ptrEnd; ) {
123 std::string filename = std::string( (char*) &Data[ptr+1], Data[ptr] );
124 ++ptr;
125
126 std::transform( filename.begin(), filename.end(), filename.begin(), ::tolower );
127
128 cResource_File File( filename, 0, 0 );
129
130 ptr += (uint16) File.mName.size();
131
132 // Start address and size
133 File.mAddressStart = readLE<uint32>( &Data[ptr] );
134
135 File.mSize = readLE<uint32>( &Data[ptr + 4] );
136
137 ptr += 8;
138
139 mFiles.push_back( File );
140 }
141
142 return true;
143}
144
145void cResource_PC_CD::ExtractFiles() {
146

Callers

nothing calls this directly

Calls 5

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected