Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ def MatchingFor(*versions):
Object(NonMatching, "Kameda/PauseManager.cpp"),
Object(NonMatching, "Kameda/Pause2D.cpp"),
Object(Matching, "Kameda/WipeManager.cpp"),
Object(NonMatching, "Kameda/Fade.cpp"),
Object(Matching, "Kameda/Fade.cpp"),
Object(Matching, "Kameda/K2DPicture.cpp"),
Object(Matching, "Kameda/Scene.cpp"),
Object(Matching, "Kameda/SceneApp.cpp"),
Expand Down
32 changes: 19 additions & 13 deletions include/Kameda/Fade.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
#ifndef _FADE_H
#define _FADE_H

#include <JSystem/JKernel/JKRHeap.h>
#include <JSystem/JUtility/TColor.h>

#include "JSystem/J2D/J2DGrafContext.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/TColor.h"
#include "types.h"

// Considering this is similar to Mario.h, the might be some sort of inheritance going on?

class Fade
{ // Autogenerated
{
public:
Fade(JKRHeap *); // 0x8013b318
void init(); // 0x8013b76c
void draw(int, f32, JUTColor); // 0x8013b770
// Inline/Unused
Fade(JKRHeap *heap); // 0x8013b318
~Fade();

void init(); // 0x8013b76c
void draw(int status, f32 f, JUTColor color); // 0x8013b770

private:
u8 _0[0x34];
}; // class Fade
void *_0; // 0x0

J2DOrthoGraph *mOrthoGraph[4]; // 0x4

struct
{
f32 mWidth; // 0x14
f32 mHeight; // 0x18
} mSizes[4];
};

#endif
#endif // _FADE_H
2 changes: 2 additions & 0 deletions include/Kameda/WipeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class WipeManager
void killWipe(int idx) { mKillFlag[idx] = true; }
void startWipe(int idx) { mMoveFlag[idx] = true; }
void stopWipe(int idx) { mMoveFlag[idx] = false; }
int getScreenCount() const { return mScrnCount; }

static WipeManager *getManager() { return mThis; }

private:
Expand Down
88 changes: 85 additions & 3 deletions src/Kameda/Fade.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,91 @@
#include "Kameda/Fade.h"

Fade::Fade(JKRHeap *) {}
#include "JSystem/JAudio/JASFakeMatch2.h" // For static initializer
#include "JSystem/JUtility/JUTAssert.h"
#include "Kameda/WipeManager.h"
#include "Osako/system.h"

Fade::Fade(JKRHeap *heap)
{
switch (WipeManager::getManager()->getScreenCount())
{
case 1:
mOrthoGraph[0] = new (heap, 0) J2DOrthoGraph(System::get3DVpX(),
System::get3DVpY(),
System::get3DVpW(),
System::get3DVpH(),
-1.0f,
1.0f);
mOrthoGraph[0]->scissor(System::get3DScisX(),
System::get3DScisY(),
System::get3DScisW(),
System::get3DScisH());
mSizes[0].mWidth = System::get3DVpW();
mSizes[0].mHeight = System::get3DVpH();
break;
case 2:
for (u8 i = 0; i < 2; ++i)
{
mOrthoGraph[i] = new (heap, 0) J2DOrthoGraph(System::get3DVpDiv2X(i),
System::get3DVpDiv2Y(i),
System::get3DVpDiv2W(i),
System::get3DVpDiv2H(i),
-1.0f,
1.0f);
mOrthoGraph[i]->scissor(System::get3DScisDiv2X(i),
System::get3DScisDiv2Y(i),
System::get3DScisDiv2W(i),
System::get3DScisDiv2H(i));
mSizes[i].mWidth = System::get3DVpDiv2W(i);
mSizes[i].mHeight = System::get3DVpDiv2H(i);
}
break;
case 3:
case 4:
for (u8 i = 0; i < 4; ++i)
{
mOrthoGraph[i] = new (heap, 0) J2DOrthoGraph(System::get3DVpDiv4X(i),
System::get3DVpDiv4Y(i),
System::get3DVpDiv4W(i),
System::get3DVpDiv4H(i),
-1.0f,
1.0f);
mOrthoGraph[i]->scissor(System::get3DScisDiv4X(i),
System::get3DScisDiv4Y(i),
System::get3DScisDiv4W(i),
System::get3DScisDiv4H(i));
mSizes[i].mWidth = System::get3DVpDiv4W(i);
mSizes[i].mHeight = System::get3DVpDiv4H(i);
}
break;
default:
#line 71
JUT_ASSERT(0);
break;
}

init();
}

void Fade::init() {}

void Fade::draw(int, float, JUTColor) {}
Fade::~Fade()
{
_0 = nullptr;

for (int i = 0; i < 4; ++i)
{
delete mOrthoGraph[i];
mOrthoGraph[i] = nullptr;
}
}

void Fade::draw(int status, f32 f, JUTColor color)
{
#line 113
JUT_MINMAX_ASSERT(0, status, 4);

#include "JSystem/JAudio/JASFakeMatch2.h"
mOrthoGraph[status]->setPort();
mOrthoGraph[status]->setColor(JUTColor(color.r, color.g, color.b, color.a * f));
mOrthoGraph[status]->fillBox(0.0f, 0.0f, mSizes[status].mWidth, mSizes[status].mHeight);
}
Loading