Skip to content

Commit

Permalink
Implement GuiImpl::MsgRead
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Sep 10, 2024
1 parent 5cb7c63 commit 37c6ddd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ th06::Gui::OnUpdate
th06::Gui::OnDraw
th06::Gui::DrawGameScene
th06::Gui::DrawStageElements
th06::GuiImpl::MsgRead
th06::GameWindow::WindowProc
th06::GameWindow::CreateGameWindow
WinMain
Expand Down
1 change: 0 additions & 1 deletion config/stubbed.csv
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ th06::Gui::ShowSpellcard
th06::Gui::ShowSpellcardBonus
th06::Gui::Vm6SetInterruptTo1
th06::GuiImpl::RunMsg
th06::GuiImpl::MsgRead
th06::GuiImpl::DrawDialogue
th06::Enemy::MathAdd
th06::Enemy::MathSub
Expand Down
39 changes: 38 additions & 1 deletion src/GuiImpl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
#include "GuiImpl.hpp"

#include "AnmManager.hpp"
#include "ZunColor.hpp"

namespace th06
{
};
#pragma optimize("s", on)
void GuiImpl::MsgRead(i32 msgIdx)
{
MsgRawHeader *msgFile;

if (this->msg.msgFile->numEntries <= msgIdx)
{
return;
}
msgFile = this->msg.msgFile;
memset(&this->msg, 0, sizeof(GuiMsgVm));
this->msg.currentMsgIdx = msgIdx;
this->msg.msgFile = msgFile;
this->msg.currentInstr = this->msg.msgFile->entries[msgIdx];
this->msg.dialogueLines[0].anmFileIndex = -1;
this->msg.dialogueLines[1].anmFileIndex = -1;
this->msg.fontSize = 15;
this->msg.textColorsA[0] = COLOR_RGB(COLOR_GUI_1);
this->msg.textColorsA[1] = COLOR_RGB(COLOR_GUI_2);
this->msg.textColorsB[0] = 0;
this->msg.textColorsB[1] = 0;
this->msg.dialogueSkippable = 1;
if (g_GameManager.currentStage == 6 && (msgIdx == 0 || msgIdx == 10))
{
g_AnmManager->LoadAnm(ANM_FILE_EFFECTS, "data/eff06.anm", ANM_OFFSET_EFFECTS);
}
else if (g_GameManager.currentStage == 7 && (msgIdx == 0 || msgIdx == 10))
{
g_AnmManager->LoadAnm(ANM_FILE_EFFECTS, "data/eff07.anm", ANM_OFFSET_EFFECTS);
g_AnmManager->LoadAnm(ANM_FILE_FACE_STAGE_A, "data/face12c.anm", ANM_OFFSET_FACE_STAGE_A);
}
return;
}
#pragma optimize("", on)
}; // namespace th06
2 changes: 1 addition & 1 deletion src/GuiImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct GuiMsgVm
ZunTimer timer;
i32 framesElapsedDuringPause;
AnmVm portraits[2];
AnmVm dialogue_lines[2];
AnmVm dialogueLines[2];
AnmVm introLines[2];
D3DCOLOR textColorsA[4];
D3DCOLOR textColorsB[4];
Expand Down
2 changes: 2 additions & 0 deletions src/ZunColor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#define COLOR_LIGHTYELLOW 0xffffff80
#define COLOR_PALEBLUE 0xffc0b0ff
#define COLOR_NEONBLUE 0xff4040ff
#define COLOR_GUI_1 0xffe8f0ff
#define COLOR_GUI_2 0xffffe8f0

#define COLOR_RGB_MASK 0x00FFFFFF
#define COLOR_ALPHA_MASK 0xFF000000
Expand Down

0 comments on commit 37c6ddd

Please sign in to comment.