semi-working miami build

This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2025-02-22 22:20:33 +02:00
parent 72056d2f57
commit 176d4ebfe0
28 changed files with 146 additions and 79 deletions

View file

@ -140,6 +140,12 @@
"svd": "cpp", "svd": "cpp",
"print": "cpp", "print": "cpp",
"strstream": "cpp", "strstream": "cpp",
"regex": "cpp" "regex": "cpp",
"cassert": "cpp",
"barrier": "cpp",
"coroutine": "cpp",
"future": "cpp",
"latch": "cpp",
"syncstream": "cpp"
} }
} }

View file

@ -44,8 +44,9 @@ all: $(TARGET)
include common.mk include common.mk
# ../src/Audio/sampman_dc.o
OBJS = $(RE3_OBJS) $(RW_OBJS) \ OBJS = $(RE3_OBJS) $(RW_OBJS) \
../src/Audio/sampman_dc.o \ ../miami/audio/sampman_null.o \
../src/prof/profiler.o ../src/prof/profiler.o
OBJS_TEXCONV = $(RW_OBJS:.o=.texconv.o) OBJS_TEXCONV = $(RW_OBJS:.o=.texconv.o)
@ -123,7 +124,7 @@ CXXFLAGS += $(if $(WITH_32MB),-O3,-Os) \
$(if $(WITH_PROF),-DWITH_PROF=\"$(WITH_PROF)\") \ $(if $(WITH_PROF),-DWITH_PROF=\"$(WITH_PROF)\") \
-MMD -MP -ffunction-sections -fdata-sections -ffast-math \ -MMD -MP -ffunction-sections -fdata-sections -ffast-math \
-fmerge-all-constants -fomit-frame-pointer -ml -std=gnu++20 \ -fmerge-all-constants -fomit-frame-pointer -ml -std=gnu++20 \
-fno-exceptions -fno-rtti -flto=auto -fipa-pta -Wno-write-strings \ -fno-exceptions -fno-rtti -fipa-pta -Wno-write-strings \
-Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion \ -Wno-deprecated-enum-enum-conversion -Wno-deprecated-enum-float-conversion \
-Wno-multichar -Wno-unused-value -Wno-char-subscripts -Wno-reorder \ -Wno-multichar -Wno-unused-value -Wno-char-subscripts -Wno-reorder \
-Wno-unused-function -Wno-class-memaccess -fno-permissive \ -Wno-unused-function -Wno-class-memaccess -fno-permissive \
@ -163,7 +164,7 @@ $(OBJS_NO_FAST_MATH): %.o: %.cpp
$(TARGET): $(OBJS) $(TARGET): $(OBJS)
kos-c++ -o $(TARGET) $(OBJS) -Wl,--gc-sections -Wl,--as-needed -Wl,-Map,output.map \ kos-c++ -o $(TARGET) $(OBJS) -Wl,--gc-sections -Wl,--as-needed -Wl,-Map,output.map \
-flto=auto $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat) -Wl,--build-id=sha1 $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat) -Wl,--build-id=sha1
@echo && echo && echo "*** Build Completed Successfully ***" && echo && echo @echo && echo && echo "*** Build Completed Successfully ***" && echo && echo
run: $(TARGET) run: $(TARGET)

View file

@ -24,6 +24,10 @@ git-version.h: git-version.tmp
../miami/skel/dc/dc.cpp: git-version.h ../miami/skel/dc/dc.cpp: git-version.h
# ../miami/core/CdStreamDC.o \
# ../miami/skel/dc/dc.o \
../miami/vmu/vmu.o \
# List all of your C files here, but change the extension to ".o" # List all of your C files here, but change the extension to ".o"
# Include "romdisk.o" if you want a rom disk. # Include "romdisk.o" if you want a rom disk.
RE3_OBJS = \ RE3_OBJS = \
@ -84,7 +88,6 @@ RE3_OBJS = \
../miami/core/Accident.o \ ../miami/core/Accident.o \
../miami/core/Cam.o \ ../miami/core/Cam.o \
../miami/core/Camera.o \ ../miami/core/Camera.o \
../miami/core/CdStreamDC.o \
../miami/core/Clock.o \ ../miami/core/Clock.o \
../miami/core/ControllerConfig.o \ ../miami/core/ControllerConfig.o \
../miami/core/Debug.o \ ../miami/core/Debug.o \
@ -147,7 +150,6 @@ RE3_OBJS = \
../miami/modelinfo/TimeModelInfo.o \ ../miami/modelinfo/TimeModelInfo.o \
../miami/modelinfo/VehicleModelInfo.o \ ../miami/modelinfo/VehicleModelInfo.o \
\ \
../miami/objects/CutsceneHead.o \
../miami/objects/CutsceneObject.o \ ../miami/objects/CutsceneObject.o \
../miami/objects/DummyObject.o \ ../miami/objects/DummyObject.o \
../miami/objects/Object.o \ ../miami/objects/Object.o \
@ -218,7 +220,6 @@ RE3_OBJS = \
../miami/skel/crossplatform.o \ ../miami/skel/crossplatform.o \
../miami/skel/events.o \ ../miami/skel/events.o \
../miami/skel/skeleton.o \ ../miami/skel/skeleton.o \
../miami/skel/dc/dc.o \
\ \
../miami/text/Messages.o \ ../miami/text/Messages.o \
../miami/text/Pager.o \ ../miami/text/Pager.o \
@ -266,7 +267,6 @@ RE3_OBJS = \
../miami/extras/postfx.o \ ../miami/extras/postfx.o \
../miami/extras/screendroplets.o \ ../miami/extras/screendroplets.o \
\ \
../miami/vmu/vmu.o \
../vendor/miniLZO/minilzo.o \ ../vendor/miniLZO/minilzo.o \
\ \

View file

