Skip to content

Commit

Permalink
Make OCB signed (#756)
Browse files Browse the repository at this point in the history
Make the OCB value signed - some items use negative numbers so use signed instead of unsigned.
Closes #753
  • Loading branch information
chreden authored Apr 14, 2021
1 parent 17c0b9d commit 1f90aa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions trview.app/Elements/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Trigger*>& 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<Trigger*>& triggers, const DirectX::SimpleMath::Vector3& position)
: _number(number), _room(room), _type_id(type_id), _type(type), _ocb(ocb), _flags(flags), _triggers(triggers), _position(position)
{
}
Expand All @@ -27,7 +27,7 @@ namespace trview
return _type;
}

uint32_t Item::ocb() const
int32_t Item::ocb() const
{
return _ocb;
}
Expand Down
4 changes: 2 additions & 2 deletions trview.app/Elements/Item.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Trigger*>& 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<Trigger*>& triggers, const DirectX::SimpleMath::Vector3& position);

/// Get the item number.
/// @returns The item number.
Expand All @@ -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.
Expand Down

0 comments on commit 1f90aa2

Please sign in to comment.