The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pump.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * Handles the current state of WML-events. This includes raising and firing,
18  * as well as tracking the context for event firing.
19  */
20 
21 #include "global.hpp"
22 #include "pump.hpp"
23 #include "conditional_wml.hpp"
24 #include "handlers.hpp"
25 #include "manager.hpp"
26 
27 #include "display_chat_manager.hpp"
28 #include "game_config.hpp"
29 #include "game_display.hpp"
30 #include "game_data.hpp"
31 #include "gettext.hpp"
32 #include "log.hpp"
33 #include "play_controller.hpp"
35 #include "side_filter.hpp"
36 #include "units/unit.hpp"
37 #include "units/map.hpp"
38 #include "whiteboard/manager.hpp"
39 #include "variable.hpp"
40 #include "resources.hpp"
41 
42 #include <iomanip>
43 #include <iostream>
44 
45 
46 static lg::log_domain log_engine("engine");
47 #define DBG_NG LOG_STREAM(debug, log_engine)
48 #define LOG_NG LOG_STREAM(info, log_engine)
49 #define ERR_NG LOG_STREAM(err, log_engine)
50 
51 static lg::log_domain log_wml("wml");
52 #define DBG_WML LOG_STREAM(debug, log_wml)
53 #define LOG_WML LOG_STREAM(info, log_wml)
54 #define WRN_WML LOG_STREAM(warn, log_wml)
55 #define ERR_WML LOG_STREAM(err, log_wml)
56 
57 static lg::log_domain log_event_handler("event_handler");
58 #define DBG_EH LOG_STREAM(debug, log_event_handler)
59 
60 // std::getline might be broken in Visual Studio so show a warning
61 #ifdef _MSC_VER
62 #if _MSC_VER < 1300
63 #ifndef GETLINE_PATCHED
64 #pragma message("warning: the std::getline implementation in your compiler might be broken.")
65 #pragma message(" http://support.microsoft.com/default.aspx?scid=kb;EN-US;q240015")
66 #endif
67 #endif
68 #endif
69 
70 
71 // This file is in the game_events namespace.
72 namespace game_events {
73 
74 namespace context {
75  /// State when processing a particular flight of events or commands.
76  struct state {
77  bool mutated;
79 
80  explicit state(bool s, bool m = true) : mutated(m), skip_messages(s) {}
81  };
82 
83  class scoped {
84  public:
85  scoped(std::stack<context::state> & contexts, bool m = true);
86  ~scoped();
87  private:
88  std::stack<context::state> & contexts_;
89  };
90 }
91 
92 struct pump_impl {
93  std::vector<queued_event> events_queue;
94 
95  /// The value returned by wml_tracking();
97 
98  std::stringstream wml_messages_stream;
99 
100  std::stack<context::state> contexts_;
101 
102  unsigned instance_count;
103 
105 
107  : events_queue()
108  , internal_wml_tracking(0)
109  , wml_messages_stream()
110  , contexts_()
111  , instance_count(0)
112  , my_manager(&man)
113  {
114  contexts_.push(context::state(false));
115  }
116 };
117 
118 namespace { // Types
119  class pump_manager {
120  public:
121  pump_manager(pump_impl & );
122  ~pump_manager();
123 
124  /// Allows iteration through the queued events.
125  queued_event & next() { return queue_[pumped_count_++]; }
126  /// Indicates the iteration is over.
127  bool done() const { return pumped_count_ >= queue_.size(); }
128 
129  unsigned count() {
130  return impl_.instance_count;
131  }
132 
133  private:
134  pump_impl & impl_;
135  int x1_, x2_, y1_, y2_;
136  /// Tracks the events to process.
137  /// This isolates these events from any events that might be generated
138  /// during the processing.
139  std::vector<queued_event> queue_;
140  /// Tracks how many events have been processed.
142  };
143 } // end anonymous namespace (types)
144 
145 namespace { // Support functions
146 
147  pump_manager::pump_manager(pump_impl & impl) :
148  impl_(impl),
149  x1_(resources::gamedata->get_variable("x1")),
150  x2_(resources::gamedata->get_variable("x2")),
151  y1_(resources::gamedata->get_variable("y1")),
152  y2_(resources::gamedata->get_variable("y2")),
153  queue_(), // Filled later with a swap().
154  pumped_count_(0)
155  {
156  queue_.swap(impl_.events_queue);
158  }
159 
160  pump_manager::~pump_manager() {
162 
163  // Not sure what the correct thing to do is here. In princple,
164  // discarding all events (i.e. clearing events_queue) seems like
165  // the right thing to do in the face of an exception. However, the
166  // previous functionality preserved the queue, so for now we will
167  // restore it.
168  if ( !done() ) {
169  // The remainig events get inserted at the beginning of events_queue.
170  std::vector<queued_event> temp;
171  impl_.events_queue.swap(temp);
172  impl_.events_queue.insert(impl_.events_queue.end(), queue_.begin() + pumped_count_, queue_.end());
173  impl_.events_queue.insert(impl_.events_queue.end(), temp.begin(), temp.end());
174  }
175 
176  // Restore the old values of the game variables.
181  }
182 }
183 
184  /**
185  * Returns true iff the given event passes all its filters.
186  */
188  {
190  unit_map::const_iterator unit1 = units->find(ev.loc1);
191  unit_map::const_iterator unit2 = units->find(ev.loc2);
192  vconfig filters(handler.get_config());
193 
194  for (const vconfig &condition : filters.get_children("filter_condition"))
195  {
197  return false;
198  }
199  }
200 
201  for (const vconfig &f : filters.get_children("filter_side"))
202  {
203  side_filter ssf(f, &resources::controller->gamestate());
205  return false;
206  }
207 
208  for (const vconfig &f : filters.get_children("filter"))
209  {
210  if ( !ev.loc1.matches_unit_filter(unit1, f) ) {
211  return false;
212  }
213  }
214 
215  vconfig::child_list special_filters = filters.get_children("filter_attack");
216  bool special_matches = special_filters.empty();
217  if ( !special_matches && unit1 != units->end() )
218  {
219  const bool matches_unit = ev.loc1.matches_unit(unit1);
220  const config & attack = ev.data.child("first");
221  for (const vconfig &f : special_filters)
222  {
223  if ( f.empty() )
224  special_matches = true;
225  else if ( !matches_unit )
226  return false;
227 
228  special_matches = special_matches ||
229  matches_special_filter(attack, f);
230  }
231  }
232  if(!special_matches) {
233  return false;
234  }
235 
236  for (const vconfig &f : filters.get_children("filter_second"))
237  {
238  if ( !ev.loc2.matches_unit_filter(unit2, f) ) {
239  return false;
240  }
241  }
242 
243  special_filters = filters.get_children("filter_second_attack");
244  special_matches = special_filters.empty();
245  if ( !special_matches && unit2 != units->end() )
246  {
247  const bool matches_unit = ev.loc2.matches_unit(unit2);
248  const config & attack = ev.data.child("second");
249  for (const vconfig &f : special_filters)
250  {
251  if ( f.empty() )
252  special_matches = true;
253  else if ( !matches_unit )
254  return false;
255 
256  special_matches = special_matches ||
257  matches_special_filter(attack, f);
258  }
259  }
260  if(!special_matches) {
261  return false;
262  }
263 
264  // All filters passed.
265  return true;
266  }
267 
268  /**
269  * Processes an event through a single event handler.
270  * This includes checking event filters, but not checking that the event
271  * name matches.
272  *
273  * @param[in,out] handler_p The handler to offer the event to.
274  * This may be reset during processing.
275  * @param[in] ev The event information.
276  *
277  * @returns true if the game state changed.
278  */
279  bool t_pump::process_event(handler_ptr& handler_p, const queued_event& ev)
280  {
281  // We currently never pass a null pointer to this function, but to
282  // guard against future modifications:
283  if ( !handler_p )
284  return false;
285 
287  scoped_xy_unit first_unit("unit", ev.loc1.x, ev.loc1.y, *units);
288  scoped_xy_unit second_unit("second_unit", ev.loc2.x, ev.loc2.y, *units);
289  scoped_weapon_info first_weapon("weapon", ev.data.child("first"));
290  scoped_weapon_info second_weapon("second_weapon", ev.data.child("second"));
291 
292  if ( !filter_event(*handler_p, ev) )
293  return false;
294 
295  // The event hasn't been filtered out, so execute the handler.
296  ++impl_->internal_wml_tracking;
297  context::scoped evc(impl_->contexts_);
298  assert(resources::lua_kernel != nullptr);
299  handler_p->handle_event(ev, handler_p, *resources::lua_kernel);
300  // NOTE: handler_p may be null at this point!
301 
302  if(ev.name == "select") {
304  }
305  if(resources::screen != nullptr) {
307  }
308  return context_mutated();
309  }
310 
311  /**
312  * Helper function for show_wml_messages(), which gathers
313  * the messages from a stringstream.
314  */
315  void t_pump::fill_wml_messages_map(std::map<std::string, int>& msg_map, std::stringstream& source)
316  {
317  while(true) {
319  std::getline(source, msg);
320 
321  if(source.eof()) {
322  break;
323  }
324 
325  if(msg == "") {
326  continue;
327  }
328 
329  if(msg_map.find(msg) == msg_map.end()) {
330  msg_map[msg] = 1;
331  } else {
332  msg_map[msg]++;
333  }
334  }
335  // Make sure the eof flag is cleared otherwise no new messages are shown
336  source.clear();
337  }
338 
339  /**
340  * Shows a summary of messages/errors generated so far by WML.
341  * Identical messages are shown once, with (between parentheses)
342  * the number of times that message was encountered.
343  * The order in which the messages are shown does not need
344  * to be the order in which these messages are encountered.
345  * Messages are also written to std::cerr if to_cerr is true.
346  */
347  void t_pump::show_wml_messages(std::stringstream& source, const std::string & caption,
348  bool to_cerr)
349  {
350  // Get all unique messages in messages,
351  // with the number of encounters for these messages
352  std::map<std::string, int> messages;
353  fill_wml_messages_map(messages, source);
354 
355  // Show the messages collected
356  for(std::map<std::string, int>::const_iterator itor = messages.begin();
357  itor != messages.end(); ++itor )
358  {
359  std::stringstream msg;
360  msg << itor->first;
361  if(itor->second > 1) {
362  msg << " (" << itor->second << ")";
363  }
364 
365  resources::screen->get_chat_manager().add_chat_message(time(nullptr), caption, 0, msg.str(),
367  if ( to_cerr )
368  std::cerr << caption << ": " << msg.str() << '\n';
369  }
370  }
371 
372  /**
373  * Shows a summary of the errors encountered in WML so far,
374  * to avoid a lot of the same messages to be shown.
375  * Identical messages are shown once, with (between parentheses)
376  * the number of times that message was encountered.
377  * The order in which the messages are shown does not need
378  * to be the order in which these messages are encountered.
379  * Messages are always written to std::cerr.
380  */
382  {
383  static const std::string caption("Invalid WML found");
384 
385  show_wml_messages(lg::wml_error(), caption, true);
386  }
387 
388  /**
389  * Shows a summary of the messages generated so far by WML.
390  * Identical messages are shown once, with (between parentheses)
391  * the number of times that message was encountered.
392  * The order in which the messages are shown does not need
393  * to be the order in which these messages are encountered.
394  */
396  {
397  static const std::string caption("WML");
398 
399  show_wml_messages(impl_->wml_messages_stream, caption, false);
400  }
401 
402  void t_pump::put_wml_message(lg::logger& logger, const std::string& prefix, const std::string& message, bool in_chat)
403  {
404  logger(log_wml) << message << std::endl;
405  if (in_chat)
406  {
407  impl_->wml_messages_stream << prefix << message << std::endl;
408  }
409  }
410 
411 
412 context::scoped::scoped(std::stack<context::state> & contexts, bool m)
413  : contexts_(contexts)
414 {
415  //The default context at least should always be on the stack
416  assert(contexts_.size() > 0);
417 
418  bool skip_messages = (contexts_.size() > 1) && contexts_.top().skip_messages;
419  contexts_.push(context::state(skip_messages, m));
420 }
421 
423 {
424  assert(contexts_.size() > 1);
425  bool mutated = contexts_.top().mutated;
426  contexts_.pop();
427  contexts_.top().mutated |= mutated;
428 }
429 
431 {
432  assert(impl_->contexts_.size() > 0);
433  return impl_->contexts_.top().mutated;
434 }
435 
437 {
438  assert(impl_->contexts_.size() > 0);
439  impl_->contexts_.top().mutated = b;
440 }
441 
443 {
444  assert(impl_->contexts_.size() > 0);
445  return impl_->contexts_.top().skip_messages;
446 }
447 
449 {
450  assert(impl_->contexts_.size() > 0);
451  impl_->contexts_.top().skip_messages = b;
452 }
453 
454 /**
455  * Helper function which determines whether a wml_message text can
456  * really be pushed into the wml_messages_stream, and does it.
457  */
458 void t_pump::put_wml_message(const std::string& logger, const std::string& message, bool in_chat)
459 {
460  if (logger == "err" || logger == "error") {
461  put_wml_message(lg::err(), _("Error: "), message, in_chat );
462  } else if (logger == "warn" || logger == "wrn" || logger == "warning") {
463  put_wml_message(lg::warn(), _("Warning: "), message, in_chat );
464  } else if ((logger == "debug" || logger == "dbg") && !lg::debug().dont_log(log_wml)) {
465  put_wml_message(lg::debug(), _("Debug: "), message, in_chat );
466  } else if (!lg::info().dont_log(log_wml)) {
467  put_wml_message(lg::info(), _("Info: "), message, in_chat );
468  }
469 }
470 
472  const entity_location& loc1,
473  const entity_location& loc2,
474  const config& data)
475 {
476  raise(event,loc1,loc2,data);
477  return (*this)();
478 }
479 
481  const entity_location& loc1,
482  const entity_location& loc2,
483  const config& data)
484 {
485  if(resources::screen == nullptr)
486  return;
487 
488  DBG_EH << "raising event: " << event << "\n";
489 
490  impl_->events_queue.push_back(queued_event(event, loc1, loc2, data));
491 }
492 
494 {
495  // Quick aborts:
496  if(resources::screen == nullptr)
497  return false;
498  assert(resources::lua_kernel != nullptr);
499  if ( impl_->events_queue.empty() ) {
500  DBG_EH << "Processing queued events, but none found.\n";
501  return false;
502  }
503  if(impl_->instance_count >= game_config::max_loop) {
504  ERR_NG << "game_events pump waiting to process new events because "
505  << "recursion level would exceed maximum: " << game_config::max_loop << '\n';
506  return false;
507  }
508  if(!lg::debug().dont_log("event_handler")) {
509  std::stringstream ss;
510  for(const queued_event& ev : impl_->events_queue) {
511  ss << "name=" << ev.name << "; ";
512  }
513  DBG_EH << "processing queued events: " << ss.str() << "\n";
514  }
515 
516  const size_t old_wml_track = impl_->internal_wml_tracking;
517  // Ensure the whiteboard doesn't attempt to build its future unit map
518  // while events are being processed.
519  wb::real_map real_unit_map;
520 
521  pump_manager pump_instance(*impl_);
522  context::scoped evc(impl_->contexts_, false);
523  // Loop through the events we need to process.
524  while ( !pump_instance.done() )
525  {
526  queued_event & ev = pump_instance.next();
527  const std::string& event_name = ev.name;
528 
529  // Clear the unit cache, since the best clearing time is hard to figure out
530  // due to status changes by WML. Every event will flush the cache.
532 
533  { // Block for context::scoped
534  context::scoped evc(impl_->contexts_, false);
535  if ( resources::lua_kernel->run_event(ev) ) {
536  ++impl_->internal_wml_tracking;
537  }
538  }
539  // Initialize an iteration over event handlers matching this event.
540  assert(impl_->my_manager);
541  manager::iteration handler_iter(event_name, *impl_->my_manager);
542 
543  // If there are any matching event handlers, initialize variables.
544  // Note: Initializing variables all the time would not be
545  // functionally wrong, merely inefficient. So we do not have
546  // to cache *handler_iter here.
547  if ( *handler_iter ) {
548  resources::gamedata->get_variable("x1") = ev.loc1.filter_x() + 1;
549  resources::gamedata->get_variable("y1") = ev.loc1.filter_y() + 1;
550  resources::gamedata->get_variable("x2") = ev.loc2.filter_x() + 1;
551  resources::gamedata->get_variable("y2") = ev.loc2.filter_y() + 1;
552  }
553 
554  // While there is a potential handler for this event name.
555  while ( handler_ptr cur_handler = *handler_iter ) {
556  DBG_EH << "processing event " << event_name << " with id="<<
557  cur_handler->get_config()["id"] << "\n";
558  // Let this handler process our event.
559  process_event(cur_handler, ev);
560  // NOTE: cur_handler may be null at this point!
561 
562  ++handler_iter;
563  }
564 
565  // Flush messages when finished iterating over event_handlers.
566  flush_messages();
567  }
568 
569  if ( old_wml_track != impl_->internal_wml_tracking )
570  // Notify the whiteboard of any event.
571  // This is used to track when moves, recruits, etc. happen.
572  resources::whiteboard->on_gamestate_change();
573 
574  return context_mutated();
575 }
576 
578 {
579  // Dialogs can only be shown if the display is not locked
580  if (resources::screen && !resources::screen->video().update_locked()) {
581  show_wml_errors();
582  show_wml_messages();
583  }
584 }
585 
586 
587 /**
588  * This function can be used to detect when no WML/Lua has been executed.
589  *
590  * If two calls to this function return the same value, then one can
591  * assume that the usual game mechanics have been followed, and code does
592  * not have to account for all the things WML/Lua can do. If the return
593  * values are different, then something unusual might have happened between
594  * those calls.
595  *
596  * This is not intended as a precise metric. Rather, it is motivated by
597  * how large the number of fired WML events is, compared to the (typical)
598  * number of WML event handlers. It is intended for code that can benefit
599  * from caching some aspect of the game state and that cannot rely on
600  * [allow_undo] not being used when that state changes.
601  */
603 {
604  return impl_->internal_wml_tracking;
605 }
606 
608  : impl_(new pump_impl(man))
609 {}
610 
612 
613 } // end namespace game_events
614 
bool context_skip_messages()
Returns whether or not we are skipping messages.
Definition: pump.cpp:442
play_controller * controller
Definition: resources.cpp:21
manager * my_manager
Definition: pump.cpp:104
int x2_
Definition: pump.cpp:135
static thandler * handler
Definition: handler.cpp:60
std::vector< queued_event > queue_
Tracks the events to process.
Definition: pump.cpp:139
unit_iterator end()
Definition: map.hpp:311
entity_location loc2
Definition: pump.hpp:56
State when processing a particular flight of events or commands.
Definition: pump.cpp:76
map_location last_selected
the last location where a select event fired.
Definition: game_data.hpp:85
#define ERR_NG
Definition: pump.cpp:49
bool dont_log(log_domain const &domain) const
Definition: log.hpp:122
bool match(const team &t) const
logger & info()
Definition: log.cpp:91
game_display * screen
Definition: resources.cpp:27
boost::scoped_ptr< pump_impl > impl_
Definition: pump.hpp:67
std::stringstream wml_messages_stream
Definition: pump.cpp:98
static std::map< std::string, tfilter > filters
The list of the available filters.
Definition: filter.cpp:77
t_pump(manager &)
Definition: pump.cpp:607
bool fire(const std::string &event, const entity_location &loc1=entity_location::null_entity, const entity_location &loc2=entity_location::null_entity, const config &data=config())
Function to fire an event.
Definition: pump.cpp:471
void show_wml_messages()
Shows a summary of the messages generated so far by WML.
Definition: pump.cpp:395
std::string name
Definition: pump.hpp:54
scoped(std::stack< context::state > &contexts, bool m=true)
Definition: pump.cpp:412
void flush_messages()
Flushes WML messages and errors.
Definition: pump.cpp:577
bool process_event(handler_ptr &handler_p, const queued_event &ev)
Processes an event through a single event handler.
Definition: pump.cpp:279
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1347
game_data * gamedata
Definition: resources.cpp:22
config::attribute_value & get_variable(const std::string &varname)
throws invalid_variablename_exception if varname is no valid variable name.
Definition: game_data.cpp:70
int x1_
Definition: pump.cpp:135
int y2_
Definition: pump.cpp:135
GLdouble GLdouble GLdouble b
Definition: glew.h:6966
static lg::log_domain log_engine("engine")
static void clear_status_caches()
Clear the unit status cache for all units.
Definition: unit.cpp:610
static UNUSEDNOWARN std::string _(const char *str)
Definition: gettext.hpp:82
int current_side() const
Returns the number of the side whose turn it is.
bool operator()()
Definition: pump.cpp:493
pump_impl(manager &man)
Definition: pump.cpp:106
void fill_wml_messages_map(std::map< std::string, int > &msg_map, std::stringstream &source)
Helper function for show_wml_messages(), which gathers the messages from a stringstream.
Definition: pump.cpp:315
size_t wml_tracking()
This function can be used to detect when no WML/Lua has been executed.
Definition: pump.cpp:602
const size_t max_loop
The maximum number of hexes on a map and items in an array and also used as maximum in wml loops...
bool matches_unit_filter(const unit_map::const_iterator &un_it, const vconfig &filter) const
Determines if un_it matches filter.
std::vector< queued_event > events_queue
Definition: pump.cpp:93
logger & debug()
Definition: log.cpp:97
static lg::log_domain log_event_handler("event_handler")
const config & get_config() const
Definition: handlers.hpp:69
GLuint GLuint GLsizei count
Definition: glew.h:1221
Domain specific events.
Definition: action_wml.cpp:93
int y1_
Definition: pump.cpp:135
state(bool s, bool m=true)
Definition: pump.cpp:80
Define conditionals for the game's events mechanism, a.k.a.
bool filter_event(const event_handler &handler, const queued_event &ev)
Returns true iff the given event passes all its filters.
Definition: pump.cpp:187
std::map< std::string, tfilter >::iterator itor
Definition: filter.cpp:199
std::stringstream & wml_error()
Use this logger to send errors due to deprecated WML.
Definition: log.cpp:262
logger & err()
Definition: log.cpp:79
bool matches_special_filter(const config &cfg, const vconfig &filter)
pump_impl & impl_
Definition: pump.cpp:134
Define the game's event mechanism.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Definition: debugger.cpp:112
#define DBG_EH
Definition: pump.cpp:58
void raise(const std::string &event, const entity_location &loc1=entity_location::null_entity, const entity_location &loc2=entity_location::null_entity, const config &data=config())
Definition: pump.cpp:480
The game event manager loads the scenario configuration object, and ensures that events are handled a...
Definition: manager.hpp:47
bool context_mutated()
Context: The general environment within which events are processed.
Definition: pump.cpp:430
This class is similar to an input iterator through event handlers, except each instance knows its own...
Definition: manager.hpp:60
static lg::log_domain log_wml("wml")
entity_location loc1
Definition: pump.hpp:55
#define next(ls)
Definition: llex.cpp:27
display_chat_manager & get_chat_manager()
bool conditional_passed(const vconfig &cond)
bool matches_unit(const unit_map::const_iterator &un_it) const
Determines if un_it matches (using underlying ID) the unit that was supplied when this was constructe...
void show_wml_errors()
Shows a summary of the errors encountered in WML so far, to avoid a lot of the same messages to be sh...
Definition: pump.cpp:381
Define the handlers for the game's events mechanism.
logger & warn()
Definition: log.cpp:85
const GLdouble * m
Definition: glew.h:6968
unsigned instance_count
Definition: pump.cpp:102
cl_event event
Definition: glew.h:3070
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
Definition: config.cpp:658
A variable-expanding proxy for the config class.
Definition: variable.hpp:36
Standard logging facilities (interface).
GLenum condition
Definition: glew.h:9969
game_lua_kernel * lua_kernel
Definition: resources.cpp:25
Container associating units to locations.
Definition: map.hpp:90
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
boost::shared_ptr< wb::manager > whiteboard
Definition: resources.cpp:36
std::stack< context::state > contexts_
Definition: pump.cpp:100
std::stack< context::state > & contexts_
Definition: pump.cpp:88
unit_iterator find(size_t id)
Definition: map.cpp:285
std::vector< vconfig > child_list
Definition: variable.hpp:71
size_t internal_wml_tracking
The value returned by wml_tracking();.
Definition: pump.cpp:96
Ensures that the real unit map is active for the duration of the struct's life.
Definition: manager.hpp:279
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
void add_chat_message(const time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell)
GLdouble s
Definition: glew.h:1358
void put_wml_message(const std::string &logger, const std::string &message, bool in_chat)
Helper function which determines whether a wml_message text can really be pushed into the wml_message...
Definition: pump.cpp:458
GLsizei const GLcharARB ** string
Definition: glew.h:4503
GLsizei GLsizei GLchar * source
Definition: glew.h:1800
unit_map * units
Definition: resources.cpp:35
size_t pumped_count_
Tracks how many events have been processed.
Definition: pump.cpp:141
bool maybe_rebuild()
Rebuilds the screen if needs_rebuild(true) was previously called, and resets the flag.
GLclampf f
Definition: glew.h:3024