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
20 changes: 20 additions & 0 deletions include/System/GCLogoDir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <JSystem/JDrama/JDRDirector.hpp>
#include <JSystem/JDrama/JDRViewObj.hpp>
#include <System/FlagManager.hpp>

namespace JDrama {
class TDisplay;
Expand All @@ -12,14 +13,33 @@ class TMarioGamePad;
class JUTTexture;
class TProgSelect;

#ifdef VERSION_GMSP01_NX
JUTRect toWideScreen(s32 x1, s32 y1, s32 x2, s32 y2);
#endif

class TNintendo2D : public JDrama::TViewObj {
public:
TNintendo2D(JUTTexture* tex, const char* name = "Nintendo2D")
: JDrama::TViewObj(name)
, mLogoTex(tex)
#ifdef VERSION_GMSP01_NX
, mRect(toWideScreen(133, 170, 509, 274))
#else
, mRect(133, 170, 509, 274)
#endif
#if defined(VERSION_GMSJ01) || defined(VERSION_GMSJ01_01)
, mColor(0, 70, 255, 255)
#elif !defined(VERSION_GMSP01_NX)
, mColor(220, 0, 0, 255)
#endif
{
#ifdef VERSION_GMSP01_NX
if (TFlagManager::getInstance()->getFlag(MSF_LANGUAGE) == 5) {
mColor = JUtility::TColor(0, 70, 255, 255);
} else {
mColor = JUtility::TColor(220, 0, 0, 255);
}
#endif
}

virtual void perform(u32 cue, JDrama::TGraphics* graphics);
Expand Down
24 changes: 24 additions & 0 deletions src/System/GCLogoDir.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "JSystem/JUtility/JUTRect.hpp"
#include <System/GCLogoDir.hpp>
#include <dolphin/vi.h>
#include <JSystem/JKernel/JKRFileLoader.hpp>
Expand Down Expand Up @@ -77,6 +78,27 @@ TGCLogoDir::TGCLogoDir()
mBHoldTimer = 0;
}

#ifdef VERSION_GMSP01_NX
inline JUTRect toWideScreen(s32 in_x1, s32 in_y1, s32 in_x2, s32 in_y2)
{
f32 x1 = in_x1;
f32 y1 = in_y1;
f32 x2 = in_x2;
f32 y2 = in_y2;

f32 centerX = (x1 + x2) * 0.5f;
f32 centerY = (y1 + y2) * 0.5f;

f32 posX1 = 0.8035714f * ((x1 - centerX) / 1.13f);
f32 posY1 = 0.8035714f * (y1 - centerY);
f32 posX2 = 0.8035714f * ((x2 - centerX) / 1.13f);
f32 posY2 = 0.8035714f * (y2 - centerY);

return JUTRect(0.5f + posX1 + centerX, 0.5f + posY1 + centerY,
0.5f + posX2 + centerX, 0.5f + posY2 + centerY);
}
#endif

void TGCLogoDir::setup(JDrama::TDisplay* param_1, TMarioGamePad* param_2)
{
unk14 = new JDrama::TDStageGroup(param_1);
Expand Down Expand Up @@ -162,6 +184,7 @@ int TGCLogoDir::direct()
switch (mOverallState) {
case OVERALL_STATE_NLOGO:
if (direct_nlogo()) {
#ifndef VERSION_GMSP01_NX
if (mGamePad->isSomethingPushed()) {
desiredAppState = TApplication::APP_STATE_DONE;
break;
Expand All @@ -172,6 +195,7 @@ int TGCLogoDir::direct()
mLogoView->mRect = JUTRect(254, 201, 404, 271);
mLogoView->mColor = JUtility::TColor(255, 255, 255, 255);
SMSGetApplication()->getFader()->startWipe(14, 0.4f, 0.0f);
#endif
nextState = OVERALL_STATE_DOLBY;
}
break;
Expand Down
Loading