From 7b1ef25f37d7e3bda4b70984d1b4dcad93672fcf Mon Sep 17 00:00:00 2001 From: zvon Date: Sat, 7 Aug 2021 12:13:03 +0200 Subject: [PATCH] SDLPP: slight code cleanup --- sdlpp/sdlpp_scene.cpp | 2 +- sdlpp/sdlpp_scene.hpp | 2 +- sdlpp/sdlpp_visitor.hpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdlpp/sdlpp_scene.cpp b/sdlpp/sdlpp_scene.cpp index 9c4edfc..96d97a4 100644 --- a/sdlpp/sdlpp_scene.cpp +++ b/sdlpp/sdlpp_scene.cpp @@ -32,7 +32,7 @@ void Scene::addObject( const std::shared_ptr< RenderObject > &obj ) { rightmost_obj = obj; } } -void Scene::setZIndex( const std::shared_ptr< RenderObject > &obj, int index ) { +void Scene::setZIndex( const std::shared_ptr< RenderObject > &obj, uint64_t index ) { std::lock_guard< std::mutex > guard( render_mutex ); int original_index = 0; for ( long unsigned int i = 0; i < render_objects.size(); i++ ) { diff --git a/sdlpp/sdlpp_scene.hpp b/sdlpp/sdlpp_scene.hpp index 096e482..7161351 100644 --- a/sdlpp/sdlpp_scene.hpp +++ b/sdlpp/sdlpp_scene.hpp @@ -16,7 +16,7 @@ class SDLPPSCOPE Scene { public: Scene( std::shared_ptr< Renderer > &r ); void addObject( const std::shared_ptr< RenderObject > &obj ); - void setZIndex( const std::shared_ptr< RenderObject > &obj, int index ); + void setZIndex( const std::shared_ptr< RenderObject > &obj, uint64_t index ); void moveDownZ( const std::shared_ptr< RenderObject > &obj ); void moveUpZ( const std::shared_ptr< RenderObject > &obj ); void moveZ( const std::shared_ptr< RenderObject > &obj, int addition ); diff --git a/sdlpp/sdlpp_visitor.hpp b/sdlpp/sdlpp_visitor.hpp index 2cc1147..499b9ea 100644 --- a/sdlpp/sdlpp_visitor.hpp +++ b/sdlpp/sdlpp_visitor.hpp @@ -9,12 +9,12 @@ class SDLPPSCOPE RenderObject; class SDLPPSCOPE Visitor { public: - Visitor() {} + Visitor() = default; virtual void visit( const RenderObject &obj ) = 0; virtual void setFromId( uint64_t id ) = 0; - virtual uint64_t getFromId() = 0; + virtual uint64_t getFromId() const = 0; virtual void setVisitorType( uint64_t type ) = 0; - virtual uint64_t getVisitorType() = 0; + virtual uint64_t getVisitorType() const = 0; }; } // namespace SDLPP