mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 13:34:52 -04:00
initial commit with working 3D view at all times
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@ message(STATUS "dusk: TP Version: ${DUSK_TP_VERSION}")
|
||||
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${JSYSTEM_DEBUG_FILES} ${REL_FILES})
|
||||
source_group("dusk" FILES ${DUSK_FILES})
|
||||
|
||||
set(GAME_COMPILE_DEFS TARGET_PC AVOID_UB=1 VERSION=0
|
||||
set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT AVOID_UB=1 VERSION=0
|
||||
DUSK_TP_VERSION="${DUSK_TP_VERSION}" DUSK_GAME_NAME="${DUSK_GAME_NAME}" DUSK_GAME_VERSION="${DUSK_GAME_VERSION}")
|
||||
|
||||
set(GAME_INCLUDE_DIRS
|
||||
|
||||
@@ -117,6 +117,13 @@ public:
|
||||
static void setTickRate(u32 rate) { JFWDisplay::getManager()->setTickRate(rate); }
|
||||
static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); }
|
||||
|
||||
#if TARGET_PC
|
||||
static f32 hudAspectScaleDown;
|
||||
static f32 hudAspectScaleUp;
|
||||
static f32 ScaleHUDXLeft(f32 baseX) { return getMinXF() + baseX; }
|
||||
static f32 ScaleHUDXRight(f32 baseX) { return -getMinXF() + baseX; }
|
||||
#endif
|
||||
|
||||
static void setBlureMtx(const Mtx m) {
|
||||
cMtx_copy(m, mBlureMtx);
|
||||
}
|
||||
@@ -266,7 +273,12 @@ public:
|
||||
#if WIDESCREEN_SUPPORT
|
||||
static void setTvSize();
|
||||
|
||||
#if TARGET_PC
|
||||
static void onWide(f32 width, f32 height);
|
||||
#else
|
||||
static void onWide();
|
||||
#endif
|
||||
|
||||
static void offWide();
|
||||
static u8 isWide();
|
||||
|
||||
|
||||
@@ -2555,7 +2555,7 @@ f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f;
|
||||
|
||||
void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
#if TARGET_PC
|
||||
f32 scaleFactor = mDoGph_gInf_c::getWidth() / FB_WIDTH; // TODO: get display pixel density from aurora
|
||||
f32 scaleFactor = mDoGph_gInf_c::getHeight() / FB_HEIGHT;
|
||||
GXSetViewport(0.0f, mViewOffsetY * scaleFactor, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
#else
|
||||
GXSetViewport(0.0f, mViewOffsetY, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
|
||||
@@ -310,7 +310,12 @@ void dMenu_ItemExplain_c::draw(J2DOrthoGraph* i_graph) {
|
||||
mpLabel->scale(g_ringHIO.mItemDescTitleScale, g_ringHIO.mItemDescTitleScale);
|
||||
mpLabel->paneTrans(g_ringHIO.mItemDescTitlePosX, g_ringHIO.mItemDescTitlePosY);
|
||||
if (mpBackTex != NULL) {
|
||||
#if TARGET_PC
|
||||
mpBackTex->draw(mDoGph_gInf_c::ScaleHUDXLeft(0.0f), 0.0f, mDoGph_gInf_c::getWidthF(),
|
||||
FB_HEIGHT, false, false, false);
|
||||
#else
|
||||
mpBackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, false, false, false);
|
||||
#endif
|
||||
}
|
||||
if (field_0xc8 != field_0xd0) {
|
||||
field_0xd0 = field_0xc8;
|
||||
|
||||
@@ -564,7 +564,13 @@ void dMeter2Draw_c::exec(u32 i_status) {
|
||||
{
|
||||
mButtonsPosX = g_drawHIO.mMainHUDButtonsPosX;
|
||||
mButtonsPosY = g_drawHIO.mMainHUDButtonsPosY;
|
||||
|
||||
#if TARGET_PC
|
||||
mpButtonParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX),
|
||||
g_drawHIO.mMainHUDButtonsPosY);
|
||||
#else
|
||||
mpButtonParent->paneTrans(g_drawHIO.mMainHUDButtonsPosX, g_drawHIO.mMainHUDButtonsPosY);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mButtonsScale != g_drawHIO.mMainHUDButtonsScale) {
|
||||
@@ -1476,7 +1482,11 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY)
|
||||
mpBigHeart->scale(g_drawHIO.mBigHeartScale, g_drawHIO.mBigHeartScale);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mpLifeParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(i_posX), i_posY);
|
||||
#else
|
||||
mpLifeParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaLifeChange(bool param_0) {
|
||||
@@ -1589,7 +1599,14 @@ void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) {
|
||||
mpMagicFrameR->move(field_0x59c[i_meterType], field_0x5a8[i_meterType]);
|
||||
mpMagicBase->resize(field_0x5b4[i_meterType], field_0x5c0[i_meterType]);
|
||||
mpMagicParent->scale(field_0x5cc[i_meterType], field_0x5d8[i_meterType]);
|
||||
|
||||
#if TARGET_PC
|
||||
mpMagicParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(field_0x5e4[i_meterType]),
|
||||
field_0x5f0[i_meterType]);
|
||||
#else
|
||||
mpMagicParent->paneTrans(field_0x5e4[i_meterType], field_0x5f0[i_meterType]);
|
||||
#endif
|
||||
|
||||
mpKanteraScreen->draw(0.0f, 0.0f, graf_ctx);
|
||||
}
|
||||
|
||||
@@ -1854,7 +1871,12 @@ void dMeter2Draw_c::drawLightDrop(u8 i_num, u8 i_needNum, f32 i_posX, f32 i_posY
|
||||
mLightDropVesselScale = i_vesselScale;
|
||||
mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8,
|
||||
mLightDropVesselScale * field_0x6f8);
|
||||
|
||||
#if TARGET_PC
|
||||
mpLightDropParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(i_posX), i_posY);
|
||||
#else
|
||||
mpLightDropParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaLightDropChange(bool unused) {}
|
||||
@@ -2001,7 +2023,13 @@ void dMeter2Draw_c::drawRupee(s16 i_rupeeNum) {
|
||||
|
||||
mpRupeeKeyParent->scale(g_drawHIO.mRupeeKeyScale * field_0x718,
|
||||
g_drawHIO.mRupeeKeyScale * field_0x718);
|
||||
|
||||
#if TARGET_PC
|
||||
mpRupeeKeyParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRupeeKeyPosX),
|
||||
g_drawHIO.mRupeeKeyPosY);
|
||||
#else
|
||||
mpRupeeKeyParent->paneTrans(g_drawHIO.mRupeeKeyPosX, g_drawHIO.mRupeeKeyPosY);
|
||||
#endif
|
||||
|
||||
mpRupeeParent[0]->scale(g_drawHIO.mRupeeScale, g_drawHIO.mRupeeScale);
|
||||
mpRupeeParent[0]->paneTrans(g_drawHIO.mRupeePosX, g_drawHIO.mRupeePosY);
|
||||
@@ -2582,7 +2610,12 @@ void dMeter2Draw_c::drawButtonCross(f32 i_posX, f32 i_posY) {
|
||||
mpButtonCrossParent->scale(g_drawHIO.mButtonCrossScale, g_drawHIO.mButtonCrossScale);
|
||||
mpTextI->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
|
||||
mpTextM->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
|
||||
|
||||
#if TARGET_PC
|
||||
mpButtonCrossParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(i_posX), i_posY);
|
||||
#else
|
||||
mpButtonCrossParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaButtonCrossAnimeMin() {
|
||||
|
||||
@@ -3003,7 +3003,7 @@ void dMeter_drawHIO_c::updateFMsgDebug() {
|
||||
#endif
|
||||
|
||||
dMeter_ringHIO_c::dMeter_ringHIO_c() {
|
||||
#if WIDESCREEN_SUPPORT
|
||||
#if WIDESCREEN_SUPPORT && !TARGET_PC
|
||||
updateOnWide();
|
||||
#else
|
||||
mRingRadiusH = 175.0f;
|
||||
|
||||
@@ -628,7 +628,13 @@ void dMeterMap_c::draw() {
|
||||
#endif
|
||||
mMapJ2DPicture->setAlpha(alpha);
|
||||
|
||||
#if TARGET_PC
|
||||
mMapJ2DPicture->draw(mDoGph_gInf_c::ScaleHUDXLeft(drawPosX), drawPosY, sizeX, sizeY, false, false,
|
||||
false);
|
||||
#else
|
||||
mMapJ2DPicture->draw(drawPosX, drawPosY, sizeX, sizeY, false, false, false);
|
||||
#endif
|
||||
|
||||
mMapJ2DPicture->calcMtx();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,8 +552,16 @@ const tvSize l_tvSize[2] = {
|
||||
{808, 448},
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
tvSize pc_tvSize = {608, 448};
|
||||
#endif
|
||||
|
||||
void mDoGph_gInf_c::setTvSize() {
|
||||
#if TARGET_PC
|
||||
const tvSize* tvsize = &pc_tvSize;
|
||||
#else
|
||||
const tvSize* tvsize = &l_tvSize[mWide];
|
||||
#endif
|
||||
|
||||
m_width = tvsize->width;
|
||||
m_height = tvsize->height;
|
||||
@@ -572,18 +580,35 @@ void mDoGph_gInf_c::setTvSize() {
|
||||
m_aspect = m_widthF / m_heightF;
|
||||
m_scale = m_aspect / 1.3571428f;
|
||||
m_invScale = 1.0f / m_scale;
|
||||
|
||||
#if TARGET_PC
|
||||
hudAspectScaleDown = 1.3571428f / mDoGph_gInf_c::getAspect();
|
||||
hudAspectScaleUp = 1.0f / hudAspectScaleDown;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void mDoGph_gInf_c::onWide(f32 width, f32 height) {
|
||||
mWide = TRUE;
|
||||
pc_tvSize.width = width;
|
||||
pc_tvSize.height = height;
|
||||
setTvSize();
|
||||
}
|
||||
#else
|
||||
void mDoGph_gInf_c::onWide() {
|
||||
mWide = TRUE;
|
||||
setTvSize();
|
||||
dMeter2Info_onWide2D();
|
||||
}
|
||||
#endif
|
||||
|
||||
void mDoGph_gInf_c::offWide() {
|
||||
mWide = FALSE;
|
||||
setTvSize();
|
||||
|
||||
#if !TARGET_PC
|
||||
dMeter2Info_offWide2D();
|
||||
#endif
|
||||
}
|
||||
|
||||
void mDoGph_gInf_c::onWideZoom() {
|
||||
@@ -686,10 +711,16 @@ void mDoGph_gInf_c::setWideZoomLightProjection(Mtx& m) {
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
f32 mDoGph_gInf_c::hudAspectScaleDown = 1.0f;
|
||||
f32 mDoGph_gInf_c::hudAspectScaleUp = 1.0f;
|
||||
|
||||
void mDoGph_gInf_c::setWindowSize(AuroraWindowSize const& size) {
|
||||
JUTVideo::getManager()->setWindowSize(size);
|
||||
dComIfGp_setWindow(0, 0.0f, 0.0f, getWidth(), getHeight(), 0.0f, 1.0f, 0, 2);
|
||||
mFader->mBox.set(0, 0, getWidth(), getHeight());
|
||||
|
||||
f32 newWidth = (getWidth() / getHeight()) * 448.0f;
|
||||
onWide(newWidth, 448.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user