This repository has been archived by the owner on Sep 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from Milerius/dev
add animation system
- Loading branch information
Showing
21 changed files
with
481 additions
and
68 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Created by roman Sztergbaum on 05/08/2018. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include <shiva/reflection/reflection.hpp> | ||
|
||
namespace shiva::ecs | ||
{ | ||
struct animation | ||
{ | ||
template <typename Animation> | ||
animation(Animation ptr) noexcept : animation_(ptr) | ||
{ | ||
} | ||
|
||
reflect_class(animation) | ||
|
||
static constexpr auto reflected_functions() noexcept | ||
{ | ||
return meta::makeMap(); | ||
} | ||
|
||
static constexpr auto reflected_members() noexcept | ||
{ | ||
return meta::makeMap(); | ||
} | ||
|
||
std::shared_ptr<void> animation_{nullptr}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// Created by roman Sztergbaum on 05/08/2018. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <array> | ||
#if defined(fmt) | ||
#undef fmt | ||
#include <sol/state.hpp> | ||
#else | ||
#include <sol/state.hpp> | ||
#endif | ||
#include <shiva/spdlog/spdlog.hpp> | ||
|
||
namespace shiva::lua | ||
{ | ||
template <typename T> | ||
void register_type(sol::state& state, shiva::logging::logger logger) noexcept | ||
{ | ||
const auto table = std::tuple_cat( | ||
std::make_tuple(T::class_name()), | ||
T::reflected_functions(), | ||
T::reflected_members()); | ||
|
||
try { | ||
std::apply( | ||
[&state](auto &&...params) { | ||
state.new_usertype<T>(std::forward<decltype(params)>(params)...); | ||
}, table); | ||
} | ||
catch (const std::exception &error) { | ||
logger->error("error: {}", error.what()); | ||
return; | ||
} | ||
|
||
logger->info("successfully registering type: {}", T::class_name()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(MODULE_PATH | ||
${CMAKE_CURRENT_SOURCE_DIR}/shiva/sfml/animation) | ||
|
||
|
||
set(MODULE_PUBLIC_SOURCES | ||
"${MODULE_PATH}/system-sfml-animation.cpp" | ||
) | ||
|
||
set(MODULE_PUBLIC_HEADERS | ||
"${MODULE_PATH}/system-sfml-animation.hpp" | ||
) | ||
|
||
set(MODULE_PRIVATE_HEADERS | ||
"") | ||
|
||
set(MODULE_SOURCES | ||
${MODULE_PUBLIC_SOURCES} | ||
${MODULE_PUBLIC_HEADERS} | ||
${MODULE_PRIVATE_HEADERS}) |
Oops, something went wrong.