mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-30 00:16:19 -04:00
Merge remote-tracking branch 'origin/main' into 26-03-28-movie-player
This commit is contained in:
Vendored
+1
-1
Submodule extern/aurora updated: d76b70fc72...236a7a5e9a
@@ -1,79 +1,67 @@
|
||||
#pragma once
|
||||
|
||||
struct RoomEntry {
|
||||
static constexpr int MAX_POINTS = 70;
|
||||
|
||||
u8 roomNo;
|
||||
s16 roomPoints[MAX_POINTS] = {};
|
||||
int numPoints;
|
||||
std::vector<s16> roomPoints = {};
|
||||
|
||||
constexpr RoomEntry() : roomNo(0), numPoints(0) {}
|
||||
constexpr RoomEntry() : roomNo(0) {}
|
||||
constexpr RoomEntry(const RoomEntry& other) = default;
|
||||
|
||||
template <int N>
|
||||
constexpr RoomEntry(const u8 roomNo, const s16 (&points)[N]) :
|
||||
roomNo(roomNo), numPoints(N) {
|
||||
static_assert(N <= MAX_POINTS);
|
||||
roomNo(roomNo) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
roomPoints[i] = points[i];
|
||||
roomPoints.push_back(points[i]);
|
||||
}
|
||||
}
|
||||
|
||||
constexpr RoomEntry(const u8 roomNo) :
|
||||
roomNo(roomNo), numPoints(1) {
|
||||
roomPoints[0] = 0;
|
||||
roomNo(roomNo) {
|
||||
roomPoints.push_back(0);
|
||||
}
|
||||
};
|
||||
|
||||
struct MapEntry {
|
||||
static constexpr int MAX_ROOMS = 50;
|
||||
|
||||
const char* mapName;
|
||||
const char* mapFile;
|
||||
RoomEntry mapRooms[MAX_ROOMS] = {};
|
||||
int numRooms;
|
||||
std::vector<RoomEntry> mapRooms = {};
|
||||
|
||||
constexpr MapEntry() : mapName(nullptr), mapFile(nullptr), numRooms(0) {}
|
||||
constexpr MapEntry() : mapName(nullptr), mapFile(nullptr) {}
|
||||
constexpr MapEntry(const MapEntry& other) = default;
|
||||
|
||||
template <int N>
|
||||
constexpr MapEntry(const char* mapName, const char* mapFile, const RoomEntry (&rooms)[N], const char*) : mapName(mapName),
|
||||
mapFile(mapFile), numRooms(N) {
|
||||
static_assert(N <= MAX_ROOMS);
|
||||
mapFile(mapFile) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
mapRooms[i] = rooms[i];
|
||||
mapRooms.push_back(rooms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template <int N>
|
||||
constexpr MapEntry(const char* mapName, const char* mapFile, const RoomEntry (&rooms)[N]) :
|
||||
mapName(mapName), mapFile(mapFile), numRooms(N) {
|
||||
static_assert(N <= MAX_ROOMS);
|
||||
mapName(mapName), mapFile(mapFile) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
mapRooms[i] = rooms[i];
|
||||
mapRooms.push_back(rooms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
constexpr MapEntry(const char* mapName, const char* mapFile) : mapName(mapName),
|
||||
mapFile(mapFile), numRooms(0) {}
|
||||
mapFile(mapFile) {}
|
||||
};
|
||||
|
||||
struct RegionEntry {
|
||||
static constexpr int MAX_MAPS = 22;
|
||||
const char* regionName = nullptr;
|
||||
int numMaps = 0;
|
||||
MapEntry maps[MAX_MAPS] = {};
|
||||
std::vector<MapEntry> maps = {};
|
||||
|
||||
template <int N>
|
||||
constexpr RegionEntry(const char* regionName, const MapEntry (&maps)[N]) : regionName(regionName), numMaps(N) {
|
||||
static_assert(N <= MAX_MAPS);
|
||||
constexpr RegionEntry(const char* regionName, const MapEntry (&maps)[N]) : regionName(regionName) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
this->maps[i] = maps[i];
|
||||
this->maps.push_back(maps[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
constexpr auto gameRegions = std::to_array({
|
||||
static const auto gameRegions = std::to_array({
|
||||
RegionEntry("Hyrule Field", {
|
||||
MapEntry("Hyrule Field", "F_SP121",
|
||||
{
|
||||
|
||||
+1
-2
@@ -218,7 +218,6 @@ using std::isnan;
|
||||
#define IS_REF_NONNULL(r) (1)
|
||||
#endif
|
||||
|
||||
#define CRASH(msg) OSPanic(__FILE__, __LINE__, "%s", msg)
|
||||
#define CRASHF(msg, ...) OSPanic(__FILE__, __LINE__, msg, __VA_ARGS__)
|
||||
#define CRASH(msg, ...) OSPanic(__FILE__, __LINE__, "%s", msg, ##__VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -101,7 +101,9 @@ JAHioNode* JAHioNode::getParent() {
|
||||
|
||||
void JAHioNode::listenPropertyEvent(const JORPropertyEvent* event) {
|
||||
propertyEvent(JAH_P_EVENT0, (uintptr_t)event->id);
|
||||
#if DEBUG
|
||||
JORReflexible::listenPropertyEvent(event);
|
||||
#endif
|
||||
propertyEvent(JAH_P_EVENT1, (uintptr_t)event->id);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "JSystem/J2DGraph/J2DAnmLoader.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/memory.h"
|
||||
|
||||
class daCoach2D_HIO_c : public mDoHIO_entry_c {
|
||||
public:
|
||||
struct Param {
|
||||
@@ -153,7 +155,7 @@ int daCoach2D_c::createHeap() {
|
||||
int daCoach2D_c::create() {
|
||||
int phase_state = dComIfG_resLoad(this, l_arcName);
|
||||
if (phase_state == cPhs_COMPLEATE_e) {
|
||||
if (!fopAcM_entrySolidHeap(this, daCoach2D_createHeap, 0x5050)) {
|
||||
if (!fopAcM_entrySolidHeap(this, daCoach2D_createHeap, HEAP_SIZE(0x5050, 0x6000))) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -4846,6 +4846,15 @@ bool dCamera_c::lockonCamera(s32 param_0) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
f32 sp194 = 1.0f;
|
||||
if (mCurCamStyleTimer < lockon_change_timer && !lockon->field_0x2a) {
|
||||
sp194 = dCamMath::rationalBezierRatio((f32)mCurCamStyleTimer / lockon_change_timer, 0.5f);
|
||||
ang2 *= sp194;
|
||||
} else if (mCurCamStyleTimer >= lockon_change_timer) {
|
||||
lockon->field_0x2a = true;
|
||||
}
|
||||
#else
|
||||
f32 sp194;
|
||||
if (mCurCamStyleTimer < lockon_change_timer && !lockon->field_0x2a) {
|
||||
sp194 = dCamMath::rationalBezierRatio((f32)mCurCamStyleTimer / lockon_change_timer, 0.5f);
|
||||
@@ -4854,7 +4863,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
|
||||
lockon->field_0x2a = true;
|
||||
sp194 = 1.0f;
|
||||
}
|
||||
|
||||
#endif
|
||||
cSAngle ang3(mViewCache.mDirection.U().Inv() - ang1);
|
||||
|
||||
if (mCurCamStyleTimer != 0 && mCurCamStyleTimer < lockon_change_timer) {
|
||||
|
||||
@@ -475,6 +475,10 @@ void dMsgScrnHowl_c::drawWave() {
|
||||
s32 local_94 = 0;
|
||||
Vec fVar12 = field_0x128;
|
||||
Vec this_02 = field_0x140;
|
||||
#if TARGET_PC // TODO: make this actually use the scissor
|
||||
f32 fVar1 = 1;
|
||||
f32 fVar2 = 1;
|
||||
#else
|
||||
f32 fVar1 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 fVar2 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
grafContext->scissor(
|
||||
@@ -484,6 +488,8 @@ void dMsgScrnHowl_c::drawWave() {
|
||||
32.0f + ((this_02.y - fVar12.y) + 2.0f)
|
||||
);
|
||||
grafContext->setScissor();
|
||||
#endif
|
||||
|
||||
bool bVar5 = true;
|
||||
if (field_0x2798 == 0) {
|
||||
if (mPlotTime != field_0x212c) {
|
||||
@@ -578,10 +584,17 @@ void dMsgScrnHowl_c::drawGuide() {
|
||||
J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort();
|
||||
Vec local_b0 = field_0x128;
|
||||
Vec local_bc = field_0x140;
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_cc = mpLineH[0]->getGlobalPosX();
|
||||
s16 sVar12 = 0;
|
||||
@@ -709,11 +722,19 @@ void dMsgScrnHowl_c::drawGuide2() {
|
||||
}
|
||||
Vec local_58 = field_0x128;
|
||||
Vec local_64 = field_0x140;
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#if TARGET_PC
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_74 = mpLineH[0]->getGlobalPosX();
|
||||
s16 local_134 = 0;
|
||||
@@ -815,9 +836,15 @@ void dMsgScrnHowl_c::drawEffect() {
|
||||
Vec vec1 = field_0x128;
|
||||
Vec vec2 = field_0x140;
|
||||
mDoGph_gInf_c::getHeightF();
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth())), field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH)), field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
u8 timer = daAlink_getAlinkActorClass()->getWolfHowlMgrP()->getReleaseTimer();
|
||||
u8 screenAlpha = mpScreen->search(MULTI_CHAR('line00'))->getAlpha();
|
||||
|
||||
+26
-21
@@ -412,11 +412,11 @@ void dScnLogo_c::progOutDraw() {
|
||||
}
|
||||
#endif
|
||||
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
} else {
|
||||
mExecCommand = EXEC_PROG_SET;
|
||||
mTimer = 150;
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ void dScnLogo_c::progSetDraw() {
|
||||
if (mTimer == 0) {
|
||||
mExecCommand = EXEC_PROG_SET2;
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(1);
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,15 +463,15 @@ void dScnLogo_c::progChangeDraw() {
|
||||
mTimer = 90;
|
||||
#else
|
||||
if (mDoRst::getWarningDispFlag() != 0) {
|
||||
mTimer = 1;
|
||||
mTimer = 90;
|
||||
mExecCommand = EXEC_NINTENDO_IN;
|
||||
} else {
|
||||
mTimer = 1;
|
||||
mTimer = 120;
|
||||
mExecCommand = EXEC_WARNING_IN;
|
||||
}
|
||||
#endif
|
||||
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,8 +516,8 @@ void dScnLogo_c::warningDispDraw() {
|
||||
#endif
|
||||
{
|
||||
mExecCommand = EXEC_WARNING_OUT;
|
||||
mTimer = 1;
|
||||
mDoGph_gInf_c::startFadeOut(1);
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
mDoRst::setWarningDispFlag(1);
|
||||
}
|
||||
}
|
||||
@@ -526,9 +526,9 @@ void dScnLogo_c::warningOutDraw() {
|
||||
dComIfGd_set2DOpa(mWarning);
|
||||
|
||||
if (mTimer == 0) {
|
||||
mTimer = 1;
|
||||
mTimer = 90;
|
||||
mExecCommand = EXEC_NINTENDO_IN;
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,8 +537,8 @@ void dScnLogo_c::nintendoInDraw() {
|
||||
|
||||
if (mTimer == 0) {
|
||||
mExecCommand = EXEC_NINTENDO_OUT;
|
||||
mTimer = 1;
|
||||
mDoGph_gInf_c::startFadeOut(1);
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,8 +547,8 @@ void dScnLogo_c::nintendoOutDraw() {
|
||||
|
||||
if (mTimer == 0) {
|
||||
mExecCommand = EXEC_DOLBY_IN;
|
||||
mTimer = 1;
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,8 +557,8 @@ void dScnLogo_c::dolbyInDraw() {
|
||||
|
||||
if (mTimer == 0) {
|
||||
mExecCommand = EXEC_DOLBY_OUT;
|
||||
mTimer = 1;
|
||||
mDoGph_gInf_c::startFadeOut(1);
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,8 +567,8 @@ void dScnLogo_c::dolbyOutDraw() {
|
||||
|
||||
if (mTimer == 0) {
|
||||
mExecCommand = EXEC_DOLBY_OUT2;
|
||||
mTimer = 1;
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1098,7 +1098,7 @@ int dScnLogo_c::create() {
|
||||
mTimer = 90;
|
||||
#endif
|
||||
|
||||
mDoGph_gInf_c::startFadeIn(1);
|
||||
mDoGph_gInf_c::startFadeIn(30);
|
||||
|
||||
#if !(PLATFORM_WII || PLATFORM_SHIELD)
|
||||
checkProgSelect();
|
||||
@@ -1107,13 +1107,18 @@ int dScnLogo_c::create() {
|
||||
mTimer = 1;
|
||||
field_0x218 = getProgressiveMode();
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
mTimer = 0; // Possibly unnecessary but just in case
|
||||
mExecCommand = EXEC_DVD_WAIT;
|
||||
#else
|
||||
if (mDoRst::getWarningDispFlag()) {
|
||||
mTimer = 1; // 90;
|
||||
mTimer = 90;
|
||||
mExecCommand = EXEC_NINTENDO_IN;
|
||||
} else {
|
||||
mTimer = 1;
|
||||
mTimer = 120;
|
||||
mExecCommand = EXEC_WARNING_IN;
|
||||
}
|
||||
#endif
|
||||
mDoRst::setProgSeqFlag(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace dusk {
|
||||
|
||||
if (ImGui::BeginCombo("Select Map", previewMap.data())) {
|
||||
int prevMapIdx = m_mapLoaderInfo.mapIdx;
|
||||
for (int i = 0; i < region.numMaps; ++i) {
|
||||
for (int i = 0; i < region.maps.size(); ++i) {
|
||||
const auto& map = region.maps[i];
|
||||
std::string label = m_mapLoaderInfo.showInternalNames ? fmt::format("{} ({})", map.mapName, map.mapFile) : map.mapName;
|
||||
if (ImGui::Selectable(label.data())) {
|
||||
@@ -79,20 +79,20 @@ namespace dusk {
|
||||
const auto& map = region.maps[m_mapLoaderInfo.mapIdx];
|
||||
const auto& room = map.mapRooms[m_mapLoaderInfo.roomNoIdx];
|
||||
|
||||
if (map.numRooms > 1) {
|
||||
if (map.mapRooms.size() > 1) {
|
||||
ImGui::Text("Selected Room: %2d", room.roomNo);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("-###RoomNoIdxDec")) {
|
||||
m_mapLoaderInfo.roomNoIdx--;
|
||||
if (m_mapLoaderInfo.roomNoIdx < 0) {
|
||||
m_mapLoaderInfo.roomNoIdx = map.numRooms - 1;
|
||||
m_mapLoaderInfo.roomNoIdx = map.mapRooms.size() - 1;
|
||||
}
|
||||
m_mapLoaderInfo.pointNoIdx = 0;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("+###RoomNoIdxInc")) {
|
||||
m_mapLoaderInfo.roomNoIdx++;
|
||||
if (m_mapLoaderInfo.roomNoIdx >= map.numRooms) {
|
||||
if (m_mapLoaderInfo.roomNoIdx >= map.mapRooms.size()) {
|
||||
m_mapLoaderInfo.roomNoIdx = 0;
|
||||
}
|
||||
m_mapLoaderInfo.pointNoIdx = 0;
|
||||
@@ -117,19 +117,19 @@ namespace dusk {
|
||||
}
|
||||
}
|
||||
|
||||
if (room.numPoints > 1) {
|
||||
if (room.roomPoints.size() > 1) {
|
||||
ImGui::Text("Selected Point: %3d", room.roomPoints[m_mapLoaderInfo.pointNoIdx]);
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("-###PointNoIdxDec")) {
|
||||
m_mapLoaderInfo.pointNoIdx--;
|
||||
if (m_mapLoaderInfo.pointNoIdx < 0) {
|
||||
m_mapLoaderInfo.pointNoIdx = room.numPoints - 1;
|
||||
m_mapLoaderInfo.pointNoIdx = room.roomPoints.size() - 1;
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("+###PointNoIdxInc")) {
|
||||
m_mapLoaderInfo.pointNoIdx++;
|
||||
if (m_mapLoaderInfo.pointNoIdx >= room.numPoints) {
|
||||
if (m_mapLoaderInfo.pointNoIdx >= room.roomPoints.size()) {
|
||||
m_mapLoaderInfo.pointNoIdx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user