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

Method private_readStream

libs/JSystem/J2DGraph/J2DPicture.cpp:154–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void J2DPicture::private_readStream(J2DPane* parent, JSURandomInputStream* input, JKRArchive* archive)
155{
156 J2DScrnBlockHeader header;
157 int headerPosition = input->getPosition();
158 input->read(&header, sizeof(J2DScrnBlockHeader));
159 mBloBlockType = header.mBloBlockType;
160 makePaneStream(parent, input);
161
162 ResTIMG* img;
163 ResTLUT* lut;
164 u32 v1 = 0;
165 u8 v2 = input->readU8();
166
167 img = (ResTIMG*)getPointer(input, 'TIMG', archive);
168 lut = (ResTLUT*)getPointer(input, 'TLUT', archive);
169
170 u8 v3 = input->read8b();
171 v2 -= 3;
172 if (v2 != 0) {
173 v1 = input->read8b();
174 v2--;
175 }
176
177 if (v2 != 0) {
178 input->read8b();
179 v2--;
180 }
181
182 mBlack = TCOLOR_BLACK_U32;
183 mWhite = TCOLOR_WHITE_U32;
184
185 if (v2 != 0) {
186 mBlack = input->readU32();
187 v2--;
188 }
189
190 if (v2 != 0) {
191 mWhite = input->readU32();
192 v2--;
193 }
194
195 setCornerColor(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
196 for (int i = 0; v2 != 0 && i < 4; i++) {
197 mCornerColors[i] = input->readU32();
198 v2--;
199 }
200
201 input->seek(headerPosition + header.mBlockLength, SEEK_SET);
202
203 for (int i = 0; i < 4; i++) {
204 mTextures[i] = nullptr;
205 }
206 mTextureCount = 0;
207 mUsedTextureFlags = 1;
208
209 if (img) {
210 mTextures[0] = new JUTTexture(img);
211 mTextureCount++;

Callers

nothing calls this directly

Calls 7

readU8Method · 0.80
read8bMethod · 0.80
readU32Method · 0.80
seekMethod · 0.80
attachPaletteMethod · 0.80
getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected