mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-31 15:47:17 -04:00
Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer
This commit is contained in:
+16
-2
@@ -37,6 +37,7 @@
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/game_clock.h"
|
||||
static f32 timeScale = 1.0f;
|
||||
#endif
|
||||
|
||||
static void GxXFog_set();
|
||||
@@ -1799,6 +1800,9 @@ void dScnKy_env_light_c::setLight_palno_get(u8* prev_envr_id_p, u8* next_envr_id
|
||||
u8 psel_idx = 0;
|
||||
int i;
|
||||
int sp14 = 0;
|
||||
#if TARGET_PC
|
||||
const f32 timeScale = (pattern_ratio_p == &g_env_light.pat_ratio) ? ::timeScale : 1.0f;
|
||||
#endif
|
||||
|
||||
if (*init_timer_p != 0) {
|
||||
(*init_timer_p)++;
|
||||
@@ -2132,14 +2136,22 @@ void dScnKy_env_light_c::setLight_palno_get(u8* prev_envr_id_p, u8* next_envr_id
|
||||
|
||||
if (g_env_light.mColPatMode == 0) {
|
||||
if (pselect_p->change_rate > 0.0f) {
|
||||
#if TARGET_PC
|
||||
*pattern_ratio_p += timeScale * ((1.0f / 30) / pselect_p->change_rate);
|
||||
#else
|
||||
*pattern_ratio_p += (1.0f / 30) / pselect_p->change_rate;
|
||||
#endif
|
||||
}
|
||||
|
||||
// pattern change rate is faster in hyrule field
|
||||
if (strcmp(dComIfGp_getStartStageName(), "F_SP121") == 0 &&
|
||||
*prev_pat_p == *next_pat_p)
|
||||
{
|
||||
#if TARGET_PC
|
||||
*pattern_ratio_p += timeScale * (1.0f / 15);
|
||||
#else
|
||||
*pattern_ratio_p += (1.0f / 15);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (*pattern_ratio_p >= 1.0f) {
|
||||
@@ -2332,6 +2344,10 @@ void dScnKy_env_light_c::setLight() {
|
||||
u8 next_pal_start_id;
|
||||
u8 prev_pal_end_id;
|
||||
u8 next_pal_end_id;
|
||||
#if TARGET_PC
|
||||
const f32 deltaTime = dusk::game_clock::consume_interval(this);
|
||||
timeScale = deltaTime / dusk::game_clock::period_for_original_frames(1.0f);
|
||||
#endif
|
||||
setLight_palno_get(&g_env_light.PrevCol, &g_env_light.UseCol, &g_env_light.wether_pat0,
|
||||
&g_env_light.wether_pat1, &prev_pal_start_id, &prev_pal_end_id,
|
||||
&next_pal_start_id, &next_pal_end_id, &color_ratio, &start_pat_pal_id,
|
||||
@@ -2517,8 +2533,6 @@ void dScnKy_env_light_c::setLight() {
|
||||
f32 sin = cM_ssin(S_fuwan_sin);
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 deltaTime = dusk::game_clock::consume_interval(this);
|
||||
const f32 timeScale = deltaTime / dusk::game_clock::period_for_original_frames(1.0f);
|
||||
S_fuwan_sin += (s16)((cM_rndF(2000.0f) + 500) * timeScale);
|
||||
#else
|
||||
S_fuwan_sin += (s16)cM_rndF(2000.0f) + 500;
|
||||
|
||||
+6
-1
@@ -1640,7 +1640,7 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) {
|
||||
|
||||
mCenterX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -mPackX :) mPackX;
|
||||
mCenterZ -= mPackZ;
|
||||
mCenterX += field_0x64;
|
||||
mCenterX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -field_0x64 : ) field_0x64;
|
||||
mCenterZ += mPackPlusZ;
|
||||
}
|
||||
|
||||
@@ -1649,6 +1649,8 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) {
|
||||
{
|
||||
#if DEBUG
|
||||
field_0x64 = 33830.0f;
|
||||
#elif TARGET_PC
|
||||
field_0x64 = dusk::getSettings().game.enableMirrorMode ? 33830.0f : 0.0f;
|
||||
#else
|
||||
field_0x64 = 0.0f;
|
||||
#endif
|
||||
@@ -1657,6 +1659,9 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) {
|
||||
f32 temp = (field_0x58 * (f32)(field_0x74 + 4)) * 0.5f;
|
||||
#if DEBUG
|
||||
mRightEdgePlus = -(((dMpath_c::getMinZ() - (-127103.67f)) - temp) / field_0x58);
|
||||
|
||||
#elif TARGET_PC
|
||||
mRightEdgePlus = dusk::getSettings().game.enableMirrorMode ? -(((dMpath_c::getMinX() - (-127103.67f)) - temp) / field_0x58) : 0.0f;
|
||||
#else
|
||||
mRightEdgePlus = 0.0f;
|
||||
#endif
|
||||
|
||||
+24
-1
@@ -914,6 +914,20 @@ void dMenu_DmapBg_c::dMapBgWide() {
|
||||
void dMenu_DmapBg_c::draw() {
|
||||
#if TARGET_PC
|
||||
dMapBgWide();
|
||||
|
||||
static bool prevMirror = false; // default state of panes is not mirrored
|
||||
if(prevMirror != dusk::getSettings().game.enableMirrorMode) {
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
static_cast<J2DPicture*>(mFloorScreen->search(MULTI_CHAR('rink')))->setMirror(J2DMirror_X);
|
||||
static_cast<J2DPicture*>(mBaseScreen->search(MULTI_CHAR('map000')))->setMirror(J2DMirror_X);
|
||||
}
|
||||
else {
|
||||
static_cast<J2DPicture*>(mFloorScreen->search(MULTI_CHAR('rink')))->setMirror(MIRROR0);
|
||||
static_cast<J2DPicture*>(mBaseScreen->search(MULTI_CHAR('map000')))->setMirror(MIRROR0);
|
||||
}
|
||||
|
||||
prevMirror = dusk::getSettings().game.enableMirrorMode;
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 scissor_left;
|
||||
@@ -960,6 +974,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpBackTexture->setAlpha(dVar17 * (field_0xdbc * field_0xd9c));
|
||||
|
||||
f32 local_28c = mpBackTexture->getBounds().i.x;
|
||||
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
CPaneMgr mgr;
|
||||
Vec local_94 = mgr.getGlobalVtxCenter(mMapPane, true, 0);
|
||||
local_28c = (local_94.x * 2.0f) - (local_28c + 0.5f * mpBackTexture->getWidth()) - 0.5f * mpBackTexture->getWidth();
|
||||
}
|
||||
#endif
|
||||
|
||||
mpBackTexture->setBlackWhite(color_black, color_white);
|
||||
mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(),
|
||||
mpBackTexture->getHeight(),
|
||||
@@ -1981,7 +2004,7 @@ void dMenu_Dmap_c::mapControl() {
|
||||
f32 temp_f28 = (var_f29 / 100.0f) * var_f31;
|
||||
f32 sp18 = temp_f28 * cM_ssin(stick_angle);
|
||||
f32 sp14 = temp_f28 * cM_scos(stick_angle);
|
||||
mMapCtrl->setPlusZoomCenterX(sp18);
|
||||
mMapCtrl->setPlusZoomCenterX(IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -sp18 :) sp18);
|
||||
mMapCtrl->setPlusZoomCenterZ(sp14);
|
||||
}
|
||||
|
||||
|
||||
@@ -359,14 +359,7 @@ f32 dMenu_StageMapCtrl_c::getPixelStageSizeZ() const {
|
||||
|
||||
f32 dMenu_StageMapCtrl_c::getPixelCenterX() const {
|
||||
f32 var_f31 = dMpath_c::getCenterX();
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
return (1.0f / field_0xbc) * (field_0x9c + var_f31);
|
||||
}
|
||||
else return (1.0f / field_0xbc) * (field_0x9c - var_f31);
|
||||
#else
|
||||
return (1.0f / field_0xbc) * (field_0x9c - var_f31);
|
||||
#endif
|
||||
}
|
||||
|
||||
f32 dMenu_StageMapCtrl_c::getPixelCenterZ() const {
|
||||
@@ -425,18 +418,7 @@ inline static f32 rightModeCnvPos(f32 param_0) {
|
||||
void dMenu_StageMapCtrl_c::cnvPosTo2Dpos(f32 param_0, f32 param_1, f32* param_2,
|
||||
f32* param_3) const {
|
||||
if (param_2 != NULL) {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
*param_2 =
|
||||
(0.5f * field_0x94) + rightModeCnvPos((1.0f / field_0xbc) * (field_0x9c + param_0));
|
||||
} else {
|
||||
*param_2 =
|
||||
(0.5f * field_0x94) + rightModeCnvPos((1.0f / field_0xbc) * (param_0 - field_0x9c));
|
||||
}
|
||||
#else
|
||||
*param_2 = (0.5f * field_0x94) + rightModeCnvPos((1.0f / field_0xbc) * (param_0 - field_0x9c));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (param_3 != NULL) {
|
||||
@@ -933,8 +915,7 @@ void dMenu_StageMapCtrl_c::move() {
|
||||
|
||||
void dMenu_DmapMapCtrl_c::draw() {
|
||||
if (field_0xef != 0) {
|
||||
setPos(field_0xeb, field_0xec,
|
||||
IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -field_0x9c :) field_0x9c,
|
||||
setPos(field_0xeb, field_0xec, field_0x9c,
|
||||
field_0xa0, field_0xbc, true, field_0xd8);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-15
@@ -931,17 +931,8 @@ void dMenu_Fmap_c::region_map_proc() {
|
||||
mpDraw2DBack->regionMapMove(mpStick);
|
||||
int stage_no, room_no;
|
||||
|
||||
#if TARGET_PC
|
||||
f32 arrow_pos_x = mpDraw2DBack->getArrowPos2DX();
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
arrow_pos_x = mpDraw2DBack->getMirrorPosX(arrow_pos_x, 0.0f);
|
||||
}
|
||||
|
||||
f32 pos_x = arrow_pos_x - mDoGph_gInf_c::getMinXF() - mDoGph_gInf_c::getWidthF() * 0.5f;
|
||||
#else
|
||||
f32 pos_x = mpDraw2DBack->getArrowPos2DX() - mDoGph_gInf_c::getMinXF()
|
||||
- mDoGph_gInf_c::getWidthF() * 0.5f;
|
||||
#endif
|
||||
f32 pos_y = mpDraw2DBack->getArrowPos2DY() - mDoGph_gInf_c::getHeightF() * 0.5f;
|
||||
|
||||
mpMenuFmapMap->getPointStagePathInnerNo(getNowFmapRegionData(), pos_x, pos_y,
|
||||
@@ -2486,12 +2477,6 @@ void dMenu_Fmap_c::portalWarpMapMove(STControl* i_stick) {
|
||||
f32 arrow_y = mpDraw2DBack->getArrowPos2DY();
|
||||
u8 uVar6 = 0xff;
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
arrow_x = mpDraw2DBack->getMirrorPosX(arrow_x, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
for (int i = 0; i < portal_dat->mCount; i++) {
|
||||
if (portals[i].mRegionNo == mpDraw2DBack->getRegionCursor() + 1
|
||||
@@ -2561,6 +2546,11 @@ void dMenu_Fmap_c::drawIcon(f32 param_0, bool param_1) {
|
||||
if (mProcess == PROC_PORTAL_DEMO1) {
|
||||
is_portal_demo1 = 1;
|
||||
}
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
angle = 0x10000 - angle;
|
||||
}
|
||||
#endif
|
||||
mpDraw2DBack->setIcon2DPos(0x11, stage_name, pos.x, pos.z, cM_sht2d(angle),
|
||||
is_portal_demo1, param_1);
|
||||
|
||||
@@ -2649,6 +2639,11 @@ void dMenu_Fmap_c::drawPlayEnterIcon() {
|
||||
angle = dComIfGs_getPlayerFieldLastStayAngleY();
|
||||
SAFE_STRCPY(stage_name, dComIfGs_getPlayerFieldLastStayName());
|
||||
}
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
angle = 0x10000 - angle;
|
||||
}
|
||||
#endif
|
||||
mpDraw2DBack->setIcon2DPos(0x15, stage_name, pos.x, pos.z, cM_sht2d(angle), 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
+63
-17
@@ -1013,11 +1013,6 @@ void dMenu_Fmap2DBack_c::allmap_move2(STControl* param_0) {
|
||||
f32 stickValue = param_0->getValueStick();
|
||||
if (stickValue >= spC) {
|
||||
s16 angle = param_0->getAngleStick();
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
angle = -angle;
|
||||
}
|
||||
#endif
|
||||
f32 local_68 = (mTexMaxX - mTexMinX);
|
||||
f32 zoomRate = local_68 / getAllMapZoomRate();
|
||||
f32 sp24;
|
||||
@@ -1031,6 +1026,11 @@ void dMenu_Fmap2DBack_c::allmap_move2(STControl* param_0) {
|
||||
f32 delta_y = speed * cM_ssin(angle);
|
||||
f32 delta_x = speed * cM_scos(angle);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
delta_y = -delta_y;
|
||||
}
|
||||
#endif
|
||||
control_xpos = control_xpos + delta_y;
|
||||
control_ypos = control_ypos + delta_x;
|
||||
}
|
||||
@@ -1473,6 +1473,12 @@ void dMenu_Fmap2DBack_c::worldGridDraw() {
|
||||
f32 dVar8 = -mStageTransZ;
|
||||
calcAllMapPos2D(dVar9, dVar8, &local_74, &local_78);
|
||||
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_74 = getMirrorPosX(local_74, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
|
||||
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
|
||||
JUtility::TColor(255, 255, 255, 255), 6);
|
||||
@@ -1481,6 +1487,11 @@ void dMenu_Fmap2DBack_c::worldGridDraw() {
|
||||
while (true) {
|
||||
calcAllMapPos2D(xPos, dVar8, &local_74, &local_78);
|
||||
if (local_74 >= getMapScissorAreaLX()) {
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_74 = getMirrorPosX(local_74, 0.0f);
|
||||
}
|
||||
#endif
|
||||
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
|
||||
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
|
||||
JUtility::TColor(255, 255, 255, 255), 6);
|
||||
@@ -1542,6 +1553,12 @@ void dMenu_Fmap2DBack_c::regionGridDraw() {
|
||||
f32 dVar8 = mRegionOriginZ[mRegionCursor] - mStageTransZ;
|
||||
calcAllMapPos2D(dVar9, dVar8, &local_74, &local_78);
|
||||
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_74 = getMirrorPosX(local_74, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
|
||||
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
|
||||
JUtility::TColor(180, 0, 0, 255), 6);
|
||||
@@ -1550,6 +1567,12 @@ void dMenu_Fmap2DBack_c::regionGridDraw() {
|
||||
while (true) {
|
||||
calcAllMapPos2D(xPos, dVar8, &local_74, &local_78);
|
||||
if (local_74 >= getMapScissorAreaLX()) {
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_74 = getMirrorPosX(local_74, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74,
|
||||
mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(),
|
||||
JUtility::TColor(180, 0, 0, 255), 6);
|
||||
@@ -1612,6 +1635,12 @@ void dMenu_Fmap2DBack_c::worldOriginDraw() {
|
||||
f32 local_44, local_48;
|
||||
calcAllMapPos2D(-mStageTransX, -mStageTransZ, &local_44, &local_48);
|
||||
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_44 = getMirrorPosX(local_44, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
J2DDrawLine(mDoGph_gInf_c::getMinXF(), local_48 - local_44 + mDoGph_gInf_c::getMinXF(),
|
||||
mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF(),
|
||||
local_48 - local_44 + (mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF()),
|
||||
@@ -1646,6 +1675,13 @@ void dMenu_Fmap2DBack_c::scrollAreaDraw() {
|
||||
calcAllMapPos2D(x_min - mStageTransX, z_min - mStageTransZ, &local_4c, &local_50);
|
||||
calcAllMapPos2D(x_max - mStageTransX, z_max - mStageTransZ, &local_54, &local_58);
|
||||
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
local_4c = getMirrorPosX(local_4c, 0.0f);
|
||||
local_54 = getMirrorPosX(local_54, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
J2DDrawLine(local_4c, local_50, local_4c, local_58,
|
||||
JUtility::TColor(255, 255, 255, 255), 6);
|
||||
J2DDrawLine(local_54, local_50, local_54, local_58,
|
||||
@@ -1666,6 +1702,11 @@ void dMenu_Fmap2DBack_c::regionOriginDraw() {
|
||||
f32 center_x, center_y;
|
||||
calcAllMapPos2D(mRegionOriginX[i] - mStageTransX, mRegionOriginZ[i] - mStageTransZ,
|
||||
¢er_x, ¢er_y);
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
center_x = getMirrorPosX(center_x - 3.0f, 3.0f);
|
||||
}
|
||||
#endif
|
||||
J2DFillBox(center_x - 3.0f, center_y - 3.0f, 6.0f, 6.0f, JUtility::TColor(255, 0, 0, 255));
|
||||
}
|
||||
}
|
||||
@@ -1683,6 +1724,11 @@ void dMenu_Fmap2DBack_c::stageOriginDraw() {
|
||||
f32 v1 = mRegionOriginX[mRegionCursor] + stage_data[i].mOffsetX - mStageTransX;
|
||||
f32 v2 = mRegionOriginZ[mRegionCursor] + stage_data[i].mOffsetZ - mStageTransZ;
|
||||
calcAllMapPos2D(v1, v2, ¢er_x, ¢er_y);
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
center_x = getMirrorPosX(center_x - 3.0f, 3.0f);
|
||||
}
|
||||
#endif
|
||||
J2DFillBox(center_x - 3.0f, center_y - 3.0f, 6.0f, 6.0f,
|
||||
JUtility::TColor(0, 0, 255, 255));
|
||||
}
|
||||
@@ -1915,11 +1961,6 @@ void dMenu_Fmap2DBack_c::regionMapMove(STControl* i_stick) {
|
||||
f32 stick_value = i_stick->getValueStick();
|
||||
if (stick_value >= slow_bound) {
|
||||
s16 angle = i_stick->getAngleStick();
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
angle = -angle;
|
||||
}
|
||||
#endif
|
||||
f32 local_68 = mTexMaxX - mTexMinX;
|
||||
f32 spot_zoom = getSpotMapZoomRate();
|
||||
f32 region_zoom = getRegionMapZoomRate(mRegionCursor);
|
||||
@@ -1934,7 +1975,7 @@ void dMenu_Fmap2DBack_c::regionMapMove(STControl* i_stick) {
|
||||
f32 speed = base_speed / 100.0f * local_78;
|
||||
f32 speed_y = speed * cM_ssin(angle);
|
||||
f32 speed_x = speed * cM_scos(angle);
|
||||
control_xpos += speed_y;
|
||||
control_xpos += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -speed_y :) speed_y;
|
||||
control_ypos += speed_x;
|
||||
}
|
||||
}
|
||||
@@ -1990,11 +2031,6 @@ void dMenu_Fmap2DBack_c::stageMapMove(STControl* i_stick, u8 param_1, bool param
|
||||
if (stick_value >= slow_bound && param_2 && field_0x1238 != 2) {
|
||||
bVar6 = true;
|
||||
s16 angle = i_stick->getAngleStick();
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
angle = -angle;
|
||||
}
|
||||
#endif
|
||||
f32 local_68 = mTexMaxX - mTexMinX;
|
||||
f32 spot_zoom = getSpotMapZoomRate();
|
||||
f32 region_zoom = getRegionMapZoomRate(mRegionCursor);
|
||||
@@ -2009,7 +2045,7 @@ void dMenu_Fmap2DBack_c::stageMapMove(STControl* i_stick, u8 param_1, bool param
|
||||
f32 speed = base_speed / 100.0f * local_78;
|
||||
f32 speed_x = speed * cM_ssin(angle);
|
||||
f32 speed_z = speed * cM_scos(angle);
|
||||
mStageTransX += speed_x;
|
||||
mStageTransX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -speed_x :) speed_x;
|
||||
mStageTransZ += speed_z;
|
||||
} else if (!param_2) {
|
||||
return;
|
||||
@@ -2103,6 +2139,11 @@ void dMenu_Fmap2DBack_c::drawDebugStageArea() {
|
||||
if (stage_no >= 0) {
|
||||
f32 v = i + mDoGph_gInf_c::getMinXF();
|
||||
f32 v2 = j;
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
v = getMirrorPosX(v - 3.0f, 3.0f);
|
||||
}
|
||||
#endif
|
||||
J2DFillBox(v - 3.0f, v2 - 3.0f, 6.0f, 6.0f, colors[stage_no % 6]);
|
||||
}
|
||||
}
|
||||
@@ -2138,6 +2179,11 @@ void dMenu_Fmap2DBack_c::drawDebugRegionArea() {
|
||||
mRegionMapSizeX[region] * mZoom, mRegionMapSizeY[region] * mZoom,
|
||||
mpAreaTex[region]->getTexture(0)->getTexInfo());
|
||||
if (u) {
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.enableMirrorMode) {
|
||||
pos_x = getMirrorPosX(pos_x - 3.0f, 3.0f);
|
||||
}
|
||||
#endif
|
||||
J2DFillBox(pos_x - 3.0f, pos_y - 3.0f, 6.0f, 6.0f, colors[region]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -394,21 +394,8 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4
|
||||
icon_size_y *= _c7c;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
f32 rotation = mIconInfo[info_idx].rotation;
|
||||
if (dusk::getSettings().game.enableMirrorMode &&
|
||||
(mIconInfo[info_idx].icon_no == ICON_LINK_e ||
|
||||
mIconInfo[info_idx].icon_no == ICON_LINK_ENTER_e))
|
||||
{
|
||||
rotation = -rotation;
|
||||
}
|
||||
|
||||
mPictures[mIconInfo[info_idx].icon_no]->rotate(icon_size_x / 2, icon_size_y / 2, ROTATE_Z,
|
||||
rotation);
|
||||
#else
|
||||
mPictures[mIconInfo[info_idx].icon_no]->rotate(icon_size_x / 2, icon_size_y / 2, ROTATE_Z,
|
||||
mIconInfo[info_idx].rotation);
|
||||
#endif
|
||||
|
||||
if (mIconInfo[info_idx].icon_no == ICON_LIGHT_DROP_e) {
|
||||
mPictures[mIconInfo[info_idx].icon_no]->setAlpha((180.0f * _c80) / 255.0f);
|
||||
@@ -423,10 +410,15 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4
|
||||
}
|
||||
|
||||
f32 pos_x = i_posX + (icon_pos_x - (icon_size_x / 2));
|
||||
bool r4 = false;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
pos_x = getMirrorCenterPosX(i_posX + (icon_pos_x - (icon_size_x / 2)), icon_size_x / 2);
|
||||
}
|
||||
|
||||
if(mIconInfo[info_idx].icon_no == ICON_GOLD_WOLF_e) {
|
||||
r4 = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
mPictures[mIconInfo[info_idx].icon_no]->draw(pos_x, (i_posY + (icon_pos_y - icon_size_y / 2)),
|
||||
@@ -435,7 +427,7 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4
|
||||
if (mIconInfo[info_idx].icon_no == ICON_LIGHT_DROP_e) {
|
||||
mLightDropPic->draw((pos_x + (icon_size_x / 2)) - (var_f29 / 2),
|
||||
((icon_size_y / 2) + (i_posY + (icon_pos_y - icon_size_y / 2))) - (var_f28 / 2),
|
||||
var_f29, var_f28, false, false, false);
|
||||
var_f29, var_f28, r4, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -869,4 +861,4 @@ void dMenuMapCommon_c::getFmapPoeCount(const int regionNo, int& nowCount, int& t
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+31
-9
@@ -27,6 +27,15 @@
|
||||
#if TARGET_PC
|
||||
#include "dusk/memory.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Reads the user HUD scale setting, clamped to a safe range.
|
||||
f32 dGetUserHudScale() {
|
||||
return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
int dMeter2_c::_create() {
|
||||
@@ -669,9 +678,7 @@ void dMeter2_c::moveLife() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 lifeGaugeScale =
|
||||
g_drawHIO.mLifeParentScale *
|
||||
std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
const f32 lifeGaugeScale = g_drawHIO.mLifeParentScale * dGetUserHudScale();
|
||||
#else
|
||||
const f32 lifeGaugeScale = g_drawHIO.mLifeParentScale;
|
||||
#endif
|
||||
@@ -1108,8 +1115,13 @@ void dMeter2_c::moveRupee() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mRupeeKeyScale != g_drawHIO.mRupeeKeyScale) {
|
||||
mRupeeKeyScale = g_drawHIO.mRupeeKeyScale;
|
||||
#if TARGET_PC
|
||||
const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale * dGetUserHudScale();
|
||||
#else
|
||||
const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale;
|
||||
#endif
|
||||
if (mRupeeKeyScale != rupeeKeyScale) {
|
||||
mRupeeKeyScale = rupeeKeyScale;
|
||||
draw_rupee = true;
|
||||
}
|
||||
|
||||
@@ -1207,8 +1219,13 @@ void dMeter2_c::moveKey() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mKeyScale != g_drawHIO.mKeyScale) {
|
||||
mKeyScale = g_drawHIO.mKeyScale;
|
||||
#if TARGET_PC
|
||||
const f32 keyScale = g_drawHIO.mKeyScale * dGetUserHudScale();
|
||||
#else
|
||||
const f32 keyScale = g_drawHIO.mKeyScale;
|
||||
#endif
|
||||
if (mKeyScale != keyScale) {
|
||||
mKeyScale = keyScale;
|
||||
draw_key = true;
|
||||
}
|
||||
|
||||
@@ -2139,8 +2156,13 @@ void dMeter2_c::moveButtonCross() {
|
||||
draw_cross = true;
|
||||
}
|
||||
|
||||
if (mButtonCrossScale != g_drawHIO.mButtonCrossScale) {
|
||||
mButtonCrossScale = g_drawHIO.mButtonCrossScale;
|
||||
#if TARGET_PC
|
||||
const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale * dGetUserHudScale();
|
||||
#else
|
||||
const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale;
|
||||
#endif
|
||||
if (mButtonCrossScale != buttonCrossScale) {
|
||||
mButtonCrossScale = buttonCrossScale;
|
||||
draw_cross = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ void dAnchorHudScale(CPaneMgr* i_pane, HudCorner i_corner, f32* io_x, f32* io_y,
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
|
||||
OS_REPORT("enter dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap *mp_heap)\n");
|
||||
|
||||
@@ -2813,7 +2814,7 @@ void dMeter2Draw_c::drawButtonCross(f32 i_posX, f32 i_posY) {
|
||||
#if TARGET_PC
|
||||
f32 buttonCrossPosX = i_posX;
|
||||
f32 buttonCrossPosY = i_posY;
|
||||
dAnchorHudScale(mpButtonCrossParent, HudCorner::TopLeft, &buttonCrossPosX, &buttonCrossPosY);
|
||||
dAnchorHudScale(mpButtonCrossParent, HudCorner::BottomLeft, &buttonCrossPosX, &buttonCrossPosY);
|
||||
mpButtonCrossParent->paneTrans(buttonCrossPosX, buttonCrossPosY);
|
||||
#else
|
||||
mpButtonCrossParent->paneTrans(i_posX, i_posY);
|
||||
|
||||
+11
-3
@@ -24,6 +24,15 @@
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/action_bindings.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Reads the user HUD scale setting, clamped to a safe range.
|
||||
f32 dGetUserHudScale() {
|
||||
return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
#if (PLATFORM_WII || PLATFORM_SHIELD)
|
||||
@@ -326,7 +335,7 @@ f32 dMeterMap_c::getMapDispEdgeTop() {
|
||||
mMap->getTexelPerCm() * (mMap->getPackZ() + -mMap->getPackPlusZ()) -
|
||||
mMap->getTopEdgePlus();
|
||||
}
|
||||
f32 rv = getMapDispEdgeBottomY_Layout() - tmp;
|
||||
f32 rv = getMapDispEdgeBottomY_Layout() - tmp IF_DUSK(* dGetUserHudScale());
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -637,8 +646,7 @@ void dMeterMap_c::draw() {
|
||||
#if TARGET_PC
|
||||
// Scale the minimap with the user HUD scale and shift down so its bottom-left
|
||||
// corner stays anchored to the same screen position as at scale 1.0.
|
||||
const f32 userHudScale =
|
||||
std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
const f32 userHudScale = dGetUserHudScale();
|
||||
const f32 scaledSizeX = sizeX * userHudScale;
|
||||
const f32 scaledSizeY = sizeY * userHudScale;
|
||||
const f32 mapBottomShift = sizeY - scaledSizeY;
|
||||
|
||||
+14
-12
@@ -434,17 +434,6 @@ static void dummyStrings() {
|
||||
dMsgObject_HIO_c g_MsgObject_HIO_c;
|
||||
|
||||
int dMsgObject_c::_execute() {
|
||||
// TODO: enabling wii message overrides fixes direction text, but gives wrong item control text
|
||||
/*#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
// enable wii message index override
|
||||
g_MsgObject_HIO_c.mMessageDisplay = 1;
|
||||
} else if (!dusk::getSettings().game.enableMirrorMode && g_MsgObject_HIO_c.mMessageDisplay == 1) {
|
||||
g_MsgObject_HIO_c.mMessageDisplay = 0;
|
||||
}
|
||||
#endif*/
|
||||
|
||||
|
||||
field_0x4c7 = 0;
|
||||
if (mpTalkHeap != NULL) {
|
||||
field_0x148 = mDoExt_setCurrentHeap(mpTalkHeap);
|
||||
@@ -661,8 +650,21 @@ static const MirrorMsgOverride mirrorMsgOverrides[] = {
|
||||
{0x17e2, 0x3ef2},
|
||||
{0x1dae, 0x44be},
|
||||
{0x14ca, 0x3bda},
|
||||
{0x470, 0x493},
|
||||
{0x470, 0x493},
|
||||
{0x473, 0x492},
|
||||
{0x1f41, 0x4651},
|
||||
{0x1f42, 0x4652},
|
||||
{0x0847, 0x0870},
|
||||
{0x0d5c, 0x0d65},
|
||||
{0x0a97, 0x0a98},
|
||||
{0x0327, 0x12ba},
|
||||
{0x0328, 0x12bb},
|
||||
{0x1534, 0x3c44},
|
||||
{0x1536, 0x3c46},
|
||||
{0x1557, 0x3c67},
|
||||
{0x1b88, 0x4298},
|
||||
{0x14c8, 0x3bd8},
|
||||
{0x151b, 0x3c2b},
|
||||
};
|
||||
|
||||
static u32 getMirrorMsgOverride(u32 msgId) {
|
||||
|
||||
+61
-1
@@ -23,8 +23,12 @@
|
||||
#include "m_Do/m_Do_main.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
|
||||
#ifdef TARGET_PC
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "dusk/main.h"
|
||||
#include "m_Do/m_Do_MemCard.h"
|
||||
#endif
|
||||
|
||||
#if !PLATFORM_GCN
|
||||
#include <revolution/os.h>
|
||||
@@ -757,7 +761,63 @@ void dScnLogo_c::nextSceneChange() {
|
||||
if (!mDoRst::isReset()) {
|
||||
if (!isOpeningCut())
|
||||
{
|
||||
dComIfG_changeOpeningScene(this, fpcNm_OPENING_SCENE_e);
|
||||
#ifdef TARGET_PC
|
||||
// If we are requesting a save from the command line, load it here and set the scene to play instead of loading the LOGO SCENE
|
||||
if (dusk::SaveRequested >= 1 && dusk::SaveRequested <= 3) {
|
||||
u8 buf[SAVEDATA_SIZE * 3];
|
||||
mDoMemCd_Load();
|
||||
uint8_t status;
|
||||
do {
|
||||
status = mDoMemCd_LoadSync(buf, sizeof(buf), 0);
|
||||
// Wait until the card is loaded
|
||||
} while (status == 0);
|
||||
|
||||
if (status == 1) {
|
||||
dComIfGs_setCardToMemory(buf, dusk::SaveRequested - 1);
|
||||
} else {
|
||||
dComIfGs_init();
|
||||
}
|
||||
|
||||
dComIfGs_setNoFile(dusk::SaveRequested);
|
||||
dComIfGs_setDataNum(dusk::SaveRequested-1);
|
||||
|
||||
dComIfGs_gameStart();
|
||||
|
||||
fopScnM_ChangeReq(this, fpcNm_PLAY_SCENE_e, 0, 30);
|
||||
|
||||
dKy_clear_game_init();
|
||||
dComIfGs_resetDan();
|
||||
dComIfGs_setRestartRoomParam(0);
|
||||
|
||||
DuskLog.info("Loaded Save From Slot {}",dusk::SaveRequested);
|
||||
dusk::SaveRequested = 0xff;
|
||||
} else if (dusk::SaveRequested == 0xff) {
|
||||
// This indicates that the save has loaded, but we are waiting for the scene
|
||||
// manager to change to play
|
||||
} else if (dusk::StageRequested.set) {
|
||||
// Do nothing if we need to request a stage to load later in the function
|
||||
} else{
|
||||
#endif
|
||||
dComIfG_changeOpeningScene(this, fpcNm_OPENING_SCENE_e);
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
|
||||
if (dusk::StageRequested.set) {
|
||||
// If we aren't loading a save, initialize a blank save file and request the correct scene to load
|
||||
if (dusk::SaveRequested == 0) {
|
||||
dComIfGs_init();
|
||||
|
||||
fopScnM_ChangeReq(this, fpcNm_PLAY_SCENE_e, 0, 30);
|
||||
dusk::SaveRequested = 0xff; //Skip requesting the scene from above
|
||||
}
|
||||
|
||||
// Use both to force-set start stage
|
||||
dComIfGp_setNextStage(dusk::StageRequested.stage.c_str(), dusk::StageRequested.point, dusk::StageRequested.room, dusk::StageRequested.layer);
|
||||
g_dComIfG_gameInfo.play.mNextStage.getStartStage()->set(dusk::StageRequested.stage.c_str(), dusk::StageRequested.room, dusk::StageRequested.point, dusk::StageRequested.layer);
|
||||
|
||||
dusk::StageRequested.set = false; // Setting the stage should only happen once
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#if DEBUG
|
||||
fopScnM_ChangeReq(this, fpcNm_MENU_SCENE_e, 0, 30);
|
||||
|
||||
Reference in New Issue
Block a user