From af26ff5caa7a495c18a23be097c1cd2e75bbde3b Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Mon, 21 Oct 2019 18:50:57 +1100 Subject: [PATCH] tlac: aet drawing funcs --- .../source/plugins/TLAC/Components/Drawing.h | 31 +++++++++++++++++++ .../source/plugins/TLAC/Components/Pause.cpp | 22 +++++++++++++ .../source/plugins/TLAC/Components/Pause.h | 7 +++++ 3 files changed, 60 insertions(+) diff --git a/source-code/source/plugins/TLAC/Components/Drawing.h b/source-code/source/plugins/TLAC/Components/Drawing.h index db93d0b..3bb8301 100644 --- a/source-code/source/plugins/TLAC/Components/Drawing.h +++ b/source-code/source/plugins/TLAC/Components/Drawing.h @@ -239,5 +239,36 @@ namespace TLAC::Components dtParam->fillColour = oldFillColour; } + + struct Point + { + float x; + float y; + }; + + enum createAetFlags : uint32_t + { + CREATEAET_20000 = 0x20000, + }; + + // draw an aet layer (with animation settings) + int createAetLayer(uint32_t drawLayer, createAetFlags flags, char* name, Point* loc, float animationVar1, float animationVar2) + { + return ((int(*)(uint32_t, createAetFlags, char*, Point*, float, float))0x14013c020)(drawLayer, flags, name, loc, animationVar1, animationVar2); + } + // draw an aet layer (with default animation) + int createAetLayer(uint32_t drawLayer, createAetFlags flags, char* name, Point* loc) + { + return createAetLayer(drawLayer, flags, name, loc, -1, -1); + } + + void destroyAetLayer(int &layer) + { + if (layer != 0) + { + ((void(*)(int layer))0x14019d570)(layer); + layer = 0; + } + } #pragma pack(pop) } \ No newline at end of file diff --git a/source-code/source/plugins/TLAC/Components/Pause.cpp b/source-code/source/plugins/TLAC/Components/Pause.cpp index cfe0d20..f69d292 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.cpp +++ b/source-code/source/plugins/TLAC/Components/Pause.cpp @@ -190,6 +190,13 @@ namespace TLAC::Components *playstate = streamPlayStates[i]; } + /* + destroyAetLayer(triangleAet); + destroyAetLayer(squareAet); + destroyAetLayer(crossAet); + destroyAetLayer(circleAet); + */ + isPaused = false; } @@ -317,6 +324,21 @@ namespace TLAC::Components drawTextW(&dtParams, (drawTextFlags)(DRAWTEXT_ENABLE_LAYOUT), L"○"); dtParams.colour = 0xffffffff; drawTextW(&dtParams, (drawTextFlags)(DRAWTEXT_ENABLE_LAYOUT), L":Select"); + + /* + destroyAetLayer(triangleAet); + destroyAetLayer(squareAet); + destroyAetLayer(crossAet); + destroyAetLayer(circleAet); + Point spriteLoc = { 64, 64 }; + triangleAet = createAetLayer(0x19, CREATEAET_20000, "button_sankaku", &spriteLoc, 0, 1); + spriteLoc.x += 64; + squareAet = createAetLayer(0x19, CREATEAET_20000, "button_shikaku", &spriteLoc, 0, 1); + spriteLoc.x += 64; + crossAet = createAetLayer(0x19, CREATEAET_20000, "button_batsu", &spriteLoc, 0, 1); + spriteLoc.x += 64; + circleAet = createAetLayer(0x19, CREATEAET_20000, "button_maru", &spriteLoc, 0, 1); + */ } } diff --git a/source-code/source/plugins/TLAC/Components/Pause.h b/source-code/source/plugins/TLAC/Components/Pause.h index d138192..eb7caaf 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.h +++ b/source-code/source/plugins/TLAC/Components/Pause.h @@ -57,6 +57,13 @@ namespace TLAC::Components static unsigned int mainMenuPos; // syncs to menuPos when menuSet == menuset_main (used for restoring on back) static unsigned int menuSet; + /* + int triangleAet; + int squareAet; + int crossAet; + int circleAet; + */ + static std::chrono::time_point menuItemSelectTime; enum menusets