1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-06 13:16:52 +02:00

rename osGetTime to osGetTimeMS for platforms

This commit is contained in:
XProger
2019-03-10 15:42:32 +03:00
parent 3241eb7948
commit 3ae71b1106
11 changed files with 22 additions and 22 deletions

View File

@@ -244,11 +244,11 @@ namespace GAPI {
LPDIRECT3DTEXTURE9 tex2D;
LPDIRECT3DCUBETEXTURE9 texCube;
int width, height, origWidth, origHeight;
int width, height, depth, origWidth, origHeight, origDepth;
TexFormat fmt;
uint32 opt;
Texture(int width, int height, uint32 opt) : tex2D(NULL), texCube(NULL), width(width), height(height), origWidth(width), origHeight(height), fmt(FMT_RGBA), opt(opt) {}
Texture(int width, int height, int depth, uint32 opt) : tex2D(NULL), texCube(NULL), width(width), height(height), depth(depth), origWidth(width), origHeight(height), origDepth(depth), fmt(FMT_RGBA), opt(opt) {}
void init(void *data) {
ASSERT((opt & OPT_PROXY) == 0);

View File

@@ -19,7 +19,7 @@ JavaVM *jvm;
// timing
time_t startTime;
int osGetTime() {
int osGetTimeMS() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);

View File

@@ -20,7 +20,7 @@
// timing
unsigned int startTime;
int osGetTime() {
int osGetTimeMS() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);

View File

@@ -24,7 +24,7 @@ void osJoyVibrate(int index, float L, float R) {
// TODO
}
int osGetTime() {
int osGetTimeMS() {
const int64_t kOneMillion = 1000 * 1000;
static mach_timebase_info_data_t info;

View File

@@ -18,7 +18,7 @@
// timing
unsigned int startTime;
int osGetTime() {
int osGetTimeMS() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);
@@ -185,7 +185,7 @@ void joyInit() {
joy.fx.type = FF_RUMBLE;
joy.fx.replay.delay = 0;
joy.vL = joy.oL = joy.vR = joy.oR = 0.0f;
joy.time = osGetTime();
joy.time = Core::getTime();
}
}
}
@@ -222,7 +222,7 @@ void joyRumble(JoyDevice &joy) {
if (joy.oL == 0.0f && joy.vL == 0.0f && joy.oR == 0.0f && joy.vR == 0.0f)
return;
if (osGetTime() <= joy.time)
if (Core::getTime() <= joy.time)
return;
input_event event;
@@ -255,7 +255,7 @@ void joyRumble(JoyDevice &joy) {
joy.oL = joy.vL;
joy.oR = joy.vR;
joy.time = osGetTime() + joy.fx.replay.length;
joy.time = Core::getTime() + joy.fx.replay.length;
}
void joyUpdate() {

View File

@@ -27,7 +27,7 @@ void osMutexUnlock(void *obj) {
// timing
u64 startTick;
int osGetTime() {
int osGetTimeMS() {
u64 tick = armGetSystemTick();
return int(((tick - startTick) * 625 / 12) / 1000000);
}
@@ -187,7 +187,7 @@ int joySplitTime;
void joySplit(bool split) {
joyIsSplit = split;
joySplitTime = osGetTime();
joySplitTime = Core::getTime();
if (split) {
hidSetNpadJoyHoldType(HidJoyHoldType_Horizontal);
hidSetNpadJoyAssignmentModeSingleByDefault(CONTROLLER_PLAYER_1);
@@ -245,7 +245,7 @@ void joyUpdate() {
Input::setJoyPos(i, jkR, vec2(float(sR.dx), float(-sR.dy)) / 32767.0f);
if ((mask & (KEY_L | KEY_R)) == (KEY_L | KEY_R)) { // hold L and R to split/merge joy-con's
if (joySplitTime + 1000 < osGetTime()) { // 1 sec timer
if (joySplitTime + 1000 < Core::getTime()) { // 1 sec timer
joySplit(!joyIsSplit);
}
waitForSplit = true;
@@ -253,7 +253,7 @@ void joyUpdate() {
}
if (!waitForSplit) {
joySplitTime = osGetTime();
joySplitTime = Core::getTime();
}
}

View File

@@ -10,7 +10,7 @@ BOOL enableRetina = YES;
int frameLimit = 58 + 4;
// timing
int osGetTime() {
int osGetTimeMS() {
static mach_timebase_info_data_t timebaseInfo;
if (timebaseInfo.denom == 0) {
mach_timebase_info(&timebaseInfo);
@@ -405,7 +405,7 @@ BOOL allowFrameUpdate = YES;
return;
}
int startDrawMs = osGetTime();
int startDrawMs = Core::getTime();
NSOpenGLContext *context = [self openGLContext];
@@ -415,7 +415,7 @@ BOOL allowFrameUpdate = YES;
[context flushBuffer];
int endDrawMs = osGetTime();
int endDrawMs = Core::getTime();
int deltaMs = endDrawMs - startDrawMs;
float avgDelta = ((lastDeltaMs + deltaMs) / 2.0);
lastDeltaMs = deltaMs;

View File

@@ -87,7 +87,7 @@ void osRWUnlockWrite(void *obj) {
int osStartTime = 0;
int osTimerFreq;
int osGetTime() {
int osGetTimeMS() {
u64 time;
sceRtcGetCurrentTick(&time);
return int(time * 1000 / osTimerFreq - osStartTime);
@@ -160,7 +160,7 @@ int main() {
joyInit();
osTimerFreq = sceRtcGetTickResolution();
osStartTime = osGetTime();
osStartTime = Core::getTime();
Game::init();

View File

@@ -39,7 +39,7 @@ void osMutexUnlock(void *obj) {
int osStartTime = 0;
int osTimerFreq;
int osGetTime() {
int osGetTimeMS() {
SceRtcTick current;
sceRtcGetCurrentTick(&current);
return int(current.tick * 1000 / osTimerFreq - osStartTime);
@@ -191,7 +191,7 @@ int main() {
inputInit();
osTimerFreq = sceRtcGetTickResolution();
osStartTime = osGetTime();
osStartTime = Core::getTime();
Game::init("PSXDATA/LEVEL2.PSX");
// sceRazorGpuCaptureSetTrigger(100, "ux0:data/OpenLara/capture.sgx");

View File

@@ -19,7 +19,7 @@
// timing
unsigned int startTime;
int osGetTime() {
int osGetTimeMS() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);

View File

@@ -13,7 +13,7 @@
// timing
unsigned int startTime;
int osGetTime() {
int osGetTimeMS() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);