From 940dec638646dea00baa9939c6a4250b2cc22382 Mon Sep 17 00:00:00 2001 From: Death Killer <884052+deathkiller@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:26:32 +0100 Subject: [PATCH] Fixed build --- .github/workflows/linux_cc.yml | 8 +- .../Multiplayer/RemotePlayerOnServer.cpp | 2 +- .../Actors/Multiplayer/RemotePlayerOnServer.h | 2 +- Sources/Jazz2/Events/EventMap.cpp | 2 +- Sources/Jazz2/Events/EventMap.h | 2 +- Sources/Jazz2/UI/Menu/AboutSection.cpp | 2 +- Sources/Jazz2/UI/Menu/AboutSection.h | 2 +- Sources/Jazz2/UI/Menu/BeginSection.cpp | 2 +- Sources/Jazz2/UI/Menu/BeginSection.h | 2 +- .../UI/Menu/CreateServerOptionsSection.cpp | 2 +- .../UI/Menu/CreateServerOptionsSection.h | 2 +- .../UI/Menu/CustomLevelSelectSection.cpp | 2 +- .../Jazz2/UI/Menu/CustomLevelSelectSection.h | 2 +- .../Jazz2/UI/Menu/EpisodeSelectSection.cpp | 6 +- Sources/Jazz2/UI/Menu/EpisodeSelectSection.h | 4 +- Sources/Jazz2/UI/Menu/HighscoresSection.cpp | 4 +- Sources/Jazz2/UI/Menu/HighscoresSection.h | 4 +- Sources/Jazz2/UI/Menu/ImportSection.cpp | 2 +- Sources/Jazz2/UI/Menu/ImportSection.h | 2 +- .../Jazz2/UI/Menu/InputDiagnosticsSection.cpp | 2 +- .../Jazz2/UI/Menu/InputDiagnosticsSection.h | 2 +- Sources/Jazz2/UI/Menu/LoadingSection.cpp | 2 +- Sources/Jazz2/UI/Menu/LoadingSection.h | 2 +- Sources/Jazz2/UI/Menu/MenuSection.h | 2 +- Sources/Jazz2/UI/Menu/PauseSection.cpp | 2 +- Sources/Jazz2/UI/Menu/PauseSection.h | 2 +- Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp | 2 +- Sources/Jazz2/UI/Menu/RefreshCacheSection.h | 2 +- .../Jazz2/UI/Menu/RemapControlsSection.cpp | 2 +- Sources/Jazz2/UI/Menu/RemapControlsSection.h | 2 +- Sources/Jazz2/UI/Menu/ScrollableMenuSection.h | 8 +- Sources/Jazz2/UI/Menu/ServerSelectSection.cpp | 2 +- Sources/Jazz2/UI/Menu/ServerSelectSection.h | 2 +- .../Jazz2/UI/Menu/SimpleMessageSection.cpp | 2 +- Sources/Jazz2/UI/Menu/SimpleMessageSection.h | 2 +- .../Jazz2/UI/Menu/SoundsOptionsSection.cpp | 2 +- Sources/Jazz2/UI/Menu/SoundsOptionsSection.h | 2 +- .../Jazz2/UI/Menu/StartGameOptionsSection.cpp | 2 +- .../Jazz2/UI/Menu/StartGameOptionsSection.h | 2 +- .../UI/Menu/TouchControlsOptionsSection.cpp | 2 +- .../UI/Menu/TouchControlsOptionsSection.h | 2 +- Sources/Jazz2/WeaponType.h | 5 +- Sources/Shared/Base/Move.h | 5 +- Sources/Shared/Base/TypeInfo.h | 99 +++++++++++-------- Sources/Shared/Containers/SmallVector.h | 18 ++-- Sources/nCine/Graphics/ParticleSystem.cpp | 2 +- Sources/nCine/Graphics/ParticleSystem.h | 2 +- Sources/nCine/Graphics/SceneNode.cpp | 2 +- Sources/nCine/Graphics/SceneNode.h | 18 ++-- Sources/nCine/Graphics/Sprite.cpp | 4 +- Sources/nCine/Graphics/Sprite.h | 4 +- 51 files changed, 140 insertions(+), 123 deletions(-) diff --git a/.github/workflows/linux_cc.yml b/.github/workflows/linux_cc.yml index b7bc48ff..91b3980a 100644 --- a/.github/workflows/linux_cc.yml +++ b/.github/workflows/linux_cc.yml @@ -39,10 +39,10 @@ jobs: with: fetch-depth: 0 - - name: 'Configure Cross-Compile Support (ARM64)' - uses: cyberjunk/gha-ubuntu-cross@v4 - with: - arch: arm64 + #- name: 'Configure Cross-Compile Support (ARM64)' + # uses: cyberjunk/gha-ubuntu-cross@v4 + # with: + # arch: arm64 - name: 'Create Build Environment' run: | diff --git a/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.cpp b/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.cpp index 9d2cdb2f..653651ef 100644 --- a/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.cpp +++ b/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.cpp @@ -89,7 +89,7 @@ namespace Jazz2::Actors::Multiplayer return success; } - void RemotePlayerOnServer::SyncWithServer(Vector2f pos, const Vector2f& speed, bool isVisible, bool isFacingLeft, bool isActivelyPushing) + void RemotePlayerOnServer::SyncWithServer(Vector2f pos, Vector2f speed, bool isVisible, bool isFacingLeft, bool isActivelyPushing) { if (_health <= 0) { // Don't sync dead players to avoid cheating diff --git a/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.h b/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.h index ebb5579a..9ef94840 100644 --- a/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.h +++ b/Sources/Jazz2/Actors/Multiplayer/RemotePlayerOnServer.h @@ -17,7 +17,7 @@ namespace Jazz2::Actors::Multiplayer bool OnHandleCollision(std::shared_ptr other) override; bool OnLevelChanging(Actors::ActorBase* initiator, ExitType exitType) override; - void SyncWithServer(Vector2f pos, const Vector2f& speed, bool isVisible, bool isFacingLeft, bool isActivelyPushing); + void SyncWithServer(Vector2f pos, Vector2f speed, bool isVisible, bool isFacingLeft, bool isActivelyPushing); protected: struct StateFrame { diff --git a/Sources/Jazz2/Events/EventMap.cpp b/Sources/Jazz2/Events/EventMap.cpp index bd4bb413..978abfa1 100644 --- a/Sources/Jazz2/Events/EventMap.cpp +++ b/Sources/Jazz2/Events/EventMap.cpp @@ -8,7 +8,7 @@ namespace Jazz2::Events { - EventMap::EventMap(const Vector2i& layoutSize) + EventMap::EventMap(Vector2i layoutSize) : _levelHandler(nullptr), _layoutSize(layoutSize), _pitType(PitType::FallForever) { } diff --git a/Sources/Jazz2/Events/EventMap.h b/Sources/Jazz2/Events/EventMap.h index 2b103c08..2b19e23d 100644 --- a/Sources/Jazz2/Events/EventMap.h +++ b/Sources/Jazz2/Events/EventMap.h @@ -32,7 +32,7 @@ namespace Jazz2::Events bool IsEventActive; }; - EventMap(const Vector2i& layoutSize); + EventMap(Vector2i layoutSize); void SetLevelHandler(ILevelHandler* levelHandler); /** @brief Returns size of event map in tiles */ diff --git a/Sources/Jazz2/UI/Menu/AboutSection.cpp b/Sources/Jazz2/UI/Menu/AboutSection.cpp index 39c9c22d..56b19303 100644 --- a/Sources/Jazz2/UI/Menu/AboutSection.cpp +++ b/Sources/Jazz2/UI/Menu/AboutSection.cpp @@ -287,7 +287,7 @@ namespace Jazz2::UI::Menu } } - void AboutSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void AboutSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { switch (event.type) { case TouchEventType::Down: { diff --git a/Sources/Jazz2/UI/Menu/AboutSection.h b/Sources/Jazz2/UI/Menu/AboutSection.h index 0886e7b8..b88c8095 100644 --- a/Sources/Jazz2/UI/Menu/AboutSection.h +++ b/Sources/Jazz2/UI/Menu/AboutSection.h @@ -15,7 +15,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawClipped(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: static constexpr std::int32_t TopLine = 2; diff --git a/Sources/Jazz2/UI/Menu/BeginSection.cpp b/Sources/Jazz2/UI/Menu/BeginSection.cpp index 2885c1c6..ea78e60d 100644 --- a/Sources/Jazz2/UI/Menu/BeginSection.cpp +++ b/Sources/Jazz2/UI/Menu/BeginSection.cpp @@ -306,7 +306,7 @@ namespace Jazz2::UI::Menu } } - void BeginSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void BeginSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/BeginSection.h b/Sources/Jazz2/UI/Menu/BeginSection.h index d95ee9a4..93349dfd 100644 --- a/Sources/Jazz2/UI/Menu/BeginSection.h +++ b/Sources/Jazz2/UI/Menu/BeginSection.h @@ -13,7 +13,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawOverlay(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class Item { diff --git a/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.cpp b/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.cpp index c87a5118..03586fa8 100644 --- a/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.cpp +++ b/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.cpp @@ -255,7 +255,7 @@ namespace Jazz2::UI::Menu } } - void CreateServerOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void CreateServerOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (!_shouldStart && event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.h b/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.h index d185847b..bcc60efd 100644 --- a/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.h +++ b/Sources/Jazz2/UI/Menu/CreateServerOptionsSection.h @@ -16,7 +16,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawOverlay(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; void SetGameMode(Multiplayer::MultiplayerGameMode value); diff --git a/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.cpp b/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.cpp index 689e8473..3af6977f 100644 --- a/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.cpp +++ b/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.cpp @@ -206,7 +206,7 @@ namespace Jazz2::UI::Menu } } - void CustomLevelSelectSection::OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) + void CustomLevelSelectSection::OnTouchEvent(const TouchEvent& event, Vector2i viewSize) { switch (event.type) { case TouchEventType::Down: { diff --git a/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.h b/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.h index 6144cba4..b115c64d 100644 --- a/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.h +++ b/Sources/Jazz2/UI/Menu/CustomLevelSelectSection.h @@ -20,7 +20,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawClipped(Canvas* canvas) override; - void OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const TouchEvent& event, Vector2i viewSize) override; private: struct ItemData { diff --git a/Sources/Jazz2/UI/Menu/EpisodeSelectSection.cpp b/Sources/Jazz2/UI/Menu/EpisodeSelectSection.cpp index c132f29a..695ecc76 100644 --- a/Sources/Jazz2/UI/Menu/EpisodeSelectSection.cpp +++ b/Sources/Jazz2/UI/Menu/EpisodeSelectSection.cpp @@ -334,7 +334,7 @@ namespace Jazz2::UI::Menu } } - void EpisodeSelectSection::OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) + void EpisodeSelectSection::OnTouchEvent(const TouchEvent& event, Vector2i viewSize) { if (_shouldStart) { return; @@ -343,9 +343,9 @@ namespace Jazz2::UI::Menu ScrollableMenuSection::OnTouchEvent(event, viewSize); } - void EpisodeSelectSection::OnTouchUp(int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) + void EpisodeSelectSection::OnTouchUp(int32_t newIndex, Vector2i viewSize, Vector2i touchPos) { - int32_t halfW = viewSize.X / 2; + std::int32_t halfW = viewSize.X / 2; if (std::abs(touchPos.X - halfW) < 150) { if (_selectedIndex == newIndex) { bool onExpand = (_touchLast.X > halfW + 100.0f && (_items[newIndex].Item.Flags & EpisodeDataFlags::CanContinue) == EpisodeDataFlags::CanContinue); diff --git a/Sources/Jazz2/UI/Menu/EpisodeSelectSection.h b/Sources/Jazz2/UI/Menu/EpisodeSelectSection.h index 9480d973..d4932c76 100644 --- a/Sources/Jazz2/UI/Menu/EpisodeSelectSection.h +++ b/Sources/Jazz2/UI/Menu/EpisodeSelectSection.h @@ -30,7 +30,7 @@ namespace Jazz2::UI::Menu void OnDraw(Canvas* canvas) override; void OnDrawClipped(Canvas* canvas) override; void OnDrawOverlay(Canvas* canvas) override; - void OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const TouchEvent& event, Vector2i viewSize) override; private: float _expandedAnimation; @@ -41,7 +41,7 @@ namespace Jazz2::UI::Menu bool _expanded; bool _shouldStart; - void OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) override; + void OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) override; void OnExecuteSelected() override; void OnDrawEmptyText(Canvas* canvas, std::int32_t& charOffset) override; void OnDrawItem(Canvas* canvas, ListViewItem& item, std::int32_t& charOffset, bool isSelected) override; diff --git a/Sources/Jazz2/UI/Menu/HighscoresSection.cpp b/Sources/Jazz2/UI/Menu/HighscoresSection.cpp index 43caeb93..51d70988 100644 --- a/Sources/Jazz2/UI/Menu/HighscoresSection.cpp +++ b/Sources/Jazz2/UI/Menu/HighscoresSection.cpp @@ -373,7 +373,7 @@ namespace Jazz2::UI::Menu } } - void HighscoresSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void HighscoresSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); @@ -420,7 +420,7 @@ namespace Jazz2::UI::Menu ScrollableMenuSection::OnTouchEvent(event, viewSize); } - void HighscoresSection::OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) + void HighscoresSection::OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) { if (!_waitForInput) { ScrollableMenuSection::OnTouchUp(newIndex, viewSize, touchPos); diff --git a/Sources/Jazz2/UI/Menu/HighscoresSection.h b/Sources/Jazz2/UI/Menu/HighscoresSection.h index f44514e8..cb85c6dc 100644 --- a/Sources/Jazz2/UI/Menu/HighscoresSection.h +++ b/Sources/Jazz2/UI/Menu/HighscoresSection.h @@ -70,8 +70,8 @@ namespace Jazz2::UI::Menu void OnLayoutItem(Canvas* canvas, ListViewItem& item) override; void OnDrawItem(Canvas* canvas, ListViewItem& item, std::int32_t& charOffset, bool isSelected) override; void OnHandleInput() override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; - void OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; + void OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) override; void OnExecuteSelected() override; void OnBackPressed() override; diff --git a/Sources/Jazz2/UI/Menu/ImportSection.cpp b/Sources/Jazz2/UI/Menu/ImportSection.cpp index 06032531..f352bf52 100644 --- a/Sources/Jazz2/UI/Menu/ImportSection.cpp +++ b/Sources/Jazz2/UI/Menu/ImportSection.cpp @@ -94,7 +94,7 @@ namespace Jazz2::UI::Menu } } - void ImportSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void ImportSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/ImportSection.h b/Sources/Jazz2/UI/Menu/ImportSection.h index 544653f8..fda33d52 100644 --- a/Sources/Jazz2/UI/Menu/ImportSection.h +++ b/Sources/Jazz2/UI/Menu/ImportSection.h @@ -21,7 +21,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class State { diff --git a/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.cpp b/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.cpp index aa12d7db..498f504a 100644 --- a/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.cpp +++ b/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.cpp @@ -266,7 +266,7 @@ namespace Jazz2::UI::Menu } } - void InputDiagnosticsSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void InputDiagnosticsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.h b/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.h index 4da9f87e..0af1781c 100644 --- a/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.h +++ b/Sources/Jazz2/UI/Menu/InputDiagnosticsSection.h @@ -14,7 +14,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; NavigationFlags GetNavigationFlags() const override { return NavigationFlags::AllowKeyboard; diff --git a/Sources/Jazz2/UI/Menu/LoadingSection.cpp b/Sources/Jazz2/UI/Menu/LoadingSection.cpp index 1ad76b92..ea7acacf 100644 --- a/Sources/Jazz2/UI/Menu/LoadingSection.cpp +++ b/Sources/Jazz2/UI/Menu/LoadingSection.cpp @@ -29,7 +29,7 @@ namespace Jazz2::UI::Menu Alignment::Top, Font::DefaultColor, 1.2f, 0.4f, 0.6f, 0.6f, 0.6f, 0.9f, 1.2f); } - void LoadingSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void LoadingSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { } } \ No newline at end of file diff --git a/Sources/Jazz2/UI/Menu/LoadingSection.h b/Sources/Jazz2/UI/Menu/LoadingSection.h index 4d9196f2..94ec9175 100644 --- a/Sources/Jazz2/UI/Menu/LoadingSection.h +++ b/Sources/Jazz2/UI/Menu/LoadingSection.h @@ -12,7 +12,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: String _message; diff --git a/Sources/Jazz2/UI/Menu/MenuSection.h b/Sources/Jazz2/UI/Menu/MenuSection.h index 9c453718..47d95384 100644 --- a/Sources/Jazz2/UI/Menu/MenuSection.h +++ b/Sources/Jazz2/UI/Menu/MenuSection.h @@ -47,7 +47,7 @@ namespace Jazz2::UI::Menu /** @brief Called when a text input is detected */ virtual void OnTextInput(const nCine::TextInputEvent& event) {} /** @brief Called when a touch event is triggered */ - virtual void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) = 0; + virtual void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) = 0; /** @brief Allows to override navigation behavior */ virtual NavigationFlags GetNavigationFlags() const { diff --git a/Sources/Jazz2/UI/Menu/PauseSection.cpp b/Sources/Jazz2/UI/Menu/PauseSection.cpp index a2ed5388..36a3d1ac 100644 --- a/Sources/Jazz2/UI/Menu/PauseSection.cpp +++ b/Sources/Jazz2/UI/Menu/PauseSection.cpp @@ -80,7 +80,7 @@ namespace Jazz2::UI::Menu } } - void PauseSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void PauseSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/PauseSection.h b/Sources/Jazz2/UI/Menu/PauseSection.h index 9a208cf5..1ee2b632 100644 --- a/Sources/Jazz2/UI/Menu/PauseSection.h +++ b/Sources/Jazz2/UI/Menu/PauseSection.h @@ -12,7 +12,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class Item { diff --git a/Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp b/Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp index 2a8e27f9..c028a7ef 100644 --- a/Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp +++ b/Sources/Jazz2/UI/Menu/RefreshCacheSection.cpp @@ -84,7 +84,7 @@ namespace Jazz2::UI::Menu Alignment::Top, Font::DefaultColor, 0.8f, 0.7f, 1.1f, 1.1f, 0.4f, 0.9f); } - void RefreshCacheSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void RefreshCacheSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { // No actions are allowed } diff --git a/Sources/Jazz2/UI/Menu/RefreshCacheSection.h b/Sources/Jazz2/UI/Menu/RefreshCacheSection.h index 789ee513..66f98dc9 100644 --- a/Sources/Jazz2/UI/Menu/RefreshCacheSection.h +++ b/Sources/Jazz2/UI/Menu/RefreshCacheSection.h @@ -18,7 +18,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: float _animation; diff --git a/Sources/Jazz2/UI/Menu/RemapControlsSection.cpp b/Sources/Jazz2/UI/Menu/RemapControlsSection.cpp index b78d383b..d404735c 100644 --- a/Sources/Jazz2/UI/Menu/RemapControlsSection.cpp +++ b/Sources/Jazz2/UI/Menu/RemapControlsSection.cpp @@ -412,7 +412,7 @@ namespace Jazz2::UI::Menu } } - void RemapControlsSection::OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) + void RemapControlsSection::OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) { auto& mapping = ControlScheme::GetMappings(_playerIndex)[newIndex]; diff --git a/Sources/Jazz2/UI/Menu/RemapControlsSection.h b/Sources/Jazz2/UI/Menu/RemapControlsSection.h index ec972d24..a5e23659 100644 --- a/Sources/Jazz2/UI/Menu/RemapControlsSection.h +++ b/Sources/Jazz2/UI/Menu/RemapControlsSection.h @@ -39,7 +39,7 @@ namespace Jazz2::UI::Menu void OnKeyPressed(const KeyboardEvent& event) override; void OnHandleInput() override; void OnExecuteSelected() override; - void OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) override; + void OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) override; void OnBackPressed() override; void RefreshPreviousState(); diff --git a/Sources/Jazz2/UI/Menu/ScrollableMenuSection.h b/Sources/Jazz2/UI/Menu/ScrollableMenuSection.h index 1457c7f5..2928bf44 100644 --- a/Sources/Jazz2/UI/Menu/ScrollableMenuSection.h +++ b/Sources/Jazz2/UI/Menu/ScrollableMenuSection.h @@ -21,7 +21,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDrawClipped(Canvas* canvas) override; - void OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const TouchEvent& event, Vector2i viewSize) override; protected: /** @brief Item in @ref ScrollableMenuSection */ @@ -62,7 +62,7 @@ namespace Jazz2::UI::Menu virtual void OnHandleInput(); virtual void OnBackPressed(); virtual void OnSelectionChanged(ListViewItem& item) { } - virtual void OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos); + virtual void OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos); }; template @@ -232,7 +232,7 @@ namespace Jazz2::UI::Menu } template - void ScrollableMenuSection::OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) + void ScrollableMenuSection::OnTouchEvent(const TouchEvent& event, Vector2i viewSize) { switch (event.type) { case TouchEventType::Down: { @@ -291,7 +291,7 @@ namespace Jazz2::UI::Menu } template - void ScrollableMenuSection::OnTouchUp(std::int32_t newIndex, const Vector2i& viewSize, const Vector2i& touchPos) + void ScrollableMenuSection::OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) { std::int32_t halfW = viewSize.X / 2; if (std::abs(touchPos.X - halfW) < 150) { diff --git a/Sources/Jazz2/UI/Menu/ServerSelectSection.cpp b/Sources/Jazz2/UI/Menu/ServerSelectSection.cpp index c0b20aa6..d38056c6 100644 --- a/Sources/Jazz2/UI/Menu/ServerSelectSection.cpp +++ b/Sources/Jazz2/UI/Menu/ServerSelectSection.cpp @@ -188,7 +188,7 @@ namespace Jazz2::UI::Menu } } - void ServerSelectSection::OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) + void ServerSelectSection::OnTouchEvent(const TouchEvent& event, Vector2i viewSize) { switch (event.type) { case TouchEventType::Down: { diff --git a/Sources/Jazz2/UI/Menu/ServerSelectSection.h b/Sources/Jazz2/UI/Menu/ServerSelectSection.h index 5124b6d7..aed639ad 100644 --- a/Sources/Jazz2/UI/Menu/ServerSelectSection.h +++ b/Sources/Jazz2/UI/Menu/ServerSelectSection.h @@ -19,7 +19,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawClipped(Canvas* canvas) override; - void OnTouchEvent(const TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const TouchEvent& event, Vector2i viewSize) override; void OnServerFound(Multiplayer::ServerDesc&& desc) override; diff --git a/Sources/Jazz2/UI/Menu/SimpleMessageSection.cpp b/Sources/Jazz2/UI/Menu/SimpleMessageSection.cpp index cd948c0e..cd72cc60 100644 --- a/Sources/Jazz2/UI/Menu/SimpleMessageSection.cpp +++ b/Sources/Jazz2/UI/Menu/SimpleMessageSection.cpp @@ -72,7 +72,7 @@ namespace Jazz2::UI::Menu } } - void SimpleMessageSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void SimpleMessageSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/SimpleMessageSection.h b/Sources/Jazz2/UI/Menu/SimpleMessageSection.h index 840a7072..0678a8db 100644 --- a/Sources/Jazz2/UI/Menu/SimpleMessageSection.h +++ b/Sources/Jazz2/UI/Menu/SimpleMessageSection.h @@ -16,7 +16,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawOverlay(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: String _message; diff --git a/Sources/Jazz2/UI/Menu/SoundsOptionsSection.cpp b/Sources/Jazz2/UI/Menu/SoundsOptionsSection.cpp index d05aa884..7f9b41f3 100644 --- a/Sources/Jazz2/UI/Menu/SoundsOptionsSection.cpp +++ b/Sources/Jazz2/UI/Menu/SoundsOptionsSection.cpp @@ -157,7 +157,7 @@ namespace Jazz2::UI::Menu } } - void SoundsOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void SoundsOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/SoundsOptionsSection.h b/Sources/Jazz2/UI/Menu/SoundsOptionsSection.h index e3cfdf3a..3cac6f57 100644 --- a/Sources/Jazz2/UI/Menu/SoundsOptionsSection.h +++ b/Sources/Jazz2/UI/Menu/SoundsOptionsSection.h @@ -13,7 +13,7 @@ namespace Jazz2::UI::Menu void OnShow(IMenuContainer* root) override; void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class Item { diff --git a/Sources/Jazz2/UI/Menu/StartGameOptionsSection.cpp b/Sources/Jazz2/UI/Menu/StartGameOptionsSection.cpp index 1eaa6f64..eef34b2e 100644 --- a/Sources/Jazz2/UI/Menu/StartGameOptionsSection.cpp +++ b/Sources/Jazz2/UI/Menu/StartGameOptionsSection.cpp @@ -347,7 +347,7 @@ namespace Jazz2::UI::Menu } } - void StartGameOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void StartGameOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { if (!_shouldStart && event.type == TouchEventType::Down) { std::int32_t pointerIndex = event.findPointerIndex(event.actionIndex); diff --git a/Sources/Jazz2/UI/Menu/StartGameOptionsSection.h b/Sources/Jazz2/UI/Menu/StartGameOptionsSection.h index 8f64e531..700efd90 100644 --- a/Sources/Jazz2/UI/Menu/StartGameOptionsSection.h +++ b/Sources/Jazz2/UI/Menu/StartGameOptionsSection.h @@ -14,7 +14,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; void OnDrawOverlay(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class Item { diff --git a/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.cpp b/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.cpp index 8abf81a0..411e012a 100644 --- a/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.cpp +++ b/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.cpp @@ -57,7 +57,7 @@ namespace Jazz2::UI::Menu DrawOutlinedSolid(viewSize.X - PreferencesCache::TouchRightPadding.X, viewSize.Y - 0.04f * LevelHandler::DefaultHeight + PreferencesCache::TouchRightPadding.Y, IMenuContainer::MainLayer + 20, Alignment::BottomRight, Vector2f(rightSizeX, rightSizeY)); } - void TouchControlsOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) + void TouchControlsOptionsSection::OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) { switch(event.type) { case TouchEventType::Down: { diff --git a/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.h b/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.h index f85bcc66..0467e4fb 100644 --- a/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.h +++ b/Sources/Jazz2/UI/Menu/TouchControlsOptionsSection.h @@ -12,7 +12,7 @@ namespace Jazz2::UI::Menu void OnUpdate(float timeMult) override; void OnDraw(Canvas* canvas) override; - void OnTouchEvent(const nCine::TouchEvent& event, const Vector2i& viewSize) override; + void OnTouchEvent(const nCine::TouchEvent& event, Vector2i viewSize) override; private: enum class SelectedZone { diff --git a/Sources/Jazz2/WeaponType.h b/Sources/Jazz2/WeaponType.h index 17e6c92c..9b2289f5 100644 --- a/Sources/Jazz2/WeaponType.h +++ b/Sources/Jazz2/WeaponType.h @@ -6,6 +6,8 @@ namespace Jazz2 { /** @brief Player weapon type */ enum class WeaponType : std::uint8_t { + Unknown = UINT8_MAX, /**< Unspecified */ + Blaster = 0, /**< Blaster */ Bouncer, /**< Bouncer */ Freezer, /**< Freezer */ @@ -18,7 +20,6 @@ namespace Jazz2 Thunderbolt, /**< Thunderbolt */ - Count, /**< Number of weapons */ - Unknown = UINT8_MAX /**< Unspecified */ + Count /**< Number of weapons */ }; } \ No newline at end of file diff --git a/Sources/Shared/Base/Move.h b/Sources/Shared/Base/Move.h index c62513b3..286ea3cb 100644 --- a/Sources/Shared/Base/Move.h +++ b/Sources/Shared/Base/Move.h @@ -75,16 +75,15 @@ namespace Death { /** @brief Swaps two values - Swaps two values. Equivalent to @ref std::swap(), but without the @cpp #include @ce + Swaps specified values. Equivalent to @ref std::swap(), but without the @cpp #include @ce dependency, and without the internals delegating to @m_class{m-doc-external} [std::move()](https://en.cppreference.com/w/cpp/utility/move), hurting debug performance. In order to keep supporting custom specializations, the usage pattern - should be similar to the standard utility, i.e. with @cpp using Utility::swap @ce. + should be similar to the standard utility, i.e. with @cpp using Death::swap @ce. @partialsupport On @ref DEATH_MSVC2015_COMPATIBILITY "MSVC 2015" it's just an alias to @ref std::swap(), as compiler limitations prevent creating an alternative that wouldn't conflict. */ /* The common_type is to prevent ambiguity with (also unrestricted) std::swap. - See MoveTest::swapStlTypesAdlAmbiguity() and swapUtilityTypesAdlAmbiguity() for details. Besides resolving ambiguity, in practice it means that std::swap() will get preferred over this overload in all cases where ADL finds it due to a STL type being used. Which means potentially slightly worse debug perf than if this overload was used for those too, due to diff --git a/Sources/Shared/Base/TypeInfo.h b/Sources/Shared/Base/TypeInfo.h index 53c2457d..ddb3e945 100644 --- a/Sources/Shared/Base/TypeInfo.h +++ b/Sources/Shared/Base/TypeInfo.h @@ -158,6 +158,7 @@ namespace Death { namespace TypeInfo { namespace Implementation { ? SkipBeginningRuntime(begin + skip().SizeAtBegin) : begin + skip().SizeAtBegin); } + }}} // It is located in the root namespace to keep the resulting string as short as possible @@ -245,6 +246,7 @@ namespace Death { namespace TypeInfo { namespace Implementation { return FindInstance(t, self); } }; + }}} /** @brief Class annotation to enable optimized `runtime_cast()` functionality */ @@ -259,32 +261,37 @@ namespace Death { namespace TypeInfo { namespace Implementation { } \ __DEATH_WARNING_POP -/** @brief Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy of classes annotated by `DEATH_RUNTIME_OBJECT()` */ -template -DEATH_ALWAYS_INLINE T runtime_cast(U* u) noexcept { - typedef typename std::remove_pointer::type Derived; - return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u, std::is_base_of()); -} +namespace Death { +//###==##====#=====--==~--~=~- --- -- - - - - -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const U* u) noexcept { - typedef typename std::remove_pointer::type Derived; - return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u, std::is_base_of()); -} + /** @brief Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy of classes annotated by `DEATH_RUNTIME_OBJECT()` */ + template + DEATH_ALWAYS_INLINE T runtime_cast(U* u) noexcept { + typedef typename std::remove_pointer::type Derived; + return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u, std::is_base_of()); + } -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const std::shared_ptr& u) noexcept { - typedef typename std::remove_pointer::type Derived; - return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u.get(), std::is_base_of()); -} + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const U* u) noexcept { + typedef typename std::remove_pointer::type Derived; + return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u, std::is_base_of()); + } + + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const std::shared_ptr& u) noexcept { + typedef typename std::remove_pointer::type Derived; + return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u.get(), std::is_base_of()); + } + + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const std::unique_ptr& u) noexcept { + typedef typename std::remove_pointer::type Derived; + return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u.get(), std::is_base_of()); + } -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const std::unique_ptr& u) noexcept { - typedef typename std::remove_pointer::type Derived; - return Death::TypeInfo::Implementation::Helpers::RuntimeCast(u.get(), std::is_base_of()); } #else @@ -292,28 +299,36 @@ DEATH_ALWAYS_INLINE T runtime_cast(const std::unique_ptr& u) noexcept { /** @brief Class annotation to enable optimized `runtime_cast()` functionality */ #define DEATH_RUNTIME_OBJECT(...) -/** @brief Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy of classes annotated by `DEATH_RUNTIME_OBJECT()` */ -template -DEATH_ALWAYS_INLINE T runtime_cast(U* u) noexcept { - return dynamic_cast(u); -} +namespace Death { +//###==##====#=====--==~--~=~- --- -- - - - - -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const U* u) noexcept { - return dynamic_cast(u); -} + /** @brief Safely converts pointers to classes up, down, and sideways along the inheritance hierarchy of classes annotated by `DEATH_RUNTIME_OBJECT()` */ + template + DEATH_ALWAYS_INLINE T runtime_cast(U* u) noexcept { + return dynamic_cast(u); + } -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const std::shared_ptr& u) noexcept { - return dynamic_cast(u.get()); -} + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const U* u) noexcept { + return dynamic_cast(u); + } + + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const std::shared_ptr& u) noexcept { + return dynamic_cast(u.get()); + } + + /** @overload */ + template + DEATH_ALWAYS_INLINE T runtime_cast(const std::unique_ptr& u) noexcept { + return dynamic_cast(u.get()); + } -/** @overload */ -template -DEATH_ALWAYS_INLINE T runtime_cast(const std::unique_ptr& u) noexcept { - return dynamic_cast(u.get()); } #endif + +// Allow to use runtime_cast without namespace +using Death::runtime_cast; \ No newline at end of file diff --git a/Sources/Shared/Containers/SmallVector.h b/Sources/Shared/Containers/SmallVector.h index 506dd7b8..f3721f36 100644 --- a/Sources/Shared/Containers/SmallVector.h +++ b/Sources/Shared/Containers/SmallVector.h @@ -27,10 +27,9 @@ namespace Death { namespace Containers { @brief @ref SmallVector base class The template parameter specifies the type which should be used to hold the Size - and Capacity of SmallVector, so it can be adjusted. Using 32-bit size is desirable - to shrink the size of SmallVector. Using 64-bit size is desirable for cases like - SmallVector, where a 32 bit size would limit the vector to ~4GB. - SmallVectors are used for buffering bitcode output - which can exceed 4GB. + and Capacity of `SmallVector`, so it can be adjusted. Using 32-bit size is desirable + to shrink the size of `SmallVector`. Using 64-bit size is desirable for cases like + @cpp SmallVector @ce, where a 32 bit size would limit the vector to ~4GB. */ template class SmallVectorBase { @@ -268,11 +267,11 @@ namespace Death { namespace Containers { return capacity() * sizeof(T); } - /** @brief Returns a pointer to the vector's buffer, even if @ref empty() */ + /** @brief Returns a pointer to the vector's buffer */ pointer data() { return pointer(begin()); } - /** @brief Returns a pointer to the vector's buffer, even if @ref empty() */ + /** @overload */ const_pointer data() const { return const_pointer(begin()); } @@ -542,7 +541,7 @@ namespace Death { namespace Containers { } }; - /** @brief Consists of common code factored out of `SmallVector` class to reduce code duplication based on `N` template parameter */ + /** @brief Consists of common code of @ref SmallVector class to reduce code duplication based on `N` template parameter */ template class SmallVectorImpl : public SmallVectorTemplateBase { @@ -1103,13 +1102,16 @@ namespace Death { namespace Containers { return *this; } - /** @brief Storage for the SmallVector elements */ + /** @brief Storage for @ref SmallVector elements */ template struct SmallVectorStorage { + /** @brief Array of inline elements */ alignas(T) char InlineElts[N * sizeof(T)]; }; +#ifndef DOXYGEN_GENERATING_OUTPUT template struct alignas(T) SmallVectorStorage {}; +#endif template class SmallVector; diff --git a/Sources/nCine/Graphics/ParticleSystem.cpp b/Sources/nCine/Graphics/ParticleSystem.cpp index d2edf075..02b9329e 100644 --- a/Sources/nCine/Graphics/ParticleSystem.cpp +++ b/Sources/nCine/Graphics/ParticleSystem.cpp @@ -146,7 +146,7 @@ namespace nCine } } - void ParticleSystem::setAnchorPoint(const Vector2f& point) + void ParticleSystem::setAnchorPoint(Vector2f point) { for (auto& particle : particleArray_) { particle->setAnchorPoint(point); diff --git a/Sources/nCine/Graphics/ParticleSystem.h b/Sources/nCine/Graphics/ParticleSystem.h index 2c58d521..2ef5eaa7 100644 --- a/Sources/nCine/Graphics/ParticleSystem.h +++ b/Sources/nCine/Graphics/ParticleSystem.h @@ -70,7 +70,7 @@ namespace nCine /// Sets the transformation anchor point for every particle void setAnchorPoint(float xx, float yy); /// Sets the transformation anchor point for every particle with a `Vector2f` - void setAnchorPoint(const Vector2f& point); + void setAnchorPoint(Vector2f point); /// Flips the texture rect horizontally for every particle void setFlippedX(bool flippedX); diff --git a/Sources/nCine/Graphics/SceneNode.cpp b/Sources/nCine/Graphics/SceneNode.cpp index adb80a6e..e7a21da0 100644 --- a/Sources/nCine/Graphics/SceneNode.cpp +++ b/Sources/nCine/Graphics/SceneNode.cpp @@ -21,7 +21,7 @@ namespace nCine } /*! \param parent The parent can be `nullptr` */ - SceneNode::SceneNode(SceneNode* parent, const Vector2f& position) + SceneNode::SceneNode(SceneNode* parent, Vector2f position) : SceneNode(parent, position.X, position.Y) { } diff --git a/Sources/nCine/Graphics/SceneNode.h b/Sources/nCine/Graphics/SceneNode.h index d8f426a2..1259f4e8 100644 --- a/Sources/nCine/Graphics/SceneNode.h +++ b/Sources/nCine/Graphics/SceneNode.h @@ -34,7 +34,7 @@ namespace nCine /// Constructor for a node with a parent and a specified relative position SceneNode(SceneNode* parent, float x, float y); /// Constructor for a node with a parent and a specified relative position as a vector - SceneNode(SceneNode* parent, const Vector2f& position); + SceneNode(SceneNode* parent, Vector2f position); /// Constructor for a node with a parent and positioned in the relative origin explicit SceneNode(SceneNode* parent); /// Constructor for a node with no parent and positioned in the origin @@ -148,7 +148,7 @@ namespace nCine /// Sets the node position through two coordinates void setPosition(float x, float y); /// Sets the node position through a vector - void setPosition(const Vector2f& position); + void setPosition(Vector2f position); /// Sets the X coordinate of the node position void setPositionX(float x); /// Sets the Y coordinate of the node position @@ -156,7 +156,7 @@ namespace nCine /// Moves the node based on two offsets void move(float x, float y); /// Adds a move vector to the node current position - void move(const Vector2f& position); + void move(Vector2f position); /// Moves the node by an offset on the X axis void moveX(float x); /// Moves the node by an offset on the Y axis @@ -169,7 +169,7 @@ namespace nCine /// Sets the transformation anchor point in pixels void setAbsAnchorPoint(float x, float y); /// Sets the transformation anchor point in pixels with a `Vector2f` - void setAbsAnchorPoint(const Vector2f& point); + void setAbsAnchorPoint(Vector2f point); /// Gets the node scale factors inline const Vector2f& scale() const { @@ -184,7 +184,7 @@ namespace nCine /// Scales the node size both horizontally and vertically void setScale(float scaleFactorX, float scaleFactorY); /// Scales the node size both horizontally and vertically with a `Vector2f` - void setScale(const Vector2f& scaleFactor); + void setScale(Vector2f scaleFactor); /// Gets the node rotation in radians inline float rotation() const { @@ -374,7 +374,7 @@ namespace nCine dirtyBits_.set(DirtyBitPositions::AabbBit); } - inline void SceneNode::setPosition(const Vector2f& position) + inline void SceneNode::setPosition(Vector2f position) { position_ = position; dirtyBits_.set(DirtyBitPositions::TransformationBit); @@ -403,7 +403,7 @@ namespace nCine dirtyBits_.set(DirtyBitPositions::AabbBit); } - inline void SceneNode::move(const Vector2f& position) + inline void SceneNode::move(Vector2f position) { position_ += position; dirtyBits_.set(DirtyBitPositions::TransformationBit); @@ -431,7 +431,7 @@ namespace nCine dirtyBits_.set(DirtyBitPositions::AabbBit); } - inline void SceneNode::setAbsAnchorPoint(const Vector2f& point) + inline void SceneNode::setAbsAnchorPoint(Vector2f point) { anchorPoint_ = point; dirtyBits_.set(DirtyBitPositions::TransformationBit); @@ -452,7 +452,7 @@ namespace nCine dirtyBits_.set(DirtyBitPositions::AabbBit); } - inline void SceneNode::setScale(const Vector2f& scaleFactor) + inline void SceneNode::setScale(Vector2f scaleFactor) { scaleFactor_ = scaleFactor; dirtyBits_.set(DirtyBitPositions::TransformationBit); diff --git a/Sources/nCine/Graphics/Sprite.cpp b/Sources/nCine/Graphics/Sprite.cpp index e7eec1a3..195560c8 100644 --- a/Sources/nCine/Graphics/Sprite.cpp +++ b/Sources/nCine/Graphics/Sprite.cpp @@ -25,7 +25,7 @@ namespace nCine init(); } - Sprite::Sprite(SceneNode* parent, Texture* texture, const Vector2f& position) + Sprite::Sprite(SceneNode* parent, Texture* texture, Vector2f position) : Sprite(parent, texture, position.X, position.Y) { } @@ -35,7 +35,7 @@ namespace nCine { } - Sprite::Sprite(Texture* texture, const Vector2f& position) + Sprite::Sprite(Texture* texture, Vector2f position) : Sprite(nullptr, texture, position.X, position.Y) { } diff --git a/Sources/nCine/Graphics/Sprite.h b/Sources/nCine/Graphics/Sprite.h index 86b8ac44..20bf32d7 100644 --- a/Sources/nCine/Graphics/Sprite.h +++ b/Sources/nCine/Graphics/Sprite.h @@ -17,11 +17,11 @@ namespace nCine /// Constructor for a sprite with a parent, a texture and a specified relative position Sprite(SceneNode* parent, Texture* texture, float xx, float yy); /// Constructor for a sprite with a parent, a texture and a specified relative position as a vector - Sprite(SceneNode* parent, Texture* texture, const Vector2f& position); + Sprite(SceneNode* parent, Texture* texture, Vector2f position); /// Constructor for a sprite with a texture and a specified position but no parent Sprite(Texture* texture, float xx, float yy); /// Constructor for a sprite with a texture and a specified position as a vector but no parent - Sprite(Texture* texture, const Vector2f& position); + Sprite(Texture* texture, Vector2f position); /// Default move constructor Sprite(Sprite&&) = default;