From 3ae71b11064cda3693192ba87e8d6fab0ec4730d Mon Sep 17 00:00:00 2001 From: XProger Date: Sun, 10 Mar 2019 15:42:32 +0300 Subject: [PATCH] rename osGetTime to osGetTimeMS for platforms --- src/gapi_d3d9.h | 4 ++-- src/platform/android/app/src/main/cpp/main.cpp | 2 +- src/platform/clover/main.cpp | 2 +- src/platform/ios/ViewController.mm | 2 +- src/platform/nix/main.cpp | 8 ++++---- src/platform/nx/main.cpp | 8 ++++---- src/platform/osx/main.mm | 6 +++--- src/platform/psp/main.cpp | 4 ++-- src/platform/psv/main.cpp | 4 ++-- src/platform/rpi/main.cpp | 2 +- src/platform/sdl2/main.cpp | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gapi_d3d9.h b/src/gapi_d3d9.h index 02f8617..079167d 100644 --- a/src/gapi_d3d9.h +++ b/src/gapi_d3d9.h @@ -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); diff --git a/src/platform/android/app/src/main/cpp/main.cpp b/src/platform/android/app/src/main/cpp/main.cpp index bc3fc65..b7715f6 100644 --- a/src/platform/android/app/src/main/cpp/main.cpp +++ b/src/platform/android/app/src/main/cpp/main.cpp @@ -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); diff --git a/src/platform/clover/main.cpp b/src/platform/clover/main.cpp index cc1fa71..0810d81 100644 --- a/src/platform/clover/main.cpp +++ b/src/platform/clover/main.cpp @@ -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); diff --git a/src/platform/ios/ViewController.mm b/src/platform/ios/ViewController.mm index dd23757..6eb5bb7 100644 --- a/src/platform/ios/ViewController.mm +++ b/src/platform/ios/ViewController.mm @@ -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; diff --git a/src/platform/nix/main.cpp b/src/platform/nix/main.cpp index 0f35a0d..e5668b3 100644 --- a/src/platform/nix/main.cpp +++ b/src/platform/nix/main.cpp @@ -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() { diff --git a/src/platform/nx/main.cpp b/src/platform/nx/main.cpp index f5ad484..d21445b 100644 --- a/src/platform/nx/main.cpp +++ b/src/platform/nx/main.cpp @@ -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(); } } diff --git a/src/platform/osx/main.mm b/src/platform/osx/main.mm index b688b6f..44741b3 100644 --- a/src/platform/osx/main.mm +++ b/src/platform/osx/main.mm @@ -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; diff --git a/src/platform/psp/main.cpp b/src/platform/psp/main.cpp index 1b30fe5..0532506 100644 --- a/src/platform/psp/main.cpp +++ b/src/platform/psp/main.cpp @@ -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(); diff --git a/src/platform/psv/main.cpp b/src/platform/psv/main.cpp index 122a447..6bf003f 100644 --- a/src/platform/psv/main.cpp +++ b/src/platform/psv/main.cpp @@ -39,7 +39,7 @@ void osMutexUnlock(void *obj) { int osStartTime = 0; int osTimerFreq; -int osGetTime() { +int osGetTimeMS() { SceRtcTick current; sceRtcGetCurrentTick(¤t); 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"); diff --git a/src/platform/rpi/main.cpp b/src/platform/rpi/main.cpp index da2ee1e..d33d268 100644 --- a/src/platform/rpi/main.cpp +++ b/src/platform/rpi/main.cpp @@ -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); diff --git a/src/platform/sdl2/main.cpp b/src/platform/sdl2/main.cpp index 174ab93..424bd5a 100644 --- a/src/platform/sdl2/main.cpp +++ b/src/platform/sdl2/main.cpp @@ -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);