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

Method draw

libs/JSystem/J2DGraph/J2DScreen.cpp:250–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void J2DScreen::draw(f32 x, f32 y, const J2DGrafContext* graf)
251{
252 u32 x1, y1, wd, ht;
253 if (mIsScissor) {
254 GXGetScissor(&x1, &y1, &wd, &ht);
255 }
256
257 if (graf) {
258 J2DPane::draw(x, y, graf, mIsScissor, true);
259 } else {
260 J2DOrthoGraph ortho(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
261 ortho.setPort();
262 J2DPane::draw(x, y, &ortho, mIsScissor, true);
263 }
264
265 if (mIsScissor) {
266 GXSetScissor(x1, y1, wd, ht);
267 }
268
269 GXSetNumIndStages(0);
270 for (int i = 0; i < 16; i++) {
271 GXSetTevDirect((GXTevStageID)i);
272 }
273 GXSetNumTevStages(1);
274 GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
275 GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
276 GXSetVtxDesc(GX_VA_TEX0, GX_NONE);
277 GXSetCullMode(GX_CULL_NONE);
278 GXSetNumTexGens(0);
279 GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE);
280 for (int i = 0; i < 4; i++) {
281 GXSetTevSwapModeTable((GXTevSwapSel)i, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
282 }
283}
284
285J2DPane* J2DScreen::search(u64 id) { return (id == 0) ? nullptr : J2DPane::search(id); }
286

Callers

nothing calls this directly

Calls 2

drawFunction · 0.50
setPortMethod · 0.45

Tested by

no test coverage detected