mirror of
https://github.com/xenia-project/elemental-forms.git
synced 2026-01-31 01:25:17 +01:00
Moving string table loading out of init.
This commit is contained in:
@@ -28,13 +28,12 @@ using graphics::Renderer;
|
||||
// From elements.cc:
|
||||
void RegisterBuiltinElementInflaters();
|
||||
|
||||
bool Initialize(Renderer* renderer, const char* language_file) {
|
||||
bool Initialize(Renderer* renderer) {
|
||||
assert(!is_initialized());
|
||||
|
||||
Renderer::set(renderer);
|
||||
|
||||
util::StringTable::set(std::make_unique<util::StringTable>());
|
||||
util::StringTable::get()->Load(language_file);
|
||||
text::FontManager::set(std::make_unique<text::FontManager>());
|
||||
Skin::set(std::make_unique<Skin>());
|
||||
parsing::ElementFactory::set(std::make_unique<parsing::ElementFactory>());
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace el {
|
||||
using el::util::format_string;
|
||||
|
||||
// Initializes Elemental Forms. Call this before using any elemental API.
|
||||
bool Initialize(graphics::Renderer* renderer, const char* language_file);
|
||||
bool Initialize(graphics::Renderer* renderer);
|
||||
|
||||
// Shuts down Elemental Forms. Call this after deleting the last element, to
|
||||
// free libelemental internals.
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "el/util/metrics.h"
|
||||
#include "el/util/string.h"
|
||||
#include "el/util/string_builder.h"
|
||||
#include "el/util/string_table.h"
|
||||
#include "testbed/list_window.h"
|
||||
#include "testbed/resource_edit_window.h"
|
||||
#include "testbed/scratch/code_text_box.h"
|
||||
@@ -210,10 +211,11 @@ int app_main() {
|
||||
ApplicationBackend::Create(application, 1280, 700, "Demo");
|
||||
if (!application_backend) return 1;
|
||||
|
||||
el::Initialize(application_backend->GetRenderer(),
|
||||
"resources/language/lng_en.tb.txt");
|
||||
el::Initialize(application_backend->GetRenderer());
|
||||
CodeTextBox::RegisterInflater();
|
||||
|
||||
util::StringTable::get()->Load("resources/language/lng_en.tb.txt");
|
||||
|
||||
// Load the default skin, and override skin that contains the graphics
|
||||
// specific to the demo.
|
||||
Skin::get()->Load("resources/default_skin/skin.tb.txt",
|
||||
|
||||
Reference in New Issue
Block a user