From 1f90aa259162861236dc4940b2c2c849b0ce6b49 Mon Sep 17 00:00:00 2001 From: chreden <4263940+chreden@users.noreply.github.com> Date: Wed, 14 Apr 2021 22:48:49 +0100 Subject: [PATCH] Make OCB signed (#756) Make the OCB value signed - some items use negative numbers so use signed instead of unsigned. Closes #753 --- trview.app/Elements/Item.cpp | 4 ++-- trview.app/Elements/Item.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trview.app/Elements/Item.cpp b/trview.app/Elements/Item.cpp index bba0e36fd..922e025f9 100644 --- a/trview.app/Elements/Item.cpp +++ b/trview.app/Elements/Item.cpp @@ -2,7 +2,7 @@ namespace trview { - Item::Item(uint32_t number, uint32_t room, uint32_t type_id, const std::wstring& type, uint32_t ocb, uint16_t flags, const std::vector& triggers, const DirectX::SimpleMath::Vector3& position) + Item::Item(uint32_t number, uint32_t room, uint32_t type_id, const std::wstring& type, int32_t ocb, uint16_t flags, const std::vector& triggers, const DirectX::SimpleMath::Vector3& position) : _number(number), _room(room), _type_id(type_id), _type(type), _ocb(ocb), _flags(flags), _triggers(triggers), _position(position) { } @@ -27,7 +27,7 @@ namespace trview return _type; } - uint32_t Item::ocb() const + int32_t Item::ocb() const { return _ocb; } diff --git a/trview.app/Elements/Item.h b/trview.app/Elements/Item.h index ff11a5ec2..8c1351bec 100644 --- a/trview.app/Elements/Item.h +++ b/trview.app/Elements/Item.h @@ -22,7 +22,7 @@ namespace trview /// @param flags The flags for the entity. /// @param triggers The triggers that affect this entity. /// @param position The position of the entity. - explicit Item(uint32_t number, uint32_t room, const uint32_t type_id, const std::wstring& type, uint32_t ocb, uint16_t flags, const std::vector& triggers, const DirectX::SimpleMath::Vector3& position); + explicit Item(uint32_t number, uint32_t room, const uint32_t type_id, const std::wstring& type, int32_t ocb, uint16_t flags, const std::vector& triggers, const DirectX::SimpleMath::Vector3& position); /// Get the item number. /// @returns The item number. @@ -42,7 +42,7 @@ namespace trview /// Get the OCB value of the item. /// @returns The OCB value of the item. - uint32_t ocb() const; + int32_t ocb() const; /// Get the activation flags for the entity. /// @returns The activation flags.