SWBoundingBox.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2021 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "Common/CommonTypes.h"
  5. #include "VideoCommon/BoundingBox.h"
  6. namespace BBoxManager
  7. {
  8. // Indicates a coordinate of the bounding box.
  9. enum class Coordinate
  10. {
  11. Left, // The X coordinate of the left side of the bounding box.
  12. Right, // The X coordinate of the right side of the bounding box.
  13. Top, // The Y coordinate of the top of the bounding box.
  14. Bottom, // The Y coordinate of the bottom of the bounding box.
  15. };
  16. // Gets a particular coordinate for the bounding box.
  17. u16 GetCoordinate(Coordinate coordinate);
  18. // Sets a particular coordinate for the bounding box.
  19. void SetCoordinate(Coordinate coordinate, u16 value);
  20. // Updates all bounding box coordinates.
  21. void Update(u16 left, u16 right, u16 top, u16 bottom);
  22. } // namespace BBoxManager
  23. namespace SW
  24. {
  25. class SWBoundingBox final : public BoundingBox
  26. {
  27. public:
  28. bool Initialize() override { return true; }
  29. protected:
  30. std::vector<BBoxType> Read(u32 index, u32 length) override;
  31. void Write(u32 index, std::span<const BBoxType> values) override;
  32. };
  33. } // namespace SW