Rename events::pump to events::run_event_loop

To make its purpose clearer.
This commit is contained in:
Charles Dang 2018-03-20 11:26:54 +11:00
parent 123dd952c0
commit 625135eb0d
10 changed files with 16 additions and 16 deletions

View file

@ -142,7 +142,7 @@ namespace
animator.start_animations();
animator.wait_for_end();
animator.set_all_standing();
events::pump();
events::run_event_loop();
}
return true;

View file

@ -255,7 +255,7 @@ void controller_base::play_slice(bool is_delay_enabled)
l->play_slice();
}
events::pump();
events::run_event_loop();
events::raise_process_event();
// Update sound sources before scrolling

View file

@ -1593,7 +1593,7 @@ void display::scroll_to_xy(int screenxpos, int screenypos, SCROLL_TYPE scroll_ty
double velocity = 0.0;
while (dist_moved < dist_total) {
events::pump();
events::run_event_loop();
int t = SDL_GetTicks();
double dt = (t - t_prev) / 1000.0;

View file

@ -417,7 +417,7 @@ void finalize()
// TODO: I'm uncertain if this is always safe to call at static init; maybe set in main() instead?
static const boost::thread::id main_thread = boost::this_thread::get_id();
void pump()
void run_event_loop()
{
if(boost::this_thread::get_id() != main_thread) {
// Can only call this on the main thread!
@ -620,7 +620,7 @@ void pump()
video.render_screen();
// Inform the pump monitors that an events::pump() has occurred
// Inform the pump monitors that an events::run_event_loop() has occurred
for(auto monitor : pump_monitors) {
monitor->process(info);
}

View file

@ -128,7 +128,7 @@ struct event_context
};
//causes events to be dispatched to all handler objects.
void pump();
void run_event_loop();
//look for resize events and update references to the screen area
void peek_for_resize();
@ -142,7 +142,7 @@ private:
};
class pump_monitor {
//pump_monitors receive notification after an events::pump() occurs
//pump_monitors receive notification after an events::run_event_loop() occurs
public:
pump_monitor();
virtual ~pump_monitor();

View file

@ -70,7 +70,7 @@ static uint32_t timer_sdl_poll_events(uint32_t, void*)
{
try
{
events::pump();
events::run_event_loop();
}
catch(CVideo::quit&)
{

View file

@ -469,7 +469,7 @@ void window::show_non_modal(/*const unsigned auto_close_timeout*/)
invalidate_layout();
suspend_drawing_ = false;
events::pump();
events::run_event_loop();
}
int window::show(const unsigned auto_close_timeout)
@ -518,7 +518,7 @@ int window::show(const unsigned auto_close_timeout)
for(status_ = SHOWING; status_ != CLOSED;) {
// process installed callback if valid, to allow e.g. network
// polling
events::pump();
events::run_event_loop();
if(!mouse_button_state_initialized) {
/*

View file

@ -94,7 +94,7 @@ static void teleport_unit_between(const map_location& a, const map_location& b,
temp_unit.anim_comp().set_standing();
disp.draw_debugging_aids();
events::pump();
events::run_event_loop();
}
/**

View file

@ -167,8 +167,8 @@ private:
/** Renders the screen. */
void render_screen();
/** events::pump() is the only place that should call render_screen(). */
friend void events::pump();
/** events::run_event_loop() is the only place that should call render_screen(). */
friend void events::run_event_loop();
public:
void render_copy(const texture& txt,

View file

@ -677,7 +677,7 @@ static int do_gameloop(const std::vector<std::string>& args)
}
events::initialise();
events::pump();
events::run_event_loop();
res = image::update_from_preferences();
if(res == false) {
@ -685,7 +685,7 @@ static int do_gameloop(const std::vector<std::string>& args)
return 1;
}
events::pump();
events::run_event_loop();
if(preferences::joystick_support_enabled()) {
res = game->init_joystick();
@ -698,7 +698,7 @@ static int do_gameloop(const std::vector<std::string>& args)
const cursor::manager cursor_manager;
cursor::set(cursor::WAIT);
events::pump();
events::run_event_loop();
#if(defined(_X11) && !defined(__APPLE__)) || defined(_WIN32)
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);