Skip to content

Commit

Permalink
Removed CVideo::blit_surface
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed Mar 26, 2018
1 parent c453a97 commit b08fa98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
4 changes: 3 additions & 1 deletion src/editor/palette/tristate_button.cpp
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/video.cpp
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/video.hpp
Expand Up @@ -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();
Expand Down

0 comments on commit b08fa98

Please sign in to comment.