mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Base content package + ContentLoader
This commit is contained in:
parent
6708e1ef86
commit
c8a283c645
33 changed files with 318 additions and 112 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include "files/settings_io.h"
|
||||
#include "files/engine_paths.h"
|
||||
#include "content/Content.h"
|
||||
#include "content/ContentLoader.h"
|
||||
|
||||
#include "coders/png.h"
|
||||
#include "graphics/Atlas.h"
|
||||
|
|
@ -20,6 +21,8 @@
|
|||
|
||||
#include "util/command_line.h"
|
||||
|
||||
using std::filesystem::path;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
EnginePaths paths;
|
||||
if (!parse_cmdline(argc, argv, paths))
|
||||
|
|
@ -28,14 +31,17 @@ int main(int argc, char** argv) {
|
|||
platform::configure_encoding();
|
||||
ContentBuilder contentBuilder;
|
||||
setup_definitions(&contentBuilder);
|
||||
// TODO: implement worlds indexing
|
||||
ContentLoader loader(paths.getResources()/path("content/base"));
|
||||
loader.load(&contentBuilder);
|
||||
|
||||
std::unique_ptr<Content> content(contentBuilder.build());
|
||||
try {
|
||||
EngineSettings settings;
|
||||
toml::Wrapper wrapper = create_wrapper(settings);
|
||||
|
||||
std::filesystem::path settings_file = platform::get_settings_file();
|
||||
std::filesystem::path controls_file = platform::get_controls_file();
|
||||
path settings_file = platform::get_settings_file();
|
||||
path controls_file = platform::get_controls_file();
|
||||
if (std::filesystem::is_regular_file(settings_file)) {
|
||||
std::cout << "-- loading settings" << std::endl;
|
||||
std::string content = files::read_string(settings_file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue