From 8b1f979f8353737d1bd8fdab57a871a40a17990d Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Tue, 6 Jun 2017 02:18:45 +1100 Subject: [PATCH] CVideo: convert blit_surface to handle input as textures instead of blitting to framebuffer --- src/video.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 6ae8e2b28419..771692006eed 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -19,6 +19,7 @@ #include "image.hpp" #include "log.hpp" #include "preferences/general.hpp" +#include "sdl/render_utils.hpp" #include "sdl/texture.hpp" #include "sdl/window.hpp" @@ -165,11 +166,12 @@ void CVideo::video_event_handler::handle_window_event(const SDL_Event &event) void CVideo::blit_surface(int x, int y, surface surf, SDL_Rect* srcrect, SDL_Rect* clip_rect) { - surface& target(getSurface()); - SDL_Rect dst {x, y, 0, 0}; + texture txt(surf); - const clip_rect_setter clip_setter(target, clip_rect, clip_rect != nullptr); - sdl_blit(surf,srcrect,target,&dst); + render_clip_rect_setter crs(clip_rect); + + SDL_Rect dst {x, y, surf->w, surf->h}; + copy_to_screen(txt, srcrect, &dst); } void CVideo::make_fake()