Changes were made to allow compilation in Carbide C++ 2.7 and the Nokia S60v5 SDK. Important code from the OpenGL ES 1.1 backend was commented out since it prevented compilation

This commit is contained in:
Dante Leoncini 2026-05-01 07:16:02 -03:00
parent 558f1b9f32
commit 33a8324d08
48 changed files with 486 additions and 295 deletions

View file

@ -84,7 +84,11 @@ public:
inline float GetTimeLeft() { return hierarchy->totalLength - currentTime; }
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
#ifdef S60V5
return (CAnimBlendAssociation*)((uint8*)l - OFFSET_OF(CAnimBlendAssociation, link));
#else
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
#endif
}
};

View file

@ -30,4 +30,4 @@ public:
void MoveMemory(bool onlyone = false);
};
VALIDATE_SIZE(CAnimBlendHierarchy, 0x28);
VALIDATE_SIZE(CAnimBlendHierarchy, 0x28);

View file

@ -207,4 +207,4 @@ enum AnimationId
ANIM_STD_PHONE_TALK,
ANIM_STD_NUM
};
};

View file

@ -670,4 +670,4 @@ static char StreamedNameTable[][25] =
"AUDIO\\k1_b.WAV",
"AUDIO\\cat1.WAV"
};
#endif
#endif

View file

@ -13,4 +13,4 @@ struct CColBox
CVector GetSize(void) { return max - min; }
CColBox& operator=(const CColBox &other);
};
};

View file

@ -11,4 +11,4 @@ struct CColLine
CColLine(void) { };
CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; };
void Set(const CVector &p0, const CVector &p1);
};
};

View file

@ -34,4 +34,4 @@ struct CColModel
void GetTrianglePoint(CVector &v, int i) const;
CColModel& operator=(const CColModel& other);
};
};

View file

@ -10,4 +10,4 @@ struct CColSphere
uint8 surface;
uint8 piece;
void Set(float radius, const CVector &center, uint8 surf = SURFACE_DEFAULT, uint8 piece = 0);
};
};

View file

@ -65,4 +65,4 @@ struct CColTrianglePlane
void GetNormal(CVector &n) const { n = normal; }
float CalcPoint(const CVector &v) const { return DotProduct(normal, v) - dist; };
#endif
};
};

View file

@ -33,4 +33,4 @@ struct CompressedVector
CVector Get(void) const { return CVector(x, y, z); };
void Set(float x, float y, float z) { this->x = x; this->y = y; this->z = z; };
#endif
};
};

View file

@ -28,4 +28,4 @@ public:
bool WorkToDoForMedics();
};
extern CAccidentManager gAccidentManager;
extern CAccidentManager gAccidentManager;

View file

@ -62,4 +62,4 @@ public:
static void ReportCrimeForEvent(eEventType type, intptr, bool);
};
extern CEvent gaEvent[NUMEVENTS];
extern CEvent gaEvent[NUMEVENTS];

View file

@ -8,4 +8,4 @@ public:
bool IsInRange(CVector2D vec);
void DebugShowRange(float, int);
CVector2D GetRandomPointInRange();
};
};

View file

@ -69,7 +69,7 @@ myrand(void)
{
#ifdef USE_PS2_RAND
// Use our own implementation of rand, stolen from PS2
myrand_seed = 0x5851F42D4C957F2D * myrand_seed + 1;
myrand_seed = 0x5851F42D4C957F2DULL * myrand_seed + 1;
return ((myrand_seed >> 32) & 0x7FFFFFFF);
#else
// or original codewarrior rand

View file

@ -201,4 +201,4 @@ inline DebugMenuEntry *DebugMenuAddVarBool8(const char *path, const char *name,
{
return DebugMenuAddVarBool8(path, name, (int8_t*)ptr, triggerFunc);
}
#endif
#endif

View file

@ -541,4 +541,4 @@ CCompressedMatrixNotAligned::DecompressIntoFullMatrix(CMatrix &other)
other.GetUp() = CrossProduct(other.GetRight(), other.GetForward());
other.GetPosition() = m_vecPos;
other.Reorthogonalise();
}
}

View file

@ -174,4 +174,4 @@ CQuaternion::Set(float f1, float f2, float f3)
y = ((s1 * c2) * c3) + ((s2 * c1) * s3);
z = ((s2 * c1) * c3) - ((s1 * c2) * s3);
w = ((c2 * c1) * c3) + ((s2 * s1) * s3);
}
}

