From 837d872bcdf809c88925e5e07bc4590ddf5e6510 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 3 Jun 2025 18:01:59 +0800 Subject: Simple usleep implementation for Windows Just copying from this site and adjusting it for now: https://filipivianna.blogspot.com/2010/07/usleep-on-windows-win32.html --- indra/newview/llappviewer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7580100977..e1e26372df 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1544,7 +1544,15 @@ bool LLAppViewer::doFrame() if(fpsLimitSleepFor) { +#if LL_WINDOWS + U64 time1 = 0, time2 = 0; + QueryPerformanceCounter((LARGE_INTEGER *)&time1); + do { + QueryPerformanceCounter((LARGE_INTEGER *)&time2); + } while ((time2-time1) < fpsLimitSleepFor); +#else usleep(fpsLimitSleepFor); +#endif } // yield some time to the os based on command line option -- cgit v1.2.3 From f0de1898e0b6a3b9f1ee1bcc762ba334b78bbcc6 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 3 Jun 2025 18:04:14 +0800 Subject: Exclude Windows from referring to LibVLC headers for now, until we are ready to enable media plugins on Windows. --- indra/newview/llappviewer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e1e26372df..3f716cc4ef 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,10 +131,12 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" +#if !LL_WINDOWS #if LL_DARWIN || LL_LINUX || __FreeBSD__ #include "cef/dullahan_version.h" -#endif +#endif // LL_DARWIN || LL_LINUX || __FreeBSD__ #include "vlc/libvlc_version.h" +#endif // !LL_WINDOWS #if LL_DARWIN #if LL_SDL @@ -3461,7 +3463,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -//#if !LL_LINUX +#if !LL_WINDOWS std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3469,11 +3471,9 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); -/* #else info["LIBVLC_VERSION"] = "Undefined"; #endif -*/ S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) -- cgit v1.2.3 From 8f44cd4d043bcaa400ce0cc47d3c03196bb8defe Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 6 Jun 2025 20:18:18 +0800 Subject: Revert "Exclude Windows from referring to LibVLC headers" This reverts commit f0de1898e0b6a3b9f1ee1bcc762ba334b78bbcc6. --- indra/newview/llappviewer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3f716cc4ef..e1e26372df 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,12 +131,10 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if !LL_WINDOWS #if LL_DARWIN || LL_LINUX || __FreeBSD__ #include "cef/dullahan_version.h" -#endif // LL_DARWIN || LL_LINUX || __FreeBSD__ +#endif #include "vlc/libvlc_version.h" -#endif // !LL_WINDOWS #if LL_DARWIN #if LL_SDL @@ -3463,7 +3461,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -#if !LL_WINDOWS +//#if !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3471,9 +3469,11 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); +/* #else info["LIBVLC_VERSION"] = "Undefined"; #endif +*/ S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) -- cgit v1.2.3 From d4f3a8c3d6c24b97f9be2445659b3a67baf3a414 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 8 Jun 2025 18:49:27 +0800 Subject: Make sure Windows include CEF & Dullahan headers and minimise diff related to LibVLC headers. --- indra/newview/llappviewer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e1e26372df..cee39fc651 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,10 +131,10 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if LL_DARWIN || LL_LINUX || __FreeBSD__ +#if 1 // !LL_LINUX #include "cef/dullahan_version.h" -#endif #include "vlc/libvlc_version.h" +#endif // LL_LINUX #if LL_DARWIN #if LL_SDL @@ -3431,7 +3431,7 @@ LLSD LLAppViewer::getViewerInfo() const info["VOICE_VERSION"] = LLTrans::getString("NotConnected"); } -#if LL_DARWIN || LL_LINUX || __FreeBSD__ +#if 1 // !LL_LINUX std::ostringstream cef_ver_codec; cef_ver_codec << "Dullahan: "; cef_ver_codec << DULLAHAN_VERSION_MAJOR; @@ -3461,7 +3461,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -//#if !LL_LINUX +#if 1 // !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3469,11 +3469,9 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); -/* #else info["LIBVLC_VERSION"] = "Undefined"; #endif -*/ S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) -- cgit v1.2.3 From b3ab1336dcf2ecd51ce4792c8977771d73790a4b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 8 Jun 2025 18:51:04 +0800 Subject: Windows x86-64 without SSE2 will be crashed too --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cee39fc651..d91d2d3f4c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -987,7 +987,7 @@ bool LLAppViewer::init() return false; } -#if defined(__i386__) || defined(__x86_64__) || defined(__amd64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || _M_X64 // Without SSE2 support we will crash almost immediately, warn here. if (!gSysCPU.hasSSE2()) { -- cgit v1.2.3 From dd05837c7aa5314a553235f46d13c88df8e448a9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 9 Jun 2025 22:37:39 +0800 Subject: Fix usleep implementation for Windows https://stackoverflow.com/questions/5801813/c-usleep-is-obsolete-workarounds-for-windows-mingw --- indra/newview/llappviewer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d91d2d3f4c..94e8fabcb2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1545,11 +1545,7 @@ bool LLAppViewer::doFrame() if(fpsLimitSleepFor) { #if LL_WINDOWS - U64 time1 = 0, time2 = 0; - QueryPerformanceCounter((LARGE_INTEGER *)&time1); - do { - QueryPerformanceCounter((LARGE_INTEGER *)&time2); - } while ((time2-time1) < fpsLimitSleepFor); + std::this_thread::sleep_for(std::chrono::microseconds(fpsLimitSleepFor)); #else usleep(fpsLimitSleepFor); #endif -- cgit v1.2.3 From 61d49c273d0ad0a58ecd9dc54d8c48d43e17199a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 23 Jun 2025 10:14:51 +0800 Subject: Exclude _M_ARM64 from including media plugin headers until we are ready to enable media plugins on Windows ARM64. --- indra/newview/llappviewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 94e8fabcb2..d9596164eb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,7 +131,7 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if 1 // !LL_LINUX +#if !_M_ARM64 // !LL_LINUX #include "cef/dullahan_version.h" #include "vlc/libvlc_version.h" #endif // LL_LINUX @@ -3427,7 +3427,7 @@ LLSD LLAppViewer::getViewerInfo() const info["VOICE_VERSION"] = LLTrans::getString("NotConnected"); } -#if 1 // !LL_LINUX +#if !_M_ARM64 // !LL_LINUX std::ostringstream cef_ver_codec; cef_ver_codec << "Dullahan: "; cef_ver_codec << DULLAHAN_VERSION_MAJOR; @@ -3457,7 +3457,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -#if 1 // !LL_LINUX +#if !_M_ARM64 // !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; -- cgit v1.2.3 From 74b0178b7b4d672c7f6b317102b0ecd26f1ea033 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 12 Jul 2025 21:49:15 +0800 Subject: Rich Presence support using Discord Social SDK Download DiscordSocialSdk-1.4.9649.zip https://discord.com/developers/applications/1393451183741599796/social-sdk/downloads to your ~/Downloads folder. Add -DUSE_DISCORD:BOOL=ON to your cmake line. The authorisation is triggered by selecting Help > Discord Social. It seems that the user will need to do this every time they want Rich Presence support on the viewer while using Discord. The Discord app is still set to be a public client in the OAuth2 tab, I'm going to try to make it work with the app set to be a confidential client, next. All Discord-related code are contained within one file, llstartup.cpp, and other classes access it through some opaque layer, static functions, otherwise we'd get these "duplicate symbol" linking errors. --- indra/newview/llappviewer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d9596164eb..419d2cb842 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1348,6 +1348,10 @@ bool LLAppViewer::doFrame() U64 fpsLimitSleepFor = 0; TimePoint fpsLimitFrameStartTime = std::chrono::steady_clock::now(); +#ifdef LL_DISCORD + LLStartUp::runDiscordCallbacks(); +#endif + LL_RECORD_BLOCK_TIME(FTM_FRAME); { // and now adjust the visuals from previous frame. -- cgit v1.2.3