Skip to content

Commit

Permalink
make some more parts of rsl compile for msvc, type_map, some cleanup …
Browse files Browse the repository at this point in the history
…around allocator, stl compatible allocator wrapper, add engine and program context, stop assertion of startup errors
  • Loading branch information
GlynLeine committed Dec 11, 2024
1 parent 09ce7e5 commit f250059
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 36 deletions.
43 changes: 9 additions & 34 deletions applications/core_test/src/core_test/source.cpp
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
#define RYTHE_ENTRY

#include <chrono>
#include <iostream>
#include <rsl/logging>
#include <rsl/math>
#include <rsl/time>

#include <core/core.hpp>

enum struct test_error : rsl::errc
{
no_error = 0,
hi,
no,
fuck,
you
};
using namespace rythe::core;

void assert_handler(
std::string_view expression, std::string_view file, rsl::size_type line, std::string_view message, bool soft
)
struct test_struct
{
rsl::log::undecoratedln(
soft ? rsl::log::severity::warn : rsl::log::severity::fatal,
"Assertion failed:\t{}\nExpected:\t\t{}\nSource:\t\t\t{}, line {}", message, expression, file, line
);

__debugbreak();
}
int i = 14;
};

rsl::result<void> RYTHE_CCONV init_program(rythe::core::Program& program)
rsl::result<void> RYTHE_CCONV init_program(Program& program)
{
rsl::asserts::assert_handler = &assert_handler;

rsl::result<void> result;

rsl::log::debug("Initilizing Core-Application");
program.addEngineInstance();
auto& engine = program.addEngineInstance();
engine.get_context().emplace<test_struct>().i = 15;

rsl::append_error(result, test_error::no, "NOPE");
rsl::append_warning(result, test_error::hi, "HEEEEYYYYY");
rsl::log::debug("{}", engine.get_context().get<test_struct>().i);

return result;
return rsl::error; // Temporarily to stop the engine from running.
}
2 changes: 1 addition & 1 deletion libraries/rythe/rythe-standard-library
2 changes: 1 addition & 1 deletion modules/rythe/core

0 comments on commit f250059

Please sign in to comment.