From b08fa982600c82e258dfd555c2cf170e0a623539 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Mon, 26 Mar 2018 14:13:55 +1100 Subject: [PATCH] Removed CVideo::blit_surface Used to be a surface drawing helper for blitting on the framebuffer surface. I made it work with accelerated rendering by forwarding it to render_copy, but we don't need it anymore. All but one of its usecases have been removed. --- src/editor/palette/tristate_button.cpp | 4 +++- src/video.cpp | 10 ---------- src/video.hpp | 13 ------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/editor/palette/tristate_button.cpp b/src/editor/palette/tristate_button.cpp index 680d472e32c9..1372952695d9 100644 --- a/src/editor/palette/tristate_button.cpp +++ b/src/editor/palette/tristate_button.cpp @@ -234,7 +234,9 @@ void tristate_button::draw_contents() { bg_restore(); image = nbase; - video().blit_surface(loc.x, loc.y, image); + UNUSED(loc); + UNUSED(image); + //video().blit_surface(loc.x, loc.y, image); } //TODO move to widget diff --git a/src/video.cpp b/src/video.cpp index 1184a0600452..42af982b023d 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -109,16 +109,6 @@ 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) -{ - texture txt(surf); - - render_clip_rect_setter crs(clip_rect); - - SDL_Rect dst {x, y, surf->w, surf->h}; - render_copy(txt, srcrect, &dst); -} - void CVideo::make_fake() { fake_screen_ = true; diff --git a/src/video.hpp b/src/video.hpp index 9ea89ea56413..a115163a9943 100644 --- a/src/video.hpp +++ b/src/video.hpp @@ -154,19 +154,6 @@ class CVideo /***** ***** ***** ***** Drawing functions ***** ***** ****** *****/ - /** - * Draws a surface directly onto the screen framebuffer. - * - * @param x The x coordinate at which to draw. - * @param y The y coordinate at which to draw. - * @param surf The surface to draw. - * @param srcrect The area of the surface to draw. This defaults to nullptr, - * which implies the entire thing. - * @param clip_rect The clippin rect. If not null, the surface will only be drawn - * within the bounds of the given rectangle. - */ - void blit_surface(int x, int y, surface surf, SDL_Rect* srcrect = nullptr, SDL_Rect* clip_rect = nullptr); - private: /** Renders the screen. */ void render_screen();