From e20bf233aa64bf12fdec0fcffe9c39e00c0ca8e7 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 14 Apr 2024 14:48:52 +1000 Subject: [PATCH] Launcher: Double maximum input length for textbox inputs --- src/LWidgets.h | 2 +- src/Platform_PS3.c | 6 +++--- src/Platform_Xbox.c | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/LWidgets.h b/src/LWidgets.h index 96c2ed3e4..29adae420 100644 --- a/src/LWidgets.h +++ b/src/LWidgets.h @@ -108,7 +108,7 @@ struct LInput { int caretPos; cc_string text; int _textHeight; - char _textBuffer[STRING_SIZE]; + char _textBuffer[STRING_SIZE * 2]; }; CC_NOINLINE void LInput_Add(void* screen, struct LInput* w, int width, const char* hintText, const struct LLayout* layouts); diff --git a/src/Platform_PS3.c b/src/Platform_PS3.c index 735276e6b..b4c15a258 100644 --- a/src/Platform_PS3.c +++ b/src/Platform_PS3.c @@ -53,9 +53,9 @@ void Platform_Log(const char* msg, int len) { } TimeMS DateTime_CurrentUTC(void) { - struct timeval cur; - gettimeofday(&cur, NULL); - return (cc_uint64)cur.tv_sec + UNIX_EPOCH_SECONDS; + u64 sec, nanosec; + sysGetCurrentTime(&sec, &nanosec); + return sec + UNIX_EPOCH_SECONDS; } void DateTime_CurrentLocal(struct DateTime* t) { diff --git a/src/Platform_Xbox.c b/src/Platform_Xbox.c index 76f6bc6a5..9ac670794 100644 --- a/src/Platform_Xbox.c +++ b/src/Platform_Xbox.c @@ -64,10 +64,10 @@ void DateTime_CurrentLocal(struct DateTime* t) { } /* TODO: check this is actually accurate */ -static cc_uint64 sw_freqMul = 1, sw_freqDiv = 1; +static cc_uint64 sw_freqDiv = 1; cc_uint64 Stopwatch_ElapsedMicroseconds(cc_uint64 beg, cc_uint64 end) { if (end < beg) return 0; - return ((end - beg) * sw_freqMul) / sw_freqDiv; + return ((end - beg) * 1000000ULL) / sw_freqDiv; } cc_uint64 Stopwatch_Measure(void) { @@ -76,9 +76,7 @@ cc_uint64 Stopwatch_Measure(void) { static void Stopwatch_Init(void) { ULONGLONG freq = KeQueryPerformanceFrequency(); - - sw_freqMul = 1000 * 1000; - sw_freqDiv = freq; + sw_freqDiv = freq; }