Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Move some app-specific stuff from SdlApp to main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Apr 24, 2023
1 parent 272c1c7 commit 2574515
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
12 changes: 10 additions & 2 deletions src/projects/machines/machines_main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#include "afx/AfxSdlApp.hpp"
#include "sdlapp.hpp"

#include "MachinesVersion.hpp"

#include <SDL.h>

int main(int argc, char* argv[])
{
SDLApp app;
app.setAppName("Machines");
app.setAppVersion(machinesVersion());
app.setAppBuildVersion(machinesBuildVersion());
app.setLoggingEnabled(true);

try
{
AfxSdlApp::sdlInstance().initialise(argc, argv);
app.initialise(argc, argv);

auto const runResult = AfxApp::abstractInstance().run();

Expand Down
7 changes: 0 additions & 7 deletions src/projects/machines/sdlapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
#include "machgui/ctxoptns.hpp"
#include "machgui/gui.hpp"

#include "MachinesVersion.hpp"

#include "spdlog/spdlog.h"
#include <cstdio>

Expand Down Expand Up @@ -76,11 +74,6 @@ SDLApp::SDLApp()
{
for (int i = 0; i < 4; ++i)
aShowRace_[i] = false;

setAppName("Machines");
setLoggingEnabled(true);
setAppVersion(machinesVersion());
setAppBuildVersion(machinesBuildVersion());
}

SDLApp::~SDLApp()
Expand Down
3 changes: 2 additions & 1 deletion src/projects/machines/sdlapp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class MachGuiStartupScreens;
class SDLApp : public AfxOSSpecificApp<SDLApp>
{
public:
SDLApp();
~SDLApp() override;

enum StartedFromLobby
{
LOBBY_START,
Expand All @@ -36,7 +38,6 @@ class SDLApp : public AfxOSSpecificApp<SDLApp>

private:
friend class AfxSingletonApp;
SDLApp();

// Provide virtual fns required by base classes.
void clientShutdown() override;
Expand Down
11 changes: 9 additions & 2 deletions src/projects/planeted/planeted_main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#include "afx/AfxSdlApp.hpp"
#include "sdlapp.hpp"

#include "MachinesVersion.hpp"

#include <SDL.h>

int main(int argc, char* argv[])
{
SDLApp app;
app.setAppName("Machines Planet Editor");
app.setAppVersion("v0.00.01");
app.setAppBuildVersion(machinesBuildVersion());

try
{
AfxSdlApp::sdlInstance().initialise(argc, argv);
app.initialise(argc, argv);

auto const runResult = AfxApp::abstractInstance().run();

Expand Down
6 changes: 0 additions & 6 deletions src/projects/planeted/sdlapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#include "machphys/levels.hpp"
#include "machphys/persist.hpp"

#include "MachinesVersion.hpp"

class ProgressIndicator : public IProgressReporter
{
public:
Expand Down Expand Up @@ -135,10 +133,6 @@ SDLApp::SDLApp()
{
for (int i = 0; i < 4; ++i)
aShowRace_[i] = false;

setAppName("Machines Planet Editor");
setAppVersion("v0.00.01");
setAppBuildVersion(machinesBuildVersion());
}

SDLApp::~SDLApp()
Expand Down
2 changes: 1 addition & 1 deletion src/projects/planeted/sdlapp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class EnvPlanetEnvironment;
class SDLApp : public AfxOSSpecificApp<SDLApp>
{
public:
SDLApp();
~SDLApp() override;

private:
friend class AfxSingletonApp;
SDLApp();

// Provide virtual fns required by base classes.
void clientShutdown() override;
Expand Down

0 comments on commit 2574515

Please sign in to comment.