From ac6508d46a0697d9135123f9235297334ed03173 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Wed, 18 Feb 2026 21:00:05 +0800 Subject: [PATCH 1/9] update submodule --- third_party/sdl | 2 +- third_party/sdl_image | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/sdl b/third_party/sdl index 5728f9d..2f4919c 160000 --- a/third_party/sdl +++ b/third_party/sdl @@ -1 +1 @@ -Subproject commit 5728f9d7033ffe472da4ddf368582ef8c209c487 +Subproject commit 2f4919c6ff7d5851b69e84d7e01128fe9ed32911 diff --git a/third_party/sdl_image b/third_party/sdl_image index 41229b1..737fc0f 160000 --- a/third_party/sdl_image +++ b/third_party/sdl_image @@ -1 +1 @@ -Subproject commit 41229b1e926383b19e9134afa45bf55583bf52bb +Subproject commit 737fc0ff9c2ec68ceca88d776f2853fda0c6b82d From e00e982405e4f54fbe77ea710b85540e52109455 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Thu, 19 Feb 2026 23:29:25 +0800 Subject: [PATCH 2/9] add type-cast error handling in funtion `ResourceLoader::load` --- src/core/event/dispatcher.hpp | 8 ++++++++ src/core/include/resource/resource_loader.hpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/core/event/dispatcher.hpp diff --git a/src/core/event/dispatcher.hpp b/src/core/event/dispatcher.hpp new file mode 100644 index 0000000..0a93612 --- /dev/null +++ b/src/core/event/dispatcher.hpp @@ -0,0 +1,8 @@ +#pragma once + +#include "utils/Singleton.hpp" +namespace gkit::event { + class Dispatcher : gkit::utils::Singleton { + + }; +} \ No newline at end of file diff --git a/src/core/include/resource/resource_loader.hpp b/src/core/include/resource/resource_loader.hpp index c3bfd60..bff57a7 100644 --- a/src/core/include/resource/resource_loader.hpp +++ b/src/core/include/resource/resource_loader.hpp @@ -18,7 +18,8 @@ namespace gkit::resource { auto load(std::filesystem::path path) -> std::optional> { auto cached_res = get_cache(path); if (cached_res.has_value()) { - return std::static_pointer_cast(cached_res); + auto target_res = std::dynamic_pointer_cast(cached_res); + return target_res == nullptr ? std::nullopt : target_res; } auto loaded_res = std::make_shared(T()); From ca553514fd10787dd887889f2314bc2066d49162 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Thu, 19 Feb 2026 23:38:36 +0800 Subject: [PATCH 3/9] simplify the code --- src/core/include/resource/resource_loader.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/include/resource/resource_loader.hpp b/src/core/include/resource/resource_loader.hpp index bff57a7..9bb5e22 100644 --- a/src/core/include/resource/resource_loader.hpp +++ b/src/core/include/resource/resource_loader.hpp @@ -33,9 +33,8 @@ namespace gkit::resource { } }; private: - std::shared_mutex cache_rw_mutex = std::shared_mutex(); - std::unordered_map> resource_cache - = std::unordered_map>(); + std::shared_mutex cache_rw_mutex {}; + std::unordered_map> resource_cache {}; auto push_to_cache(std::shared_ptr res) -> void; auto get_cache(std::filesystem::path path) -> std::optional>; From c63b82dd28fee006a260a1387b19e1d3763bb6f6 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Tue, 31 Mar 2026 16:16:47 +0800 Subject: [PATCH 4/9] Handle the confict from .gitmodules --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f9db581..34d156c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,8 +1,8 @@ [submodule "third_party/sdl"] path = third_party/sdl - url = https://github.com/libsdl-org/SDL.git + url = https://github.com/gkit-org/SDL.git branch = release-3.4.x [submodule "third_party/sdl_image"] path = third_party/sdl_image - url = https://github.com/libsdl-org/SDL_image.git + url = https://github.com/gkit-org/SDL_image.git branch = release-3.4.x From b89b8b6e644e3e5e667b34fa2cc142b007b97b3b Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Tue, 31 Mar 2026 16:32:23 +0800 Subject: [PATCH 5/9] Remove rust binding and update submodule --- binding/rust/Cargo.lock | 7 --- binding/rust/Cargo.toml | 12 ----- binding/rust/build.rs | 7 --- binding/rust/src/application/application.rs | 34 ------------ binding/rust/src/graphic/window.rs | 57 --------------------- binding/rust/src/lib.rs | 9 ---- test/rust_binding/Cargo.lock | 14 ----- test/rust_binding/Cargo.toml | 7 --- test/rust_binding/src/graphic/window.rs | 14 ----- test/rust_binding/src/main.rs | 7 --- third_party/sdl | 2 +- third_party/sdl_image | 2 +- 12 files changed, 2 insertions(+), 170 deletions(-) delete mode 100644 binding/rust/Cargo.lock delete mode 100644 binding/rust/Cargo.toml delete mode 100644 binding/rust/build.rs delete mode 100644 binding/rust/src/application/application.rs delete mode 100644 binding/rust/src/graphic/window.rs delete mode 100644 binding/rust/src/lib.rs delete mode 100644 test/rust_binding/Cargo.lock delete mode 100644 test/rust_binding/Cargo.toml delete mode 100644 test/rust_binding/src/graphic/window.rs delete mode 100644 test/rust_binding/src/main.rs diff --git a/binding/rust/Cargo.lock b/binding/rust/Cargo.lock deleted file mode 100644 index 39abfd1..0000000 --- a/binding/rust/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "gkit" -version = "0.1.0" diff --git a/binding/rust/Cargo.toml b/binding/rust/Cargo.toml deleted file mode 100644 index 03feccc..0000000 --- a/binding/rust/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "gkit" -version = "0.1.0" -edition = "2024" -build = "build.rs" - -[lib] -name = "gkit" -path = "src/lib.rs" -crate-type = ["rlib", "cdylib"] - -[dependencies] \ No newline at end of file diff --git a/binding/rust/build.rs b/binding/rust/build.rs deleted file mode 100644 index 389eb01..0000000 --- a/binding/rust/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - println!("cargo:rustc-link-search=native=/usr/lib"); - println!("cargo:rustc-link-search=native=../../bin"); - println!("cargo:rustc-link-lib=static=stdc++"); - println!("cargo:rustc-link-lib=SDL3"); - println!("cargo:rustc-link-lib=static=gkit_static"); -} \ No newline at end of file diff --git a/binding/rust/src/application/application.rs b/binding/rust/src/application/application.rs deleted file mode 100644 index 7660ebd..0000000 --- a/binding/rust/src/application/application.rs +++ /dev/null @@ -1,34 +0,0 @@ -pub struct Application{ - raw_ptr: *mut Gkit_Application -} - -impl Application { - #[allow(unused)] - pub fn new() -> Self { - return unsafe { - Self { - raw_ptr: gkit_application_new() - } - } - } -} - -impl Drop for Application { - fn drop(&mut self) { - unsafe { - gkit_application_delete(self.raw_ptr) - } - } -} - - -// ffi // -#[repr(C)] -struct Gkit_Application { - _data: () -} - -unsafe extern "C" { - fn gkit_application_new() -> *mut Gkit_Application; - fn gkit_application_delete(app_ptr: *mut Gkit_Application); -} diff --git a/binding/rust/src/graphic/window.rs b/binding/rust/src/graphic/window.rs deleted file mode 100644 index 6cc9493..0000000 --- a/binding/rust/src/graphic/window.rs +++ /dev/null @@ -1,57 +0,0 @@ -use std::ffi::CString; -use std::os::raw::{c_int, c_char}; - - -pub struct Window { - raw_ptr: *mut Gkit_Window -} - - -impl Window { - #[allow(unused)] - pub fn new(title: String, width: i32, height: i32) -> Self { - let title_cstr = CString::new(title).expect("filed to cast title to CString"); - return unsafe { - Self { - raw_ptr: gkit_window_new(title_cstr.as_ptr(), width, height) - } - }; - } - - #[allow(unused)] - pub fn show(&self) { - unsafe { - gkit_window_show(self.raw_ptr); - } - } - - #[allow(unused)] - pub fn hide(&self) { - unsafe { - gkit_window_hide(self.raw_ptr); - } - } -} - - -impl Drop for Window { - fn drop(&mut self) -> () { - unsafe { - gkit_window_delete(self.raw_ptr); - } - } -} - - -// ffi // -#[repr(C)] -struct Gkit_Window { - _data: () -} - -unsafe extern "C" { - fn gkit_window_new(title: *const c_char, width: c_int, height: c_int) -> *mut Gkit_Window; - fn gkit_window_delete(win_ptr: *mut Gkit_Window); - fn gkit_window_show(win_ptr: *mut Gkit_Window); - fn gkit_window_hide(win_ptr: *mut Gkit_Window); -} \ No newline at end of file diff --git a/binding/rust/src/lib.rs b/binding/rust/src/lib.rs deleted file mode 100644 index 35e914c..0000000 --- a/binding/rust/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub(crate) mod application { - pub mod application; -} -pub use application::application::Application; - -pub mod graphic { - pub(crate) mod window; - pub use window::Window; -} \ No newline at end of file diff --git a/test/rust_binding/Cargo.lock b/test/rust_binding/Cargo.lock deleted file mode 100644 index f2f40fa..0000000 --- a/test/rust_binding/Cargo.lock +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "gkit" -version = "0.1.0" - -[[package]] -name = "rust_binding" -version = "0.1.0" -dependencies = [ - "gkit", -] diff --git a/test/rust_binding/Cargo.toml b/test/rust_binding/Cargo.toml deleted file mode 100644 index 428c55c..0000000 --- a/test/rust_binding/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "rust_binding" -version = "0.1.0" -edition = "2024" - -[dependencies] -gkit = { version = "0.1.0", path = "../../binding/rust" } diff --git a/test/rust_binding/src/graphic/window.rs b/test/rust_binding/src/graphic/window.rs deleted file mode 100644 index cdcb865..0000000 --- a/test/rust_binding/src/graphic/window.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[test] -fn test_graphic_window() { - use std::time::Duration; - - use gkit::Application; - use gkit::graphic::Window; - - #[allow(unused)] - let app = Application::new(); - let win_title = "Hello, World!".to_string(); - let win = Window::new(win_title, 640, 480); - win.show(); - std::thread::sleep(Duration::from_millis(500)); -} \ No newline at end of file diff --git a/test/rust_binding/src/main.rs b/test/rust_binding/src/main.rs deleted file mode 100644 index 35652b3..0000000 --- a/test/rust_binding/src/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod graphic { - mod window; -} - -fn main() { - println!("test with command: cargo test ") -} \ No newline at end of file diff --git a/third_party/sdl b/third_party/sdl index 2f4919c..c546c5d 160000 --- a/third_party/sdl +++ b/third_party/sdl @@ -1 +1 @@ -Subproject commit 2f4919c6ff7d5851b69e84d7e01128fe9ed32911 +Subproject commit c546c5d335455476fae9ae4a7b14b1defcf1dde5 diff --git a/third_party/sdl_image b/third_party/sdl_image index 737fc0f..074262a 160000 --- a/third_party/sdl_image +++ b/third_party/sdl_image @@ -1 +1 @@ -Subproject commit 737fc0ff9c2ec68ceca88d776f2853fda0c6b82d +Subproject commit 074262a89c6a58f374d16db5738dcc279bc896f1 From ce419057f8e07480ad8d636fc5ca6d58d5ba41b0 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Tue, 31 Mar 2026 16:43:34 +0800 Subject: [PATCH 6/9] Remove graphic code --- src/core/CMakeLists.txt | 2 -- src/core/application.cpp | 2 +- src/core/graphic/window.cpp | 33 ----------------------------- src/core/include/application.hpp | 7 ++---- src/core/include/gkit.hpp | 3 --- src/core/include/graphic/window.hpp | 28 ------------------------ test/core/graphic/window_test.cpp | 15 ------------- 7 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 src/core/graphic/window.cpp delete mode 100644 src/core/include/graphic/window.hpp delete mode 100644 test/core/graphic/window_test.cpp diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c481f6b..ec55f5c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -3,8 +3,6 @@ set (CORE "gkit_core") ## Core Sources file ## file(GLOB_RECURSE CORE_SRC "./application/*.cpp" - "./graphic/*.cpp" - # "./input/*.cpp" "./scene/*.cpp" "./resource/*cpp" "./utils/*.cpp" diff --git a/src/core/application.cpp b/src/core/application.cpp index 1f64b0b..88f6d19 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -3,7 +3,7 @@ #include #include -gkit::Application::Application() noexcept : root(), windows() { +gkit::Application::Application() noexcept : root() { SDL_InitFlags flags = SDL_INIT_AUDIO | SDL_INIT_EVENTS | SDL_INIT_GAMEPAD | diff --git a/src/core/graphic/window.cpp b/src/core/graphic/window.cpp deleted file mode 100644 index 0f63a1b..0000000 --- a/src/core/graphic/window.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "graphic/window.hpp" -#include -#include -#include -#include - -gkit::graphic::Window::Window(std::string title, int width, int height) noexcept - : gkit::scene::Unit() - , window_ptr(SDL_CreateWindow(title.c_str(), width, height, SDL_WINDOW_RESIZABLE), SDL_DestroyWindow) - , renderer_ptr(SDL_CreateRenderer(this->window_ptr.get(), nullptr), SDL_DestroyRenderer) { - - if (!SDL_InitSubSystem(SDL_INIT_VIDEO)) { - SDL_Log("SDL_INIT_VIDEO initialize failed, error: %s", SDL_GetError()); - } -} - -gkit::graphic::Window::Window(std::string title, int width, int height, std::vector flags) noexcept - : gkit::graphic::Window::Window(title, width, height) { - SDL_WindowFlags win_flags = 0x00ul; - for (auto flag : flags) { - win_flags |= flag; - } - - this->window_ptr.reset(SDL_CreateWindow(title.c_str(), width, height, win_flags)); -} - -void gkit::graphic::Window::hide() noexcept { - SDL_HideWindow(this->window_ptr.get()); -} - -void gkit::graphic::Window::show() noexcept { - SDL_ShowWindow(this->window_ptr.get()); -} \ No newline at end of file diff --git a/src/core/include/application.hpp b/src/core/include/application.hpp index 0db1680..264ea1e 100644 --- a/src/core/include/application.hpp +++ b/src/core/include/application.hpp @@ -1,14 +1,13 @@ #pragma once -#include "graphic/window.hpp" #include "scene/unit.hpp" +#include "utils/Singleton.hpp" #include #include -#include namespace gkit { - class Application { + class Application : utils::Singleton { public: explicit Application() noexcept; virtual ~Application() noexcept; @@ -21,8 +20,6 @@ namespace gkit { private: std::unique_ptr root; - std::vector> windows; - std::atomic running = false; }; // class Application diff --git a/src/core/include/gkit.hpp b/src/core/include/gkit.hpp index 78e3075..8871076 100644 --- a/src/core/include/gkit.hpp +++ b/src/core/include/gkit.hpp @@ -3,9 +3,6 @@ // Basic #include -// Graphic -#include - // Scene #include #include diff --git a/src/core/include/graphic/window.hpp b/src/core/include/graphic/window.hpp deleted file mode 100644 index 9c2d5bb..0000000 --- a/src/core/include/graphic/window.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include "scene/unit.hpp" -#include -#include -#include -#include -#include -#include - -namespace gkit::graphic { - - class Window : gkit::scene::Unit{ - public: - Window(std::string title, int width, int height) noexcept; - Window(std::string title, int width, int height, std::vector flags) noexcept; - virtual ~Window() = default; - - public: - void show() noexcept; - void hide() noexcept; - - private: - std::unique_ptr window_ptr; - std::unique_ptr renderer_ptr; - }; // class Window - -} // namespace gkit \ No newline at end of file diff --git a/test/core/graphic/window_test.cpp b/test/core/graphic/window_test.cpp deleted file mode 100644 index 294dd21..0000000 --- a/test/core/graphic/window_test.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "gkit.hpp" -#include -#include -#include - -#include - -int main() { - gkit::Application app; - - gkit::graphic::Window win("Hello World", 640, 480); - std::this_thread::sleep_for(std::chrono::seconds(3)); - - return 0; -} \ No newline at end of file From 9178612bac9d560222a1d187392c37d3d6d66ac7 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Tue, 31 Mar 2026 16:47:32 +0800 Subject: [PATCH 7/9] Make class application singleton --- src/core/include/application.hpp | 2 +- test/core/scene/test_unit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/application.hpp b/src/core/include/application.hpp index 264ea1e..8c54ea5 100644 --- a/src/core/include/application.hpp +++ b/src/core/include/application.hpp @@ -7,7 +7,7 @@ namespace gkit { - class Application : utils::Singleton { + class Application : public utils::Singleton { public: explicit Application() noexcept; virtual ~Application() noexcept; diff --git a/test/core/scene/test_unit.cpp b/test/core/scene/test_unit.cpp index 911766f..3a0b2ce 100644 --- a/test/core/scene/test_unit.cpp +++ b/test/core/scene/test_unit.cpp @@ -67,7 +67,7 @@ class RootUnit : public Unit { int main() { - gkit::Application app; + auto& app = gkit::Application::instance(); auto root = Unit::create("root"); app.set_root(std::move(root)); app.run(); From 905421fab38baa206d1f852a65a779f849009950 Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Tue, 31 Mar 2026 16:53:53 +0800 Subject: [PATCH 8/9] add singleton_units properties for class Application --- src/core/application.cpp | 3 ++- src/core/include/application.hpp | 2 ++ src/core/scene/unit.cpp | 18 ++---------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index 88f6d19..5edbfd4 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -1,9 +1,10 @@ #include "../include/application.hpp" +#include "scene/unit.hpp" #include #include #include -gkit::Application::Application() noexcept : root() { +gkit::Application::Application() noexcept : root(), singleton_units(gkit::scene::Unit::create()) { SDL_InitFlags flags = SDL_INIT_AUDIO | SDL_INIT_EVENTS | SDL_INIT_GAMEPAD | diff --git a/src/core/include/application.hpp b/src/core/include/application.hpp index 8c54ea5..07e52c4 100644 --- a/src/core/include/application.hpp +++ b/src/core/include/application.hpp @@ -4,6 +4,7 @@ #include "utils/Singleton.hpp" #include #include +#include namespace gkit { @@ -20,6 +21,7 @@ namespace gkit { private: std::unique_ptr root; + std::unique_ptr singleton_units; std::atomic running = false; }; // class Application diff --git a/src/core/scene/unit.cpp b/src/core/scene/unit.cpp index 539403f..c7b98b7 100644 --- a/src/core/scene/unit.cpp +++ b/src/core/scene/unit.cpp @@ -13,22 +13,8 @@ gkit::scene::Unit::Unit() noexcept : children(std::vector>()), active_index_cache(), children_rw_mutex() { } -// gkit::scene::Unit::Unit(const Unit&) noexcept {} -// gkit::scene::Unit::Unit(Unit&& other) noexcept : -// name(other.name), -// parent(nullptr), -// modified(true), -// active_index_cache(), -// process_enabled(other.process_enabled.load()), -// ready_to_drop(other.ready_to_drop.load()) -// { -// for (auto&& child_ptr : other.children) { -// if (child_ptr == nullptr) continue; -// this->children.push_back(std::move(child_ptr)); -// } -// this->update_index_cache(); -// } -// gkit::scene::Unit::Unit(std::string&& name) noexcept : gkit::scene::Unit(name) { } + + gkit::scene::Unit::Unit(std::string name) noexcept : gkit::scene::Unit() { this->name = name; } From 0ca12e57bdd05c4ec2d5d65a4ce8caf63cac853b Mon Sep 17 00:00:00 2001 From: Cora <17833654450@163.com> Date: Thu, 2 Apr 2026 13:49:45 +0800 Subject: [PATCH 9/9] update submodule and link to gkit fork repo --- src/core/event/dispatcher.hpp | 8 -------- src/core/include/scene/unit.hpp | 10 ++++++++-- src/core/scene/unit.cpp | 10 ++++------ 3 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 src/core/event/dispatcher.hpp diff --git a/src/core/event/dispatcher.hpp b/src/core/event/dispatcher.hpp deleted file mode 100644 index 0a93612..0000000 --- a/src/core/event/dispatcher.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "utils/Singleton.hpp" -namespace gkit::event { - class Dispatcher : gkit::utils::Singleton { - - }; -} \ No newline at end of file diff --git a/src/core/include/scene/unit.hpp b/src/core/include/scene/unit.hpp index 8572961..4db83fa 100644 --- a/src/core/include/scene/unit.hpp +++ b/src/core/include/scene/unit.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -170,10 +171,15 @@ namespace gkit::scene { private: // children management std::atomic modified = false; - mutable std::shared_mutex index_cache_rw_mutex; + + std::unordered_map name_map_cache; + mutable std::shared_mutex name_map_cache_rw_mutex; + std::vector active_index_cache; - mutable std::shared_mutex children_rw_mutex; + mutable std::shared_mutex index_cache_rw_mutex; + std::vector> children; + mutable std::shared_mutex children_rw_mutex; // when (active_index_cache.size() / children.size() <= overload_factor) // children vector will realloc(call method @ref remap_children_and_cache()) diff --git a/src/core/scene/unit.cpp b/src/core/scene/unit.cpp index c7b98b7..e32ab68 100644 --- a/src/core/scene/unit.cpp +++ b/src/core/scene/unit.cpp @@ -203,11 +203,11 @@ auto gkit::scene::Unit::iterator::operator--(int) -> iterator { auto gkit::scene::Unit::iterator::operator==(const iterator& other) const -> bool { return m_owner == other.m_owner && m_pos == other.m_pos; } auto gkit::scene::Unit::iterator::operator!=(const iterator& other) const -> bool { return !(*this == other); } -auto gkit::scene::Unit::begin() -> iterator{ +auto gkit::scene::Unit::begin() -> iterator { return iterator(this, 0); } -auto gkit::scene::Unit::end() -> iterator{ +auto gkit::scene::Unit::end() -> iterator { return iterator(this, active_index_cache.size()); } @@ -247,13 +247,11 @@ auto gkit::scene::Unit::const_iterator::operator==(const const_iterator& other) auto gkit::scene::Unit::const_iterator::operator!=(const const_iterator& other) const -> bool { return !(*this == other); } auto gkit::scene::Unit::begin() const -> const_iterator { - const_cast(this); - return const_iterator(this, 0); + return const_iterator(const_cast(this), 0); } auto gkit::scene::Unit::end() const -> const_iterator { - const_cast(this); - return const_iterator(this, active_index_cache.size()); + return const_iterator(const_cast(this), active_index_cache.size()); } auto gkit::scene::Unit::cbegin() const -> const_iterator { return begin(); }