CVideo: convert blit_surface to handle input as textures instead of blitting to framebuffer

This commit is contained in:
Charles Dang 2017-06-06 02:18:45 +11:00
parent 81a62bf49c
commit 4a0f8d9db0

View file

@ -21,6 +21,7 @@
#include "log.hpp"
#include "preferences/general.hpp"
#include "sdl/point.hpp"
#include "sdl/render_utils.hpp"
#include "sdl/texture.hpp"
#include "sdl/userevent.hpp"
#include "sdl/utils.hpp"
@ -163,11 +164,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()