mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- fix crash when in software truecolor mode - the pitch is in pixels, not bytes
This commit is contained in:
parent
1fc1fac2c2
commit
fde87c40d2
2 changed files with 2 additions and 1 deletions
|
@ -115,7 +115,7 @@ void SWSceneDrawer::RenderView(player_t *player)
|
|||
}
|
||||
auto buf = FBTexture->hwtex->MapBuffer();
|
||||
if (!buf) I_FatalError("Unable to map buffer for software rendering");
|
||||
buffer.SetBuffer(screen->GetWidth(), screen->GetHeight(), screen->GetWidth() * (swtruecolor ? 4 : 1), buf);
|
||||
buffer.SetBuffer(screen->GetWidth(), screen->GetHeight(), screen->GetWidth(), buf);
|
||||
SWRenderer->RenderView(player, &buffer);
|
||||
FBTexture->hwtex->CreateTexture(nullptr, screen->GetWidth(), screen->GetHeight(), 0, false, 0, "swbuffer");
|
||||
|
||||
|
|
|
@ -224,6 +224,7 @@ public:
|
|||
inline int GetPitch () const { return Pitch; }
|
||||
inline bool IsBgra() const { return Bgra; }
|
||||
|
||||
// Note: pitch here is in pixels, not bytes.
|
||||
bool SetBuffer(int width, int height, int pitch, uint8_t *buffer)
|
||||
{
|
||||
assert(buffer);
|
||||
|
|
Loading…
Reference in a new issue