Skip to content

Commit

Permalink
- Updated packages
Browse files Browse the repository at this point in the history
- Fix wayland cpm link
- Fix settings not saving if migration fails
  • Loading branch information
edunad committed Jun 15, 2024
1 parent c2ae9a8 commit e22ea47
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ if(magic_enum_ADDED)
endif()

if(NOT WIN32 AND RAWRBOX_USE_WAYLAND)
CPMAddPackage("gl:wayland/weston@12.0.3")
CPMAddPackage("https://gitlab.freedesktop.org/wayland/weston@13.0.3")
endif()

CPMAddPackage("gh:stephenberry/glaze@2.6.9")
CPMAddPackage("gh:stephenberry/glaze@2.9.0")

# ---
if(RAWRBOX_BUILD_RAWRBOX_NETWORK OR RAWRBOX_BUILD_RAWRBOX_ASSIMP)
Expand Down
2 changes: 1 addition & 1 deletion cmake/cpm.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.39.0)
set(CPM_DOWNLOAD_VERSION 0.40.0)

set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")

Expand Down
6 changes: 3 additions & 3 deletions package-lock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CPMDeclarePackage(magic_enum
)
# glaze
CPMDeclarePackage(glaze
VERSION 2.6.9
VERSION 2.9.0
GITHUB_REPOSITORY stephenberry/glaze
SYSTEM YES
EXCLUDE_FROM_ALL YES
Expand Down Expand Up @@ -60,7 +60,7 @@ CPMDeclarePackage(thread-pool
)
# cpptrace
CPMDeclarePackage(cpptrace
VERSION 0.6.0
VERSION 0.6.1
GITHUB_REPOSITORY jeremy-rifkin/cpptrace
SYSTEM YES
EXCLUDE_FROM_ALL YES
Expand All @@ -77,7 +77,7 @@ CPMDeclarePackage(cpptrace
# luau
CPMDeclarePackage(luau
NAME luau
GIT_TAG 0.628
GIT_TAG 0.630
GITHUB_REPOSITORY luau-lang/luau
OPTIONS
"LUAU_BUILD_CLI OFF"
Expand Down
2 changes: 1 addition & 1 deletion rawrbox.network/src/scripting/wrappers/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace rawrbox {
void PacketWrapper::writeFloat(float val) { data.write(val); }
void PacketWrapper::writeDouble(double val) { data.write(val); }
void PacketWrapper::writeString(const std::string& val) { data.write(val); }
void PacketWrapper::writeTable(const luabridge::LuaRef& val) { data.write(glz::write<glz::opts{.prettify = true}>(rawrbox::LuaUtils::luaToJsonObject(val))); }
void PacketWrapper::writeTable(const luabridge::LuaRef& val) { data.write(glz::write<glz::opts{.prettify = true}>(rawrbox::LuaUtils::luaToJsonObject(val))->c_str()); }
// -------

// READ ----
Expand Down
2 changes: 1 addition & 1 deletion rawrbox.scripting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CPMAddPackage(
GITHUB_REPOSITORY
luau-lang/luau
GIT_TAG
0.628
0.630
OPTIONS
"LUAU_BUILD_CLI OFF"
"LUAU_BUILD_TESTS OFF"
Expand Down
2 changes: 1 addition & 1 deletion rawrbox.scripting/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace rawrbox {
luabridge::getGlobalNamespace(L)
.addFunction("printTable", [](const luabridge::LuaRef& ref) {
auto json = rawrbox::LuaUtils::luaToJsonObject(ref);
_logger->info("{}", glz::write<glz::opts{.prettify = true}>(json));
_logger->info("{}", glz::write<glz::opts{.prettify = true}>(json)->c_str());
})
.addFunction("print", [](lua_State* state) {
auto args = rawrbox::LuaUtils::argsToString(state);
Expand Down
2 changes: 1 addition & 1 deletion rawrbox.utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if(thread-pool_ADDED)
endif()

# DEPS ----
CPMAddPackage("gh:jeremy-rifkin/[email protected].0")
CPMAddPackage("gh:jeremy-rifkin/[email protected].1")
if(cpptrace_ADDED)
set_lib_runtime_mt(cpptrace-lib)
endif()
Expand Down
12 changes: 5 additions & 7 deletions rawrbox.utils/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace rawrbox {
std::ofstream out(fileName);
if (!out.is_open()) throw this->_logger->error("Failed to save settings '{}'", fileName);

out << glz::write<glz::opts{.prettify = true}>(this->_settings);
out << glz::write<glz::opts{.prettify = true}>(this->_settings)->c_str();
out.close();
}

Expand Down Expand Up @@ -56,19 +56,17 @@ namespace rawrbox {
}

rawrbox::JSONUtils::patch(this->_settings, fixedDiff);
this->_settings["VERSION"] = this->getVersion(); // For settings version comparison
this->save();
this->_logger->warn("Settings migrated!");
} else {
this->_logger->warn("Missing version, cannot migrate! Adding current version, some things might be broken!");
this->_settings["VERSION"] = this->getVersion(); // For settings version comparison
}

} else {
this->_settings = this->getDefaults();
this->_settings["VERSION"] = this->getVersion(); // For settings version comparison

this->save();
}

this->_settings["VERSION"] = this->getVersion(); // For settings version comparison
this->save();
}

glz::json_t& Settings::getSettings() {
Expand Down
2 changes: 1 addition & 1 deletion samples/011-physics-3D/src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ namespace phys_3d_test {
if (!this->_ready) return;

auto* stencil = rawrbox::RENDERER->stencil();
stencil->drawText(fmt::format("[F1] PAUSED: {}", rawrbox::PHYSICS::simulate), {15, 15});
stencil->drawText(fmt::format("[F1] PAUSED: {}", !rawrbox::PHYSICS::simulate), {15, 15});
stencil->drawText(fmt::format("[F2] DEBUG: {}", this->_debug), {15, 28});
stencil->drawText(fmt::format("[F3] CLEAR"), {15, 48});

Expand Down

0 comments on commit e22ea47

Please sign in to comment.