Skip to content

Commit

Permalink
CVideo: removed get_screen_surface in favor of getSurface
Browse files Browse the repository at this point in the history
They do the same thing, and the latter was more widely used.
  • Loading branch information
Vultraz committed Dec 6, 2016
1 parent ae91632 commit 0c18c9c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/display.cpp
Expand Up @@ -227,7 +227,7 @@ display::display(const display_context * dc, CVideo& video, std::weak_ptr<wb::ma
read(level.child_or_empty("display"));

if(video.non_interactive()
&& (get_video_surface() != nullptr
&& (video.getSurface() != nullptr
&& video.faked())) {
screen_.lock_updates(true);
}
Expand Down Expand Up @@ -1315,7 +1315,7 @@ void display::flip()
return;
}

surface& frameBuffer = get_video_surface();
surface& frameBuffer = video().getSurface();

// This is just the debug function "sunset" to progressively darken the map area
static size_t sunset_timer = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/canvas.cpp
Expand Up @@ -1461,7 +1461,7 @@ void canvas::blit(surface& surf, SDL_Rect rect)
* can be seen in the title screen. So also use the not 32 bpp method
* for this situation.
*/
if(surf != get_video_surface() && is_neutral(surf)) {
if(surf != CVideo::get_singleton().getSurface() && is_neutral(surf)) {
blur_surface(surf, rect, blur_depth_);
} else {
// Can't directly blur the surface if not 32 bpp.
Expand Down
7 changes: 0 additions & 7 deletions src/video.cpp
Expand Up @@ -109,13 +109,6 @@ bool CVideo::non_interactive()
return window == nullptr;
}



surface& get_video_surface()
{
return frameBuffer;
}

SDL_Rect screen_area()
{
return sdl::create_rect(0, 0, frameBuffer->w, frameBuffer->h);
Expand Down
6 changes: 0 additions & 6 deletions src/video.hpp
Expand Up @@ -29,14 +29,8 @@ class surface;
#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
#define SDL_APPACTIVE 0x04 /**< The application is active */


surface& get_video_surface();


SDL_Rect screen_area();



//which areas of the screen will be updated when the buffer is flipped?
void update_rect(size_t x, size_t y, size_t w, size_t h);
void update_rect(const SDL_Rect& rect);
Expand Down

0 comments on commit 0c18c9c

Please sign in to comment.