Skip to content

Commit 32aea80

Browse files
set SDL metadata in Fred/QtFred and remove SDL main
1 parent d802c63 commit 32aea80

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

fred2/management.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@
7777
#include <direct.h>
7878
#include "cmdline/cmdline.h"
7979

80-
#define SDL_MAIN_HANDLED
81-
#include <SDL3/SDL_main.h>
82-
8380
#define MAX_DOCKS 1000
8481

8582
#define UNKNOWN_USER "Unknown"
@@ -263,7 +260,14 @@ bool fred_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps)
263260
{
264261
int i;
265262

266-
SDL_SetMainReady();
263+
// Metadata must to be set as early as possible, before the first SDL_Init().
264+
// This is global info and cannot be changed later (i.e., it can't be set per mod)
265+
SDL_SetAppMetadata("FRED2 Open", FS_VERSION_FULL, "us.indiegames.scp.FRED2Open");
266+
267+
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, "application");
268+
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING,
269+
"Copyright 1999 Volition, Inc. & Copyright 2002-2026 The Source Code Project.");
270+
267271

268272
Random::seed(static_cast<unsigned int>(time(nullptr)));
269273
init_pending_messages();

qtfred/src/main.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
#include <csignal>
2424
#include <project.h>
2525

26-
#define SDL_MAIN_HANDLED
27-
#include <SDL3/SDL_main.h>
28-
2926

3027

3128
// Globals needed by the engine when built in 'FRED' mode.
@@ -79,6 +76,14 @@ void game_busy_callback(int /*count*/) {
7976
int main(int argc, char* argv[]) {
8077
signal( SIGSEGV, handler );
8178

79+
// Metadata must to be set as early as possible, before the first SDL_Init().
80+
// This is global info and cannot be changed later (i.e., it can't be set per mod)
81+
SDL_SetAppMetadata("qtFRED", FS_VERSION_FULL, "us.indiegames.scp.qtFRED");
82+
83+
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, "application");
84+
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING,
85+
"Copyright 1999 Volition, Inc. & Copyright 2002-2026 The Source Code Project.");
86+
8287
using namespace fso::fred;
8388

8489
#ifdef WIN32
@@ -91,8 +96,6 @@ int main(int argc, char* argv[]) {
9196

9297
qInstallMessageHandler(fsoMessageOutput);
9398

94-
SDL_SetMainReady();
95-
9699
QCoreApplication::setOrganizationName("HardLightProductions");
97100
QCoreApplication::setOrganizationDomain("hard-light.net");
98101
QCoreApplication::setApplicationName("qtFRED");

0 commit comments

Comments
 (0)