mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-02 18:46:00 -04:00
Fix some Clang compile warnings
This commit is contained in:
@@ -116,7 +116,13 @@ public:
|
||||
// same logic but without the bug.
|
||||
// See J3DMaterialFactory::newColorChan - both the bugged and correct behavior are present there, as it calls
|
||||
// both constructors.
|
||||
#if TARGET_PC
|
||||
// The faulty comparison is EXTREMELY noisy in the build due to warnings being emitted for
|
||||
// every TU that includes it - best to just remove it since it doesn't do anything anyway.
|
||||
u32 ambSrc = info.mAmbSrc;
|
||||
#else
|
||||
u32 ambSrc = info.mAmbSrc == 0xFFFF ? 0 : info.mAmbSrc;
|
||||
#endif
|
||||
mColorChanID = calcColorChanID(info.mEnable, info.mMatSrc, info.mLightMask,
|
||||
info.mDiffuseFn, info.mAttnFn, ambSrc);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,12 @@ public:
|
||||
|
||||
static JHIComPortManager<T>* getInstance() { return instance; }
|
||||
|
||||
#ifdef __MWERKS__
|
||||
static JHIComPortManager<T>* instance;
|
||||
#else
|
||||
// C++17 allows in-class instantiation
|
||||
static inline JHIComPortManager<T>* instance = nullptr;
|
||||
#endif
|
||||
|
||||
/* 0x00000 */ T port;
|
||||
/* 0x0000C */ JHIpvector<JHITag<T>*, 10> field_0xc;
|
||||
|
||||
@@ -56,13 +56,13 @@ void J3DClusterLoader_v15::readCluster(const J3DClusterBlock* block) {
|
||||
mpDeformData->mVtxNrmNum = block->mVtxNrmNum;
|
||||
mpDeformData->mClusterVertexNum = block->mClusterVertexNum;
|
||||
|
||||
if (block->mClusterName != NULL) {
|
||||
if ((uintptr_t)block->mClusterName != (uintptr_t)NULL) {
|
||||
mpDeformData->mClusterName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(block, block->mClusterName));
|
||||
} else {
|
||||
mpDeformData->mClusterName = NULL;
|
||||
}
|
||||
if (block->mClusterKeyName != NULL) {
|
||||
if ((uintptr_t)block->mClusterKeyName != (uintptr_t)NULL) {
|
||||
mpDeformData->mClusterKeyName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(block, block->mClusterKeyName));
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,7 @@ J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) {
|
||||
mMaterialNum = i_block.mMaterialNum;
|
||||
mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&i_block, i_block.mpMaterialInitData);
|
||||
mpMaterialID = JSUConvertOffsetToPtr<BE(u16)>(&i_block, i_block.mpMaterialID);
|
||||
if (i_block.mpIndInitData != NULL && (uintptr_t)i_block.mpIndInitData - (uintptr_t)i_block.mpNameTable > 4) {
|
||||
if (i_block.mpIndInitData != (uintptr_t)NULL && (uintptr_t)i_block.mpIndInitData - (uintptr_t)i_block.mpNameTable > 4) {
|
||||
mpIndInitData = JSUConvertOffsetToPtr<J3DIndInitData>(&i_block, i_block.mpIndInitData);
|
||||
} else {
|
||||
mpIndInitData = NULL;
|
||||
|
||||
@@ -603,7 +603,7 @@ void J3DModelLoader::readJoint(J3DJointBlock const* i_block) {
|
||||
J3D_ASSERT_NULLPTR(781, i_block);
|
||||
J3DJointFactory factory(*i_block);
|
||||
mpModelData->getJointTree().mJointNum = i_block->mJointNum;
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpModelData->getJointTree().mJointName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(791, mpModelData->getJointTree().mJointName);
|
||||
@@ -623,7 +623,7 @@ void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_fla
|
||||
J3DMaterialFactory factory(*i_block);
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(832, mpMaterialTable->mMaterialName);
|
||||
@@ -669,7 +669,7 @@ void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u
|
||||
J3DMaterialFactory_v21 factory(*i_block);
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(930, mpMaterialTable->mMaterialName);
|
||||
@@ -713,7 +713,7 @@ void J3DModelLoader::readShape(J3DShapeBlock const* i_block, u32 i_flags) {
|
||||
J3DShapeTable* shape_table = mpModelData->getShapeTable();
|
||||
J3DShapeFactory factory(*i_block);
|
||||
shape_table->mShapeNum = i_block->mShapeNum;
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
shape_table->mShapeName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1026, shape_table->mShapeName);
|
||||
@@ -738,7 +738,7 @@ void J3DModelLoader::readTexture(J3DTextureBlock const* i_block) {
|
||||
J3D_ASSERT_NULLPTR(1067, i_block);
|
||||
u16 texture_num = i_block->mTextureNum;
|
||||
ResTIMG* texture_res = JSUConvertOffsetToPtr<ResTIMG>(i_block, i_block->mpTextureRes);
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mTextureName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1077, mpMaterialTable->mTextureName);
|
||||
@@ -753,7 +753,7 @@ void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* i_block, u32
|
||||
J3D_ASSERT_NULLPTR(1101, i_block);
|
||||
J3DMaterialFactory factory(*i_block);
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1114, mpMaterialTable->mMaterialName);
|
||||
@@ -776,7 +776,7 @@ void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* i_blo
|
||||
J3D_ASSERT_NULLPTR(1152, i_block);
|
||||
J3DMaterialFactory_v21 factory(*i_block);
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1165, mpMaterialTable->mMaterialName);
|
||||
@@ -799,7 +799,7 @@ void J3DModelLoader::readTextureTable(J3DTextureBlock const* i_block) {
|
||||
J3D_ASSERT_NULLPTR(1200, i_block);
|
||||
u16 texture_num = i_block->mTextureNum;
|
||||
ResTIMG* texture_res = JSUConvertOffsetToPtr<ResTIMG>(i_block, i_block->mpTextureRes);
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mTextureName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1211, mpMaterialTable->mTextureName);
|
||||
@@ -815,7 +815,7 @@ void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* i_block, u32 i_
|
||||
J3DMaterialFactory factory(*i_block);
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials();
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1251, mpMaterialTable->mMaterialName);
|
||||
@@ -841,7 +841,7 @@ void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* i_block, u32 i_fla
|
||||
mpMaterialTable->field_0x1c = 1;
|
||||
mpMaterialTable->mMaterialNum = i_block->mMaterialNum;
|
||||
mpMaterialTable->mUniqueMatNum = i_block->mMaterialNum;
|
||||
if (i_block->mpNameTable != NULL) {
|
||||
if (i_block->mpNameTable != (uintptr_t)NULL) {
|
||||
mpMaterialTable->mMaterialName =
|
||||
JKR_NEW JUTNameTab(JSUConvertOffsetToPtr<ResNTAB>(i_block, i_block->mpNameTable));
|
||||
J3D_ASSERT_ALLOCMEM(1312, mpMaterialTable->mMaterialName);
|
||||
|
||||
@@ -222,7 +222,7 @@ u32 J3DModelLoader_v26::calcSizeMaterial(const J3DMaterialBlock* block, u32 flag
|
||||
J3DMaterialFactory factory(*block);
|
||||
u32 count = block->mMaterialNum;
|
||||
int uniqueCount = factory.countUniqueMaterials();
|
||||
if (block->mpNameTable != NULL) {
|
||||
if (block->mpNameTable != (uintptr_t)NULL) {
|
||||
size += 0x10;
|
||||
}
|
||||
size += (count * sizeof(J3DMaterial*));
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#if TARGET_PC
|
||||
#include <format>
|
||||
#include <fmt/ranges.h>
|
||||
#endif
|
||||
|
||||
void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i_layer, s8 i_wipe,
|
||||
u8 i_speed) {
|
||||
@@ -1661,7 +1665,20 @@ static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void*
|
||||
player_data++;
|
||||
}
|
||||
if (i == num) {
|
||||
#if TARGET_PC
|
||||
std::vector<s16> valid_points;
|
||||
valid_points.reserve(num);
|
||||
player_data = player->m_entries;
|
||||
for (i = 0; i < num; i++) {
|
||||
valid_points.push_back(player_data->base.angle.z);
|
||||
player_data++;
|
||||
}
|
||||
std::ranges::sort(valid_points);
|
||||
DuskLog.fatal("Failed to find player start point for next stage! Requested point: {}, Valid points: [{}]",
|
||||
point, fmt::join(valid_points, ", "));
|
||||
#else
|
||||
OS_REPORT_ERROR("プレイヤーが発見できません。[No.%d]\n切り替えの情報や処理の確認をお願いします。\n", point);
|
||||
#endif
|
||||
}
|
||||
JUT_ASSERT(1636, i != num);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace dusk {
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Pause", &StubLogPaused);
|
||||
|
||||
ImGui::Text("Line count (this frame): %llu", LineOffsets.size());
|
||||
ImGui::Text("Line count (this frame): %zu", LineOffsets.size());
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
@@ -82,4 +82,4 @@ namespace dusk {
|
||||
StubLogBuffer.clear();
|
||||
LineOffsets.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2276,7 +2276,7 @@ int mDoExt_3Dline_c::init(u16 param_0, int param_1, BOOL param_2) {
|
||||
int sp20 = param_0 * 2;
|
||||
|
||||
field_0x8[0] = JKR_NEW_ARRAY(cXyz, sp20);
|
||||
if (field_0x8 == NULL) {
|
||||
if (field_0x8[0] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2286,7 +2286,7 @@ int mDoExt_3Dline_c::init(u16 param_0, int param_1, BOOL param_2) {
|
||||
}
|
||||
|
||||
field_0x10[0] = JKR_NEW_ARRAY(mDoExt_3Dline_field_0x10_c, sp20);
|
||||
if (field_0x10 == NULL) {
|
||||
if (field_0x10[0] == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -245,8 +245,8 @@ int game_main(int argc, char* argv[]) {
|
||||
|
||||
if (parsed_arg_options.count("help"))
|
||||
{
|
||||
printf((arg_options.help() + "\n").c_str());
|
||||
exit(0);
|
||||
printf("%s", (arg_options.help() + "\n").c_str());
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
catch (const cxxopts::exceptions::exception& e) {
|
||||
@@ -310,13 +310,13 @@ bool JKRHeap::dump_sort() {
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __MWERKS__
|
||||
template <typename T>
|
||||
JHIComPortManager<T>* JHIComPortManager<T>::instance = nullptr;
|
||||
|
||||
template <>
|
||||
JHIComPortManager<JHICmnMem>* JHIComPortManager<JHICmnMem>::instance = nullptr;
|
||||
|
||||
#ifdef __MWERKS__
|
||||
template<>
|
||||
Z2WolfHowlMgr* JASGlobalInstance<Z2WolfHowlMgr>::sInstance JAS_GLOBAL_INSTANCE_INIT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user