shithub: cstory

Download patch

ref: e094f2ff6818c0b05cbd559e668295cd307c3e6c
parent: 3a10bf57cbaa044693ce7e4ec0e0c7d1ed6a7534
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Aug 11 01:22:02 EDT 2019

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...

--- a/src/Backends/Rendering/SDLSurface.cpp
+++ b/src/Backends/Rendering/SDLSurface.cpp
@@ -130,7 +130,7 @@
 
 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_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_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)
--- a/src/Backends/Rendering/Software.cpp
+++ b/src/Backends/Rendering/Software.cpp
@@ -200,7 +200,7 @@
 
 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)