Skip to content

Commit bf30f64

Browse files
set SDL metadata in Fred/QtFred and remove SDL main
1 parent a019536 commit bf30f64

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
@@ -79,9 +79,6 @@
7979
#include <direct.h>
8080
#include "cmdline/cmdline.h"
8181

82-
#define SDL_MAIN_HANDLED
83-
#include <SDL3/SDL_main.h>
84-
8582
#define MAX_DOCKS 1000
8683

8784
#define UNKNOWN_USER "Unknown"
@@ -267,7 +264,14 @@ bool fred_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps)
267264
{
268265
int i;
269266

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

272276
Random::seed(static_cast<unsigned int>(time(nullptr)));
273277
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)