[aseprite] 88/134: Don't initialize GuiSystem if it's not necessary
Tobias Hansen
thansen at moszumanska.debian.org
Sat Mar 14 17:10:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit b1d9d82fbf7fca0da132a44520d647afc6bac674
Author: David Capello <davidcapello at gmail.com>
Date: Sun Nov 30 21:01:54 2014 -0300
Don't initialize GuiSystem if it's not necessary
---
src/app/app.cpp | 5 +++--
src/app/app.h | 8 +++++++-
src/main/main.cpp | 9 +++++----
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/app/app.cpp b/src/app/app.cpp
index aacf33e..70d26f2 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -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.
diff --git a/src/app/app.h b/src/app/app.h
index 9f9237b..32e0554 100644
--- a/src/app/app.h
+++ b/src/app/app.h
@@ -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;
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 9396885..794962c 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list