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

Method private_readStream

libs/JSystem/J2DGraph/J2DWindow.cpp:141–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void J2DWindow::private_readStream(J2DPane* parent, JSURandomInputStream* input, JKRArchive* arc)
142{
143 int startPos = input->getPosition();
144 u32 startData[2];
145 input->read(startData, 8);
146 mBloBlockType = startData[0];
147 makePaneStream(parent, input);
148 JUTResReference resRef;
149 u8 counter = input->readU8();
150 f32 x0 = input->read16b();
151 f32 y0 = input->read16b();
152 f32 x1 = x0 + input->read16b();
153 f32 y1 = y0 + input->read16b();
154 mWindowArea.set(x0, y0, x1, y1);
155 ResTIMG* timg = (ResTIMG*)getPointer(input, 'TIMG', arc);
156 if (timg) {
157 mFrameTextureA = new JUTTexture(timg, 0);
158 }
159 timg = (ResTIMG*)getPointer(input, 'TIMG', arc);
160 if (timg) {
161 mFrameTextureB = new JUTTexture(timg, 0);
162 }
163 timg = (ResTIMG*)getPointer(input, 'TIMG', arc);
164 if (timg) {
165 mFrameTextureC = new JUTTexture(timg, 0);
166 }
167 timg = (ResTIMG*)getPointer(input, 'TIMG', arc);
168 if (timg) {
169 mFrameTextureD = new JUTTexture(timg, 0);
170 }
171 ResTLUT* tlut = (ResTLUT*)getPointer(input, 'TLUT', arc);
172 if (tlut) {
173 mPalette = new JUTPalette(GX_TLUT0, tlut);
174 }
175 mWrapFlags = input->read8b();
176 mContentsColorA.set(input->read32b());
177 mContentsColorB.set(input->read32b());
178 mContentsColorC.set(input->read32b());
179 mContentsColorD.set(input->read32b());
180 counter -= 14;
181 mContentsTexture = nullptr;
182 if (counter != 0) {
183 timg = (ResTIMG*)getPointer(input, 'TIMG', arc);
184 if (timg) {
185 mContentsTexture = new JUTTexture(timg, 0);
186 }
187 counter--;
188 }
189 mBlack = JUTColor(0);
190 mWhite = JUTColor(0xFFFFFFFF);
191 if (counter != 0) {
192 mBlack = JUTColor(input->readU32());
193 counter--;
194 }
195 if (counter != 0) {
196 mWhite = JUTColor(input->readU32());
197 }
198 input->seek(startPos + startData[1], SEEK_SET);

Callers

nothing calls this directly

Calls 9

readU8Method · 0.80
read16bMethod · 0.80
read8bMethod · 0.80
read32bMethod · 0.80
readU32Method · 0.80
seekMethod · 0.80
getPositionMethod · 0.45
readMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected