mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-25 15:41:07 +00:00
Don't initialize GuiSystem if it's not necessary
This commit is contained in:
parent
7a4f4c9c5e
commit
b1d9d82fbf
@ -124,9 +124,10 @@ App::App()
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
void App::initialize(int argc, const char* argv[])
|
||||
void App::initialize(const AppOptions& options)
|
||||
{
|
||||
AppOptions options(argc, argv);
|
||||
if (options.startUI())
|
||||
m_guiSystem.reset(new ui::GuiSystem);
|
||||
|
||||
// Initializes the application loading the modules, setting the
|
||||
// graphics mode, loading the configuration and resources, etc.
|
||||
|
@ -33,8 +33,13 @@ namespace raster {
|
||||
class Layer;
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
class GuiSystem;
|
||||
}
|
||||
|
||||
namespace app {
|
||||
|
||||
class AppOptions;
|
||||
class Document;
|
||||
class DocumentExporter;
|
||||
class INotificationDelegate;
|
||||
@ -65,7 +70,7 @@ namespace app {
|
||||
// Runs the Aseprite application. In GUI mode it's the top-level
|
||||
// window, in console/scripting it just runs the specified
|
||||
// scripts.
|
||||
void initialize(int argc, const char* argv[]);
|
||||
void initialize(const AppOptions& options);
|
||||
void run();
|
||||
|
||||
tools::ToolBox* getToolBox() const;
|
||||
@ -91,6 +96,7 @@ namespace app {
|
||||
static App* m_instance;
|
||||
|
||||
base::SystemConsole m_systemConsole;
|
||||
base::UniquePtr<ui::GuiSystem> m_guiSystem;
|
||||
Modules* m_modules;
|
||||
LegacyModules* m_legacy;
|
||||
bool m_isGui;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#endif
|
||||
|
||||
#include "app/app.h"
|
||||
#include "app/app_options.h"
|
||||
#include "app/console.h"
|
||||
#include "app/resource_finder.h"
|
||||
#include "app/send_crash.h"
|
||||
@ -30,7 +31,6 @@
|
||||
#include "she/error.h"
|
||||
#include "she/scoped_handle.h"
|
||||
#include "she/system.h"
|
||||
#include "ui/base.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
@ -67,9 +67,10 @@ int app_main(int argc, char* argv[])
|
||||
|
||||
try {
|
||||
base::MemoryDump memoryDump;
|
||||
she::ScopedHandle<she::System> system(she::create_system());
|
||||
MemLeak memleak;
|
||||
ui::GuiSystem guiSystem;
|
||||
|
||||
app::AppOptions options(argc, const_cast<const char**>(argv));
|
||||
she::ScopedHandle<she::System> system(she::create_system());
|
||||
app::App app;
|
||||
|
||||
// Change the name of the memory dump file
|
||||
@ -79,7 +80,7 @@ int app_main(int argc, char* argv[])
|
||||
memoryDump.setFileName(filename);
|
||||
}
|
||||
|
||||
app.initialize(argc, const_cast<const char**>(argv));
|
||||
app.initialize(options);
|
||||
app.run();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user