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/endgame.cpp

    r60 r106  
    179179
    180180  image blank(2,2); blank.clear();
    181   eh->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
     181  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    182182
    183183
     
    263263      eoff+=2; if (eoff>=320) eoff-=320;
    264264      coff+=1; if (coff>=320) coff-=320;     
    265       eh->flush_screen();
     265      wm->flush_screen();
    266266      i++;
    267267    }
     
    326326      }
    327327
    328       eh->flush_screen();
     328      wm->flush_screen();
    329329
    330330    }
     
    356356      eoff+=2; if (eoff>=320) eoff-=320;
    357357      coff+=1; if (coff>=320) coff-=320;     
    358       eh->flush_screen();
     358      wm->flush_screen();
    359359      i++;
    360360    }
    361361   
    362     if (eh->event_waiting())
    363       eh->get_event(ev);
     362    if (wm->event_waiting())
     363      wm->get_event(ev);
    364364
    365365  } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON);
     
    387387             256,paddr,
    388388             p,cash.img(mask)->height(),eoff,coff);     
    389     text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),eh->font(),cmap,eh->bright_color());
    390     eh->flush_screen();
     389    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
     390    wm->flush_screen();
    391391    time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time();
    392392
    393     while (eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);
     393    while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev);
    394394  }
    395395
     
    412412
    413413
    414   eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
     414  wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
    415415  the_game->set_state(MENU_STATE);
    416416}
     
    422422  fade_out(16);
    423423  image blank(2,2); blank.clear();
    424   eh->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
     424  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    425425  screen->clear();
    426426
     
    453453                           lstring_value(to_be));
    454454
    455     text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(mid_plot),eh->font(),cmap,eh->bright_color());
    456     eh->flush_screen();
     455    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(mid_plot),wm->font(),cmap,wm->bright_color());
     456    wm->flush_screen();
    457457    time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time();
    458     while (eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);
     458    while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev);
    459459  }
    460460
     
    463463    do
    464464    {
    465       eh->flush_screen();
    466       eh->get_event(ev);   
     465      wm->flush_screen();
     466      wm->get_event(ev);   
    467467    } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON);
    468468  }
    469469
    470470  fade_out(16);
    471   eh->set_mouse_shape(blank.copy(),0,0);      // don't show mouse 
     471  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse 
    472472  show_sell(1);
    473   eh->push_event(new event(ID_SHOW_SELL,NULL));
     473  wm->push_event(new event(ID_SHOW_SELL,NULL));
    474474}
    475475
     
    479479  fade_out(16);
    480480  image blank(2,2); blank.clear();
    481   eh->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
     481  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    482482  screen->clear();
    483483
     
    503503    im->put_image(screen,dx,dy);
    504504
    505     text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),eh->font(),cmap,eh->bright_color());
    506     eh->flush_screen();
     505    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
     506    wm->flush_screen();
    507507    time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time();
    508     while (eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);
     508    while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev);
    509509  }
    510510
     
    513513    do
    514514    {
    515       eh->flush_screen();
    516       eh->get_event(ev);   
     515      wm->flush_screen();
     516      wm->get_event(ev);   
    517517    } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON);
    518518  }
     
    526526  show_sell(1);
    527527
    528   eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
     528  wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
    529529  the_game->set_state(MENU_STATE);
    530530}
Note: See TracChangeset for help on using the changeset viewer.