mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-12 19:36:01 -04:00
Merge branch 'main' of https://github.com/TwilitRealm/dusklight into charlo-fix
This commit is contained in:
@@ -8,7 +8,10 @@
|
||||
#include "d/actor/d_a_alink.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_k_wmark.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/gx_helper.h"
|
||||
#endif
|
||||
|
||||
DUSK_GAME_DATA const EffParamProc daAlink_c::m_fEffParamProc[] = {
|
||||
&daAlink_c::setEffectFrontRollParam,
|
||||
|
||||
@@ -8,9 +8,14 @@
|
||||
#include "d/actor/d_a_obj_swhang.h"
|
||||
#include "d/actor/d_a_obj_chandelier.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
static const int HS_CHAIN_MAX_LINKS = 600;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
HS_MODE_NONE_e,
|
||||
HS_MODE_READY_e,
|
||||
@@ -19,10 +24,6 @@ enum {
|
||||
HS_MODE_RETURN_e = 6,
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
static const int HS_CHAIN_MAX_LINKS = 600;
|
||||
#endif
|
||||
|
||||
void daAlink_c::hsChainShape_c::draw() {
|
||||
static const int dummy = 0;
|
||||
|
||||
@@ -34,9 +35,7 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
j3dSys.setVtxPos(modelData->getVtxPosArray(), modelData->getVtxNum());
|
||||
j3dSys.setVtxNrm(modelData->getVtxNrmArray(), modelData->getNrmNum());
|
||||
j3dSys.setVtxCol(modelData->getVtxColorArray(0), modelData->getColNum());
|
||||
#if TARGET_PC
|
||||
j3dSys.setTexture(modelData->getTexture());
|
||||
#endif
|
||||
IF_DUSK(j3dSys.setTexture(modelData->getTexture()));
|
||||
J3DShape::resetVcdVatCache();
|
||||
|
||||
material->loadSharedDL();
|
||||
@@ -150,12 +149,9 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
hsInterpSubRoot = alink->getHsSubChainRootPos();
|
||||
hsInterpSubTop = alink->getHsSubChainTopPos();
|
||||
}
|
||||
const cXyz& chainRootPos = hsInterpRoot;
|
||||
const cXyz& chainTopPos = hsInterpTop;
|
||||
#else
|
||||
const cXyz& chainRootPos = alink->getHsChainRootPos();
|
||||
const cXyz& chainTopPos = alink->getHsChainTopPos();
|
||||
#endif
|
||||
const cXyz& chainRootPos = DUSK_IF_ELSE(hsInterpRoot, alink->getHsChainRootPos());
|
||||
const cXyz& chainTopPos = DUSK_IF_ELSE(hsInterpTop, alink->getHsChainTopPos());
|
||||
cXyz maxDistance = chainRootPos - chainTopPos;
|
||||
|
||||
f32 maxDistanceF = maxDistance.abs();
|
||||
@@ -185,11 +181,9 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
}
|
||||
(void)0;
|
||||
|
||||
#if TARGET_PC
|
||||
int chainLinks = 0;
|
||||
#endif
|
||||
IF_DUSK(int chainLinks = 0);
|
||||
|
||||
while (maxDistanceF > var_f30 IF_DUSK(&&chainLinks < HS_CHAIN_MAX_LINKS)) {
|
||||
while (maxDistanceF > var_f30 IF_DUSK(&& chainLinks < HS_CHAIN_MAX_LINKS)) {
|
||||
temp_f27 = var_f28 * cM_fsin(sp34 * var_f30);
|
||||
s16 spC = cM_atan2s(temp_f27 - var_f26, 5.0f);
|
||||
sp64.x = sp6C.x + spC;
|
||||
@@ -212,19 +206,12 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
var_f26 = temp_f27;
|
||||
var_f30 += fabsf(cM_scos(spC)) * 5.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
chainLinks++;
|
||||
#endif
|
||||
IF_DUSK(chainLinks++);
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const cXyz& subChainRootPos = hsInterpSubRoot;
|
||||
const cXyz& subChainTopPos = hsInterpSubTop;
|
||||
#else
|
||||
const cXyz& subChainRootPos = alink->getHsSubChainRootPos();
|
||||
const cXyz& subChainTopPos = alink->getHsSubChainTopPos();
|
||||
#endif
|
||||
const cXyz& subChainRootPos = DUSK_IF_ELSE(hsInterpSubRoot, alink->getHsSubChainRootPos());
|
||||
const cXyz& subChainTopPos = DUSK_IF_ELSE(hsInterpSubTop, alink->getHsSubChainTopPos());
|
||||
maxDistance = subChainRootPos - subChainTopPos;
|
||||
|
||||
maxDistanceF = maxDistance.abs();
|
||||
@@ -235,11 +222,9 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
sp98 = subChainTopPos;
|
||||
sp6C.set(maxDistance.atan2sY_XZ(), maxDistance.atan2sX_Z(), 0);
|
||||
|
||||
#if TARGET_PC
|
||||
int subChainLinks = 0;
|
||||
#endif
|
||||
IF_DUSK(int subChainLinks = 0);
|
||||
|
||||
while (maxDistanceF > var_f30 IF_DUSK(&&subChainLinks < HS_CHAIN_MAX_LINKS)) {
|
||||
while (maxDistanceF > var_f30 IF_DUSK(&& subChainLinks < HS_CHAIN_MAX_LINKS)) {
|
||||
mDoMtx_stack_c::copy(j3dSys.getViewMtx());
|
||||
mDoMtx_stack_c::transM(sp98);
|
||||
mDoMtx_stack_c::ZXYrotM(sp6C);
|
||||
@@ -252,9 +237,7 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
sp98 += maxDistance * 5.0f;
|
||||
ANGLE_ADD_2(sp6C.z, 0x3000);
|
||||
var_f30 += 5.0f;
|
||||
#if TARGET_PC
|
||||
subChainLinks++;
|
||||
#endif
|
||||
IF_DUSK(subChainLinks++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,9 +624,7 @@ int daBg_c::create() {
|
||||
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
|
||||
OS_REPORT("<BG> room%d\n", roomNo);
|
||||
|
||||
#if TARGET_PC
|
||||
draw_interp_frame = true;
|
||||
#endif
|
||||
IF_DUSK(draw_interp_frame = true);
|
||||
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
@@ -5,15 +5,18 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <os.h>
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/actor/d_a_bg_obj.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include <cstdio>
|
||||
#include <os.h>
|
||||
#include <cstring>
|
||||
#include "d/actor/d_a_set_bgobj.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static const char* getBmdName(int param_0, int param_1) {
|
||||
static char l_bmdName[16];
|
||||
|
||||
@@ -1103,14 +1103,8 @@ inline int daDemo00_c::execute() {
|
||||
case 2: {
|
||||
u16 sp0A = sp0E & 0x3FFF;
|
||||
if ((sp0E & 0xC000) == 0) {
|
||||
#if !MOVIE_SUPPORT
|
||||
// If movie support isn't available, automatically reset.
|
||||
// TPHD-esque. Maybe not the best solution, but it works.
|
||||
dComIfGp_event_reset();
|
||||
#else
|
||||
fopAcM_create(fpcNm_MOVIE_PLAYER_e, sp0A, NULL, fopAcM_GetRoomNo(this), NULL, NULL, 0xFF);
|
||||
mDoGph_gInf_c::fadeOut(1.0f);
|
||||
#endif
|
||||
} else {
|
||||
switch (sp0A) {
|
||||
case 0:
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include <f_ap/f_ap_game.h>
|
||||
#include <dusk/autosave.h>
|
||||
#include "dusk/autosave.h"
|
||||
|
||||
#include "f_ap/f_ap_game.h"
|
||||
#endif
|
||||
|
||||
char DUSK_CONST* daDoor20_c::getStopBmdName() {
|
||||
|
||||
@@ -4542,9 +4542,7 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
i_this->demo_cam_way_spd.z = fabsf(i_this->demo_cam_way.z - i_this->demo_cam_ctr.z);
|
||||
i_this->demo_cam_morf = 0;
|
||||
pla->setPlayerPosAndAngle(&pla->current.pos, pla->shape_angle.y - 4000, 0);
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
if (i_this->demo_timer == 345) {
|
||||
daPy_getPlayerActorClass()->setThrowDamage(boss->enemy.shape_angle.y - 8000 + TREG_S(8),
|
||||
@@ -4791,9 +4789,7 @@ static void demo_camera(e_wb_class* i_this) {
|
||||
i_this->demo_cam_eye.x += 300.0f + VREG_F(8);
|
||||
i_this->demo_cam_eye.y += 150.0f + VREG_F(9);
|
||||
i_this->demo_cam_eye.z -= 1400.0f + VREG_F(10);
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
} else {
|
||||
i_this->demo_cam_eye = enemy->current.pos;
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include <aurora/texture.hpp>
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
#include <aurora/texture.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
using namespace dusk::version;
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
#include "d/d_msg_object.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "d/d_debug_viewer.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static f32 dummy_lit_3777(int idx, u8 foo) {
|
||||
Vec dummy_vec = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
@@ -13,14 +13,11 @@
|
||||
#include <gf/GFGeometry.h>
|
||||
#include <gf/GFLight.h>
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include "helpers/math.h"
|
||||
#endif
|
||||
|
||||
static BOOL daMirror_c_createHeap(fopAc_ac_c* i_this) {
|
||||
return ((daMirror_c*)i_this)->createHeap();
|
||||
}
|
||||
@@ -30,7 +27,7 @@ static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Mirror";
|
||||
static DUSK_CONSTEXPR char DUSK_CONST* l_arcName2 = "MR-Table";
|
||||
|
||||
dMirror_packet_c::dMirror_packet_c() {
|
||||
#ifdef TARGET_PC
|
||||
#if TARGET_PC
|
||||
GXInitTexObj(&mTexObj, nullptr, 0, 0, static_cast<GXTexFmt>(-1), GX_MAX_TEXWRAPMODE,
|
||||
GX_MAX_TEXWRAPMODE, GX_FALSE);
|
||||
#endif
|
||||
|
||||
@@ -14,34 +14,21 @@
|
||||
#pragma optimization_level 4
|
||||
#pragma optimize_for_size off
|
||||
|
||||
#include <cstring>
|
||||
#include <span>
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "d/actor/d_a_movie_player.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/layout.hpp"
|
||||
#include "dusk/os.h"
|
||||
#include "helpers/gx_helper.h"
|
||||
|
||||
#include "JSystem/JAudio2/JASCriticalSection.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/gx_helper.h"
|
||||
#include "dusk/os.h"
|
||||
#include "dusk/layout.hpp"
|
||||
#if MOVIE_SUPPORT
|
||||
#include "turbojpeg.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) {
|
||||
return *(BE(s32)*)readBuf->ptr;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
// idk what OS_THREAD_ATTR_DETACH does, and it stops OSThreadJoin()
|
||||
// probably the difference doesn't matter since we are using OS threads anyways.
|
||||
#define OS_THREAD_ATTR 0
|
||||
@@ -49,7 +36,12 @@ inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) {
|
||||
#define OS_THREAD_ATTR OS_THREAD_ATTR_DETACH
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !TARGET_PC
|
||||
inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) {
|
||||
return *(BE(s32)*)readBuf->ptr;
|
||||
}
|
||||
|
||||
#if !TARGET_PC
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -217,7 +209,6 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr) {
|
||||
info->encodeData++;
|
||||
}
|
||||
|
||||
#if !TARGET_PC
|
||||
ATTRIBUTE_ALIGN(32) static u8 THPStatistics[1120];
|
||||
|
||||
ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Ydchuff;
|
||||
@@ -2587,104 +2578,9 @@ static void __THPHuffDecodeDCTCompV(__REGISTER THPFileInfo* info, THPCoeff* bloc
|
||||
#else // !TARGET_PC
|
||||
|
||||
static daMP_THPPlayer daMP_ActivePlayer;
|
||||
|
||||
#if MOVIE_SUPPORT
|
||||
static std::vector<u8> FixedJpegData;
|
||||
static tjhandle JpegDecompressHandle;
|
||||
|
||||
static const std::vector<u8>& FixJpeg(const std::span<u8> data) {
|
||||
FixedJpegData.resize(0);
|
||||
FixedJpegData.reserve(data.size());
|
||||
|
||||
size_t startOfScanLocation = 0;
|
||||
for (; startOfScanLocation < data.size() - 1; startOfScanLocation++) {
|
||||
if (data[startOfScanLocation] == 0xFF && data[startOfScanLocation + 1] == 0xDA) {
|
||||
goto sosFound;
|
||||
}
|
||||
}
|
||||
|
||||
CRASH("Unable to find SOS marker!");
|
||||
|
||||
sosFound:
|
||||
|
||||
startOfScanLocation += 2; // TODO: Skip entire SOS header?
|
||||
|
||||
size_t endOfImage = data.size() - 1;
|
||||
for (; endOfImage > startOfScanLocation; endOfImage--) {
|
||||
if (data[endOfImage] == 0xFF && data[endOfImage + 1] == 0xD9) {
|
||||
goto eoiFound;
|
||||
}
|
||||
}
|
||||
|
||||
CRASH("Unable to find EOI marker!");
|
||||
eoiFound:
|
||||
|
||||
// Copy data before SOS
|
||||
for (size_t i = 0; i < startOfScanLocation; i++) {
|
||||
FixedJpegData.push_back(data[i]);
|
||||
}
|
||||
|
||||
// Copy data inside SOS, fixing up lacking of "byte shuffling"
|
||||
for (size_t i = startOfScanLocation; i < endOfImage; i++) {
|
||||
u8 value = data[i];
|
||||
FixedJpegData.push_back(value);
|
||||
if (value == 0xFF) {
|
||||
FixedJpegData.push_back(0x00);
|
||||
}
|
||||
}
|
||||
|
||||
// Copy data after SOS.
|
||||
for (size_t i = endOfImage; i < data.size(); i++) {
|
||||
FixedJpegData.push_back(data[i]);
|
||||
}
|
||||
|
||||
return FixedJpegData;
|
||||
}
|
||||
|
||||
static s32 THPVideoDecode(void* file, size_t fileSize, void* tileY, void* tileU, void* tileV, void*) {
|
||||
assert(JpegDecompressHandle);
|
||||
|
||||
const auto handle = JpegDecompressHandle;
|
||||
const auto fixedData = FixJpeg(std::span(static_cast<u8*>(file), fileSize));
|
||||
|
||||
auto ret = tj3DecompressHeader(handle, fixedData.data(), fixedData.size());
|
||||
if (ret == -1) {
|
||||
OSReport_Error("Parsing JPEG header failed: %s", tj3GetErrorStr(handle));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (tj3Get(handle, TJPARAM_JPEGWIDTH) != daMP_ActivePlayer.videoInfo.xSize) {
|
||||
OSReport_Error("Invalid width in video frame!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (tj3Get(handle, TJPARAM_JPEGHEIGHT) != daMP_ActivePlayer.videoInfo.ySize) {
|
||||
OSReport_Error("Invalid height in video frame!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = tj3Set(handle, TJPARAM_SUBSAMP, TJSAMP_420);
|
||||
if (ret != 0) {
|
||||
OSReport_Error("Failed to set subsampling mode: %s", tj3GetErrorStr(handle));
|
||||
return 1;
|
||||
}
|
||||
|
||||
u8* planes[3] = {static_cast<u8*>(tileY), static_cast<u8*>(tileU), static_cast<u8*>(tileV)};
|
||||
ret = tj3DecompressToYUVPlanes8(handle, fixedData.data(), fixedData.size(), planes, nullptr);
|
||||
if (ret != 0) {
|
||||
OSReport_Error("Image decompression failed: %s", tj3GetErrorStr(handle));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else // MOVIE_SUPPORT
|
||||
static s32 THPVideoDecode(void*, size_t, void*, void*, void*, void*) {
|
||||
return 1; // Immediate error.
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !TARGET_PC
|
||||
static BOOL THPInit() {
|
||||
#if !TARGET_PC
|
||||
u8* base;
|
||||
@@ -2712,9 +2608,10 @@ static BOOL THPInit() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) && !TARGET_PC
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif // !TARGET_PC
|
||||
|
||||
#if !TARGET_PC // Defined earlier in file.
|
||||
static daMP_THPPlayer daMP_ActivePlayer;
|
||||
@@ -2937,9 +2834,6 @@ static void daMP_VideoDecode(daMP_THPReadBuffer* readBuffer) {
|
||||
case 0: {
|
||||
if ((daMP_ActivePlayer.videoError = THPVideoDecode(
|
||||
tile,
|
||||
#if TARGET_PC
|
||||
*tileOffsets,
|
||||
#endif
|
||||
textureSet->ytexture, textureSet->utexture,
|
||||
textureSet->vtexture,
|
||||
daMP_ActivePlayer.thpWork))) {
|
||||
@@ -3434,26 +3328,19 @@ static void daMP_THPGXYuv2RgbDraw(u8* y_data, u8* u_data, u8* v_data, s16 x,
|
||||
TGXTexObj tobj0;
|
||||
TGXTexObj tobj1;
|
||||
TGXTexObj tobj2;
|
||||
#if TARGET_PC
|
||||
#define FMT (GXTexFmt)GX_TF_R8_PC
|
||||
#else
|
||||
#define FMT GX_TF_I8
|
||||
#endif
|
||||
|
||||
GXInitTexObj(&tobj0, y_data, textureWidth, textureHeight, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObj(&tobj0, y_data, textureWidth, textureHeight, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&tobj0, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1);
|
||||
GXLoadTexObj(&tobj0, GX_TEXMAP0);
|
||||
|
||||
GXInitTexObj(&tobj1, u_data, textureWidth >> 1, textureHeight >> 1, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObj(&tobj1, u_data, textureWidth >> 1, textureHeight >> 1, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&tobj1, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1);
|
||||
GXLoadTexObj(&tobj1, GX_TEXMAP1);
|
||||
|
||||
GXInitTexObj(&tobj2, v_data, textureWidth >> 1, textureHeight >> 1, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObj(&tobj2, v_data, textureWidth >> 1, textureHeight >> 1, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&tobj2, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1);
|
||||
GXLoadTexObj(&tobj2, GX_TEXMAP2);
|
||||
|
||||
#undef FMT
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT7, 4);
|
||||
GXPosition3s16(x, y, 0);
|
||||
GXTexCoord2u16(0, 0);
|
||||
@@ -3774,13 +3661,6 @@ static BOOL daMP_THPPlayerOpen(char const* filename, BOOL onMemory) {
|
||||
}
|
||||
|
||||
static BOOL daMP_THPPlayerClose() {
|
||||
#if TARGET_PC && MOVIE_SUPPORT
|
||||
tj3Destroy(JpegDecompressHandle);
|
||||
JpegDecompressHandle = nullptr;
|
||||
|
||||
FixedJpegData.clear();
|
||||
#endif
|
||||
|
||||
if (daMP_ActivePlayer.open && daMP_ActivePlayer.state == 0) {
|
||||
daMP_ActivePlayer.open = 0;
|
||||
DVDClose(&daMP_ActivePlayer.fileInfo);
|
||||
@@ -3832,11 +3712,6 @@ static BOOL daMP_THPPlayerSetBuffer(u8* buffer) {
|
||||
|
||||
ysize = ALIGN_NEXT(daMP_ActivePlayer.videoInfo.xSize * daMP_ActivePlayer.videoInfo.ySize, 32);
|
||||
uvsize = ALIGN_NEXT(daMP_ActivePlayer.videoInfo.xSize * daMP_ActivePlayer.videoInfo.ySize / 4, 32);
|
||||
#if TARGET_PC
|
||||
assert(ysize >= tj3YUVPlaneSize(0, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420));
|
||||
assert(uvsize >= tj3YUVPlaneSize(1, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420));
|
||||
assert(uvsize >= tj3YUVPlaneSize(2, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420));
|
||||
#endif
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(daMP_ActivePlayer.textureSet); i++) {
|
||||
daMP_ActivePlayer.textureSet[i].ytexture = ptr;
|
||||
@@ -4329,15 +4204,6 @@ static BOOL daMP_ActivePlayer_Init(char const* moviePath) {
|
||||
|
||||
daMP_THPPlayerSetBuffer((u8*)daMP_buffer);
|
||||
|
||||
#if TARGET_PC && MOVIE_SUPPORT
|
||||
assert(JpegDecompressHandle == nullptr);
|
||||
JpegDecompressHandle = tj3Init(TJINIT_DECOMPRESS);
|
||||
if (JpegDecompressHandle == nullptr) {
|
||||
OSReport_Error("Failed to create turbojpeg handle: %s", tj3GetErrorStr(nullptr));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!daMP_THPPlayerPrepare(0, 0, daMP_audioInfo.sndNumTracks != 1 ? OSGetTick() % daMP_audioInfo.sndNumTracks : 0)) {
|
||||
OSReport("Fail to prepare\n");
|
||||
#if DEBUG
|
||||
@@ -4373,10 +4239,6 @@ static void daMP_ActivePlayer_Main() {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC && 0
|
||||
#include "imgui.h"
|
||||
#endif
|
||||
|
||||
static void daMP_ActivePlayer_Draw() {
|
||||
#if TARGET_PC
|
||||
u16 width = JUTVideo::getManager()->getFbWidth();
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
#include "d/actor/d_a_npc_gra.h"
|
||||
#include "d/actor/d_a_tag_gra.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "mods/items.h"
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
DUSK_GAME_DATA const daNpc_grA_HIOParam daNpc_grA_Param_c::m = {
|
||||
{90.0f, -4.0f, 1.0f, 850.0f, 255.0f, 280.0f, 40.0f, 100.0f, 0.0f, 0.0f, 20.0f,
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
#include "d/actor/d_a_npc_grc.h"
|
||||
#include "d/actor/d_a_npc.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "mods/items.h"
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
enum grC_RES_File_ID {
|
||||
/* BCK */
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static DUSK_CONSTEXPR int l_bmdData[4][2] = {
|
||||
{14, 1}, {26, 2},
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
#include "d/actor/d_a_npc_kkri.h"
|
||||
#include "d/actor/d_a_e_ym.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "mods/items.h"
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
static DUSK_CONSTEXPR int l_bmdData[2][2] = {
|
||||
{35, 1},
|
||||
|
||||
+10
-19
@@ -18,9 +18,12 @@
|
||||
#include "f_op/f_op_kankyo_mng.h"
|
||||
#include "c/c_damagereaction.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static home_path_pnt home_path[38] = {
|
||||
{0, {561.0f, 87.0f, -1110.0f}},
|
||||
{1, {306.0f, 87.0f, -849.0f}},
|
||||
@@ -2656,9 +2659,7 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraFovY = 55.0f;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
// fallthrough
|
||||
|
||||
case 2:
|
||||
@@ -2687,9 +2688,7 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
if (i_this->mDemoCounter == 0) {
|
||||
i_this->mCameraCenter1.set(387.0f, 133.0f, -866.0f);
|
||||
i_this->mCameraEye1.set(284.0f, 208.0f, -585.0f);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
|
||||
if (i_this->mDemoCounter == 12) {
|
||||
@@ -2726,9 +2725,7 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraFovY = 45.0f;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
// fallthrough
|
||||
|
||||
case 11:
|
||||
@@ -2809,14 +2806,10 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
MtxPosition(&vec, &i_this->mCameraEye2);
|
||||
i_this->mCameraEye2 += player->current.pos;
|
||||
player->changeDemoParam2(2);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
} else if (i_this->mDemoCounter == 120) {
|
||||
player->changeDemoParam2(0);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2869,9 +2862,7 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraCenter1 = _this->current.pos;
|
||||
i_this->mCameraCenter1.y += 20.0f;
|
||||
i_this->mCameraFovY = 55.0f;
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
|
||||
camera->mCamera.Set(i_this->mCameraCenter1, i_this->mCameraEye1,
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include "d/actor/d_a_e_ym.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
enum saru_TW_RES_File_ID {
|
||||
/* BMDR */
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include "d/actor/d_a_npc_shop0.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static int createHeapCallBack(fopAc_ac_c* i_this) {
|
||||
return static_cast<daNpc_Shop0_c*>(i_this)->createHeap();
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
#include "d/actor/d_a_obj_automata.h"
|
||||
#include "d/d_msg_object.h"
|
||||
#include "d/actor/d_a_obj_scannon.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
DUSK_GAME_DATA const daNpc_Toby_HIOParam daNpc_Toby_Param_c::m = {
|
||||
160.0f,
|
||||
-3.0f,
|
||||
@@ -1399,7 +1402,7 @@ int daNpc_Toby_c::cutRepairSCannon(int arg0) {
|
||||
old.pos = current.pos;
|
||||
setAngle(cM_deg2s(5.0f * f32(mPath.getArg0())));
|
||||
mEventTimer = mPath.getArg2();
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
} else if (!mHide) {
|
||||
mHide = 1;
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "d/actor/d_a_demo_item.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdData[3] = {
|
||||
{3, 1},
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
class daNpc_ykW_HIO_c : public mDoHIO_entry_c {
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include "d/actor/d_a_npc4.h"
|
||||
#include "d/actor/d_a_obj_gra2.h"
|
||||
#include "d/actor/d_a_npc4.h"
|
||||
#include "d/actor/d_a_tag_gra.h"
|
||||
#include "d/d_bg_w.h"
|
||||
#include "d/d_cc_uty.h"
|
||||
#include "d/d_com_inf_actor.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "helpers/string.hpp"
|
||||
#include "d/d_com_inf_actor.h"
|
||||
#if DEBUG
|
||||
#include "d/d_debug_viewer.h"
|
||||
#endif
|
||||
@@ -21,6 +20,10 @@
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
class daObj_GrA_Param_c {
|
||||
public:
|
||||
virtual ~daObj_GrA_Param_c() {}
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
#include "d/d_cc_d.h"
|
||||
#include "d/d_cc_uty.h"
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include "helpers/math.h"
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
class daObjLv4Chan_HIO_c : public mDoHIO_entry_c {
|
||||
public:
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
#include "d/d_meter2_info.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "d/d_item.h"
|
||||
#include "dusk/mods/item.hpp"
|
||||
#include "mods/items.h"
|
||||
|
||||
#include "d/d_item.h"
|
||||
#endif
|
||||
|
||||
DUSK_GAME_DATA daObjMasterSword_Attr_c const daObjMasterSword_c::mAttr = {1.0f};
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
#include "d/actor/d_a_tag_kmsg.h"
|
||||
#include <types.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "helpers/string.hpp"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "f_op/f_op_msg.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdData[9] = {
|
||||
{36, 1}, {36, 1}, {35, 1}, {37, 1}, {38, 1}, {3, 2}, {3, 2}, {4, 2}, {5, 2},
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static DUSK_CONST char* l_evtNameList[] = {
|
||||
NULL,
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include "d/d_debug_viewer.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "helpers/string.hpp"
|
||||
#endif
|
||||
|
||||
static int createHeapCallBack(fopAc_ac_c* i_this) {
|
||||
daTag_Msg_c* msg = (daTag_Msg_c*)i_this;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "d/d_pane_class_alpha.h"
|
||||
#include "d/d_s_logo.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "dusk/version.hpp"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "f_op/f_op_scene_mng.h"
|
||||
@@ -19,9 +18,9 @@
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
|
||||
#ifdef TARGET_PC
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/version.hpp"
|
||||
#endif
|
||||
|
||||
class daTit_HIO_c : public JORReflexible {
|
||||
@@ -353,11 +352,7 @@ void daTitle_c::fastLogoDispInit() {
|
||||
mWaitTimer = 30;
|
||||
mProcID = 5;
|
||||
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
}
|
||||
#endif
|
||||
IF_DUSK(dusk::frame_interp::request_presentation_sync());
|
||||
}
|
||||
|
||||
void daTitle_c::fastLogoDisp() {
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
|
||||
#include "SSystem/SComponent/c_counter.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
const u16 l_J_Ohana00_64TEX__width = 63;
|
||||
const u16 l_J_Ohana00_64TEX__height = 63;
|
||||
|
||||
@@ -11,15 +11,10 @@
|
||||
#include "d/d_camera.h"
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
const u16 l_M_Hijiki00TEX__width = 31;
|
||||
const u16 l_M_Hijiki00TEX__height = 31;
|
||||
const u16 l_M_kusa05_RGBATEX__width = 31;
|
||||
const u16 l_M_kusa05_RGBATEX__height = 31;
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/dvd_asset.hpp"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
template <typename T, size_t N>
|
||||
@@ -61,6 +56,11 @@ DEFINE_GRASS_ASSET(l_M_Hijiki00TEX, u8, 0x800, {
|
||||
#include "assets/l_M_Hijiki00TEX.h" // ALIGN 32
|
||||
#endif
|
||||
|
||||
const u16 l_M_Hijiki00TEX__width = 31;
|
||||
const u16 l_M_Hijiki00TEX__height = 31;
|
||||
const u16 l_M_kusa05_RGBATEX__width = 31;
|
||||
const u16 l_M_kusa05_RGBATEX__height = 31;
|
||||
|
||||
static u8 l_pos[960] = {
|
||||
0x3F, 0x4A, 0x56, 0xEF, 0xC2, 0x20, 0x00, 0x00, 0x41, 0xFB, 0x17, 0xE4, 0x41, 0xAA, 0xBB, 0xEA,
|
||||
0xC2, 0x20, 0x00, 0x00, 0xC1, 0xB7, 0x03, 0x7A, 0x42, 0x55, 0x8D, 0x6F, 0x43, 0x13, 0x16, 0x3F,
|
||||
|
||||
Reference in New Issue
Block a user