@ -84,9 +84,9 @@
#define EXTENDED_RANGE_DESPAWN_MULTIPLIER (1.5f) #define EXTENDED_RANGE_DESPAWN_MULTIPLIER (1.5f)
bool CCarCtrl::bMadDriversCheat; bool CCarCtrl::bMadDriversCheat;
int CCarCtrl::NumLawEnforcerCars; int32 CCarCtrl::NumLawEnforcerCars;
int CCarCtrl::NumAmbulancesOnDuty; int32 CCarCtrl::NumAmbulancesOnDuty;
int CCarCtrl::NumFiretrucksOnDuty; int32 CCarCtrl::NumFiretrucksOnDuty;
bool CCarCtrl::bCarsGeneratedAroundCamera; bool CCarCtrl::bCarsGeneratedAroundCamera;
float CCarCtrl::CarDensityMultiplier = 1.0f; float CCarCtrl::CarDensityMultiplier = 1.0f;
int32 CCarCtrl::NumMissionCars; int32 CCarCtrl::NumMissionCars;
@ -811,7 +811,7 @@ CCarCtrl::AddToLoadedVehicleArray(int32 mi, int32 rating, int32 freq)
} }
void void
CCarCtrl::RemoveFromLoadedVehicleArray(int mi, int32 rating) CCarCtrl::RemoveFromLoadedVehicleArray(int32 mi, int32 rating)
{ {
int index = 0; int index = 0;
while (LoadedCarsArray[rating][index] != -1) { while (LoadedCarsArray[rating][index] != -1) {
@ -832,7 +832,7 @@ CCarCtrl::RemoveFromLoadedVehicleArray(int mi, int32 rating)
} }
int32 int32
CCarCtrl::ChooseCarModelToLoad(int rating) CCarCtrl::ChooseCarModelToLoad(int32 rating)
{ {
return CarArrays[rating][CGeneral::GetRandomNumberInRange(0, TotalNumOfCarsOfRating[rating])]; return CarArrays[rating][CGeneral::GetRandomNumberInRange(0, TotalNumOfCarsOfRating[rating])];
} }
@ -3229,7 +3229,7 @@ bool CCarCtrl::GenerateOneEmergencyServicesCar(uint32 mi, CVector vecPos)
bool created = false; bool created = false;
int attempts = 0; int attempts = 0;
CVector spawnPos; CVector spawnPos;
int curNode, nextNode; int32 curNode, nextNode;
float posBetweenNodes; float posBetweenNodes;
while (!created && attempts < 5){ while (!created && attempts < 5){
if (ThePaths.GenerateCarCreationCoors(pPlayerPos.x, pPlayerPos.y, 0.707f, 0.707f, if (ThePaths.GenerateCarCreationCoors(pPlayerPos.x, pPlayerPos.y, 0.707f, 0.707f,

View file

@ -421,7 +421,7 @@ CPathFind::StoreDetachedNodeInfoCar(int32 node, int8 type, int32 next, float x,
} }
void void
CPathFind::CalcNodeCoors(float x, float y, float z, int id, CVector *out) CPathFind::CalcNodeCoors(float x, float y, float z, int32 id, CVector *out)
{ {
CVector pos; CVector pos;
pos.x = x; pos.x = x;
@ -600,7 +600,7 @@ int32 TempListLength;
void void
CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoForObject *objectpathinfo, CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoForObject *objectpathinfo,
float maxdist, CPathInfoForObject *detachednodes, int numDetached) float maxdist, CPathInfoForObject *detachednodes, int32 numDetached)
{ {
static CVector CoorsXFormed; static CVector CoorsXFormed;
int i, j, k; int i, j, k;

View file

@ -1555,7 +1555,7 @@ int16 ThingsToCollect;
CPacManPickup CPacManPickups::aPMPickUps[NUMPACMANPICKUPS]; CPacManPickup CPacManPickups::aPMPickUps[NUMPACMANPICKUPS];
CVector CPacManPickups::LastPickUpCoors; CVector CPacManPickups::LastPickUpCoors;
int32 CPacManPickups::PillsEatenInRace; int CPacManPickups::PillsEatenInRace;
bool CPacManPickups::bPMActive; bool CPacManPickups::bPMActive;
void void

View file

@ -1062,7 +1062,7 @@ int8 CRunningScript::ProcessOneCommand()
int8 CRunningScript::ProcessCommands0To99(int32 command) int8 CRunningScript::ProcessCommands0To99(int32 command)
{ {
float *fScriptVar1; float *fScriptVar1;
int *nScriptVar1; int32 *nScriptVar1;
switch (command) { switch (command) {
case COMMAND_NOP: case COMMAND_NOP:
return 0; return 0;
@ -1795,7 +1795,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
int8 CRunningScript::ProcessCommands100To199(int32 command) int8 CRunningScript::ProcessCommands100To199(int32 command)
{ {
float *fScriptVar1; float *fScriptVar1;
int *nScriptVar1; int32 *nScriptVar1;
switch (command) { switch (command) {
case COMMAND_SUB_INT_LVAR_FROM_INT_VAR: case COMMAND_SUB_INT_LVAR_FROM_INT_VAR:
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);

View file

@ -2819,7 +2819,7 @@ CCamera::IsItTimeForNewcam(int32 obbeMode, int32 time)
} }
bool bool
CCamera::TryToStartNewCamMode(int obbeMode) CCamera::TryToStartNewCamMode(int32 obbeMode)
{ {
CVehicle *veh; CVehicle *veh;
CVector target, camPos, playerSpeed, fwd, fwd2; CVector target, camPos, playerSpeed, fwd, fwd2;

View file

@ -136,8 +136,8 @@ public:
GlfwJoyState m_OldState; GlfwJoyState m_OldState;
GlfwJoyState m_NewState; GlfwJoyState m_NewState;
#else #else
DIJOYSTATE2 m_OldState; // DIJOYSTATE2 m_OldState;
DIJOYSTATE2 m_NewState; // DIJOYSTATE2 m_NewState;
#endif #endif
wchar m_aActionNames[MAX_CONTROLLERACTIONS][ACTIONNAME_LENGTH]; wchar m_aActionNames[MAX_CONTROLLERACTIONS][ACTIONNAME_LENGTH];
bool m_aButtonStates[MAX_BUTTONS]; bool m_aButtonStates[MAX_BUTTONS];

View file

@ -221,7 +221,7 @@ CFileLoader::LoadCollisionFileFirstTime(uint8 *buffer, uint32 size, uint8 colSlo
char modelname[24]; char modelname[24];
CBaseModelInfo *mi; CBaseModelInfo *mi;
ColHeader *header; ColHeader *header;
int modelIndex; int32 modelIndex;
while(size > 8){ while(size > 8){
header = (ColHeader*)buffer; header = (ColHeader*)buffer;

View file

@ -4939,7 +4939,9 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
ControlsManager.MakeControllerActionsBlank(); ControlsManager.MakeControllerActionsBlank();
ControlsManager.InitDefaultControlConfiguration(); ControlsManager.InitDefaultControlConfiguration();
ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp()); ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
#if !defined RW_GL3 #if defined(RW_DC)
printf("TODO: implement this");
#elif !defined RW_GL3
if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) { if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) {
DIDEVCAPS devCaps; DIDEVCAPS devCaps;
devCaps.dwSize = sizeof(DIDEVCAPS); devCaps.dwSize = sizeof(DIDEVCAPS);

View file

@ -164,8 +164,17 @@ public:
static float GetRandomNumberInRange(float low, float high) static float GetRandomNumberInRange(float low, float high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); } { return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }
static int GetRandomNumberInRange(int low, int high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }
#if !defined(INT32_IS_INT)
static int32 GetRandomNumberInRange(int32 low, int32 high) static int32 GetRandomNumberInRange(int32 low, int32 high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); } { return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }
static int32 GetRandomNumberInRange(int low, const int32& high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }
#endif
static void SetRandomSeed(int32 seed) static void SetRandomSeed(int32 seed)
{ mysrand(seed); } { mysrand(seed); }
}; };

View file

@ -862,6 +862,8 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
state.WHEELUP = true; state.WHEELUP = true;
} }
} }
#elif defined(RW_DC)
printf("TODO this %s\n", __func__);
#else #else
// It seems there is no way to get number of buttons on mouse, so assign all buttons if we have mouse. // It seems there is no way to get number of buttons on mouse, so assign all buttons if we have mouse.
double xpos = 1.0f, ypos; double xpos = 1.0f, ypos;
@ -921,6 +923,8 @@ void CPad::UpdateMouse()
NewMouseControllerState = PCTempMouseControllerState; NewMouseControllerState = PCTempMouseControllerState;
} }
} }
#elif defined(RW_DC)
printf("TODO this %s\n", __func__);
#else #else
if ( IsForegroundApp() && PSGLOBAL(cursorIsInWindow) ) if ( IsForegroundApp() && PSGLOBAL(cursorIsInWindow) )
{ {

View file

@ -1151,7 +1151,7 @@ void CRadar::SetBlipSprite(int32 i, int32 icon)
} }
} }
int CRadar::SetCoordBlip(eBlipType type, CVector pos, uint32 color, eBlipDisplay display) int32 CRadar::SetCoordBlip(eBlipType type, CVector pos, uint32 color, eBlipDisplay display)
{ {
int nextBlip; int nextBlip;
for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) { for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) {
@ -1177,7 +1177,7 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, uint32 color, eBlipDisplay
return CRadar::GetNewUniqueBlipIndex(nextBlip); return CRadar::GetNewUniqueBlipIndex(nextBlip);
} }
int CRadar::SetShortRangeCoordBlip(eBlipType type, CVector pos, uint32 color, eBlipDisplay display) int32 CRadar::SetShortRangeCoordBlip(eBlipType type, CVector pos, uint32 color, eBlipDisplay display)
{ {
int index = SetCoordBlip(type, pos, color, display); int index = SetCoordBlip(type, pos, color, display);
if (index == -1) if (index == -1)
@ -1186,7 +1186,7 @@ int CRadar::SetShortRangeCoordBlip(eBlipType type, CVector pos, uint32 color, eB
return index; return index;
} }
int CRadar::SetEntityBlip(eBlipType type, int32 handle, uint32 color, eBlipDisplay display) int32 CRadar::SetEntityBlip(eBlipType type, int32 handle, uint32 color, eBlipDisplay display)
{ {
int nextBlip; int nextBlip;
for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) { for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) {

View file

@ -401,10 +401,10 @@ CStreaming::LoadCdDirectory(void)
} }
void void
CStreaming::LoadCdDirectory(const char *dirname, int n) CStreaming::LoadCdDirectory(const char *dirname, int32 n)
{ {
int fd, lastID, imgSelector; int fd, lastID, imgSelector;
int modelId; int32 modelId;
CDirectory::DirectoryInfo direntry; CDirectory::DirectoryInfo direntry;
char *dot; char *dot;

View file

@ -396,6 +396,9 @@ template<int s, int t> struct check_size {
#define PERCENT(x, p) ((float(x) * (float(p) / 100.0f))) #define PERCENT(x, p) ((float(x) * (float(p) / 100.0f)))
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
#ifdef BIT
#undef BIT
#endif
#define BIT(num) (1<<(num)) #define BIT(num) (1<<(num))
#define ABS(a) (((a) < 0) ? (-(a)) : (a)) #define ABS(a) (((a) < 0) ? (-(a)) : (a))

View file

@ -301,6 +301,12 @@ void StoreIni(const char *cat, const char *key, int8 val)
sprintf(temp, "%d", val); sprintf(temp, "%d", val);
cfg[cat][key] = temp; cfg[cat][key] = temp;
} }
void StoreIni(const char *cat, const char *key, bool val)
{
char temp[11];
sprintf(temp, "%d", val);
cfg[cat][key] = temp;
}
void StoreIni(const char *cat, const char *key, float val) void StoreIni(const char *cat, const char *key, float val)
{ {
@ -973,7 +979,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Special car", SpecialCarCheats); DebugMenuAddCmd("Cheats", "Special car", SpecialCarCheats);
DebugMenuAddCmd("Cheats", "Pickup chicks", PickUpChicksCheat); DebugMenuAddCmd("Cheats", "Pickup chicks", PickUpChicksCheat);
static int spawnCarId = MI_LANDSTAL; static int32 spawnCarId = MI_LANDSTAL;
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_VICECHEE, carnames); e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_VICECHEE, carnames);
DebugMenuEntrySetWrap(e, true); DebugMenuEntrySetWrap(e, true);
DebugMenuAddCmd("Spawn", "Spawn Car", [](){ DebugMenuAddCmd("Spawn", "Spawn Car", [](){
@ -1027,8 +1033,8 @@ DebugMenuPopulate(void)
#endif #endif
DebugMenuAddVarBool8("Render", "Backface Culling", &gBackfaceCulling, nil); DebugMenuAddVarBool8("Render", "Backface Culling", &gBackfaceCulling, nil);
DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil); DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil);
DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil); DebugMenuAddVarBool8("Render", "Frame limiter", (int8_t*)&FrontEndMenuManager.m_PrefsFrameLimiter, nil);
DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil); DebugMenuAddVarBool8("Render", "VSynch", (int8_t*)&FrontEndMenuManager.m_PrefsVsync, nil);
DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil); DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil);
#ifdef NEW_RENDERER #ifdef NEW_RENDERER
DebugMenuAddVarBool8("Render", "New Renderer", &gbNewRenderer, nil); DebugMenuAddVarBool8("Render", "New Renderer", &gbNewRenderer, nil);
@ -1157,7 +1163,7 @@ extern bool gbRenderWorld2;
"PIZZA BOY", "RC Raider Pickup", "RC Bandit Race", "RC Baron Race", "Checkpoint Charlie" "PIZZA BOY", "RC Raider Pickup", "RC Bandit Race", "RC Baron Race", "Checkpoint Charlie"
}; };
missionEntry = DebugMenuAddVar("Game", "Select mission", &nextMissionToSwitch, nil, 1, 0, ARRAY_SIZE(missions) - 1, missions); missionEntry = DebugMenuAddVar("Game", "Select mission", (uint32_t*)&nextMissionToSwitch, nil, 1, 0, ARRAY_SIZE(missions) - 1, missions);
DebugMenuEntrySetWrap(missionEntry, true); DebugMenuEntrySetWrap(missionEntry, true);
DebugMenuAddCmd("Game", "Start selected mission ", SwitchToMission); DebugMenuAddCmd("Game", "Start selected mission ", SwitchToMission);
#endif #endif

View file

@ -156,21 +156,21 @@ void DebugMenuRender(void);
// Some overloads for simplicity // Some overloads for simplicity
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc, int8_t step, int8_t lowerBound, int8_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int8_t *ptr, TriggerFunc triggerFunc, int8_t step, int8_t lowerBound, int8_t upperBound, const char **strings)
{ return DebugMenuAddInt8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddInt8(path, name, (int8*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc, int16_t step, int16_t lowerBound, int16_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int16_t *ptr, TriggerFunc triggerFunc, int16_t step, int16_t lowerBound, int16_t upperBound, const char **strings)
{ return DebugMenuAddInt16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddInt16(path, name, (int16*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc, int32_t step, int32_t lowerBound, int32_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int32_t *ptr, TriggerFunc triggerFunc, int32_t step, int32_t lowerBound, int32_t upperBound, const char **strings)
{ return DebugMenuAddInt32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddInt32(path, name, (int32*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int64_t *ptr, TriggerFunc triggerFunc, int64_t step, int64_t lowerBound, int64_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, int64_t *ptr, TriggerFunc triggerFunc, int64_t step, int64_t lowerBound, int64_t upperBound, const char **strings)
{ return DebugMenuAddInt64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddInt64(path, name, (int64*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint8_t *ptr, TriggerFunc triggerFunc, uint8_t step, uint8_t lowerBound, uint8_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint8_t *ptr, TriggerFunc triggerFunc, uint8_t step, uint8_t lowerBound, uint8_t upperBound, const char **strings)
{ return DebugMenuAddUInt8(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddUInt8(path, name, (uint8*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint16_t *ptr, TriggerFunc triggerFunc, uint16_t step, uint16_t lowerBound, uint16_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint16_t *ptr, TriggerFunc triggerFunc, uint16_t step, uint16_t lowerBound, uint16_t upperBound, const char **strings)
{ return DebugMenuAddUInt16(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddUInt16(path, name, (uint16*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint32_t *ptr, TriggerFunc triggerFunc, uint32_t step, uint32_t lowerBound, uint32_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint32_t *ptr, TriggerFunc triggerFunc, uint32_t step, uint32_t lowerBound, uint32_t upperBound, const char **strings)
{ return DebugMenuAddUInt32(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddUInt32(path, name, (uint32*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint64_t *ptr, TriggerFunc triggerFunc, uint64_t step, uint64_t lowerBound, uint64_t upperBound, const char **strings) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, uint64_t *ptr, TriggerFunc triggerFunc, uint64_t step, uint64_t lowerBound, uint64_t upperBound, const char **strings)
{ return DebugMenuAddUInt64(path, name, ptr, triggerFunc, step, lowerBound, upperBound, strings); } { return DebugMenuAddUInt64(path, name, (uint64*)ptr, triggerFunc, step, lowerBound, upperBound, strings); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, float *ptr, TriggerFunc triggerFunc, float step, float lowerBound, float upperBound) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, float *ptr, TriggerFunc triggerFunc, float step, float lowerBound, float upperBound)
{ return DebugMenuAddFloat32(path, name, ptr, triggerFunc, step, lowerBound, upperBound); } { return DebugMenuAddFloat32(path, name, ptr, triggerFunc, step, lowerBound, upperBound); }
inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, double *ptr, TriggerFunc triggerFunc, double step, double lowerBound, double upperBound) inline DebugMenuEntry *DebugMenuAddVar(const char *path, const char *name, double *ptr, TriggerFunc triggerFunc, double step, double lowerBound, double upperBound)

View file

@ -182,7 +182,7 @@ CModelInfo::AddVehicleModel(int id)
} }
CBaseModelInfo* CBaseModelInfo*
CModelInfo::GetModelInfo(const char *name, int *id) CModelInfo::GetModelInfo(const char *name, int32 *id)
{ {
CBaseModelInfo *modelinfo; CBaseModelInfo *modelinfo;
for(int i = 0; i < MODELINFOSIZE; i++){ for(int i = 0; i < MODELINFOSIZE; i++){

View file

@ -34,8 +34,8 @@ public:
static CStore<C2dEffect, TWODFXSIZE> &Get2dEffectStore(void) { return ms_2dEffectStore; } static CStore<C2dEffect, TWODFXSIZE> &Get2dEffectStore(void) { return ms_2dEffectStore; }
static CBaseModelInfo *GetModelInfo(const char *name, int *id); static CBaseModelInfo *GetModelInfo(const char *name, int32 *id);
static CBaseModelInfo *GetModelInfo(int id){ static CBaseModelInfo *GetModelInfo(int32 id){
return ms_modelInfoPtrs[id]; return ms_modelInfoPtrs[id];
} }
static CBaseModelInfo *GetModelInfo(const char *name, int minIndex, int maxIndex); static CBaseModelInfo *GetModelInfo(const char *name, int minIndex, int maxIndex);

View file

@ -7596,7 +7596,7 @@ CPed::SeekCar(void)
bool bool
CPed::CheckForExplosions(CVector2D &area) CPed::CheckForExplosions(CVector2D &area)
{ {
int event = 0; int32 event = 0;
if (CEventList::FindClosestEvent(EVENT_EXPLOSION, GetPosition(), &event)) { if (CEventList::FindClosestEvent(EVENT_EXPLOSION, GetPosition(), &event)) {
area.x = gaEvent[event].posn.x; area.x = gaEvent[event].posn.x;
area.y = gaEvent[event].posn.y; area.y = gaEvent[event].posn.y;
@ -7640,7 +7640,7 @@ CPed::CheckForExplosions(CVector2D &area)
CPed * CPed *
CPed::CheckForGunShots(void) CPed::CheckForGunShots(void)
{ {
int event; int32 event;
if (CEventList::FindClosestEvent(EVENT_GUNSHOT, GetPosition(), &event)) { if (CEventList::FindClosestEvent(EVENT_GUNSHOT, GetPosition(), &event)) {
if (gaEvent[event].entityType == EVENT_ENTITY_PED) { if (gaEvent[event].entityType == EVENT_ENTITY_PED) {
// Probably due to we don't want peds to go gunshot area? (same on VC) // Probably due to we don't want peds to go gunshot area? (same on VC)
@ -7655,7 +7655,7 @@ CPed::CheckForGunShots(void)
CPed * CPed *
CPed::CheckForDeadPeds(void) CPed::CheckForDeadPeds(void)
{ {
int event; int32 event;
if (CEventList::FindClosestEvent(EVENT_DEAD_PED, GetPosition(), &event)) { if (CEventList::FindClosestEvent(EVENT_DEAD_PED, GetPosition(), &event)) {
int pedHandle = gaEvent[event].entityRef; int pedHandle = gaEvent[event].entityRef;
if (pedHandle && gaEvent[event].entityType == EVENT_ENTITY_PED) { if (pedHandle && gaEvent[event].entityType == EVENT_ENTITY_PED) {
@ -8047,7 +8047,7 @@ PlayRandomAnimationsFromAnimBlock(CPed* ped, AssocGroupId animGroup, uint32 firs
if (!assoc || assoc->blendDelta < 0.0f) { if (!assoc || assoc->blendDelta < 0.0f) {
int selectedAnimOffset; int selectedAnimOffset;
do do
selectedAnimOffset = CGeneral::GetRandomNumberInRange(0, amount); selectedAnimOffset = CGeneral::GetRandomNumberInRange(0, (int32)amount);
while (assoc && first + selectedAnimOffset == assoc->animId); while (assoc && first + selectedAnimOffset == assoc->animId);
assoc = CAnimManager::BlendAnimation(ped->GetClump(), animGroup, (AnimationId)(first + selectedAnimOffset), 3.0f); assoc = CAnimManager::BlendAnimation(ped->GetClump(), animGroup, (AnimationId)(first + selectedAnimOffset), 3.0f);
@ -9423,7 +9423,7 @@ CPed::HasAttractor(void)
} }
void void
CPed::SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float heading, float time, int32 qid) CPed::SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float heading, float time, int qid)
{ {
if (!m_attractor) if (!m_attractor)
m_attractor = pAttractor; m_attractor = pAttractor;

View file

@ -2040,7 +2040,7 @@ CPlayerPed::PlayIdleAnimations(CPad *padUsed)
if (!hasIdleAnim && !bIsLooking && !bIsRestoringLook && sinceLastInput - lastTime > 25000) { if (!hasIdleAnim && !bIsLooking && !bIsRestoringLook && sinceLastInput - lastTime > 25000) {
int anim; int anim;
do do
anim = CGeneral::GetRandomNumberInRange(0, ARRAY_SIZE(idleAnims)); anim = CGeneral::GetRandomNumberInRange(0, (int32)ARRAY_SIZE(idleAnims));
while (lastAnim == anim); while (lastAnim == anim);
assoc = CAnimManager::BlendAnimation(GetClump(), idleAnims[anim].groupId, idleAnims[anim].animId, 8.0f); assoc = CAnimManager::BlendAnimation(GetClump(), idleAnims[anim].groupId, idleAnims[anim].animId, 8.0f);

View file

@ -346,7 +346,7 @@ CPopulation::UpdatePedCount(ePedType pedType, bool decrease)
} }
} }
int int32
CPopulation::ChooseGangOccupation(int gangId) CPopulation::ChooseGangOccupation(int gangId)
{ {
return CGangs::ChooseGangPedModel(gangId); return CGangs::ChooseGangPedModel(gangId);
@ -620,7 +620,7 @@ CPopulation::AddToPopulation(float minDist, float maxDist, float minDistOffScree
pedAmount = 1; pedAmount = 1;
CVector generatedCoors; CVector generatedCoors;
int node1, node2; int32 node1, node2;
float randomPos; float randomPos;
bool foundCoors = !!ThePaths.GeneratePedCreationCoors(playerCentreOfWorld.x, playerCentreOfWorld.y, minDist, maxDist, minDistOffScreen, maxDistOffScreen, bool foundCoors = !!ThePaths.GeneratePedCreationCoors(playerCentreOfWorld.x, playerCentreOfWorld.y, minDist, maxDist, minDistOffScreen, maxDistOffScreen,
&generatedCoors, &node1, &node2, &randomPos, nil); &generatedCoors, &node1, &node2, &randomPos, nil);
@ -1426,7 +1426,7 @@ CPopulation::ChooseCivilianCoupleOccupations(int32 group, int32& man, int32& wom
} }
void void
CPopulation::PlaceGangMembers(ePedType pedType, int pedAmount, CVector const& coors) CPopulation::PlaceGangMembers(ePedType pedType, int32 pedAmount, CVector const& coors)
{ {
if (CGeneral::GetRandomNumberInRange(0.f, 1.f) < 0.333f) { if (CGeneral::GetRandomNumberInRange(0.f, 1.f) < 0.333f) {
PlaceGangMembersInFormation(pedType, pedAmount, coors); PlaceGangMembersInFormation(pedType, pedAmount, coors);
@ -1436,7 +1436,7 @@ CPopulation::PlaceGangMembers(ePedType pedType, int pedAmount, CVector const& co
} }
void void
CPopulation::PlaceGangMembersInFormation(ePedType pedType, int pedAmount, CVector const& coors) CPopulation::PlaceGangMembersInFormation(ePedType pedType, int32 pedAmount, CVector const& coors)
{ {
CPed *createdPeds[5]; CPed *createdPeds[5];
@ -1507,7 +1507,7 @@ CPopulation::PlaceGangMembersInFormation(ePedType pedType, int pedAmount, CVecto
} }
void void
CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector const& coors) CPopulation::PlaceGangMembersInCircle(ePedType pedType, int32 pedAmount, CVector const& coors)
{ {
CPed *createdPeds[5]; CPed *createdPeds[5];

View file

@ -387,7 +387,7 @@ CMovingThing CMovingThings::EndCloseList;
int16 CMovingThings::Num; int16 CMovingThings::Num;
CMovingThing CMovingThings::aMovingThings[NUMMOVINGTHINGS]; CMovingThing CMovingThings::aMovingThings[NUMMOVINGTHINGS];
int32 CScrollBar::TonightsEvent; int CScrollBar::TonightsEvent;
void CMovingThings::Init() void CMovingThings::Init()
{ {

View file

@ -71,7 +71,7 @@ int16 CFont::Size[MAX_FONTS][210] = {
18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30, 18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30,
// A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19, 12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19,
//P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, Ў, \, //P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, <EFBFBD>, \,
#ifdef FIX_BUGS #ifdef FIX_BUGS
22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19, 22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19,
#else #else
@ -81,11 +81,11 @@ int16 CFont::Size[MAX_FONTS][210] = {
12, 14, 11, 11, 16, 11, 12, 14, 14, 10, 13, 12, 10, 19, 18, 12, 12, 14, 11, 11, 16, 11, 12, 14, 14, 10, 13, 12, 10, 19, 18, 12,
//p, q, r, s, t, u, v, w, x, y, z, ??, ??, ??, ??, ??, //p, q, r, s, t, u, v, w, x, y, z, ??, ??, ??, ??, ??,
16, 13, 13, 11, 12, 15, 12, 15, 13, 12, 12, 37, 33, 37, 35, 37, 16, 13, 13, 11, 12, 15, 12, 15, 13, 12, 12, 37, 33, 37, 35, 37,
//А, Б, В, Д, Ж, З, И, Й, К, Л, М, Н, О, П, Т, У, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19, 16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19,
//Ф, Ц, Щ, Ъ, Ы, Ь, Я, а, б, в, д, ж, з, и, й, к, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11, 19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11,
//л, м, н, о, п, т, у, ф, ц, щ, ъ, ы, ь, С, с, ї, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
#ifdef FIX_BUGS #ifdef FIX_BUGS
11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21, 11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21,
#else #else
@ -110,7 +110,7 @@ int16 CFont::Size[MAX_FONTS][210] = {
20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19, 20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19,
//TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, //TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24, 20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24,
//P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, Ў, °, //P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, <EFBFBD>, <20>,
#ifdef FIX_BUGS #ifdef FIX_BUGS
22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19, 22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19,
#else #else
@ -120,11 +120,11 @@ int16 CFont::Size[MAX_FONTS][210] = {
10, 17, 17, 16, 17, 17, 11, 17, 17, 7, 7, 18, 7, 25, 17, 17, 10, 17, 17, 16, 17, 17, 11, 17, 17, 7, 7, 18, 7, 25, 17, 17,
//p, q, r, s, t, u, v, w, x, y, z, *I, *I, $2, (2, )2, //p, q, r, s, t, u, v, w, x, y, z, *I, *I, $2, (2, )2,
17, 17, 11, 17, 11, 17, 18, 25, 19, 18, 17, 28, 26, 20, 15, 15, 17, 17, 11, 17, 11, 17, 18, 25, 19, 18, 17, 28, 26, 20, 15, 15,
//А, Б, В, Д, Ж, З, И, Й, К, Л, М, Н, О, П, Т, У, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23, 20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23,
//Ф, Ц, Щ, Ъ, Ы, Ь, Я, а, б, в, д, ж, з, и, й, к, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17, 23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17,
//л, м, н, о, п, т, у, ф, ц, щ, ъ, ы, ь, С, с, ї, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
#ifdef FIX_BUGS #ifdef FIX_BUGS
17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19, 17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19,
#else #else
@ -134,9 +134,9 @@ int16 CFont::Size[MAX_FONTS][210] = {
20, 18, 19, 19, 21, 19, 19, 19, 19, 19, 16, 19, 19, 19, 20, 19, 20, 18, 19, 19, 21, 19, 19, 19, 19, 19, 16, 19, 19, 19, 20, 19,
//F2,G2,H2, I2, J2, K2, L2, M2, N2, O2, P2, Q2, R2, S2, T2, U2, //F2,G2,H2, I2, J2, K2, L2, M2, N2, O2, P2, Q2, R2, S2, T2, U2,
16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19, 16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19,
//V2,W2,X2, Y2, Z2, А2, Б2, В2, Д2, Ж2, З2, И2, Й2, К2, Л2, М2, //V2,W2,X2, Y2, Z2, <EFBFBD>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2,
20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9, 20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9,
//Н2,О2,П2, Т2, У2, Ф2, Ц2, Щ2, Ъ2, Ы2, Ь2, Я2, С2, ї2, '2, .2, //<EFBFBD>2,<2C>2,<2C>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, '2, .2,
#ifdef FIX_BUGS #ifdef FIX_BUGS
9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9, 9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9,
#else #else
@ -191,17 +191,17 @@ int16 CFont::Size[MAX_FONTS][210] = {
18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30, 18, 10, 17, 17, 17, 17, 17, 15, 12, 16, 5, 30, 30, 30, 30, 30,
// A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, // A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19, 12, 16, 19, 16, 19, 18, 18, 17, 22, 11, 17, 18, 18, 30, 22, 19,
//P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, Ў, \, //P, Q, R, S, T, U, V, W, X, Y, Z, ??, ??, ??, <EFBFBD>, \,
22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19, 22, 19, 19, 20, 18, 19, 19, 29, 19, 18, 19, 19, 33, 33, 10, 19,
//??,a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, //??,a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
12, 14, 11, 11, 16, 11, 12, 14, 14, 10, 13, 12, 10, 19, 18, 12, 12, 14, 11, 11, 16, 11, 12, 14, 14, 10, 13, 12, 10, 19, 18, 12,
//p, q, r, s, t, u, v, w, x, y, z, ??, ??, ??, ??, ??, //p, q, r, s, t, u, v, w, x, y, z, ??, ??, ??, ??, ??,
16, 13, 13, 11, 12, 15, 12, 15, 13, 12, 12, 37, 33, 37, 35, 37, 16, 13, 13, 11, 12, 15, 12, 15, 13, 12, 12, 37, 33, 37, 35, 37,
//А, Б, В, Д, Ж, З, И, Й, К, Л, М, Н, О, П, Т, У, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19, 16, 16, 16, 16, 33, 17, 18, 18, 18, 18, 11, 11, 11, 11, 19, 19,
//Ф, Ц, Щ, Ъ, Ы, Ь, Я, а, б, в, д, ж, з, и, й, к, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11, 19, 19, 19, 19, 19, 19, 15, 14, 14, 14, 14, 20, 14, 11, 11, 11,
//л, м, н, о, п, т, у, ф, ц, щ, ъ, ы, ь, С, с, ї, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21, 11, 10, 10, 10, 10, 12, 12, 12, 12, 15, 15, 15, 15, 22, 18, 21,
//i,BLANKS //i,BLANKS
10, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
@ -222,25 +222,25 @@ int16 CFont::Size[MAX_FONTS][210] = {
20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19, 20, 7, 20, 20, 21, 20, 20, 19, 21, 20, 8, 30, 24, 30, 24, 19,
//TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, //TM,A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24, 20, 22, 22, 21, 22, 18, 18, 22, 22, 9, 14, 21, 18, 27, 21, 24,
//P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, Ў, °, //P, Q, R, S, T, U, V, W, X, Y, Z, *I, \, *I, <EFBFBD>, <20>,
22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19, 22, 22, 23, 20, 19, 23, 22, 31, 23, 23, 21, 25, 13, 30, 7, 19,
//(C),a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, //(C),a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
10, 17, 17, 16, 17, 17, 11, 17, 17, 7, 7, 18, 7, 25, 17, 17, 10, 17, 17, 16, 17, 17, 11, 17, 17, 7, 7, 18, 7, 25, 17, 17,
//p, q, r, s, t, u, v, w, x, y, z, *I, *I, $2, (2, )2, //p, q, r, s, t, u, v, w, x, y, z, *I, *I, $2, (2, )2,
17, 17, 11, 17, 11, 17, 18, 25, 19, 18, 17, 28, 26, 20, 15, 15, 17, 17, 11, 17, 11, 17, 18, 25, 19, 18, 17, 28, 26, 20, 15, 15,
//А, Б, В, Д, Ж, З, И, Й, К, Л, М, Н, О, П, Т, У, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23, 20, 20, 20, 20, 29, 22, 19, 19, 19, 19, 9, 9, 9, 9, 23, 23,
//Ф, Ц, Щ, Ъ, Ы, Ь, Я, а, б, в, д, ж, з, и, й, к, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17, 23, 23, 24, 24, 24, 24, 20, 19, 17, 17, 17, 30, 16, 17, 17, 17,
//л, м, н, о, п, т, у, ф, ц, щ, ъ, ы, ь, С, с, ї, //<EFBFBD>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>, <20>,
17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19, 17, 11, 11, 15, 12, 17, 17, 17, 17, 17, 17, 17, 17, 21, 17, 19,
//02,12,22, 32, 42, 52, 62, 72, 82, 92, :2, A2, B2, C2, D2, E2, //02,12,22, 32, 42, 52, 62, 72, 82, 92, :2, A2, B2, C2, D2, E2,
20, 18, 19, 19, 21, 19, 19, 19, 19, 19, 16, 19, 19, 19, 20, 19, 20, 18, 19, 19, 21, 19, 19, 19, 19, 19, 16, 19, 19, 19, 20, 19,
//F2,G2,H2, I2, J2, K2, L2, M2, N2, O2, P2, Q2, R2, S2, T2, U2, //F2,G2,H2, I2, J2, K2, L2, M2, N2, O2, P2, Q2, R2, S2, T2, U2,
16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19, 16, 19, 19, 9, 19, 20, 14, 29, 19, 19, 19, 19, 19, 19, 21, 19,
//V2,W2,X2, Y2, Z2, А2, Б2, В2, Д2, Ж2, З2, И2, Й2, К2, Л2, М2, //V2,W2,X2, Y2, Z2, <EFBFBD>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2,
20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9, 20, 32, 20, 19, 19, 19, 19, 19, 19, 29, 19, 19, 19, 19, 19, 9,
//Н2,О2,П2, Т2, У2, Ф2, Ц2, Щ2, Ъ2, Ы2, Ь2, Я2, С2, ї2, '2, .2, //<EFBFBD>2,<2C>2,<2C>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, <20>2, '2, .2,
9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9, 9, 9, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 10, 9,
//space, unprop //space, unprop
10, 20 10, 20
@ -298,7 +298,7 @@ uint8 FontRenderStateBuf[1024];
#ifdef BUTTON_ICONS #ifdef BUTTON_ICONS
CSprite2d CFont::ButtonSprite[MAX_BUTTON_ICONS]; CSprite2d CFont::ButtonSprite[MAX_BUTTON_ICONS];
int CFont::PS2Symbol = BUTTON_NONE; int CFont::PS2Symbol = BUTTON_NONE;
int CFont::ButtonsSlot = -1; int32 CFont::ButtonsSlot = -1;
#endif // BUTTON_ICONS #endif // BUTTON_ICONS
void void

View file

@ -37,6 +37,22 @@ int32 texNumLoaded;
#define READNATIVE(stream, tex, size) RWSRCGLOBAL(stdFunc[rwSTANDARDNATIVETEXTUREREAD](stream, tex, size)) #define READNATIVE(stream, tex, size) RWSRCGLOBAL(stdFunc[rwSTANDARDNATIVETEXTUREREAD](stream, tex, size))
#endif #endif
void RwTextureGtaStreamWrite(RwStream *stream, RwTexture* texture)
{
auto fheader = stream->tell();
// size will be written later
rw::writeChunkHeader(stream, rwID_TEXTURENATIVE, 0);
auto fbegin = stream->tell();
texture->streamWriteNative(stream);
// rewrite header with correct size
auto fend = stream->tell();
stream->seek(fheader, 0);
rw::writeChunkHeader(stream, rwID_TEXTURENATIVE, fend - fbegin);
stream->seek(fend, 0);
}
RwTexture* RwTexture*
RwTextureGtaStreamRead(RwStream *stream) RwTextureGtaStreamRead(RwStream *stream)
{ {

View file

@ -91,7 +91,9 @@ void GetDateFormat(int unused1, int unused2, SYSTEMTIME* in, int unused3, char*
linuxTime.tm_hour = in->wHour; linuxTime.tm_hour = in->wHour;
linuxTime.tm_min = in->wMinute; linuxTime.tm_min = in->wMinute;
linuxTime.tm_sec = in->wSecond; linuxTime.tm_sec = in->wSecond;
strftime(out, size, nl_langinfo(D_FMT), &linuxTime); // strftime(out, size, nl_langinfo(D_FMT), &linuxTime);
printf("TODO: FIXME %s\n",__func__);
strcpy(out,"abc");
} }
void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) { void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) {

View file

@ -79,6 +79,24 @@ void CapturePad(RwInt32 padID);
void joysChangeCB(int jid, int event); void joysChangeCB(int jid, int event);
#endif #endif
#ifdef RW_DC
typedef struct
{
RwBool fullScreen;
RwV2d lastMousePos;
double mouseWheel; // glfw doesn't cache it
bool cursorIsInWindow;
RwInt8 joy1id;
RwInt8 joy2id;
}
psGlobalType;
#define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var)
void CapturePad(RwInt32 padID);
void joysChangeCB(int jid, int event);
#endif
#ifdef DETECT_JOYSTICK_MENU #ifdef DETECT_JOYSTICK_MENU
extern char gSelectedJoystickName[128]; extern char gSelectedJoystickName[128];
#endif #endif
@ -135,7 +153,7 @@ void GetLocalTime_CP(SYSTEMTIME* out);
#include <dirent.h> #include <dirent.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <langinfo.h> // #include <langinfo.h>
#include <unistd.h> #include <unistd.h>
typedef void* HANDLE; typedef void* HANDLE;