View file

@ -14,4 +14,4 @@ CRect::CRect(float l, float t, float r, float b)
top = t;
right = r;
bottom = b;
}
}

View file

@ -126,4 +126,4 @@ class CMatrix;
CVector Multiply3x3(const CMatrix &mat, const CVector &vec);
CVector Multiply3x3(const CVector &vec, const CMatrix &mat);
CVector operator*(const CMatrix &mat, const CVector &vec);
CVector operator*(const CMatrix &mat, const CVector &vec);

View file

@ -11,4 +11,4 @@ public:
public:
CMloModelInfo(void) : CClumpModelInfo(MITYPE_MLO) {}
void ConstructClump();
};
};

View file

@ -506,4 +506,4 @@ IsFence(int16 id)
{
return id == MI_FENCE ||
id == MI_FENCE2;
}
}

View file

@ -64,4 +64,4 @@ public:
};
#ifndef PED_SKIN
VALIDATE_SIZE(CPedModelInfo, 0x48);
#endif
#endif

View file

@ -10,4 +10,4 @@ public:
void Shutdown(void) {};
RwObject *CreateInstance(void) { return nil; }
void SetClump(RpClump*) {};
};
};

View file

@ -464,4 +464,4 @@ CPed::RunToReportCrime(eCrimeType crimeToReport)
m_phoneId = phoneId;
m_crimeToReportOnPhone = crimeToReport;
return true;
}
}

View file

@ -149,4 +149,4 @@ CPed::Say(uint16 audio)
m_queuedSound = audio;
}
}
}
}

View file

@ -307,4 +307,4 @@ CPed::DebugRenderClosePedText()
{
// TODO: mobile code
}
#endif
#endif

View file

@ -5,4 +5,4 @@ public:
static void FindZCoorForPed(CVector* pos);
static CEntity* IsPositionClearOfCars(Const CVector*);
static bool IsPositionClearForPed(CVector*);
};
};

View file

@ -170,4 +170,4 @@ public:
static ePedStats GetPedStatType(char *name);
};
VALIDATE_SIZE(CPedStats, 0x34);
VALIDATE_SIZE(CPedStats, 0x34);

View file

@ -24,4 +24,4 @@ public:
extern CConsole TheConsole;
void cprintf(char*, ...);
void cprintf(char*, ...);

View file

@ -60,4 +60,4 @@ void RestoreAlphaTest();
#else
#define SetAlphaTest(a) (0)
#define RestoreAlphaTest() (0)
#endif
#endif

View file

@ -70,4 +70,4 @@ ZeroSaveBuf(uint8 *&buf, uint32 length)
} while(0)
#else
#define CheckSaveHeader(buf, a, b, c, d, size) SkipSaveBuf(buf, 8);
#endif
#endif

View file

@ -406,7 +406,9 @@ public:
openParams.width = RsGlobal.width;
openParams.height = RsGlobal.height;
openParams.windowtitle = RsGlobal.appName;
#ifndef S60V5
openParams.windowtitle = RsGlobal.appName;
#endif
ControlsManager.MakeControllerActionsBlank();
ControlsManager.InitDefaultControlConfiguration();

View file

@ -78,4 +78,4 @@ VALIDATE_SIZE(CBoat, 0x484);
extern float MAX_WAKE_LENGTH;
extern float MIN_WAKE_INTERVAL;
extern float WAKE_LIFETIME;
extern float WAKE_LIFETIME;

View file

@ -75,4 +75,4 @@ public:
};
VALIDATE_SIZE(CWeapon, 0x18);
void FireOneInstantHitRound(CVector *source, CVector *target, int32 damage);
void FireOneInstantHitRound(CVector *source, CVector *target, int32 damage);

View file

@ -49,4 +49,4 @@ public:
bool IsFlagSet(uint32 flag) const { return (m_Flags & flag) != 0; }
};
VALIDATE_SIZE(CWeaponInfo, 0x54);
VALIDATE_SIZE(CWeaponInfo, 0x54);

View file

@ -46,4 +46,4 @@ enum eWeaponState
WEAPONSTATE_RELOADING,
WEAPONSTATE_OUT_OF_AMMO,
WEAPONSTATE_MELEE_MADECONTACT
};
};