Skip to content

Commit 6ef9445

Browse files
committed
Draw the title screen text and file select text under everything else
This is mainly done to prevent them from being drawn on top of other future text thats also drawn on the 2D layer.
1 parent 7ee99dd commit 6ef9445

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

ttyd-tools/rel/include/draw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace mod {
77
void drawFunctionOnDebugLayer(void (*func)());
88
void drawFunctionOnDebugLayerWithOrder(void (*func)(), float order);
99
void drawFunctionOn2DLayer(void (*func)());
10+
void drawFunctionOn2DLayerWithOrder(void (*func)(), float order);
1011

1112
void drawMenuWindow();
1213

ttyd-tools/rel/source/draw.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ void drawFunctionOn2DLayer(void (*func)())
7979
}, reinterpret_cast<void *>(func));
8080
}
8181

82+
void drawFunctionOn2DLayerWithOrder(void (*func)(), float order)
83+
{
84+
ttyd::dispdrv::dispEntry(ttyd::dispdrv::CameraId::k2d, 2, order,
85+
[](ttyd::dispdrv::CameraId cameraId, void *user)
86+
{
87+
reinterpret_cast<void (*)()>(user)();
88+
}, reinterpret_cast<void *>(func));
89+
}
90+
8291
void drawMenuWindow()
8392
{
8493
uint32_t color = 0x000000F4;

ttyd-tools/rel/source/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void displayTitleScreenAndFileSelectScreenInfo()
266266
{
267267
// Curtain is not fully displayed
268268
// Draw the title screen info
269-
drawFunctionOn2DLayer(drawTitleScreenInfo);
269+
drawFunctionOn2DLayerWithOrder(drawTitleScreenInfo, -1.f);
270270
}
271271
}
272272
else if (checkForSpecificSeq(ttyd::seqdrv::SeqIndex::kLoad))
@@ -277,7 +277,7 @@ void displayTitleScreenAndFileSelectScreenInfo()
277277
if (SeqMainCheck == 2)
278278
{
279279
// Draw the file select screen info
280-
drawFunctionOn2DLayer(drawFileSelectScreenInfo);
280+
drawFunctionOn2DLayerWithOrder(drawFileSelectScreenInfo, -1.f);
281281
}
282282
}
283283
}

0 commit comments

Comments
 (0)