MCPcopy Create free account
hub / github.com/doldecomp/mkdd / private_readStream

Method private_readStream

libs/JSystem/J2DGraph/J2DTextBox.cpp:199–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void J2DTextBox::private_readStream(J2DPane* parent, JSURandomInputStream* input, JKRArchive* archive)
200{
201 int initialPosition = input->getPosition();
202
203 J2DScrnBlockHeader header;
204 input->read(&header, sizeof(header));
205 mBloBlockType = header.mBloBlockType;
206
207 makePaneStream(parent, input);
208 u8 bytesRemaining = input->read8b();
209
210 ResFONT* resFont = (ResFONT*)getPointer(input, 'FONT', archive);
211
212 if (resFont) {
213 mFont = new JUTResFont(resFont, nullptr);
214 }
215
216 mCharColor.set(input->readU32());
217 mGradientColor.set(input->readU32());
218 mFlags = input->read8b();
219 mCharSpacing = input->readS16();
220 mLineSpacing = input->readS16();
221 mFontSize.x = input->read16b();
222 mFontSize.y = input->read16b();
223
224 s16 strLength = input->read16b();
225 mStringPtr = new char[strLength + 1];
226 if (mStringPtr != nullptr) {
227 input->read(mStringPtr, strLength);
228 mStringPtr[strLength] = '\0';
229 mStringLength = strLength + 1;
230 } else {
231 input->skip(strLength);
232 mStringLength = 0;
233 }
234
235 bytesRemaining -= 10;
236 if (bytesRemaining != 0) {
237 if (input->read8b() != 0) {
238 setConnectParent(true);
239 }
240 bytesRemaining--;
241 }
242
243 mBlack = 0;
244 mWhite = 0xFFFFFFFF;
245
246 if (bytesRemaining != 0) {
247 mBlack.set(input->read32b());
248 bytesRemaining--;
249 }
250
251 if (bytesRemaining != 0) {
252 mWhite.set(input->read32b());
253 bytesRemaining--;
254 }
255
256 mOffsetX = 0.0f;

Callers

nothing calls this directly

Calls 10

read8bMethod · 0.80
readU32Method · 0.80
readS16Method · 0.80
read16bMethod · 0.80
skipMethod · 0.80
read32bMethod · 0.80
seekMethod · 0.80
getPositionMethod · 0.45
readMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected