Skip to content

Commit

Permalink
the_end() only needs CVideo
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Jan 12, 2016
1 parent 30522e6 commit 0ecf4d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/game_launcher.cpp
Expand Up @@ -1109,7 +1109,7 @@ void game_launcher::launch_game(RELOAD_GAME_DATA reload)
// change this if MP campaigns are implemented
if(result == LEVEL_RESULT::VICTORY && !state_.classification().is_normal_mp_game()) {
preferences::add_completed_campaign(state_.classification().campaign, state_.classification().difficulty);
the_end(disp(), state_.classification().end_text, state_.classification().end_text_duration);
the_end(video(), state_.classification().end_text, state_.classification().end_text_duration);
if(state_.classification().end_credits) {
about::show_about(disp(),state_.classification().campaign);
}
Expand Down
13 changes: 7 additions & 6 deletions src/intro.cpp
Expand Up @@ -22,11 +22,13 @@

#include "intro.hpp"

#include "display.hpp"
#include "video.hpp"
#include "gettext.hpp"
#include "marked-up_text.hpp"
#include "sdl/rect.hpp"
#include "font.hpp"

void the_end(display &disp, std::string text, unsigned int duration)
void the_end(CVideo &video, std::string text, unsigned int duration)
{
//
// Some sane defaults.
Expand All @@ -37,11 +39,10 @@ void the_end(display &disp, std::string text, unsigned int duration)
duration = 3500;

SDL_Rect area = screen_area();
CVideo &video = disp.video();
sdl::fill_rect(video.getSurface(),&area,0);

update_whole_screen();
disp.flip();
video.flip();

const size_t font_size = font::SIZE_XLARGE;

Expand All @@ -60,7 +61,7 @@ void the_end(display &disp, std::string text, unsigned int duration)
events::pump();
events::raise_process_event();
events::raise_draw_event();
disp.flip();
video.flip();
CVideo::delay(10);
}

Expand All @@ -73,7 +74,7 @@ void the_end(display &disp, std::string text, unsigned int duration)
events::pump();
events::raise_process_event();
events::raise_draw_event();
disp.flip();
video.flip();
CVideo::delay(10);
--count;
}
Expand Down
4 changes: 2 additions & 2 deletions src/intro.hpp
Expand Up @@ -17,7 +17,7 @@
#ifndef INTRO_HPP_INCLUDED
#define INTRO_HPP_INCLUDED

class display;
class CVideo;

#include <string>

Expand All @@ -30,6 +30,6 @@ class display;
* @param duration In milliseconds, for how much time the text will
* be displayed on screen.
*/
void the_end(display &disp, std::string text, unsigned int duration);
void the_end(CVideo &video, std::string text, unsigned int duration);

#endif /* ! INTRO_HPP_INCLUDED */

0 comments on commit 0ecf4d8

Please sign in to comment.