mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-20 13:24:40 -04:00
Fix MSVC compiler and linker errors
- Fix struct/class forward declaration mismatches (JAIAudience, JASTrack) causing different MSVC mangled names and unresolved symbols - Add jsystem_stubs.cpp with stubs for JASHeap, JASVoiceBank, J3DShapeTable, JAUSection, JHICommBuf, HIO/HIO2, JOR
This commit is contained in:
@@ -178,7 +178,11 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
|
||||
}
|
||||
|
||||
JUtility::TColor J2DMaterialFactory::newMatColor(int param_0, int param_1) const {
|
||||
#ifdef __MWERKS__
|
||||
JUtility::TColor local_20 = (GXColor){0xff,0xff,0xff,0xff};
|
||||
#else
|
||||
JUtility::TColor local_20 = GXColor{0xff,0xff,0xff,0xff};
|
||||
#endif
|
||||
J2DMaterialInitData* iVar2 = &field_0x4[field_0x8[param_0]];
|
||||
if (iVar2->field_0x8[param_1] != 0xffff) {
|
||||
return field_0x10[iVar2->field_0x8[param_1]];
|
||||
|
||||
@@ -552,6 +552,32 @@ inline f32 J3DHermiteInterpolation(__REGISTER f32 pp1, __REGISTER s16 const* pp2
|
||||
fsubs fout, fout, ff0
|
||||
}
|
||||
// clang-format on
|
||||
return fout;
|
||||
#else
|
||||
f32 time1 = (f32)*pp2;
|
||||
f32 value1 = (f32)*pp3;
|
||||
f32 tangent1 = (f32)*pp4;
|
||||
f32 time2 = (f32)*pp5;
|
||||
f32 value2 = (f32)*pp6;
|
||||
f32 tangent2 = (f32)*pp7;
|
||||
|
||||
f32 duration = time2 - time1;
|
||||
f32 t = (pp1 - time1) / duration;
|
||||
f32 t2 = t * t;
|
||||
|
||||
f32 dv = value2 - value1;
|
||||
f32 ff4 = dv - duration * tangent1;
|
||||
|
||||
f32 ff0 = tangent2 * duration + value1;
|
||||
ff0 = ff0 - value2;
|
||||
ff0 = ff0 - ff4;
|
||||
ff0 = t2 * ff0;
|
||||
|
||||
f32 fout = duration * tangent1 + ff0;
|
||||
fout = fout * t + value1;
|
||||
fout = ff4 * t2 + fout;
|
||||
fout = fout - ff0;
|
||||
|
||||
return fout;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ Mtx* J3DMtxBuffer::sNoUseDrawMtxPtr = &J3DMtxBuffer::sNoUseDrawMtx;
|
||||
Mtx33* J3DMtxBuffer::sNoUseNrmMtxPtr = &J3DMtxBuffer::sNoUseNrmMtx;
|
||||
|
||||
// force .sdata2 order
|
||||
f32 dummy1() {
|
||||
static f32 dummy1() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
f32 dummy0() {
|
||||
static f32 dummy0() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -464,7 +464,11 @@ u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial* i_material, int i_id
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const {
|
||||
#ifdef __MWERKS__
|
||||
J3DGXColor dflt = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
#else
|
||||
J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff};
|
||||
#endif
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) {
|
||||
return mpMatColor[mtl_init_data->mMatColorIdx[i_no]];
|
||||
@@ -493,7 +497,11 @@ J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const {
|
||||
#ifdef __MWERKS__
|
||||
J3DGXColor dflt = (GXColor){0x32, 0x32, 0x32, 0x32};
|
||||
#else
|
||||
J3DGXColor dflt = GXColor{0x32, 0x32, 0x32, 0x32};
|
||||
#endif
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mAmbColorIdx[i_no] != 0xffff) {
|
||||
return mpAmbColor[mtl_init_data->mAmbColorIdx[i_no]];
|
||||
@@ -570,7 +578,11 @@ J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const {
|
||||
#ifdef __MWERKS__
|
||||
J3DGXColor dflt = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
#else
|
||||
J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff};
|
||||
#endif
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevKColorIdx[i_no] != 0xffff) {
|
||||
return mpTevKColor[mtl_init_data->mTevKColorIdx[i_no]];
|
||||
|
||||
@@ -167,7 +167,11 @@ J3DMaterial* J3DMaterialFactory_v21::create(J3DMaterial* i_material, int i_idx,
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory_v21::newMatColor(int i_idx, int i_no) const {
|
||||
#ifdef __MWERKS__
|
||||
J3DGXColor defaultColor = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
#else
|
||||
J3DGXColor defaultColor = GXColor{0xff, 0xff, 0xff, 0xff};
|
||||
#endif
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) {
|
||||
return J3DGXColor(mpMatColor[mtl_init_data->mMatColorIdx[i_no]]);
|
||||
@@ -262,7 +266,11 @@ J3DGXColorS10 J3DMaterialFactory_v21::newTevColor(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory_v21::newTevKColor(int i_idx, int param_1) const {
|
||||
#ifdef __MWERKS__
|
||||
J3DGXColor defaultColor = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
#else
|
||||
J3DGXColor defaultColor = GXColor{0xff, 0xff, 0xff, 0xff};
|
||||
#endif
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevKColorIdx[param_1] != 0xffff) {
|
||||
return J3DGXColor(mpTevKColor[mtl_init_data->mTevKColorIdx[param_1]]);
|
||||
|
||||
Reference in New Issue
Block a user