From ceb80c601cc74bfedad90554580c1e41b8166d2f Mon Sep 17 00:00:00 2001 From: David Avedissian Date: Fri, 31 May 2019 21:48:20 +0100 Subject: [PATCH] Formatting. --- src/dawn/resource/ResourceCache.cpp | 3 +-- src/dawn/script/LuaVM.cpp | 11 ++++++----- src/lua_shooter/Main.cpp | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/dawn/resource/ResourceCache.cpp b/src/dawn/resource/ResourceCache.cpp index 4760ab06..18a0e147 100644 --- a/src/dawn/resource/ResourceCache.cpp +++ b/src/dawn/resource/ResourceCache.cpp @@ -59,8 +59,7 @@ void ResourceCache::addPackage(const String& package, UniquePtr resource_packages_.emplace(makePair(package, std::move(file))); } -Result> ResourceCache::loadRaw( - const ResourcePath &resource_path) { +Result> ResourceCache::loadRaw(const ResourcePath& resource_path) { // Parse resource path. auto path = parseResourcePath(resource_path); String package = path.first; diff --git a/src/dawn/script/LuaVM.cpp b/src/dawn/script/LuaVM.cpp index c26cac39..c724edc6 100644 --- a/src/dawn/script/LuaVM.cpp +++ b/src/dawn/script/LuaVM.cpp @@ -27,11 +27,12 @@ void registerWorldLib(sol::state& state) { } // namespace LuaVM::LuaVM(Context* context) : Object(context) { - state_.open_libraries(sol::lib::base, sol::lib::package, sol::lib::coroutine, sol::lib::string, sol::lib::os, sol::lib::math, sol::lib::table, sol::lib::debug, sol::lib::bit32); - state_.set_function("__dw_write_log", - [this](const char* caller, const char* str) { - log().info("%s: %s", caller, str); - }); + state_.open_libraries(sol::lib::base, sol::lib::package, sol::lib::coroutine, sol::lib::string, + sol::lib::os, sol::lib::math, sol::lib::table, sol::lib::debug, + sol::lib::bit32); + state_.set_function("__dw_write_log", [this](const char* caller, const char* str) { + log().info("%s: %s", caller, str); + }); redirectLuaPrintToLogger(*context, state_); registerWorldLib(state_); } diff --git a/src/lua_shooter/Main.cpp b/src/lua_shooter/Main.cpp index 9a983145..b691a3f7 100644 --- a/src/lua_shooter/Main.cpp +++ b/src/lua_shooter/Main.cpp @@ -24,11 +24,11 @@ class LuaGameSession : public GameSession { } // Create Lua VM and execute script. - auto script_result = rc->loadRaw(lua_script_file); - auto execute_result = lua_state_.execute(**script_result); - if (!execute_result) { - log().error("Failed to execute %s: %s", lua_script_file, execute_result.error()); - } + auto script_result = rc->loadRaw(lua_script_file); + auto execute_result = lua_state_.execute(**script_result); + if (!execute_result) { + log().error("Failed to execute %s: %s", lua_script_file, execute_result.error()); + } } ~LuaGameSession() override { @@ -70,7 +70,8 @@ class LuaShooter : public App { void init(const CommandLine&) override { module()->addPath("shooter", "../src/lua_shooter/data"); - engine_->addSession(makeUnique(context_, "shooter:script_idea.lua", GameSessionInfo{})); + engine_->addSession( + makeUnique(context_, "shooter:script_idea.lua", GameSessionInfo{})); } void shutdown() override {