GBAWidget: Use std::span with SetVideoBuffer()

Previously we were always taking the buffer by value, even if it wasn't
being stored anywhere and only read from.

We can use a std::span for the same thing.
This commit is contained in:
Lioncash
2023-12-13 10:04:44 -05:00
parent 3f06d32dcd
commit 67a06d17b1
2 changed files with 6 additions and 5 deletions

View File

@ -5,6 +5,7 @@
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
@ -37,7 +38,7 @@ public:
~GBAWidget();
void GameChanged(const HW::GBA::CoreInfo& info);
void SetVideoBuffer(std::vector<u32> video_buffer);
void SetVideoBuffer(std::span<const u32> video_buffer);
void SetVolume(int volume);
void VolumeDown();
@ -106,7 +107,7 @@ public:
void Create(std::weak_ptr<HW::GBA::Core> core, const HW::GBA::CoreInfo& info);
void GameChanged(const HW::GBA::CoreInfo& info);
void FrameEnded(std::vector<u32> video_buffer);
void FrameEnded(std::span<const u32> video_buffer);
private:
GBAWidget* m_widget{};