From 98472dbb7b2fc092e8eb673614737777414843a2 Mon Sep 17 00:00:00 2001 From: yzh Date: Thu, 1 Feb 2024 14:58:32 +0800 Subject: [PATCH 1/3] vs config file --- .gitignore | 5 ++--- source/CMakeSettings.json | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e9282ec..2ca1f10 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,8 @@ enc_temp_folder/ .cache/ attic/chucklefish/ tiled/ -assets/user/ -assets/devel/ -assets/packed.pak +assets/* +!assets/opensb mods/*.pak mods/* */.vs/ diff --git a/source/CMakeSettings.json b/source/CMakeSettings.json index 86e0011..d9c6622 100644 --- a/source/CMakeSettings.json +++ b/source/CMakeSettings.json @@ -2,11 +2,11 @@ "configurations": [ { "name": "x64-RelWithDebInfo", - "generator": "Ninja", + "generator": "Visual Studio 17 2022 Win64", "configurationType": "RelWithDebInfo", "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${projectDir}\\..\\build", - "installRoot": "${projectDir}\\..\\out\\install\\${name}", + "buildRoot": "${projectDir}\\..\\build\\${name}", + "installRoot": "${projectDir}\\..\\dist\\install\\${name}", "cmakeCommandArgs": "-DCMAKE_INCLUDE_PATH=\"..\\lib\\windows\\include\" -DCMAKE_LIBRARY_PATH=\"..\\lib\\windows\"", "variables": [ { @@ -18,8 +18,19 @@ "name": "STAR_ENABLE_DISCORD_INTEGRATION", "value": "True", "type": "BOOL" + }, + { + "name": "STAR_USE_JEMALLOC", + "value": "True", + "type": "BOOL" + }, + { + "name": "CMAKE_CONFIGURATION_TYPES", + "value": "RelWithAsserts", + "type": "STRING" } - ] + ], + "cmakeExecutable": "C:/Program Files/CMake/bin/cmake.exe" } ] } \ No newline at end of file From 33db825d0424ef6b6061f0ee4f20bb5f8642a389 Mon Sep 17 00:00:00 2001 From: yzh Date: Thu, 1 Feb 2024 15:00:57 +0800 Subject: [PATCH 2/3] fix world_benchmark update() param --- source/utility/world_benchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utility/world_benchmark.cpp b/source/utility/world_benchmark.cpp index 40476a1..90524f5 100644 --- a/source/utility/world_benchmark.cpp +++ b/source/utility/world_benchmark.cpp @@ -81,7 +81,7 @@ int main(int argc, char** argv) { lastReport = Time::monotonicTime(); coutf("[{}] {}s | FPS: {} | Entities: {}\n", j, Time::monotonicTime() - start, fps, entityCount); } - worldServer.update(); + worldServer.update(ServerGlobalTimestep * GlobalTimescale); } double totalTime = Time::monotonicTime() - start; coutf("Finished run of running dungeon world '{}' with seed {} for {} steps in {} seconds, average FPS: {}\n", From 4e331c54048ba8dfbc2bc05d85fcc9b517f5fea7 Mon Sep 17 00:00:00 2001 From: yzh Date: Tue, 13 Feb 2024 14:49:00 +0800 Subject: [PATCH 3/3] fix memory leak --- source/game/scripting/StarLuaRoot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/game/scripting/StarLuaRoot.cpp b/source/game/scripting/StarLuaRoot.cpp index c538df1..fc205c0 100644 --- a/source/game/scripting/StarLuaRoot.cpp +++ b/source/game/scripting/StarLuaRoot.cpp @@ -106,7 +106,7 @@ LuaContext LuaRoot::createContext(StringList const& scriptPaths) { } }); - newContext.set("loadstring", m_luaEngine->createFunction([newContext](String const& source, Maybe const& name, Maybe const& env) -> LuaFunction { + newContext.set("loadstring", m_luaEngine->createFunction([&newContext](String const& source, Maybe const& name, Maybe const& env) -> LuaFunction { String functionName = name ? strf("loadstring: {}", *name) : "loadstring"; return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr()); }));