diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2017-10-02 00:21:10 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2017-11-17 22:11:33 -0600 |
| commit | 0f7f4ccaf9dd054b40691b82eedd2c61dc61d25a (patch) | |
| tree | 77562910d2d70bd25876c2d6124af9bf9e224a46 /Source/Core/VideoBackends/Software/SWTexture.cpp | |
| parent | 7248dd47d5b48564a1ed049bdf392146dca2d72a (diff) | |
Software Backend: allow screenshots/video to be taken with valid data
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWTexture.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Software/SWTexture.cpp b/Source/Core/VideoBackends/Software/SWTexture.cpp index b42f3d4e21..66e76f09a5 100644 --- a/Source/Core/VideoBackends/Software/SWTexture.cpp +++ b/Source/Core/VideoBackends/Software/SWTexture.cpp @@ -10,8 +10,21 @@ namespace SW { +namespace +{ +#pragma pack(push, 1) +struct Pixel +{ + u8 r; + u8 g; + u8 b; + u8 a; +}; +#pragma pack(pop) +} SWTexture::SWTexture(const TextureConfig& tex_config) : AbstractTexture(tex_config) { + m_data.resize(tex_config.width * tex_config.height * 4); } void SWTexture::Bind(unsigned int stage) @@ -31,7 +44,8 @@ void SWTexture::CopyRectangleFromTexture(const AbstractTexture* source, } else { - copy_region(software_source_texture->GetData(), srcrect, GetData(), dstrect); + copy_region(reinterpret_cast<const Pixel*>(software_source_texture->GetData()), srcrect, + reinterpret_cast<Pixel*>(GetData()), dstrect); } } |
