From e094f2ff6818c0b05cbd559e668295cd307c3e6c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 11 Aug 2019 05:22:02 +0000 Subject: [PATCH] Renderer backend fixes Surface-to-surface blits were broken (would draw to screen instead), and the SDLSurface backend wouldn't even compile. You know, I thought I tested each backend when I made those changes to the API... --- src/Backends/Rendering/SDLSurface.cpp | 6 +++--- src/Backends/Rendering/Software.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Backends/Rendering/SDLSurface.cpp b/src/Backends/Rendering/SDLSurface.cpp index 15a9f756..2091a3f2 100644 --- a/src/Backends/Rendering/SDLSurface.cpp +++ b/src/Backends/Rendering/SDLSurface.cpp @@ -130,7 +130,7 @@ static void BlitCommon(Backend_Surface *source_surface, const RECT *rect, Backen void Backend_BlitToSurface(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y) { - BlitCommon(source_surface, rect, &framebuffer, x, y, TRUE); + BlitCommon(source_surface, rect, destination_surface, x, y, TRUE); } void Backend_BlitToScreen(Backend_Surface *source_surface, const RECT *rect, long x, long y, BOOL colour_key) @@ -151,7 +151,7 @@ void Backend_ColourFillToSurface(Backend_Surface *surface, const RECT *rect, uns void Backend_ColourFillToScreen(const RECT *rect, unsigned char red, unsigned char green, unsigned char blue) { - Backend_ColourFill(&framebuffer, rect, red, green, blue); + Backend_ColourFillToSurface(&framebuffer, rect, red, green, blue); } void Backend_ScreenToSurface(Backend_Surface *surface, const RECT *rect) @@ -248,7 +248,7 @@ void Backend_DrawGlyphToSurface(Backend_Surface *surface, Backend_Glyph *glyph, void Backend_DrawGlyphToScreen(Backend_Glyph *glyph, long x, long y, const unsigned char *colours) { - Backend_DrawGlyph(&framebuffer, glyph, x, y, colours); + Backend_DrawGlyphToSurface(&framebuffer, glyph, x, y, colours); } void Backend_HandleDeviceLoss(void) diff --git a/src/Backends/Rendering/Software.cpp b/src/Backends/Rendering/Software.cpp index 2e5d9bd7..4c024706 100644 --- a/src/Backends/Rendering/Software.cpp +++ b/src/Backends/Rendering/Software.cpp @@ -200,7 +200,7 @@ static void BlitCommon(Backend_Surface *source_surface, const RECT *rect, Backen void Backend_BlitToSurface(Backend_Surface *source_surface, const RECT *rect, Backend_Surface *destination_surface, long x, long y) { - BlitCommon(source_surface, rect, &framebuffer, x, y, TRUE); + BlitCommon(source_surface, rect, destination_surface, x, y, TRUE); } void Backend_BlitToScreen(Backend_Surface *source_surface, const RECT *rect, long x, long y, BOOL colour_key)