mirror of
https://github.com/mrxenginner/reVC.git
synced 2026-10-10 03:43:04 +08:00
ps2 related changes and fixes
This commit is contained in:
+2
-2
@@ -2,14 +2,14 @@ newoption {
|
||||
trigger = "glfwdir64",
|
||||
value = "PATH",
|
||||
description = "Directory of glfw",
|
||||
default = "vendor/glfw-3.3.2.bin.WIN64",
|
||||
default = "vendor/glfw-3.3.4.bin.WIN64",
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = "glfwdir32",
|
||||
value = "PATH",
|
||||
description = "Directory of glfw",
|
||||
default = "vendor/glfw-3.3.2.bin.WIN32",
|
||||
default = "vendor/glfw-3.3.4.bin.WIN32",
|
||||
}
|
||||
|
||||
newoption {
|
||||
|
||||
@@ -203,8 +203,7 @@ CPedPath::AddBlockade(CEntity *pEntity, CPedPathNode(*pathNodes)[40], CVector *p
|
||||
const float fDistanceX = pPosition->x - pEntity->GetMatrix().GetPosition().x;
|
||||
const float fDistanceY = pPosition->y - pEntity->GetMatrix().GetPosition().y;
|
||||
const float fBoundRadius = pEntity->GetBoundRadius();
|
||||
CVector vecBoundCentre;
|
||||
pEntity->GetBoundCentre(vecBoundCentre);
|
||||
CVector vecBoundCentre = pEntity->GetBoundCentre();
|
||||
if (vecBoundCentre.x + fBoundRadius >= pPosition->x &&
|
||||
vecBoundCentre.y + fBoundRadius >= pPosition->y &&
|
||||
vecBoundCentre.x - fBoundRadius <= pPosition->x + 28.0f &&
|
||||
|
||||
@@ -400,7 +400,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
||||
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
||||
#endif
|
||||
CFileMgr::Seek(handle, offset, 0);
|
||||
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
||||
CFileMgr::Read(handle, (char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
||||
CFileMgr::CloseFile(handle);
|
||||
CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
|
||||
CTimer::Resume();
|
||||
|
||||
@@ -1753,7 +1753,7 @@ CTheScripts::SwitchToMission(int32 mission)
|
||||
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
||||
#endif
|
||||
CFileMgr::Seek(handle, offset, 0);
|
||||
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
||||
CFileMgr::Read(handle, (char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
||||
CFileMgr::CloseFile(handle);
|
||||
CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
|
||||
CTimer::Resume();
|
||||
|
||||
@@ -277,7 +277,7 @@ CFileMgr::OpenFileForWriting(const char *file)
|
||||
}
|
||||
|
||||
size_t
|
||||
CFileMgr::Read(int fd, const char *buf, ssize_t len)
|
||||
CFileMgr::Read(int fd, char *buf, ssize_t len)
|
||||
{
|
||||
return myfread((void*)buf, 1, len, fd);
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ public:
|
||||
static int OpenFile(const char *file, const char *mode);
|
||||
static int OpenFile(const char *file) { return OpenFile(file, "rb"); }
|
||||
static int OpenFileForWriting(const char *file);
|
||||
static size_t Read(int fd, const char *buf, ssize_t len);
|
||||
static size_t Read(int fd, char *buf, ssize_t len);
|
||||
static size_t Write(int fd, const char *buf, ssize_t len);
|
||||
static bool Seek(int fd, int offset, int whence);
|
||||
static bool ReadLine(int fd, char *buf, int len);
|
||||
|
||||
+13
-11
@@ -1160,17 +1160,19 @@ TidyUpModelInfo(CBaseModelInfo* modelInfo, bool onlyone)
|
||||
return true;
|
||||
|
||||
RwObject* rwobj = modelInfo->GetRwObject();
|
||||
if (RwObjectGetType(rwobj) == rpATOMIC)
|
||||
if (MoveAtomicMemory((RpAtomic*)rwobj, onlyone))
|
||||
return true;
|
||||
if (RwObjectGetType(rwobj) == rpCLUMP) {
|
||||
bool ret = false;
|
||||
if (onlyone)
|
||||
RpClumpForAllAtomics((RpClump*)rwobj, MoveAtomicMemoryCB, &ret);
|
||||
else
|
||||
RpClumpForAllAtomics((RpClump*)rwobj, MoveAtomicMemoryCB, nil);
|
||||
if (ret)
|
||||
return true;
|
||||
if(rwobj){
|
||||
if (RwObjectGetType(rwobj) == rpATOMIC)
|
||||
if (MoveAtomicMemory((RpAtomic*)rwobj, onlyone))
|
||||
return true;
|
||||
if (RwObjectGetType(rwobj) == rpCLUMP) {
|
||||
bool ret = false;
|
||||
if (onlyone)
|
||||
RpClumpForAllAtomics((RpClump*)rwobj, MoveAtomicMemoryCB, &ret);
|
||||
else
|
||||
RpClumpForAllAtomics((RpClump*)rwobj, MoveAtomicMemoryCB, nil);
|
||||
if (ret)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (modelInfo->GetModelType() == MITYPE_PED && ((CPedModelInfo*)modelInfo)->m_hitColModel)
|
||||
|
||||
@@ -3204,7 +3204,7 @@ CStreaming::PrintStreamingBufferState()
|
||||
CFont::InitPerFrame();
|
||||
DefinedState();
|
||||
|
||||
CRect unusedRect(0, 0, RsGlobal.maximumWidth, RsGlobal.maximumHeight);
|
||||
CRect unusedRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
CRGBA unusedColor(255, 255, 255, 255);
|
||||
CFont::SetFontStyle(FONT_BANK);
|
||||
CFont::SetBackgroundOff();
|
||||
|
||||
+3
-3
@@ -1873,7 +1873,7 @@ void TheGame(void)
|
||||
TheText.Load();
|
||||
}
|
||||
|
||||
CGame::currLevel = TheMemoryCard.GetLevelToLoad();
|
||||
CGame::currLevel = (eLevelName)TheMemoryCard.GetLevelToLoad();
|
||||
}
|
||||
#else
|
||||
//TODO
|
||||
@@ -1896,7 +1896,7 @@ void TheGame(void)
|
||||
CSprite2d::InitPerFrame();
|
||||
CFont::InitPerFrame();
|
||||
|
||||
PUSH_MEMID(MEMID_GAME_PROCESS)
|
||||
PUSH_MEMID(MEMID_GAME_PROCESS);
|
||||
CPointLights::InitPerFrame();
|
||||
CGame::Process();
|
||||
POP_MEMID();
|
||||
@@ -1980,7 +1980,7 @@ void TheGame(void)
|
||||
|
||||
CTimer::Update();
|
||||
|
||||
POP_MEMID(): // MEMID_RENDER
|
||||
POP_MEMID(); // MEMID_RENDER
|
||||
|
||||
if (g_SlowMode)
|
||||
ProcessSlowMode();
|
||||
|
||||
+2
-2
@@ -5064,7 +5064,7 @@ CPed::CheckAroundForPossibleCollisions(void)
|
||||
if (CTimer::GetTimeInMilliseconds() <= m_nPedStateTimer)
|
||||
return;
|
||||
|
||||
GetBoundCentre(ourCentre);
|
||||
ourCentre = GetBoundCentre();
|
||||
|
||||
CWorld::FindObjectsInRange(ourCentre, 10.0f, true, &maxObject, 6, objects, false, true, false, true, false);
|
||||
for (int i = 0; i < maxObject; i++) {
|
||||
@@ -5073,7 +5073,7 @@ CPed::CheckAroundForPossibleCollisions(void)
|
||||
if (gPhoneInfo.PhoneAtThisPosition(object->GetPosition()))
|
||||
break;
|
||||
}
|
||||
object->GetBoundCentre(objCentre);
|
||||
objCentre = object->GetBoundCentre();
|
||||
float radius = object->GetBoundRadius();
|
||||
if (radius > 4.5f || radius < 1.0f)
|
||||
radius = 1.0f;
|
||||
|
||||
@@ -2083,12 +2083,10 @@ CPed::FightStrike(CVector &touchedNodePos, bool fightWithWeapon)
|
||||
maxDistanceToBeat = nearPed->GetBoundRadius() + radius;
|
||||
|
||||
if ((nearPed->bUsesCollision || nearPed->m_nPedState == PED_DEAD) && (m_pedInObjective != FindPlayerPed() || nearPed == FindPlayerPed())) {
|
||||
CVector nearPedCentre;
|
||||
|
||||
// Have to animate a skinned clump because the initial col model is useless
|
||||
hisCol = ((CPedModelInfo*)CModelInfo::GetModelInfo(nearPed->GetModelIndex()))->AnimatePedColModelSkinnedWorld(nearPed->GetClump());
|
||||
|
||||
nearPed->GetBoundCentre(nearPedCentre);
|
||||
CVector nearPedCentre = nearPed->GetBoundCentre();
|
||||
CVector potentialAttackDistance = nearPedCentre - touchedNodePos;
|
||||
|
||||
// He can beat us
|
||||
|
||||
@@ -571,7 +571,7 @@ CWaterLevel::WaterLevelAccordingToRectangles(float fX, float fY, float *pfOutLev
|
||||
bool
|
||||
CWaterLevel::TestVisibilityForFineWaterBlocks(const CVector &worldPos)
|
||||
{
|
||||
static CVector2D tab[] =
|
||||
static RwV2d tab[] =
|
||||
{
|
||||
{ 50.0f, 50.0f },
|
||||
{ -50.0f, 50.0f },
|
||||
|
||||
@@ -436,7 +436,7 @@ ReadInSizeofSaveFileBuffer(int32 &file, uint32 &size)
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_OPEN;
|
||||
return false;
|
||||
}
|
||||
CFileMgr::Read(file, (const char*)&size, sizeof(size));
|
||||
CFileMgr::Read(file, (char*)&size, sizeof(size));
|
||||
if (CFileMgr::GetErrorReadWrite(file)) {
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_READ;
|
||||
if (!CloseFile(file))
|
||||
@@ -453,7 +453,7 @@ ReadDataFromFile(int32 file, uint8 *buf, uint32 size)
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_OPEN;
|
||||
return false;
|
||||
}
|
||||
size_t read_size = CFileMgr::Read(file, (const char*)buf, size);
|
||||
size_t read_size = CFileMgr::Read(file, (char*)buf, size);
|
||||
if (CFileMgr::GetErrorReadWrite(file) || read_size != size) {
|
||||
PcSaveHelper.nErrorCode = SAVESTATUS_ERR_LOAD_READ;
|
||||
if (!CloseFile(file))
|
||||
@@ -646,9 +646,9 @@ align4bytes(int32 size)
|
||||
#ifdef FIX_INCOMPATIBLE_SAVES
|
||||
#define LoadSaveDataBlockNoCheck(buf, file, size) \
|
||||
do { \
|
||||
CFileMgr::Read(file, (const char *)&size, sizeof(size)); \
|
||||
CFileMgr::Read(file, (char *)&size, sizeof(size)); \
|
||||
size = align4bytes(size); \
|
||||
CFileMgr::Read(file, (const char *)work_buff, size); \
|
||||
CFileMgr::Read(file, (char *)work_buff, size); \
|
||||
buf = work_buff; \
|
||||
} while(0)
|
||||
|
||||
@@ -703,10 +703,10 @@ GetSaveType(char *savename)
|
||||
int file = CFileMgr::OpenFile(savename, "rb");
|
||||
|
||||
uint32 size;
|
||||
CFileMgr::Read(file, (const char *)&size, sizeof(size));
|
||||
CFileMgr::Read(file, (char *)&size, sizeof(size));
|
||||
|
||||
uint8 *buf = work_buff;
|
||||
CFileMgr::Read(file, (const char *)work_buff, size); // simple vars + scripts
|
||||
CFileMgr::Read(file, (char *)work_buff, size); // simple vars + scripts
|
||||
|
||||
buf += 0x40 + sizeof(int32) + sizeof(int32) + sizeof(float) * 3;
|
||||
|
||||
@@ -1075,11 +1075,11 @@ FixSave(int32 slot, uint8 save_type)
|
||||
CheckSum = 0;
|
||||
totalSize = 0;
|
||||
|
||||
CFileMgr::Read(file_in, (const char *)&size, sizeof(size));
|
||||
CFileMgr::Read(file_in, (char *)&size, sizeof(size));
|
||||
size = align4bytes(size);
|
||||
|
||||
buf = work_buff;
|
||||
CFileMgr::Read(file_in, (const char *)work_buff, size); // simple vars + scripts
|
||||
CFileMgr::Read(file_in, (char *)work_buff, size); // simple vars + scripts
|
||||
|
||||
if (save_type & SAVE_TYPE_STEAM && save_type & SAVE_TYPE_MSVC && save_type & SAVE_TYPE_32_BIT) {
|
||||
memset(work_buff2, 0, sizeof(work_buff2));
|
||||
|
||||
@@ -1374,7 +1374,7 @@ CMemoryCard::ReadFromMemCard(int32 file, void *buff, int32 size)
|
||||
nError = ERR_NONE;
|
||||
return result;
|
||||
#else
|
||||
int32 s = CFileMgr::Read(file, (const char *)buff, size);
|
||||
int32 s = CFileMgr::Read(file, (char *)buff, size);
|
||||
if ( s == size )
|
||||
{
|
||||
printf("%i Bytes Read for Filehandle %i \n", s, file);
|
||||
|
||||
Reference in New Issue
Block a user