Ignore:
Timestamp:
Mar 15, 2008, 12:55:44 AM (11 years ago)
Author:
Sam Hocevar
Message:
  • Rename the "eh" variable to "wm" because it's a window manager, not an event handler.
  • No longer pass the window manager to functions, there's only one.

Inspired by Win32 Abuse changelog for January 28, 2001:

  • Starting work on singleton code; will get rid of all

references to an arbitrary window_manager* because
there's only going to be one, and it's not ever
going to change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/net/gserver.cpp

    r61 r106  
    2929#include "input.hpp"
    3030#include "dev.hpp"
     31#include "game.hpp"
    3132
    3233extern base_memory_struct *base;
     
    3536extern net_protocol *prot;
    3637extern join_struct *join_array;
    37 extern window_manager *eh;
    3838extern void service_net_request();
    3939
     
    6666    if (last_count!=total_players())
    6767    {
    68       if (stat) eh->close_window(stat);
     68      if (stat) wm->close_window(stat);
    6969      char msg[100];
    7070      sprintf(msg,symbol_str("min_wait"),main_net_cfg->min_players-total_players());
    71       stat=eh->new_window(100,50,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,msg,
    72                                        new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+eh->font()->height()*2,
     71      stat=wm->new_window(100,50,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,msg,
     72                                       new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+wm->font()->height()*2,
    7373                                                  ID_CANCEL,symbol_str("cancel_button"),NULL)  ));
    74       eh->flush_screen();
     74      wm->flush_screen();
    7575      last_count=total_players();
    7676    }
    7777
    78     if (eh->event_waiting())
    79     {
    80       do { eh->get_event(ev); }  while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());
    81       eh->flush_screen();
     78    if (wm->event_waiting())
     79    {
     80      do { wm->get_event(ev); }  while (ev.type==EV_MOUSE_MOVE && wm->event_waiting());
     81      wm->flush_screen();
    8282      if (ev.type==EV_MESSAGE && ev.message.id==ID_CANCEL)
    8383        abort=1;
     
    8888  if (stat)
    8989  {
    90     eh->close_window(stat);
    91     eh->flush_screen(); 
     90    wm->close_window(stat);
     91    wm->flush_screen(); 
    9292  }
    9393}
Note: See TracChangeset for help on using the changeset viewer.