1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #79126 from bruvzg/SteamTime

Enable optional minimal SteamAPI integration for usage time tracking (editor only).
This commit is contained in:
Rémi Verschelde
2024-06-03 12:42:38 +02:00
committed by GitHub
5 changed files with 214 additions and 0 deletions

View File

@@ -113,6 +113,10 @@
#endif // DISABLE_DEPRECATED
#endif // TOOLS_ENABLED
#if defined(STEAMAPI_ENABLED)
#include "main/steam_tracker.h"
#endif
#include "modules/modules_enabled.gen.h" // For mono.
#if defined(MODULE_MONO_ENABLED) && defined(TOOLS_ENABLED)
@@ -143,6 +147,10 @@ static ZipArchive *zip_packed_data = nullptr;
#endif
static MessageQueue *message_queue = nullptr;
#if defined(STEAMAPI_ENABLED)
static SteamTracker *steam_tracker = nullptr;
#endif
// Initialized in setup2()
static AudioServer *audio_server = nullptr;
static CameraServer *camera_server = nullptr;
@@ -2445,6 +2453,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->benchmark_end_measure("Startup", "Core");
#if defined(STEAMAPI_ENABLED)
if (editor || project_manager) {
steam_tracker = memnew(SteamTracker);
}
#endif
if (p_second_phase) {
return setup2();
}
@@ -2503,6 +2517,12 @@ error:
OS::get_singleton()->benchmark_end_measure("Startup", "Core");
OS::get_singleton()->benchmark_end_measure("Startup", "Setup");
#if defined(STEAMAPI_ENABLED)
if (steam_tracker) {
memdelete(steam_tracker);
}
#endif
OS::get_singleton()->finalize_core();
locale = String();
@@ -4336,6 +4356,12 @@ void Main::cleanup(bool p_force) {
message_queue->flush();
memdelete(message_queue);
#if defined(STEAMAPI_ENABLED)
if (steam_tracker) {
memdelete(steam_tracker);
}
#endif
unregister_core_driver_types();
unregister_core_extensions();
uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE);