cleanup: flatten dead branches in world io level network and stats

This commit is contained in:
MatthewBeshay
2026-03-26 20:53:52 +11:00
parent 12ff12a263
commit 8d3c504ee6
93 changed files with 274 additions and 3246 deletions

View File

@@ -1,13 +1,10 @@
#include "stdafx.h"
#if 0
#include <sys/sys_time.h>
#endif
#include "System.h"
#if defined(__linux__)
#include <sys/time.h>
#include <time.h>
#include <ctime>
#endif // __linux__
#endif
template <class T>
void System::arraycopy(arrayWithLength<T> src, unsigned int srcPos,
@@ -70,7 +67,7 @@ int64_t System::nanoTime() {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return static_cast<int64_t>(ts.tv_sec) * 1000000000LL + ts.tv_nsec;
#endif // __linux__
#endif
}
// Returns the current time in milliseconds. Note that while the unit of time of
@@ -84,31 +81,7 @@ int64_t System::nanoTime() {
// the difference, measured in milliseconds, between the current time and
// midnight, January 1, 1970 UTC.
int64_t System::currentTimeMillis() {
#if 0
// sys_time_get_current_time() obtains the elapsed time since Epoch
//(1970/01/01 00:00:00 UTC). The value is separated into two parts: sec
//stores the elapsed time in seconds, and nsec
// stores the value that is smaller than a second in nanoseconds.
sys_time_sec_t sec;
sys_time_nsec_t nsec;
sys_time_get_current_time(&sec, &nsec);
int64_t msec = (sec * 1000) + (nsec / (1000 * 1000));
return msec;
#elif 0
SceRtcTick tick;
int err = sceRtcGetCurrentTick(&tick);
return (int64_t)(tick.tick / 1000);
#elif 0
// AP - TRC states we can't use the RTC for measuring elapsed game time
return sceKernelGetProcessTimeWide() / 1000;
/* SceDateTime Time;
sceRtcGetCurrentClockLocalTime(&Time);
int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) +
Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return
systTime;*/
#elif defined(__linux__)
#if defined(__linux__)
struct timeval tv;
gettimeofday(&tv, NULL);
// Convert to milliseconds since unix epoch instead of windows file time
@@ -129,24 +102,13 @@ int64_t System::currentTimeMillis() {
li.LowPart = UTCFileTime.dwLowDateTime;
return li.QuadPart / 10000;
#endif // 0
#endif
}
// 4J Stu - Added this so that we can use real-world timestamps in PSVita saves.
// Particularly required for the save transfers to be smooth
int64_t System::currentRealTimeMillis() {
#if 0
SceDateTime Time;
sceRtcGetCurrentClockLocalTime(&Time);
int64_t systTime =
(((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) +
Time.second) *
1000) +
(Time.microsecond / 1000);
return systTime;
#else
return currentTimeMillis();
#endif
}
void System::ReverseUSHORT(unsigned short* pusVal) {