Changeset 643


Ignore:
Timestamp:
May 13, 2011, 9:13:53 AM (9 years ago)
Author:
Sam Hocevar
Message:

imlib: refactor Event and EventHandler?.

Location:
abuse/trunk/src
Files:
1 added
58 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/ant.cpp

    r577 r643  
    449449    fade_out(8);
    450450    wm->set_mouse_position(0,0);
    451     screen->clear();
     451    main_screen->clear();
    452452    image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1));
    453     im->put_image(screen,0,0);
    454 
    455 
    456     int x1=im->Size().x+1,y1=0,x2=xres,y2=screen->Size().y;
     453    im->put_image(main_screen,0,0);
     454
     455
     456    int x1=im->Size().x+1,y1=0,x2=xres,y2=main_screen->Size().y;
    457457    fade_in(NULL,16);
    458458
     
    475475    int w=wm->font()->width()*strlen(msg),h=wm->font()->height();
    476476    int x=(x1+x2)/2-w/2,y=(y1+y2)/2-h/2;
    477     screen->bar(x-10,y-10,x+w+10,y+h+10,wm->bright_color());
    478     screen->bar(x-9,y-9,x+w+9,y+h+9,wm->medium_color());
    479 
    480     wm->font()->put_string(screen,x+1,y+1,msg,wm->dark_color());
    481     wm->font()->put_string(screen,x,y,msg,wm->bright_color());
     477    main_screen->bar(x-10,y-10,x+w+10,y+h+10,wm->bright_color());
     478    main_screen->bar(x-9,y-9,x+w+9,y+h+9,wm->medium_color());
     479
     480    wm->font()->put_string(main_screen,x+1,y+1,msg,wm->dark_color());
     481    wm->font()->put_string(main_screen,x,y,msg,wm->bright_color());
    482482    wm->flush_screen();
    483483    Timer now; now.WaitMs(500);
  • abuse/trunk/src/automap.cpp

    r555 r643  
    188188}
    189189
    190 void automap::handle_event(event &ev)
     190void automap::handle_event(Event &ev)
    191191{
    192192
  • abuse/trunk/src/automap.h

    r555 r643  
    2424  automap(level *l, int width, int height);
    2525  void toggle_window();
    26   void handle_event(event &ev);
     26  void handle_event(Event &ev);
    2727  void draw();
    2828  ~automap() { if (automap_window) toggle_window(); }
  • abuse/trunk/src/chars.cpp

    r642 r643  
    170170    if (t->tiv <= number || !t->vars[number])
    171171    {
    172         lbreak("access : variable does not exsist for this class\n");
     172        lbreak("access : variable does not exists for this class\n");
    173173        return 0;
    174174    }
     
    181181  if (t->tiv<=number || !t->vars[number])
    182182  {
    183     lbreak("set : variable does not exsist for this class\n");
     183    lbreak("set : variable does not exists for this class\n");
    184184    return;
    185185  }
     
    192192  if (t->tiv<=number || !t->vars[number])
    193193  {
    194     lbreak("access : variable does not exsist for this class\n");
     194    lbreak("access : variable does not exists for this class\n");
    195195    return;
    196196  }
  • abuse/trunk/src/chat.h

    r555 r643  
    1818
    1919  public :
    20   int chat_event(event &ev) { if (!con_win) return 0; else return con_win==ev.window; }
     20  int chat_event(Event &ev) { if (!con_win) return 0; else return con_win==ev.window; }
    2121  void draw_user(char *st);
    2222  void put_all(char *st);
  • abuse/trunk/src/clisp.cpp

    r642 r643  
    12001200
    12011201    case 50 : dev_cont->add_palette(args); break;
    1202     case 51 : write_PCX(screen,pal,lstring_value(CAR(args))); break;
     1202    case 51 : write_PCX(main_screen,pal,lstring_value(CAR(args))); break;
    12031203
    12041204    case 52 : the_game->zoom=lnumber_value(CAR(args)); the_game->draw(); break;
     
    12161216    case 59 : return menu(args,big_font); break;
    12171217    case 60 :
    1218     { event ev; dev_cont->do_command(lstring_value(CAR(args)),ev); return 1; } break;
     1218    { Event ev; dev_cont->do_command(lstring_value(CAR(args)),ev); return 1; } break;
    12191219    case 61 : the_game->set_state(lnumber_value(CAR(args))); break;
    12201220
     
    12941294      the_game->game_to_mouse(x1,y1,current_view,cx1,cy1);
    12951295      the_game->game_to_mouse(x2,y2,current_view,cx2,cy2);
    1296       screen->line(cx1,cy1,cx2,cy2,c);
     1296      main_screen->line(cx1,cy1,cx2,cy2,c);
    12971297      return 1;
    12981298    } break;
     
    18441844      int32_t y1=lnumber_value(CAR(args)); args=lcdr(args);
    18451845      int32_t id=lnumber_value(CAR(args));
    1846       cache.img(id)->put_image(screen,x1,y1,1);
     1846      cache.img(id)->put_image(main_screen,x1,y1,1);
    18471847    } break;
    18481848    case 217 :
     
    20442044      int32_t cy2=lnumber_value(CAR(args)); args=lcdr(args);
    20452045      int32_t c1=lnumber_value(CAR(args)); args=lcdr(args);
    2046       screen->bar(cx1,cy1,cx2,cy2,c1);
     2046      main_screen->bar(cx1,cy1,cx2,cy2,c1);
    20472047    } break;
    20482048    case 248 :
     
    21832183      int y=lnumber_value(CAR(args));
    21842184      c_target=id;
    2185       if (screen)
     2185      if (main_screen)
    21862186        wm->set_mouse_shape(cache.img(c_target)->copy(),x,y);
    21872187    } break;
     
    22042204      if (args)
    22052205        color=lnumber_value(CAR(args));
    2206       fnt->put_string(screen,x,y,st,color);
     2206      fnt->put_string(main_screen,x,y,st,color);
    22072207    } break;
    22082208    case 278 : return ((JCFont *)lpointer_value(CAR(args)))->width(); break;
     
    22222222      int32_t y2=lnumber_value(CAR(args));   args=CDR(args);
    22232223      int32_t c=lnumber_value(CAR(args));
    2224       screen->bar(x1,y1,x2,y2,c);
     2224      main_screen->bar(x1,y1,x2,y2,c);
    22252225    } break;
    22262226    case 283 :
     
    22312231      int32_t y2=lnumber_value(CAR(args));   args=CDR(args);
    22322232      int32_t c=lnumber_value(CAR(args));
    2233       screen->rectangle(x1,y1,x2,y2,c);
     2233      main_screen->rectangle(x1,y1,x2,y2,c);
    22342234    } break;
    22352235    case 284 :
  • abuse/trunk/src/console.cpp

    r555 r643  
    195195}
    196196
    197 int shell_term::handle_event(event &ev)
     197int shell_term::handle_event(Event &ev)
    198198{
    199199  if (ev.window==con_win && con_win)
  • abuse/trunk/src/console.h

    r555 r643  
    4848  shell_term(JCFont *font, int width, int height, char const *Name);
    4949  virtual ~shell_term() { };
    50   int handle_event(event &ev);
     50  int handle_event(Event &ev);
    5151  virtual void prompt();
    5252  virtual void execute(char const *st);
  • abuse/trunk/src/cop.cpp

    r577 r643  
    829829    player_draw(just_fired,o->get_tint());
    830830    if (o->controller() && o->controller()->local_player())
    831       cache.img(S_health_image)->put_image(screen,o->controller()->cx2-20,
     831      cache.img(S_health_image)->put_image(main_screen,o->controller()->cx2-20,
    832832                        o->controller()->cy1+5,1);
    833833      } break;
     
    850850    o->state=(character_state)old_state;
    851851    if (o->controller() && o->controller()->local_player())
    852       cache.img(S_fast_image)->put_image(screen,o->controller()->cx2-20,
     852      cache.img(S_fast_image)->put_image(main_screen,o->controller()->cx2-20,
    853853                        o->controller()->cy1+5,1);
    854854      } break;
     
    871871
    872872    if (o->controller() && o->controller()->local_player())
    873       cache.img(S_fly_image)->put_image(screen,o->controller()->cx2-20,
     873      cache.img(S_fly_image)->put_image(main_screen,o->controller()->cx2-20,
    874874                        o->controller()->cy1+5,1);
    875875      } break;
     
    884884
    885885    if (o->controller() && o->controller()->local_player())
    886       cache.img(S_sneaky_image)->put_image(screen,o->controller()->cx2-20,
     886      cache.img(S_sneaky_image)->put_image(main_screen,o->controller()->cx2-20,
    887887                        o->controller()->cy1+5,1);
    888888      } break;
     
    10311031        strcat(msg," <<");
    10321032
    1033       fnt->put_string(screen,x,y,msg,color);
     1033      fnt->put_string(main_screen,x,y,msg,color);
    10341034      y+=fnt->height();
    10351035    }
     
    10461046  fade_out(8);
    10471047  wm->set_mouse_position(0,0);
    1048   screen->clear();
     1048  main_screen->clear();
    10491049  image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1));
    1050   im->put_image(screen,0,0);
    1051   int x1=im->Size().x+1,y1=0,y2=screen->Size().y;
     1050  im->put_image(main_screen,0,0);
     1051  int x1=im->Size().x+1,y1=0,y2=main_screen->Size().y;
    10521052  JCFont *fnt=wm->font();
    10531053
     
    10571057  int y=(y1+y2)/2-(tp+2)*fnt->height()/2,x=x1+10;
    10581058  char const *header_str = symbol_str("score_header");
    1059   fnt->put_string(screen,x,y,header_str,wm->bright_color());
     1059  fnt->put_string(main_screen,x,y,header_str,wm->bright_color());
    10601060  y+=fnt->height();
    10611061
    1062   screen->widget_bar(x,y+2,x+strlen(header_str)*fnt->width(),y+fnt->height()-3,
     1062  main_screen->widget_bar(x,y+2,x+strlen(header_str)*fnt->width(),y+fnt->height()-3,
    10631063             wm->bright_color(),wm->medium_color(),wm->dark_color());
    10641064  y+=fnt->height();
     
    10751075
    10761076    sprintf(msg,"%-17s %3ld  %3ld",max_name,(long)v->kills,(long)(v->tkills+v->kills));
    1077     fnt->put_string(screen,x,y,msg,color);
     1077    fnt->put_string(main_screen,x,y,msg,color);
    10781078
    10791079    y+=fnt->height();
  • abuse/trunk/src/demo.cpp

    r577 r643  
    3838extern void fade_out(int steps);
    3939
    40 void get_event(event &ev)
     40void get_event(Event &ev)
    4141{ wm->get_event(ev);
    4242  switch (ev.type)
     
    168168  while (*c) { if (*c=='\\') *c='/'; c++; }
    169169
    170   bFILE *probe=open_file(tname,"rb");   // see if the level still exsist?
     170  bFILE *probe=open_file(tname,"rb");   // see if the level still exists?
    171171  if (probe->open_failure()) { delete record_file; delete probe; return 0; }
    172172  delete probe;
     
    209209      l_difficulty = initial_difficulty;
    210210      the_game->set_state(MENU_STATE);
    211       wm->push_event(new event(ID_NULL,NULL));
     211      wm->Push(new Event(ID_NULL,NULL));
    212212
    213213      view *v=player_list;
  • abuse/trunk/src/demo.h

    r555 r643  
    4040extern demo_manager demo_man;
    4141
    42 extern void get_event(event &ev);
     42extern void get_event(Event &ev);
    4343extern int event_waiting();
    4444
  • abuse/trunk/src/dev.cpp

    r635 r643  
    181181        wm->flush_screen();
    182182
    183         event ev;
     183        Event ev;
    184184        wm->get_event(ev);
    185185        if(ev.type == EV_MESSAGE && ev.message.id == ID_QUIT_OK)
     
    257257  {
    258258    char *name=search_window->read(ID_SEARCH_TEXT);
    259     int type=-1;    // see if this type exsists
     259    int type=-1;    // see if this type existss
    260260    int i;
    261261    for (i=0; i<total_objects; i++)
     
    265265    {
    266266      char msg[60];
    267       sprintf(msg,"Object type '%s' does not exsists!\n",name);
     267      sprintf(msg,"Object type '%s' does not existss!\n",name);
    268268      the_game->show_help(msg);
    269269      the_game->need_refresh();
     
    295295      else
    296296      {
    297     the_game->show_help("No object matching name exsist in level\n");
     297    the_game->show_help("No object matching name exists in level\n");
    298298
    299299      }
     
    339339  } else
    340340  {
    341     event ev;
     341    Event ev;
    342342    dv->do_command(st,ev);
    343343  }
     
    482482    {
    483483      image *im=cache.img(light_buttons[f->type]);
    484       im->put_image(screen,f->x-vx+v->cx1-im->Size().x/2,f->y-vy+v->cy1-im->Size().y/2,1);
    485       screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1,
     484      im->put_image(main_screen,f->x-vx+v->cx1-im->Size().x/2,f->y-vy+v->cy1-im->Size().y/2,1);
     485      main_screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1,
    486486                wm->medium_color());
    487487    }
     
    493493      int32_t rx1,ry1;
    494494      the_game->game_to_mouse(link_object->x,link_object->y,v,rx1,ry1);
    495       screen->line(rx1,ry1,dlastx,dlasty,yellow);
     495      main_screen->line(rx1,ry1,dlastx,dlasty,yellow);
    496496    }
    497497
     
    502502      int32_t rx1,ry1;
    503503      the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1);
    504       screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h,wm->bright_color());
     504      main_screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h,wm->bright_color());
    505505    }
    506506
     
    511511    the_game->game_to_mouse(o->x,o->y,current_view,x1,y1);
    512512    char *nm=object_names[o->otype];
    513     console_font->put_string(screen,x1-strlen(nm)*console_font->width()/2,y1+2,nm);
     513    console_font->put_string(main_screen,x1-strlen(nm)*console_font->width()/2,y1+2,nm);
    514514      }
    515515
     
    526526      game_object *other=o->get_object(i);
    527527      the_game->game_to_mouse(other->x,other->y,current_view,x2,y2);
    528       screen->line(x1,y1,x2,y2,wm->bright_color());
     528      main_screen->line(x1,y1,x2,y2,wm->bright_color());
    529529    }
    530530
     
    533533      light_source *l=o->get_light(i);
    534534      the_game->game_to_mouse(l->x,l->y,current_view,x2,y2);
    535       screen->line(x1,y1,x2,y2,light_connection_color);
     535      main_screen->line(x1,y1,x2,y2,light_connection_color);
    536536    }
    537537
     
    545545      the_game->game_to_mouse(x1,y1,v,rx1,ry1);
    546546      the_game->game_to_mouse(x2,y2,v,rx2,ry2);
    547       screen->rectangle(rx1,ry1,rx2,ry2,wm->bright_color());
     547      main_screen->rectangle(rx1,ry1,rx2,ry2,wm->bright_color());
    548548
    549549      the_game->game_to_mouse(selected_object->x,selected_object->y,current_view,x1,y1);
     
    552552    game_object *other=selected_object->get_object(i);
    553553    the_game->game_to_mouse(other->x,other->y,current_view,x2,y2);
    554     screen->line(x1,y1,x2,y2,light_connection_color);
     554    main_screen->line(x1,y1,x2,y2,light_connection_color);
    555555      }
    556556    }
     
    976976}
    977977
    978 void dev_controll::do_command(char const *command, event &ev)
     978void dev_controll::do_command(char const *command, Event &ev)
    979979{
    980980  char fword[50];
     
    10361036      current_level->unactivate_all();
    10371037
    1038       if (screen)  // don't draw if graphics haven't been setup yet.
     1038      if (main_screen)  // don't draw if graphics haven't been setup yet.
    10391039        the_game->draw();
    10401040      player_list->reset_player();
     
    15161516
    15171517
    1518 void dev_controll::area_handle_input(event &ev)
     1518void dev_controll::area_handle_input(Event &ev)
    15191519{
    15201520
     
    15541554}
    15551555
    1556 void dev_controll::pick_handle_input(event &ev)
     1556void dev_controll::pick_handle_input(Event &ev)
    15571557{
    15581558  area_controller *find=NULL;
     
    16271627int sshot_fcount=-1;
    16281628
    1629 void dev_controll::handle_event(event &ev)
     1629void dev_controll::handle_event(Event &ev)
    16301630{
    16311631  int32_t x,y;
     
    16371637  }
    16381638
    1639   if (dev_menu && dev_menu->handle_event(ev,screen)) return ;
     1639  if (dev_menu && dev_menu->handle_event(ev,main_screen)) return ;
    16401640
    16411641  if (!current_level) return ;
     
    16521652
    16531653  if (ev.type==EV_KEY && ev.key==JK_F2)
    1654     write_PCX(screen,pal,"scrnshot.pcx");
     1654    write_PCX(main_screen,pal,"scrnshot.pcx");
    16551655  else if (ev.type==EV_KEY && ev.key==JK_F3)
    16561656  {
    16571657    char name[100];
    16581658    sprintf(name,"shot%04d.pcx",screen_shot_on++);
    1659     write_PCX(screen,pal,name);
     1659    write_PCX(main_screen,pal,name);
    16601660  } else if (ev.type==EV_KEY && ev.key==JK_F5)
    16611661  {
     
    20492049      sprintf(cmd,"load %s",mess_win->read(ID_MESS_STR1));
    20502050      dev_cont->do_command(cmd,ev);
    2051       wm->push_event(new event(ID_CANCEL,NULL));        // close window
     2051      wm->Push(new Event(ID_CANCEL,NULL));        // close window
    20522052    } break;
    20532053    case ID_GAME_SAVE :
     
    20862086      {
    20872087        current_level->set_name(mess_win->read(ID_MESS_STR1));
    2088         wm->push_event(new event(ID_CANCEL,NULL));        // close window after save
    2089         wm->push_event(new event(ID_LEVEL_SAVE,NULL));
     2088        wm->Push(new Event(ID_CANCEL,NULL));        // close window after save
     2089        wm->Push(new Event(ID_LEVEL_SAVE,NULL));
    20902090      }
    20912091    } break;
     
    21272127    case ID_LEVEL_NEW_OK :
    21282128    {
    2129       wm->push_event(new event(ID_CANCEL,NULL));  // close_window
     2129      wm->Push(new Event(ID_CANCEL,NULL));  // close_window
    21302130      if (current_level)
    21312131        delete current_level;
     
    21532153                    atoi(mess_win->read(ID_MESS_STR2)));
    21542154      } else the_game->show_help("Create a level first!");
    2155       wm->push_event(new event(ID_CANCEL,NULL));  // close_window
     2155      wm->Push(new Event(ID_CANCEL,NULL));  // close_window
    21562156    } break;
    21572157
     
    22012201    {
    22022202      demo_man.set_state(demo_manager::RECORDING,mess_win->read(ID_RECORD_DEMO_FILENAME));
    2203       wm->push_event(new event(ID_CANCEL,NULL));        // close window
     2203      wm->Push(new Event(ID_CANCEL,NULL));        // close window
    22042204    } break;
    22052205
     
    22582258                    symbol_str("WARNING"));
    22592259        wm->grab_focus(warn_win);
    2260       } else wm->push_event(new event(ID_SET_SCROLL_OK,NULL));
     2260      } else wm->Push(new Event(ID_SET_SCROLL_OK,NULL));
    22612261    } break;
    22622262    case ID_WARN_CANCEL :
    22632263    {
    22642264      wm->close_window(warn_win); warn_win=NULL;
    2265       wm->push_event(new event(ID_CANCEL,NULL));
     2265      wm->Push(new Event(ID_CANCEL,NULL));
    22662266    } break;
    22672267    case ID_SET_SCROLL_OK :
     
    22722272      bg_ymul=atoi(mess_win->read(ID_MESS_STR3));
    22732273      bg_ydiv=atoi(mess_win->read(ID_MESS_STR4));
    2274       wm->push_event(new event(ID_CANCEL,NULL));        // close window
     2274      wm->Push(new Event(ID_CANCEL,NULL));        // close window
    22752275    } break;
    22762276
     
    23112311      char const *s=name;
    23122312      LObject::Compile(s)->Eval();
    2313       wm->push_event(new event(ID_CANCEL,NULL));        // close window
     2313      wm->Push(new Event(ID_CANCEL,NULL));        // close window
    23142314    } break;
    23152315    case ID_TOGGLE_DELAY :
     
    23242324    case ID_CLEAR_WEAPONS :
    23252325    {
    2326       event ev;
     2326      Event ev;
    23272327      do_command("clear_weapons",ev);
    23282328    } break;
     
    27612761      case 'A' : { if (selected_object)
    27622762               {
    2763              if (oedit) wm->push_event(new event(DEV_OEDIT_OK,NULL));
     2763             if (oedit) wm->Push(new Event(DEV_OEDIT_OK,NULL));
    27642764             make_ai_window(selected_object);
    27652765               }
     
    28252825      if (selected_object && selected_object->controller()==NULL)
    28262826      { copy_object=selected_object;
    2827             wm->push_event(new event(DEV_OEDIT_COPY,NULL)); } break;
     2827            wm->Push(new Event(DEV_OEDIT_COPY,NULL)); } break;
    28282828
    28292829      case 'D' : the_game->toggle_delay(); break;
     
    28722872        {
    28732873          v->god=!v->god;
    2874           sbar.redraw(screen);
     2874          sbar.redraw(main_screen);
    28752875        }
    28762876      } break;
     
    30263026}
    30273027
    3028 void pal_win::handle_event(event &ev)
     3028void pal_win::handle_event(Event &ev)
    30293029{
    30303030  int d=cur_fg;
     
    35733573         new pmenu_item(symbol_str("file_top"),new psub_menu(i_recurse(filemenu),NULL),
    35743574     new pmenu_item(symbol_str("edit_top"),new psub_menu(i_recurse(editmenu),NULL),
    3575      new pmenu_item(symbol_str("window_top"),new psub_menu(i_recurse(winmenu),NULL),NULL))),screen);
     3575     new pmenu_item(symbol_str("window_top"),new psub_menu(i_recurse(winmenu),NULL),NULL))),main_screen);
    35763576}
    35773577
  • abuse/trunk/src/dev.h

    r555 r643  
    4141  void open_window();
    4242  char *name;
    43   void handle_event(event &ev);
     43  void handle_event(Event &ev);
    4444  pal_win(void *args);
    4545  void resize(int xa, int ya);
     
    101101  void show_mem();
    102102  dev_controll();
    103   void handle_event(event &ev);
    104   void do_command(char const *st, event &ev);
     103  void handle_event(Event &ev);
     104  void do_command(char const *st, Event &ev);
    105105  int is_pal_win(Jwindow *win);
    106106  void dev_draw(view *v);
     
    115115  int32_t snap_x(int32_t x);
    116116  int32_t snap_y(int32_t y);
    117   void area_handle_input(event &ev);
    118   void pick_handle_input(event &ev);
     117  void area_handle_input(Event &ev);
     118  void pick_handle_input(Event &ev);
    119119  void close_area_win(int read_values);
    120120  void notify_deleted_object(game_object *o);
  • abuse/trunk/src/devsel.cpp

    r555 r643  
    147147
    148148
    149 void tile_picker::handle_inside_event(event &ev, image *screen, InputManager *inm)
     149void tile_picker::handle_inside_event(Event &ev, image *screen, InputManager *inm)
    150150{
    151151  if (ev.type==EV_MOUSE_BUTTON)
  • abuse/trunk/src/devsel.h

    r555 r643  
    1919  tile_picker(int X, int Y, int ID, int spec_type,
    2020         int scale, int scroll_h, int Wid, ifield *Next);
    21   virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
     21  virtual void handle_inside_event(Event &ev, image *screen, InputManager *inm);
    2222  virtual void scroll_event(int newx, image *screen);
    2323  virtual char *read() { return (char *)this; }
  • abuse/trunk/src/director.cpp

    r555 r643  
    4444{
    4545  int cx1, cy1, cx2, cy2, word_size, word_len;
    46   screen->GetClip(cx1, cy1, cx2, cy2);
    47   screen->InClip(x1,y1,x2+1,y2+1);
     46  main_screen->GetClip(cx1, cy1, cx2, cy2);
     47  main_screen->InClip(x1,y1,x2+1,y2+1);
    4848  int h=font->height()+2,w=font->width(),x=x1,dist;
    4949  y+=y1;
     
    107107      while (word_len--)
    108108      {
    109     font->put_char(screen,x+1,y+1,*word_start,0);
    110     font->put_char(screen,x,y,*word_start,c);
     109    font->put_char(main_screen,x+1,y+1,*word_start,0);
     110    font->put_char(main_screen,x,y,*word_start,c);
    111111    word_start++;
    112112    x+=w;
     
    115115
    116116  }
    117   screen->SetClip(cx1,cy1,cx2,cy2);
     117  main_screen->SetClip(cx1,cy1,cx2,cy2);
    118118  return (y<=y1);
    119119}
     
    179179    while (wm->event_waiting())
    180180    {
    181       event ev;
     181      Event ev;
    182182      wm->get_event(ev);
    183183      if (ev.type==EV_KEY)
  • abuse/trunk/src/endgame.cpp

    r590 r643  
    185185
    186186
    187   screen->clear();
     187  main_screen->clear();
    188188  int c[4]={ pal->find_closest(222,222,22),
    189189        pal->find_closest(200,200,200),
     
    197197    *(si++)=jrand()%200;
    198198    *(si++)=c[jrand()%4];
    199     screen->PutPixel(vec2i(si[-3],si[-2]),si[-1]);
     199    main_screen->PutPixel(vec2i(si[-3],si[-2]),si[-1]);
    200200  }
    201201  int32_t paddr[256];
     
    214214
    215215
    216   scan_map(screen,ex,ey,cache.img(planet),cache.img(planet2),0,paddr,p,cache.img(mask)->Size().y,eoff,coff);
     216  scan_map(main_screen,ex,ey,cache.img(planet),cache.img(planet2),0,paddr,p,cache.img(mask)->Size().y,eoff,coff);
    217217  image *tcopy=cache.img(planet)->copy();
    218218  fade_in(NULL,32);
     
    231231
    232232      old_time.get_time();
    233       screen->clear();
     233      main_screen->clear();
    234234      int j;
    235235      for (si=sinfo,j=0; j<800; j++,si+=3)
    236         screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     236        main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
    237237
    238238      if (i>=30 && i<=37)
     
    240240    cache.img(planet)->put_image(tcopy,0,0);
    241241    cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,vec2i(100,50));
    242         scan_map(screen,ex,ey,tcopy,
     242        scan_map(main_screen,ex,ey,tcopy,
    243243           cache.img(planet2),
    244244           0,paddr,
     
    246246      }
    247247      else
    248         scan_map(screen,ex,ey,cache.img(planet),
     248        scan_map(main_screen,ex,ey,cache.img(planet),
    249249           cache.img(planet2),
    250250           0,paddr,
     
    258258
    259259
    260         scale_put_trans(s,screen,ex-(i-38)*5,ey+cache.img(mask)->Size().y/2+t*4,nw,nh);
     260        scale_put_trans(s,main_screen,ex-(i-38)*5,ey+cache.img(mask)->Size().y/2+t*4,nw,nh);
    261261    if (i==77)
    262262      if (sound_avail&SFX_INITIALIZED)
     
    283283
    284284      old_time.get_time();
    285       screen->clear();
     285      main_screen->clear();
    286286      int j;
    287287      for (si=sinfo,j=0; j<800; j++,si+=3)
    288         screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
    289 
    290 
    291       scan_map(screen,ex,ey,cache.img(planet),
     288        main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     289
     290
     291      scan_map(main_screen,ex,ey,cache.img(planet),
    292292           cache.img(planet2),i*256/200,paddr,p,cache.img(mask)->Size().y,eoff,coff);
    293293
     
    322322      last=c;
    323323      if (c->char_num)
    324         cache.fig(explo_frames2[c->frame])->forward->PutImage(screen,vec2i(c->x,c->y));
     324        cache.fig(explo_frames2[c->frame])->forward->PutImage(main_screen,vec2i(c->x,c->y));
    325325
    326326      c->x-=3;
     
    337337  while (clist) { ex_char *p=clist; clist=clist->next; delete p; }
    338338
    339   screen->clear();
     339  main_screen->clear();
    340340  int j;
    341341  for (si=sinfo,j=0; j<800; j++,si+=3)
    342     screen->PutPixel(vec2i(si[0],si[1]),si[2]);
    343 
    344   event ev;
     342    main_screen->PutPixel(vec2i(si[0],si[1]),si[2]);
     343
     344  Event ev;
    345345  i=0;
    346346  do
     
    353353
    354354      old_time.get_time();
    355       scan_map(screen,ex,ey,cache.img(planet),
     355      scan_map(main_screen,ex,ey,cache.img(planet),
    356356           cache.img(planet2),
    357357           256,paddr,
     
    381381  for (i=0; i<320 && ev.type!=EV_KEY; i++)
    382382  {
    383     screen->clear();
     383    main_screen->clear();
    384384    int j;
    385385    for (si=sinfo,j=0; j<800; j++,si+=3)
    386       screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
    387 
    388     scan_map(screen,ex,ey,cache.img(planet),
     386      main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     387
     388    scan_map(main_screen,ex,ey,cache.img(planet),
    389389         cache.img(planet2),
    390390         256,paddr,
     
    412412
    413413  fade_out(16);
    414   screen->clear();
     414  main_screen->clear();
    415415
    416416
     
    426426  image blank(vec2i(2, 2)); blank.clear();
    427427  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    428   screen->clear();
     428  main_screen->clear();
    429429
    430430  image *im=cache.img(cache.reg("art/fore/endgame.spe","tbc",SPEC_IMAGE,1));
     
    437437
    438438  int dx=(xres+1)/2-im->Size().x/2,dy=(yres+1)/2-im->Size().y/2;
    439   im->put_image(screen,dx,dy);
    440   console_font->put_string(screen,xres/2+35,yres/2+100-console_font->height()-2,
     439  im->put_image(main_screen,dx,dy);
     440  console_font->put_string(main_screen,xres/2+35,yres/2+100-console_font->height()-2,
    441441               lstring_value(to_be));
    442442  fade_in(NULL,32);
     
    447447    cmap[i]=pal->find_closest(i*256/32,i*256/32,i*256/32);
    448448
    449   event ev; ev.type=EV_SPURIOUS;
     449  Event ev; ev.type=EV_SPURIOUS;
    450450  time_marker start;
    451451  for (i=0; i<320 && ev.type!=EV_KEY; i++)
    452452  {
    453     im->put_image(screen,dx,dy);
    454     console_font->put_string(screen,xres/2+35,yres/2+100-console_font->height()-2,
     453    im->put_image(main_screen,dx,dy);
     454    console_font->put_string(main_screen,xres/2+35,yres/2+100-console_font->height()-2,
    455455               lstring_value(to_be));
    456456
     
    473473  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    474474  show_sell(1);
    475   wm->push_event(new event(ID_SHOW_SELL,NULL));
     475  wm->Push(new Event(ID_SHOW_SELL,NULL));
    476476}
    477477
     
    482482  image blank(vec2i(2, 2)); blank.clear();
    483483  wm->set_mouse_shape(blank.copy(),0,0);      // don't show mouse
    484   screen->clear();
     484  main_screen->clear();
    485485
    486486  image *im=cache.img(cache.reg("art/fore/endgame.spe","end.pcx",SPEC_IMAGE,1));
     
    499499    cmap[i]=pal->find_closest(i*256/32,i*256/32,i*256/32);
    500500
    501   event ev; ev.type=EV_SPURIOUS;
     501  Event ev; ev.type=EV_SPURIOUS;
    502502  time_marker start;
    503503  for (i=0; i<320 && ev.type!=EV_KEY; i++)
    504504  {
    505     im->put_image(screen,dx,dy);
     505    im->put_image(main_screen,dx,dy);
    506506
    507507    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
     
    524524
    525525  fade_out(16);
    526   screen->clear();
     526  main_screen->clear();
    527527
    528528  show_sell(1);
  • abuse/trunk/src/game.cpp

    r641 r643  
    120120    Jwindow *no_space = wm->new_window(0, 0, -1, -1, b, "ERROR");
    121121
    122     event ev;
     122    Event ev;
    123123    do
    124124    {
     
    461461}
    462462
    463 void Game::joy_calb(event &ev)
     463void Game::joy_calb(Event &ev)
    464464{
    465465    if(!joy_win) // make sure the joystick calibration window is open
     
    490490}
    491491
    492 void Game::menu_select(event &ev)
     492void Game::menu_select(Event &ev)
    493493{
    494494    state = DEV_MOUSE_RELEASE;
     
    496496    {
    497497#if 0
    498         wm->push_event(new event(men_mess[((pick_list *)ev.message.data)->get_selection()], NULL));
     498        wm->Push(new Event(men_mess[((pick_list *)ev.message.data)->get_selection()], NULL));
    499499        wm->close_window(top_menu);
    500500        top_menu = NULL;
     
    581581      yoff / ftile_height()>y || yoff / ftile_height()+(viewy2 - viewy1)/ftile_height()+1 < y) return;
    582582      int cx1, cy1, cx2, cy2;
    583       screen->GetClip(cx1, cy1, cx2, cy2);
    584       screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
    585       im->PutImage(screen, vec2i((x - xoff / ftile_width())*ftile_width()+viewx1 - xoff % ftile_width(),
     583      main_screen->GetClip(cx1, cy1, cx2, cy2);
     584      main_screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
     585      im->PutImage(main_screen, vec2i((x - xoff / ftile_width())*ftile_width()+viewx1 - xoff % ftile_width(),
    586586            (y - yoff / ftile_height())*ftile_height()+viewy1 - yoff % ftile_height()));
    587       screen->SetClip(cx1, cy1, cx2, cy2);
     587      main_screen->SetClip(cx1, cy1, cx2, cy2);
    588588    }
    589589  }
     
    603603      yo / btile_height()>y || yo / btile_height()+(viewy2 - viewy1)/btile_height()+1 < y) return;
    604604      int cx1, cy1, cx2, cy2;
    605       screen->GetClip(cx1, cy1, cx2, cy2);
    606       screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
    607       im->put_image(screen, (x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(),
     605      main_screen->GetClip(cx1, cy1, cx2, cy2);
     606      main_screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
     607      im->put_image(main_screen, (x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(),
    608608            (y - yo / btile_height())*btile_height()+viewy1 - yo % btile_height(), 0);
    609       screen->SetClip(cx1, cy1, cx2, cy2);
     609      main_screen->SetClip(cx1, cy1, cx2, cy2);
    610610    }
    611611  }
     
    633633    int xs, ys;
    634634    if(mousex < xmargin &&  dev_cont->ok_to_scroll()) xs = -18;
    635     else if(mousex>(screen->Size().x-xmargin) &&  dev_cont->ok_to_scroll()) xs = 18;
     635    else if(mousex>(main_screen->Size().x-xmargin) &&  dev_cont->ok_to_scroll()) xs = 18;
    636636    else if(wm->key_pressed(JK_LEFT) && !last_input && !dev_cont->need_arrows())
    637637      xs = -18;
     
    642642
    643643    if(mousey < ymargin && dev_cont->ok_to_scroll()) ys = -18;
    644     else if(mousey>(screen->Size().y-ymargin) &&  dev_cont->ok_to_scroll()) ys = 18;
     644    else if(mousey>(main_screen->Size().y-ymargin) &&  dev_cont->ok_to_scroll()) ys = 18;
    645645    else if(wm->key_pressed(JK_UP) && !last_input)
    646646      ys = -18;
     
    698698  if(DEFINEDP(l_post_render->GetFunction()))
    699699  {
    700     screen->dirt_off();
     700    main_screen->dirt_off();
    701701    LSpace::Tmp.Clear();
    702702    l_post_render->EvalFunction(NULL);
    703703    LSpace::Tmp.Clear();
    704     screen->dirt_on();
     704    main_screen->dirt_on();
    705705  }
    706706}
     
    711711  int x1, y1, x2, y2, x, y, xo, yo, nxoff, nyoff;
    712712  int cx1, cy1, cx2, cy2;
    713   screen->GetClip(cx1, cy1, cx2, cy2);
     713  main_screen->GetClip(cx1, cy1, cx2, cy2);
    714714
    715715  if(!current_level || state == MENU_STATE)
     
    718718    {
    719719      if(state == SCENE_STATE)
    720         screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
     720        main_screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
    721721      image *tit = cache.img(title_screen);
    722       tit->put_image(screen, screen->Size().x/2 - tit->Size().x/2,
    723                     screen->Size().y/2 - tit->Size().y/2);
     722      tit->put_image(main_screen, main_screen->Size().x/2 - tit->Size().x/2,
     723                    main_screen->Size().y/2 - tit->Size().y/2);
    724724      if(state == SCENE_STATE)
    725         screen->SetClip(cx1, cy1, cx2, cy2);
     725        main_screen->SetClip(cx1, cy1, cx2, cy2);
    726726      wm->flush_screen();
    727727    }
     
    736736
    737737  if(small_render)
    738     screen->AddDirty(v->cx1, v->cy1, (v->cx2 - v->cx1 + 1)*2 + v->cx1 + 1, v->cy1+(v->cy2 - v->cy1 + 1)*2 + 1);
     738    main_screen->AddDirty(v->cx1, v->cy1, (v->cx2 - v->cx1 + 1)*2 + v->cx1 + 1, v->cy1+(v->cy2 - v->cy1 + 1)*2 + 1);
    739739  else
    740     screen->AddDirty(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
     740    main_screen->AddDirty(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
    741741
    742742  if(v->draw_solid != -1)      // fill the screen and exit..
    743743  {
    744744    int c = v->draw_solid;
    745     screen->Lock();
     745    main_screen->Lock();
    746746    for(int y = v->cy1; y <= v->cy2; y++)
    747       memset(screen->scan_line(y)+v->cx1, c, v->cx2 - v->cx1 + 1);
    748     screen->Unlock();
     747      memset(main_screen->scan_line(y)+v->cx1, c, v->cx2 - v->cx1 + 1);
     748    main_screen->Unlock();
    749749    v->draw_solid = -1;
    750750    return;
     
    765765    v->cy2 = small_render->Size().y-1;
    766766
    767     old_screen = screen;
    768     screen = small_render;
     767    old_screen = main_screen;
     768    main_screen = small_render;
    769769  } else
    770     screen->dirt_off();
     770    main_screen->dirt_off();
    771771
    772772
     
    788788  current_vyadd = yoff - v->cy1;
    789789
    790   screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
     790  main_screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
    791791
    792792  nxoff = xoff * bg_xmul / bg_xdiv;
     
    828828    else bt = get_bg(0);
    829829
    830         bt->im->put_image(screen, draw_x, draw_y);
     830        bt->im->put_image(main_screen, draw_x, draw_y);
    831831//        if(!(dev & EDIT_MODE) && bt->next)
    832832//      current_level->put_bg(x, y, bt->next);
     
    890890  {
    891891    int ncx1, ncy1, ncx2, ncy2;
    892     screen->GetClip(ncx1, ncy1, ncx2, ncy2);
    893 
    894     int scr_w = screen->Size().x;
     892    main_screen->GetClip(ncx1, ncy1, ncx2, ncy2);
     893
     894    int scr_w = main_screen->Size().x;
    895895    if(dev & MAP_MODE)
    896896    {
    897897      if(dev & EDIT_MODE)
    898         screen->clear(wm->bright_color());
     898        main_screen->clear(wm->bright_color());
    899899      else
    900         screen->clear(wm->black());
    901       screen->Lock();
     900        main_screen->clear(wm->black());
     901      main_screen->Lock();
    902902      for(y = y1, draw_y = yo; y <= y2; y++, draw_y += yinc)
    903903      {
     
    905905    {
    906906      uint16_t *cl = current_level->get_fgline(y)+x1;
    907       uint8_t *sl1 = screen->scan_line(draw_y)+xo;
     907      uint8_t *sl1 = main_screen->scan_line(draw_y)+xo;
    908908      for(x = x1, draw_x = xo; x <= x2; x++, cl++, sl1 += xinc, draw_x += xinc)
    909909      {
     
    924924    }
    925925      }
    926       screen->Unlock();
     926      main_screen->Unlock();
    927927
    928928      if(dev & EDIT_MODE)
     
    952952          if(fort_num != BLACK)
    953953          {
    954             get_fg(fort_num)->im->PutImage(screen, vec2i(draw_x, draw_y));
     954            get_fg(fort_num)->im->PutImage(main_screen, vec2i(draw_x, draw_y));
    955955
    956956        if(!(dev & EDIT_MODE))
     
    994994        {
    995995          if(dev & DRAW_BG_LAYER)
    996           get_fg(fort_num)->im->PutImage(screen, vec2i(draw_x, draw_y));
     996          get_fg(fort_num)->im->PutImage(main_screen, vec2i(draw_x, draw_y));
    997997          else
    998           get_fg(fort_num)->im->PutFilled(screen, vec2i(draw_x, draw_y), 0);
     998          get_fg(fort_num)->im->PutFilled(main_screen, vec2i(draw_x, draw_y), 0);
    999999
    10001000          if(!(dev & EDIT_MODE))
     
    10021002          else
    10031003          {
    1004         screen->line(draw_x, draw_y, draw_x + xinc, draw_y + yinc, wm->bright_color());
    1005         screen->line(draw_x + xinc, draw_y, draw_x, draw_y + yinc, wm->bright_color());
     1004        main_screen->line(draw_x, draw_y, draw_x + xinc, draw_y + yinc, wm->bright_color());
     1005        main_screen->line(draw_x + xinc, draw_y, draw_x, draw_y + yinc, wm->bright_color());
    10061006          }
    10071007        }
     
    10371037        {
    10381038          d += 2;
    1039           screen->line(draw_x+*(d - 2), draw_y+*(d - 1), draw_x+*d, draw_y+*(d + 1), b);
     1039          main_screen->line(draw_x+*(d - 2), draw_y+*(d - 1), draw_x+*d, draw_y+*(d + 1), b);
    10401040        }
    1041         screen->line(draw_x+*d, draw_y+*(d - 1), draw_x + p->data[0], draw_y + p->data[1], b);
     1041        main_screen->line(draw_x+*d, draw_y+*(d - 1), draw_x + p->data[0], draw_y + p->data[1], b);
    10421042          }
    10431043        }
     
    10631063    int x1 = v->cx1, y1 = v->cy1, x2 = v->cx2, y2 = v->cy1 + wm->font()->height()+10;
    10641064
    1065     remap_area(screen, x1, y1, x2, y2, white_light + 40 * 256);
    1066     screen->bar(x1, y1, x2, y1, color);
    1067     screen->bar(x1, y2, x2, y2, color);
    1068 
    1069     wm->font()->put_string(screen, x1 + 5, y1 + 5,
     1065    remap_area(main_screen, x1, y1, x2, y2, white_light + 40 * 256);
     1066    main_screen->bar(x1, y1, x2, y1, color);
     1067    main_screen->bar(x1, y2, x2, y2, color);
     1068
     1069    wm->font()->put_string(main_screen, x1 + 5, y1 + 5,
    10701070                   help_text, color);
    10711071    if(color > 30)
     
    10791079    dev_cont->dev_draw(v);
    10801080    if(cache.in_use())
    1081     cache.img(vmm_image)->put_image(screen, v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1);
     1081    cache.img(vmm_image)->put_image(main_screen, v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1);
    10821082
    10831083    if(dev & DRAW_LIGHTS)
     
    10851085      if(small_render)
    10861086      {
    1087     double_light_screen(screen, xoff, yoff, white_light, v->ambient, old_screen, old_cx1, old_cy1);
     1087    double_light_screen(main_screen, xoff, yoff, white_light, v->ambient, old_screen, old_cx1, old_cy1);
    10881088
    10891089    v->cx1 = old_cx1;
     
    10911091    v->cx2 = old_cx2;
    10921092    v->cy2 = old_cy2;
    1093     screen = old_screen;
     1093    main_screen = old_screen;
    10941094      } else
    10951095      {
    1096     screen->dirt_on();
     1096    main_screen->dirt_on();
    10971097    if(xres * yres <= 64000)
    1098           light_screen(screen, xoff, yoff, white_light, v->ambient);
    1099     else light_screen(screen, xoff, yoff, white_light, 63);            // no lighting for hi - rez
     1098          light_screen(main_screen, xoff, yoff, white_light, v->ambient);
     1099    else light_screen(main_screen, xoff, yoff, white_light, 63);            // no lighting for hi - rez
    11001100      }
    11011101
    11021102    } else
    1103       screen->dirt_on();
     1103      main_screen->dirt_on();
    11041104
    11051105
    11061106
    11071107  }  else
    1108     screen->dirt_on();
     1108    main_screen->dirt_on();
    11091109
    11101110  rand_on = ro;                // restore random start in case in draw funs moved it
     
    11131113  post_render();
    11141114
    1115   screen->SetClip(cx1, cy1, cx2 + 1, cy2 + 1);
     1115  main_screen->SetClip(cx1, cy1, cx2 + 1, cy2 + 1);
    11161116
    11171117
     
    11491149}
    11501150
    1151 int Game::in_area(event &ev, int x1, int y1, int x2, int y2)
     1151int Game::in_area(Event &ev, int x1, int y1, int x2, int y2)
    11521152{
    11531153  return (last_demo_mx >= x1 && last_demo_mx <= x2 &&
     
    11711171    if (im)
    11721172    {
    1173         screen->clear();
    1174         im->put_image(screen, (xres + 1) / 2 - im->Size().x / 2,
     1173        main_screen->clear();
     1174        im->put_image(main_screen, (xres + 1) / 2 - im->Size().x / 2,
    11751175                              (yres + 1) / 2 - im->Size().y / 2);
    11761176    }
     
    11941194    if (N == 0)
    11951195    {
    1196         screen->clear();
     1196        main_screen->clear();
    11971197        wm->flush_screen();
    11981198        old_pal->load();
     
    12681268        }
    12691269
    1270         screen->clear();
     1270        main_screen->clear();
    12711271        pal->load();
    12721272
    12731273        int dx = (xres + 1) / 2 - gray->Size().x / 2, dy = (yres + 1) / 2 - gray->Size().y / 2;
    1274         gray->put_image(screen, dx, dy);
    1275         smoke[0]->put_image(screen, dx + 24, dy + 5);
     1274        gray->put_image(main_screen, dx, dy);
     1275        smoke[0]->put_image(main_screen, dx + 24, dy + 5);
    12761276
    12771277        fade_in(NULL, 16);
     
    12801280        cmap[i] = pal->find_closest(i * 256 / 32, i * 256 / 32, i * 256 / 32);
    12811281
    1282         event ev;
     1282        Event ev;
    12831283        ev.type = EV_SPURIOUS;
    12841284        Timer total;
     
    12931293                break;
    12941294
    1295             gray->put_image(screen, dx, dy);
    1296             smoke[i % 5]->put_image(screen, dx + 24, dy + 5);
     1295            gray->put_image(main_screen, dx, dy);
     1296            smoke[i % 5]->put_image(main_screen, dx + 24, dy + 5);
    12971297            text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, wm->font(), cmap, wm->bright_color());
    12981298            wm->flush_screen();
     
    14461446  console_font = new JCFont(cache.img(console_font_pict));
    14471447
    1448   wm = new WindowManager(screen, pal, bright_color,
     1448  wm = new WindowManager(main_screen, pal, bright_color,
    14491449                         med_color, dark_color, game_font);
    14501450
     
    14961496  else
    14971497  {
    1498     screen->clear();
     1498    main_screen->clear();
    14991499    if(title_screen >= 0)
    15001500    {
    15011501      image *tit = cache.img(title_screen);
    1502       tit->put_image(screen, screen->Size().x/2 - tit->Size().x/2,
    1503                     screen->Size().y/2 - tit->Size().y/2);
     1502      tit->put_image(main_screen, main_screen->Size().x/2 - tit->Size().x/2,
     1503                    main_screen->Size().y/2 - tit->Size().y/2);
    15041504    }
    15051505    set_state(MENU_STATE);   // then go to menu state so windows will turn off
     
    15241524    char str[16];
    15251525    sprintf(str, "%ld", (long)(10000.0f / avg_ms));
    1526     console_font->put_string(screen, first_view->cx1, first_view->cy1, str);
     1526    console_font->put_string(main_screen, first_view->cx1, first_view->cy1, str);
    15271527
    15281528    sprintf(str, "%d", total_active);
    1529     console_font->put_string(screen, first_view->cx1, first_view->cy1 + 10, str);
     1529    console_font->put_string(main_screen, first_view->cx1, first_view->cy1 + 10, str);
    15301530}
    15311531
     
    15731573    {
    15741574      for(view *f = first_view; f; f = f->next)
    1575         cache.img(pause_image)->put_image(screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,
     1575        cache.img(pause_image)->put_image(main_screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,
    15761576                   f->cy1 + 5, 1);
    15771577    }
     
    16491649void Game::get_input()
    16501650{
    1651     event ev;
     1651    Event ev;
    16521652    idle_ticks++;
    16531653    while(event_waiting())
     
    17131713            {
    17141714                if(v->local_player() && v->handle_event(ev))
    1715                     ev.type = EV_SPURIOUS;       // if the event was used by the view, gobble it up
     1715                    ev.type = EV_SPURIOUS;       // if the Event was used by the view, gobble it up
    17161716            }
    17171717
     
    18061806                                    case 'v':
    18071807                                    {
    1808                                         wm->push_event(new event(DO_VOLUME, NULL));
     1808                                        wm->Push(new Event(DO_VOLUME, NULL));
    18091809                                    } break;
    18101810                                    case 'p':
     
    18211821                                        if(start_edit)
    18221822                                        {
    1823                                             wm->push_event(new event(ID_LEVEL_SAVE, NULL));
     1823                                            wm->Push(new Event(ID_LEVEL_SAVE, NULL));
    18241824                                        }
    18251825                                    } break;
     
    18651865                            case EV_REDRAW:
    18661866                            {
    1867                                 screen->AddDirty(ev.redraw.x1, ev.redraw.y1,
     1867                                main_screen->AddDirty(ev.redraw.x1, ev.redraw.y1,
    18681868                                    ev.redraw.x2 + 1, ev.redraw.y2 + 1);
    18691869                            } break;
     
    20332033  } else if(state == JOY_CALB_STATE)
    20342034  {
    2035     event ev;
     2035    Event ev;
    20362036    joy_calb(ev);
    20372037  } else if(state == MENU_STATE)
     
    21282128void Game::draw(int scene_mode)
    21292129{
    2130     screen->AddDirty(0, 0, xres + 1, yres + 1);
    2131 
    2132     screen->clear();
     2130    main_screen->AddDirty(0, 0, xres + 1, yres + 1);
     2131
     2132    main_screen->clear();
    21332133
    21342134    if(scene_mode)
    21352135    {
    21362136        char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED";
    2137         wm->font()->put_string(screen, screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2 + 1,
    2138             screen->Size().y-wm->font()->height()-5 + 1, helpstr, wm->dark_color());
    2139         wm->font()->put_string(screen, screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2,
    2140             screen->Size().y-wm->font()->height()-5, helpstr, wm->bright_color());
     2137        wm->font()->put_string(main_screen, main_screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2 + 1,
     2138            main_screen->Size().y-wm->font()->height()-5 + 1, helpstr, wm->dark_color());
     2139        wm->font()->put_string(main_screen, main_screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2,
     2140            main_screen->Size().y-wm->font()->height()-5, helpstr, wm->bright_color());
    21412141    }
    21422142/*    else
    21432143    {
    21442144        char *helpstr="PRESS h FOR HELP";
    2145         wm->font()->put_string(screen, screen->Size().x-wm->font()->width()*strlen(helpstr)-5,
    2146             screen->Size().y-wm->font()->height()-5, helpstr);
     2145        wm->font()->put_string(main_screen, main_screen->Size().x-wm->font()->width()*strlen(helpstr)-5,
     2146            main_screen->Size().y-wm->font()->height()-5, helpstr);
    21472147    }*/
    21482148/*    int dc = cache.img(window_colors)->pixel(0, 2);
    21492149    int mc = cache.img(window_colors)->pixel(1, 2);
    21502150    int bc = cache.img(window_colors)->pixel(2, 2);
    2151     screen->line(0, 0, screen->Size().x-1, 0, dc);
    2152     screen->line(0, 0, 0, screen->Size().y-1, dc);
    2153     screen->line(0, screen->Size().y-1, screen->Size().x-1, screen->Size().y-1, bc);
    2154     screen->line(screen->Size().x-1, 0, screen->Size().x-1, screen->Size().y-1, bc); */
     2151    main_screen->line(0, 0, main_screen->Size().x-1, 0, dc);
     2152    main_screen->line(0, 0, 0, main_screen->Size().y-1, dc);
     2153    main_screen->line(0, main_screen->Size().y-1, main_screen->Size().x-1, main_screen->Size().y-1, bc);
     2154    main_screen->line(main_screen->Size().x-1, 0, main_screen->Size().x-1, main_screen->Size().y-1, bc); */
    21552155
    21562156    for(view *f = first_view; f; f = f->next)
    21572157        draw_map(f, 0);
    21582158
    2159     sbar.redraw(screen);
     2159    sbar.redraw(main_screen);
    21602160}
    21612161
     
    22042204    dev_console->show();
    22052205    int t = 0;
    2206     event ev;
     2206    Event ev;
    22072207    do
    22082208    {
  • abuse/trunk/src/game.h

    r555 r643  
    132132
    133133
    134   int in_area(event &ev, int x1, int y1, int x2, int y2);
     134  int in_area(Event &ev, int x1, int y1, int x2, int y2);
    135135  void load_level(char const *name);
    136136  void set_level(level *nl);
     
    145145  void get_input();
    146146  void do_intro();
    147   void joy_calb(event &ev);
    148   void menu_select(event &ev2);
     147  void joy_calb(Event &ev);
     148  void menu_select(Event &ev2);
    149149  int can_morph_into(int type);
    150150  void morph_into(int type);
  • abuse/trunk/src/gamma.cpp

    r635 r643  
    150150        Jwindow *gw = wm->new_window(xres / 2 - 190, yres / 2 - 90, -1, -1, gp);
    151151
    152         event ev;
     152        Event ev;
    153153        wm->flush_screen();
    154154#if !defined __CELLOS_LV2__
  • abuse/trunk/src/gui.cpp

    r579 r643  
    7373}
    7474
    75 void ico_switch_button::handle_event(event &ev, image *screen, InputManager *im)
     75void ico_switch_button::handle_event(Event &ev, image *screen, InputManager *im)
    7676{
    7777  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    9292
    9393  if (active!=act  && activate_id!=-1 && active)
    94     wm->push_event(new event(activate_id,NULL));
     94    wm->Push(new Event(activate_id,NULL));
    9595
    9696  if (up && !active)
     
    103103
    104104  if (act!=active && active && activate_id!=-1)
    105     wm->push_event(new event(activate_id,NULL));
     105    wm->Push(new Event(activate_id,NULL));
    106106  act=active;
    107107
     
    121121extern int sfx_volume;
    122122
    123 void ico_button::handle_event(event &ev, image *screen, InputManager *im)
     123void ico_button::handle_event(Event &ev, image *screen, InputManager *im)
    124124{
    125125  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    130130    up=!up;
    131131    draw(act,screen);
    132     wm->push_event(new event(id,(char *)this));
     132    wm->Push(new Event(id,(char *)this));
    133133    if (S_BUTTON_PRESS_SND)
    134134      cache.sfx(S_BUTTON_PRESS_SND)->play(sfx_volume);
  • abuse/trunk/src/gui.h

    r555 r643  
    2525  virtual void draw_first(image *screen) { draw(0,screen); }
    2626  virtual void draw(int active, image *screen);
    27   virtual void handle_event(event &ev, image *screen, InputManager *im);
     27  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    2828
    2929  virtual char *read() { return (char *)&up; }
     
    4444  virtual void draw_first(image *screen) { cur_but->draw_first(screen); }
    4545  virtual void draw(int active, image *screen) { cur_but->draw(active,screen); act=active; }
    46   virtual void handle_event(event &ev, image *screen, InputManager *im);
     46  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    4747  virtual ifield *unlink(int id);
    4848  virtual char *read() { return cur_but->read(); }
  • abuse/trunk/src/help.cpp

    r555 r643  
    3131  int x1=xres/2-im->Size().x/2,y1=yres/2-im->Size().y/2;
    3232  int x2=x1+im->Size().x,y2=y1+im->Size().y;
    33   im->put_image(screen,x1,y1);
    34   screen->bar(0,0,x1-1,yres,0);
    35   screen->bar(0,0,xres,y1-1,0);
    36   screen->bar(x2,y1,xres,yres,0);
    37   screen->bar(x1,y2,x2,yres,0);
     33  im->put_image(main_screen,x1,y1);
     34  main_screen->bar(0,0,x1-1,yres,0);
     35  main_screen->bar(0,0,xres,y1-1,0);
     36  main_screen->bar(x2,y1,xres,yres,0);
     37  main_screen->bar(x1,y2,x2,yres,0);
    3838}
    3939
    40 void help_handle_event(event &ev)
     40void help_handle_event(Event &ev)
    4141{
    4242  if (ev.window!=NULL) return ;
  • abuse/trunk/src/help.h

    r555 r643  
    1616extern int total_help_screens;
    1717extern int *help_screens;
    18 void help_handle_event(event &ev);
     18void help_handle_event(Event &ev);
    1919void draw_help();        // called from game draw if in help mode
    2020
  • abuse/trunk/src/imlib/Makefile.am

    r605 r643  
    2626    jwindow.cpp jwindow.h \
    2727    video.cpp video.h \
    28     event.h mouse.h timing.h jdir.h visobj.h \
     28    event.cpp event.h \
     29    mouse.h timing.h jdir.h visobj.h \
    2930    $(NULL)
    3031
  • abuse/trunk/src/imlib/event.h

    r555 r643  
    3232class Jwindow;
    3333
    34 class event : public linked_node
     34class Event : public linked_node
    3535{
    36 public :
    37   int                             type;
    38   struct { int x,y; }             mouse_move;
    39   int                             mouse_button;
    40   int                             key;
    41   struct { char alt,ctrl,shift; } key_special;
    42   struct { int x1,y1,x2,y2;
    43        void *start; }         redraw;
    44   Jwindow                        *window;      // NULL is root
    45   struct { int x,y; }             window_position;
    46   struct { int id; char *data; }  message;
    47   event(int id, char *data) { type=EV_MESSAGE; message.id=id; message.data=data; }
    48   event() { type=EV_SPURIOUS; }
    49 } ;
     36public:
     37    Event()
     38    {
     39        type = EV_SPURIOUS;
     40    }
    5041
    51 class event_handler
     42    Event(int id, char *data)
     43    {
     44        type = EV_MESSAGE;
     45        message.id = id;
     46        message.data = data;
     47    }
     48
     49    int type;
     50    vec2i mouse_move;
     51    int mouse_button, key;
     52
     53    struct { char alt, ctrl, shift; } key_special;
     54    struct { int x1, y1, x2, y2; void *start; } redraw;
     55
     56    Jwindow *window;      // NULL is root
     57    vec2i window_position;
     58    struct { int id; char *data; } message;
     59};
     60
     61class EventHandler
    5262{
    53   sprite_controller sc;
    54   int mhere,ewaiting,last_keystat,last_key;
    55   int get_key_flags();
    56   linked_list events;
    57 public :
     63public:
     64    EventHandler(image *screen, palette *pal);
     65    ~EventHandler();
     66
     67    void Push(Event *ev)
     68    {
     69        m_events.add_end(ev);
     70    }
     71
    5872  JCMouse *mouse;
    5973  sprite *mouse_sprite() { return mouse->mouse_sprite(); }
    60   event_handler(image *screen, palette *pal);
    6174  int event_waiting();
    62   void get_event(event &ev);
     75  void Get(Event &ev);
    6376  void add_redraw(int X1, int Y1, int X2, int Y2, void *Start);
    6477  void mouse_status(int &x, int &y, int &button)
    65   { if (mouse)
     78  {
     79    if (mouse)
    6680    {
    67       x=mouse->x(); y=mouse->y(); button=mouse->button();
    68     } else x=y=button=0;
     81      x = mouse->x();
     82      y = mouse->y();
     83      button = mouse->button();
     84    } else x = y = button = 0;
    6985  }
    70   void push_event(event *ev) { events.add_end(ev); }
    7186  void flush_screen();
    72   int has_mouse() { return mouse->exsist(); }
    73   void set_mouse_shape(image *im, int centerx, int centery) { mouse->set_shape(im,-centerx,-centery); }
    74   void set_mouse_position(int mx, int my) { if (mouse) mouse->set_position(mx,my); }
    75   ~event_handler();
    76 } ;
     87  int has_mouse() { return mouse->exists(); }
     88  void set_mouse_shape(image *im, int centerx, int centery) { mouse->set_shape(im, -centerx, -centery); }
     89  void set_mouse_position(int mx, int my) { if (mouse) mouse->set_position(mx, my); }
     90
     91private:
     92    int get_key_flags();
     93
     94    linked_list m_events;
     95    int mhere, ewaiting, last_keystat, last_key;
     96    sprite_controller sc;
     97};
     98
    7799#endif
    78100
  • abuse/trunk/src/imlib/include.cpp

    r555 r643  
    2828      tmp_name[j]='_';
    2929
    30   FILE *fp=fopen(filename,"rb");  // see if the file already exsist
     30  FILE *fp=fopen(filename,"rb");  // see if the file already exists
    3131  if (fp)
    3232  {
  • abuse/trunk/src/imlib/input.cpp

    r579 r643  
    113113}
    114114
    115 void button_box::handle_event(event &ev, image *screen, InputManager *im)
     115void button_box::handle_event(Event &ev, image *screen, InputManager *im)
    116116{
    117117  switch (ev.type)
     
    268268}
    269269
    270 void text_field::handle_event(event &ev, image *screen, InputManager *im)
     270void text_field::handle_event(Event &ev, image *screen, InputManager *im)
    271271{
    272272  int xx;
     
    293293           draw_text(screen);
    294294           draw_cur(wm->bright_color(),screen);
    295            wm->push_event(new event(id,(char *)this));
     295           wm->Push(new Event(id,(char *)this));
    296296         } break;
    297297      default : if (ev.key>=' ' && ev.key<='~')
     
    306306           draw_text(screen);
    307307           draw_cur(wm->bright_color(),screen);
    308            wm->push_event(new event(id,(char *)this));
     308           wm->Push(new Event(id,(char *)this));
    309309         } break;
    310310    }
     
    366366{ up=!up; }
    367367
    368 void button::handle_event(event &ev, image *screen, InputManager *im)
     368void button::handle_event(Event &ev, image *screen, InputManager *im)
    369369{
    370370  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    376376    draw_first(screen);
    377377    draw(act,screen);
    378     wm->push_event(new event(id,(char *)this));
     378    wm->Push(new Event(id,(char *)this));
    379379  }
    380380}
     
    385385  area(x1,y1,x2,y2);
    386386  if (active!=act  && act_id!=-1 && active)
    387     wm->push_event(new event(act_id,NULL));
     387    wm->Push(new Event(act_id,NULL));
    388388
    389389  if (pressed)
  • abuse/trunk/src/imlib/input.h

    r579 r643  
    3030  virtual void draw_first(image *screen);
    3131  virtual void draw(int active, image *screen);
    32   virtual void handle_event(event &ev, image *screen, InputManager *im);
     32  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    3333  void change_visual(image *new_visual);
    3434  virtual void remap(Filter *f);
     
    5353  virtual void draw_first(image *screen);
    5454  virtual void draw(int active, image *screen);
    55   virtual void handle_event(event &ev, image *screen, InputManager *im);
     55  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    5656  virtual ~button_box();
    5757  virtual char *read();   // return pointer to first button which is depressed
     
    8484  virtual void draw_first(image *screen);
    8585  virtual void draw(int active, image *screen);
    86   virtual void handle_event(event &ev, image *screen, InputManager *im);
     86  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    8787
    8888  virtual ~text_field() { free(prompt); free(format); free(data); }
     
    104104  virtual void draw_first(image *screen);
    105105  virtual void draw(int active, image *screen) { ; }
    106   virtual void handle_event(event &ev, image *screen, InputManager *im) { ; }
     106  virtual void handle_event(Event &ev, image *screen, InputManager *im) { ; }
    107107  virtual char *read() { return text; }
    108108  virtual int selectable() { return 0; }
  • abuse/trunk/src/imlib/jwindow.cpp

    r579 r643  
    2222#include "event.h"
    2323#include "filter.h"
    24 #include "event.h"
    2524#include "jwindow.h"
    2625
     
    7372        {
    7473            p->hide();
    75             screen->AddDirty(p->x, p->y, p->x + p->l, p->y + p->h);
     74            m_screen->AddDirty(p->x, p->y, p->x + p->l, p->y + p->h);
    7675        }
    7776    }
     
    10099        k->next = j->next;
    101100    }
    102     screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
     101    m_screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
    103102    j->hide();
    104103}
     
    113112}
    114113
    115 void WindowManager::get_event(event &ev)
    116 {
    117   Jwindow *j;
    118   eh->get_event(ev);
     114void WindowManager::get_event(Event &ev)
     115{
     116  Get(ev);
     117
    119118  if (ev.type==EV_KEY)
    120119    key_state[ev.key]=1;
     
    124123  if (state==inputing)
    125124  {
     125    Jwindow *j;
    126126    for (ev.window=NULL,j=first; j; j=j->next)
    127127      if (!j->is_hidden() && ev.mouse_move.x>=j->x && ev.mouse_move.y>=j->y &&
     
    180180    {
    181181      Jwindow *j=ev.window;
    182 /*      screen->AddDirty(j->x,j->y,j->x+j->l,j->y+j->h);
     182/*      m_screen->AddDirty(j->x,j->y,j->x+j->l,j->y+j->h);
    183183      for (p=first; p!=j; p=p->next)
    184184        p->screen->AddDirty(j->x-p->x,j->y-p->y,j->x+j->l-p->x,j->y+j->h-p->y); */
     
    213213  if (ev.type == EV_REDRAW)
    214214  {
    215     for (j=first; j; j=j->next)
     215    for (Jwindow *j = first; j; j = j->next)
    216216       j->screen->AddDirty(ev.redraw.x1 - j->x, ev.redraw.y1 - j->y,
    217217                           ev.redraw.x2 + 1 - j->x, ev.redraw.y2 + 1 - j->y);
    218     screen->AddDirty(ev.redraw.x1, ev.redraw.y1, ev.redraw.x2 + 1, ev.redraw.y2 + 1);
     218    m_screen->AddDirty(ev.redraw.x1, ev.redraw.y1, ev.redraw.x2 + 1, ev.redraw.y2 + 1);
    219219    flush_screen();
    220220    ev.type=EV_SPURIOUS;   // we took care of this one by ourselves.
     
    231231{
    232232  Jwindow *p;
    233   screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
     233  m_screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
    234234  for (p=first; p!=j; p=p->next)
    235235    p->screen->AddDirty(j->x - p->x, j->y - p->y, j->x + j->l - p->x, j->y + j->h - p->y);
     
    241241void WindowManager::move_window(Jwindow *j, int x, int y)
    242242{
    243     screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
     243    m_screen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);
    244244    for(Jwindow *p = first; p != j; p = p->next)
    245245        p->screen->AddDirty(j->x - p->x, j->y - p->y,
     
    250250}
    251251
    252 WindowManager::WindowManager(image *Screen, palette *Pal, int Hi,
     252WindowManager::WindowManager(image *screen, palette *pal, int Hi,
    253253                             int Med, int Low, JCFont *Font)
     254  : EventHandler(screen, pal)
    254255{
    255256    wm = this;
    256     screen = Screen;
    257     hi = Hi; low = Low; med = Med; first = NULL; pal = Pal; grab = NULL;
     257    m_screen = screen;
     258    hi = Hi; low = Low; med = Med; first = NULL; m_pal = pal; grab = NULL;
    258259    bk = pal->find_closest(0, 0, 0);
    259260    state = inputing; fnt = Font;  wframe_fnt = Font;
    260261    memset(key_state, 0, sizeof(key_state));
    261     eh = new event_handler(screen, pal);
    262262    frame_suppress = 0;
    263263}
     
    265265WindowManager::~WindowManager()
    266266{
    267     delete eh;
    268267    while(first)
    269268        close_window(first);
     
    310309    }
    311310
    312     screen->AddDirty(win->x, win->y, win->x + win->l, win->y + win->h);
     311    m_screen->AddDirty(win->x, win->y, win->x + win->l, win->y + win->h);
    313312}
    314313
     
    316315                                     ifield * fields, char const *name)
    317316{
    318     if(x > screen->Size().x - 4)
    319         x = screen->Size().x - 25;
    320     if(y > screen->Size().y - 4)
    321         y = screen->Size().y - 10;
     317    if(x > m_screen->Size().x - 4)
     318        x = m_screen->Size().x - 25;
     319    if(y > m_screen->Size().y - 4)
     320        y = m_screen->Size().y - 10;
    322321
    323322    Jwindow * j = new Jwindow (x, y, l, h, fields, name);
     
    336335    if(has_mouse())
    337336    {
    338         mouse_pic = eh->mouse_sprite()->visual;
    339         mouse_save = eh->mouse_sprite()->save;
    340         mx = eh->mouse->drawx();
    341         my = eh->mouse->drawy();
    342 
    343         screen->put_part(mouse_save, 0, 0, mx, my,
     337        mouse_pic = mouse_sprite()->visual;
     338        mouse_save = mouse_sprite()->save;
     339        mx = mouse->drawx();
     340        my = mouse->drawy();
     341
     342        m_screen->put_part(mouse_save, 0, 0, mx, my,
    344343                         mx + mouse_pic->Size().x - 1,
    345344                         my + mouse_pic->Size().y - 1);
    346         mouse_pic->put_image(screen, mx, my, 1);
     345        mouse_pic->put_image(m_screen, mx, my, 1);
    347346    }
    348347
    349348    for(p = first; p; p = p->next)
    350349        if(!p->is_hidden())
    351             screen->delete_dirty(p->x, p->y, p->x + p->l, p->y + p->h);
    352     update_dirty(screen);
     350            m_screen->delete_dirty(p->x, p->y, p->x + p->l, p->y + p->h);
     351    update_dirty(m_screen);
    353352
    354353    if(has_mouse())
    355         mouse_save->put_image(screen, mx, my);
     354        mouse_save->put_image(m_screen, mx, my);
    356355
    357356    for(p = first; p; p = p->next)
     
    369368        }
    370369
    371 //          screen->delete_dirty(p->x, p->y, p->x+p->l, p->y+p->h);
     370//          m_screen->delete_dirty(p->x, p->y, p->x+p->l, p->y+p->h);
    372371        for(q = p->next; q; q = q->next)
    373372            if(!q->is_hidden())
     
    598597}
    599598
    600 void InputManager::handle_event(event &ev, Jwindow *j)
     599void InputManager::handle_event(Event &ev, Jwindow *j)
    601600{
    602601  ifield *i,*in_area=NULL;
  • abuse/trunk/src/imlib/jwindow.h

    r579 r643  
    1111#ifndef __JWIN__
    1212#define __JWIN__
     13
    1314#include "video.h"
    1415#include "image.h"
    1516#include "event.h"
    1617#include "filter.h"
    17 #include "event.h"
    1818#include "fonts.h"
    1919
     
    4040
    4141public:
    42   InputManager(image *Screen, ifield *First);
    43   InputManager(Jwindow *owner, ifield *First);
    44   void handle_event(event &ev, Jwindow *j);
     42  InputManager(image *screen, ifield *first);
     43  InputManager(Jwindow *owner, ifield *first);
     44  void handle_event(Event &ev, Jwindow *j);
    4545  ifield *get(int id);
    4646  void redraw();
     
    7474    virtual void draw_first(image *screen) = 0;
    7575    virtual void draw(int active, image *screen) = 0;
    76     virtual void handle_event(event &ev, image *screen, InputManager *im) = 0;
     76    virtual void handle_event(Event &ev, image *screen, InputManager *im) = 0;
    7777    virtual int selectable() { return 1; }
    7878    virtual void remap(Filter *f) { ; }
     
    133133};
    134134
    135 class WindowManager
     135class WindowManager : public EventHandler
    136136{
    137137    friend class Jwindow;
     
    142142
    143143public:
    144     event_handler *eh;
     144    WindowManager(image *, palette *, int hi, int med, int low, JCFont *);
     145    ~WindowManager();
     146
    145147    Jwindow *first, *grab;
    146     image *screen, *mouse_pic, *mouse_save;
    147     palette *pal;
     148    image *mouse_pic, *mouse_save;
    148149    int hi, med, low, bk; // bright, medium, dark and black colors
    149150    int key_state[512];
     
    152153    Jwindow *drag_window;
    153154    JCFont *fnt, *wframe_fnt;
    154 
    155     WindowManager(image *, palette *, int hi, int med, int low, JCFont *);
    156     ~WindowManager();
    157155
    158156    Jwindow *new_window(int x, int y, int l, int h,
     
    164162    void resize_window(Jwindow *j, int l, int h);
    165163    void move_window(Jwindow *j, int x, int y);
    166     void get_event(event &ev);
    167     void push_event(event *ev) { eh->push_event(ev); }
    168     int event_waiting() { return eh->event_waiting(); }
     164    void get_event(Event &ev);
    169165    void flush_screen();
    170166    int bright_color() { return hi; }
     
    174170    void set_colors(int Hi, int Med, int Low) { hi=Hi; med=Med; low=Low; }
    175171    JCFont *font() { return fnt; }
    176     int has_mouse() { return eh->has_mouse(); }
    177     void mouse_status(int &x, int &y, int &button) { eh->mouse_status(x,y,button); }
    178     void set_mouse_shape(image *im, int centerx, int centery)
    179     { eh->set_mouse_shape(im,centerx,centery); }
    180 
    181     void set_mouse_position(int mx, int my)
    182     { eh->set_mouse_position(mx,my); }
    183172
    184173    int key_pressed(int x) { return key_state[x]; }
     
    191180    void release_focus();
    192181    int window_in_area(int x1, int y1, int x2, int y2); // true if a window lies in this area
     182
     183private:
     184    palette *m_pal;
     185    image *m_screen;
    193186};
    194187
  • abuse/trunk/src/imlib/mouse.h

    r555 r643  
    3434  int last_button() { if (here) return lbut; else return 0; }
    3535  int button() { return but; }
    36   int exsist() { return here; }
     36  int exists() { return here; }
    3737  sprite *mouse_sprite() { return sp; }
    3838  void set_position(int new_mx, int new_my);
  • abuse/trunk/src/imlib/pmenu.cpp

    r555 r643  
    148148  calc_size(w,h);
    149149  int cx1, cy1, cx2, cy2;
    150   screen->GetClip(cx1, cy1, cx2, cy2);
     150  main_screen->GetClip(cx1, cy1, cx2, cy2);
    151151  // FIXME: is this correct? it looks like it used to be incorrect
    152152  // before the GetClip refactoring...
     
    191191  calc_size(w,h);
    192192  int cx1, cy1, cx2, cy2;
    193   screen->GetClip(cx1, cy1, cx2, cy2);
     193  main_screen->GetClip(cx1, cy1, cx2, cy2);
    194194  if (parent->x+w+x>=cx2)
    195195    x=cx2-1-w-parent->x;
     
    311311
    312312
    313 int psub_menu::handle_event(Jwindow *parent, int x, int y, event &ev)
     313int psub_menu::handle_event(Jwindow *parent, int x, int y, Event &ev)
    314314{
    315315  int w,h;
    316316  calc_size(w,h);
    317317  int cx1, cy1, cx2, cy2;
    318   screen->GetClip(cx1, cy1, cx2, cy2);
     318  main_screen->GetClip(cx1, cy1, cx2, cy2);
    319319
    320320  x=win->x;
     
    353353
    354354int pmenu_item::handle_event(Jwindow *parent, int x, int y, int w, int top,
    355                  event &ev)
     355                 Event &ev)
    356356{
    357357  x+=parent->x;
     
    364364    {
    365365      if (ev.type==EV_MOUSE_BUTTON &&n)
    366         wm->push_event(new event(id,(char *)this));
     366        wm->Push(new Event(id,(char *)this));
    367367      return 1;
    368368    }
     
    393393}
    394394
    395 int psub_menu::own_event(event &ev)
     395int psub_menu::own_event(Event &ev)
    396396{
    397397  if (win && ev.window==win) return 1; else
     
    402402}
    403403
    404 int pmenu_item::own_event(event &ev)
     404int pmenu_item::own_event(Event &ev)
    405405{
    406406  if (sub)
     
    413413}
    414414
    415 int pmenu::handle_event(event &ev, image *screen)
     415int pmenu::handle_event(Event &ev, image *screen)
    416416{
    417417  if (!active && ev.window!=bar) return 0;
     
    436436    if (r)
    437437    {
    438       wm->push_event(new event(r->id,(char *)r));
     438      wm->Push(new Event(r->id,(char *)r));
    439439      return 1;
    440440    }
  • abuse/trunk/src/imlib/pmenu.h

    r555 r643  
    3333  void draw       (Jwindow *parent, int x, int y, int w, int top, int active);
    3434  void draw_self  (Jwindow *parent, int x, int y, int w, int top, int active);
    35   int handle_event(Jwindow *parent, int x, int y, int w, int top, event &ev);
    36   int own_event(event &ev);
     35  int handle_event(Jwindow *parent, int x, int y, int w, int top, Event &ev);
     36  int own_event(Event &ev);
    3737  ~pmenu_item();
    3838} ;
     
    5252  psub_menu(pmenu_item *First, psub_menu *Next)
    5353  { first=First; Next=Next; win=0; active=0; }
    54   int handle_event(Jwindow *parent, int x, int y, event &ev);
     54  int handle_event(Jwindow *parent, int x, int y, Event &ev);
    5555  void draw(Jwindow *parent, int x, int y);
    5656  void hide(Jwindow *parent, int x, int y);
    57   int own_event(event &ev);
     57  int own_event(Event &ev);
    5858  ~psub_menu();
    5959} ;
     
    7272  void move(int new_x, int new_y);
    7373  void draw(image *screen, int top_only=0);
    74   int handle_event(event &ev, image *screen);
     74  int handle_event(Event &ev, image *screen);
    7575
    7676} ;
  • abuse/trunk/src/imlib/scroller.cpp

    r555 r643  
    180180
    181181
    182 void scroller::handle_event(event &ev, image *screen, InputManager *inm)
     182void scroller::handle_event(Event &ev, image *screen, InputManager *inm)
    183183{
    184184  int mx=ev.mouse_move.x,my=ev.mouse_move.y;
     
    414414}
    415415
    416 void pick_list::handle_inside_event(event &ev, image *screen, InputManager *inm)
     416void pick_list::handle_inside_event(Event &ev, image *screen, InputManager *inm)
    417417{
    418418  if (ev.type==EV_MOUSE_MOVE && activate_on_mouse_move())
     
    431431    {
    432432      if (sel==cur_sel)
    433       wm->push_event(new event(id,(char *)this));
     433      wm->Push(new Event(id,(char *)this));
    434434      else
    435435      {
     
    439439    }
    440440  } else if (ev.type==EV_KEY && ev.key==JK_ENTER)
    441     wm->push_event(new event(id,(char *)this));
     441    wm->Push(new Event(id,(char *)this));
    442442  else if (ev.type==EV_KEY)
    443443  {
     
    628628
    629629
    630 void spicker::handle_inside_event(event &ev, image *screen, InputManager *inm)
     630void spicker::handle_inside_event(Event &ev, image *screen, InputManager *inm)
    631631{
    632632  switch (ev.type)
  • abuse/trunk/src/imlib/scroller.h

    r555 r643  
    4242  virtual void draw_first(image *screen);
    4343  virtual void draw(int active, image *screen);
    44   virtual void handle_event(event &ev, image *screen, InputManager *im);
     44  virtual void handle_event(Event &ev, image *screen, InputManager *im);
    4545  virtual char *read() { return (char *)&sx; }
    4646
    4747  virtual int activate_on_mouse_move() { return 1; }
    48   virtual void handle_inside_event(event &ev, image *screen, InputManager *inm) { ; }
     48  virtual void handle_inside_event(Event &ev, image *screen, InputManager *inm) { ; }
    4949  virtual void scroll_event(int newx, image *screen);
    5050  virtual void handle_up(image *screen, InputManager *inm);
     
    7070  int first_selected();
    7171  virtual void scroll_event(int newx, image *screen);
    72   virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
     72  virtual void handle_inside_event(Event &ev, image *screen, InputManager *inm);
    7373
    7474  // you should define \/
     
    105105  pick_list(int X, int Y, int ID, int height,
    106106        char **List, int num_entries, int start_yoffset, ifield *Next, image *texture=NULL);
    107   virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
     107  virtual void handle_inside_event(Event &ev, image *screen, InputManager *inm);
    108108  virtual void scroll_event(int newx, image *screen);
    109109  virtual char *read() { return (char *)this; }
  • abuse/trunk/src/imlib/tools.h

    r579 r643  
    3939  virtual int item_height() { return ih; }
    4040  virtual void note_new_current(image *screen, InputManager *inm, int x)
    41   { wm->push_event(new event(ids[x],NULL)); }
     41  { wm->Push(new Event(ids[x],NULL)); }
    4242
    4343  void remap(palette *pal, image *screen);
  • abuse/trunk/src/imlib/video.h

    r555 r643  
    2222#include "image.h"
    2323
    24 
    2524extern int xres,yres;
    2625extern int xoff,yoff;
    27 extern image *screen;
     26extern image *main_screen;
    2827
    2928void set_mode(int mode, int argc=0, char **argv=NULL);
     
    4039
    4140#endif
     41
  • abuse/trunk/src/innet.cpp

    r629 r643  
    607607                if (wm->event_waiting())
    608608                {
    609                   event ev;
     609                  Event ev;
    610610                  do
    611611                  {
     
    707707    if (wm->event_waiting())
    708708    {
    709       event ev;
     709      Event ev;
    710710      do
    711711      {
  • abuse/trunk/src/level.cpp

    r635 r643  
    771771      char name[100];
    772772      sprintf(name,"shot%04d.pcx",screen_shot_on++);
    773       write_PCX(screen,pal,name);
     773      write_PCX(main_screen,pal,name);
    774774    }
    775775  }
     
    802802    the_game->game_to_mouse(a->x,a->y,v,sx1,sy1);
    803803    the_game->game_to_mouse(a->x+a->w,a->y+a->h,v,sx2,sy2);
    804     screen->rectangle(sx1,sy1,sx2,sy2,c1);
    805     screen->bar(sx1-1,sy1-1,sx1+1,sy1+1,c2);
    806     screen->bar(sx2-1,sy2-1,sx2+1,sy2+1,c2);
     804    main_screen->rectangle(sx1,sy1,sx2,sy2,c1);
     805    main_screen->bar(sx1-1,sy1-1,sx1+1,sy1+1,c2);
     806    main_screen->bar(sx2-1,sy2-1,sx2+1,sy2+1,c2);
    807807  }
    808808}
     
    10791079    fp->read(old_name,fp->read_uint8());
    10801080    int new_type=o_remap[i];
    1081     if (new_type<total_objects)     // make sure old object still exsist
     1081    if (new_type<total_objects)     // make sure old object still exists
    10821082    {
    10831083      int k=0;
     
    11171117      fp->read(old_name,fp->read_uint8());
    11181118      int new_type=o_remap[i];
    1119       if (new_type!=0xffff)        // make sure old object still exsist
     1119      if (new_type!=0xffff)        // make sure old object still exists
    11201120      {
    11211121        int k=0;
     
    13701370  stat_man->update(10);
    13711371
    1372   /***************** Check map for non exsistant tiles **************************/
     1372  /***************** Check map for non existsant tiles **************************/
    13731373  int32_t i,w;
    13741374  uint16_t *m;
     
    17921792      if (fp->read_uint8()==RC_32)
    17931793      {
    1794     int32_t m=fp->read_uint32();  // read how many weapons exsisted when last saved
     1794    int32_t m=fp->read_uint32();  // read how many weapons existsed when last saved
    17951795    int i;
    17961796    for (v=player_list; v; v=v->next)
     
    23232323            {
    23242324                write_player_info( fp, objs );
    2325                 write_thumb_nail( fp,screen );
     2325                write_thumb_nail( fp,main_screen );
    23262326            }
    23272327
  • abuse/trunk/src/light.cpp

    r579 r643  
    794794  light_patch *f=first;
    795795
    796   screen->Lock();
    797 
    798   int scr_w=screen->Size().x;
    799   uint8_t *screen_line=screen->scan_line(cy1)+cx1;
     796  main_screen->Lock();
     797
     798  int scr_w=main_screen->Size().x;
     799  uint8_t *screen_line=main_screen->scan_line(cy1)+cx1;
    800800
    801801  for (int y = cy1; y < cy2; )
     
    887887    screen_line-=prefix;
    888888  }
    889   screen->Unlock();
     889  main_screen->Unlock();
    890890
    891891  while (first)
  • abuse/trunk/src/lisp/lisp.cpp

    r638 r643  
    764764
    765765
    766 LSymbol *make_find_symbol(char const *name)    // find a symbol, if it doesn't exsist it is created
     766LSymbol *make_find_symbol(char const *name)    // find a symbol, if it doesn't exists it is created
    767767{
    768768  LSymbol *s=find_symbol(name);
  • abuse/trunk/src/loadgame.cpp

    r619 r643  
    112112
    113113  Jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,MAX_SAVE_LINES,NULL);
    114   event ev;
     114  Event ev;
    115115  int got_level=0;
    116116  int quit=0;
     
    238238    first->put_image(preview->screen,preview->x1(),preview->y1());
    239239
    240     event ev;
     240    Event ev;
    241241    int got_level=0;
    242242    int quit=0;
  • abuse/trunk/src/menu.cpp

    r635 r643  
    5252  int x,y;
    5353  int cx1, cy1, cx2, cy2;
    54   screen->GetClip(cx1, cy1, cx2, cy2);
     54  main_screen->GetClip(cx1, cy1, cx2, cy2);
    5555  if (x1<cx1) x1=cx1;
    5656  if (y1<cy1) y1=cy1;
     
    6161  percent=256-percent;
    6262
    63   screen->Lock();
     63  main_screen->Lock();
    6464  for (y=y1; y<=y2; y++)
    6565  {
    66     uint8_t *sl=screen->scan_line(y)+x1;
     66    uint8_t *sl=main_screen->scan_line(y)+x1;
    6767    for (x=x1; x<=x2; x++,sl++)
    6868    {
     
    7474    }
    7575  }
    76   screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
    77   screen->Unlock();
     76  main_screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
     77  main_screen->Unlock();
    7878}
    7979
     
    8282  int x,y;
    8383  int cx1, cy1, cx2, cy2;
    84   screen->GetClip(cx1, cy1, cx2, cy2);
     84  main_screen->GetClip(cx1, cy1, cx2, cy2);
    8585  if (x1<cx1) x1=cx1;
    8686  if (y1<cy1) y1=cy1;
     
    8989  if (x2<x1 || y2<y1) return ;
    9090
    91   screen->Lock();
     91  main_screen->Lock();
    9292  for (y=y1; y<=y2; y++)
    9393  {
    94     uint8_t *sl=screen->scan_line(y)+x1;
     94    uint8_t *sl=main_screen->scan_line(y)+x1;
    9595    for (x=x1; x<=x2; x++,sl++)
    9696    {
     
    102102    }
    103103  }
    104   screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
    105   screen->Unlock();
     104  main_screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
     105  main_screen->Unlock();
    106106}
    107107
    108108void dark_widget(int x1, int y1, int x2, int y2, int br, int dr, int amount)
    109109{
    110   screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
    111   screen->line(x1,y1,x1,y2,br);
    112   screen->line(x1+1,y1,x2,y1,br);
    113   screen->line(x2,y1+1,x2,y2,dr);
    114   screen->line(x1+1,y2,x2,y2,dr);
     110  main_screen->AddDirty(x1, y1, x2 + 1, y2 + 1);
     111  main_screen->line(x1,y1,x1,y2,br);
     112  main_screen->line(x1+1,y1,x2,y1,br);
     113  main_screen->line(x2,y1+1,x2,y2,dr);
     114  main_screen->line(x1+1,y2,x2,y2,dr);
    115115  darken_area(x1+1,y1+1,x2-1,y2-1,amount);
    116116}
     
    154154
    155155  int mw=(font->width())*maxw+20;
    156   int mx=screen->Size().x/2-mw/2,
    157       my=screen->Size().y/2-mh/2;
    158 
    159 
    160   screen->AddDirty(mx, my, mx + mw, my + mh);
     156  int mx=main_screen->Size().x/2-mw/2,
     157      my=main_screen->Size().y/2-mh/2;
     158
     159
     160  main_screen->AddDirty(mx, my, mx + mw, my + mh);
    161161
    162162  if (title)
    163163  {
    164164    int tl=strlen(title)*font->width();
    165     int tx=screen->Size().x/2-tl/2;
     165    int tx=main_screen->Size().x/2-tl/2;
    166166    dark_widget(tx-2,my-font->height()-4,tx+tl+2,my-2,wm->medium_color(),wm->dark_color(),180);
    167     font->put_string(screen,tx+1,my-font->height()-2,title,wm->bright_color());
     167    font->put_string(main_screen,tx+1,my-font->height()-2,title,wm->bright_color());
    168168  }
    169169
     
    175175  {
    176176    char *ms=men_str(CAR(c));
    177     font->put_string(screen,mx+10+1,y+1,ms,wm->black());
    178     font->put_string(screen,mx+10,y,ms,wm->bright_color());
     177    font->put_string(main_screen,mx+10+1,y+1,ms,wm->black());
     178    font->put_string(main_screen,mx+10,y,ms,wm->bright_color());
    179179    y+=font->height()+1;
    180180  }
    181181
    182182  wm->flush_screen();
    183   event ev;
     183  Event ev;
    184184  int choice=0,done=0;
    185185  int bh=font->height()+3;
     
    240240      int by2=by1+bh-1;
    241241
    242       screen->put_part(save,0,0,mx+1,by1,mx+mw-2,by2);
     242      main_screen->put_part(save,0,0,mx+1,by1,mx+mw-2,by2);
    243243      tint_area(mx+1,by1,mx+mw-2,by2,63,63,63,color);
    244244
    245245      char *cur=men_str(nth(choice,args));
    246       font->put_string(screen,mx+10+1,by1+3,cur,wm->black());
    247       font->put_string(screen,mx+10,by1+2,cur,wm->bright_color());
    248       screen->rectangle(mx+1,by1,mx+mw-2,by2,wm->bright_color());
     246      font->put_string(main_screen,mx+10+1,by1+3,cur,wm->black());
     247      font->put_string(main_screen,mx+10,by1+2,cur,wm->bright_color());
     248      main_screen->rectangle(mx+1,by1,mx+mw-2,by2,wm->bright_color());
    249249
    250250      color+=cdir;
     
    256256      }
    257257      wm->flush_screen();
    258       save->put_image(screen,mx+1,by1);
     258      save->put_image(main_screen,mx+1,by1);
    259259    } else { Timer tmp; tmp.WaitMs(10); }
    260260
     
    286286    while(volume_window)
    287287    {
    288         event ev;
     288        Event ev;
    289289
    290290        do
     
    410410      fade_in(cache.img(im),16);
    411411
    412       event ev;
     412      Event ev;
    413413      do
    414414      { wm->flush_screen();
     
    425425
    426426
    427 void menu_handler(event &ev, InputManager *inm)
     427void menu_handler(Event &ev, InputManager *inm)
    428428{
    429429  switch (ev.type)
     
    516516    {
    517517      show_sell(1);
    518       screen->clear();
     518      main_screen->clear();
    519519      if (title_screen>=0)
    520520      {
    521521        image *tit=cache.img(title_screen);
    522           tit->put_image(screen,screen->Size().x/2-tit->Size().x/2,
    523                           screen->Size().y/2-tit->Size().y/2);
     522          tit->put_image(main_screen,main_screen->Size().x/2-tit->Size().x/2,
     523                          main_screen->Size().y/2-tit->Size().y/2);
    524524      }
    525525      inm->redraw();
     
    661661    list=make_default_buttons(xres-33,y,list);
    662662
    663     InputManager *inm=new InputManager(screen,list);
     663    InputManager *inm=new InputManager(main_screen,list);
    664664    inm->allow_no_selections();
    665665    inm->clear_current();
    666666
    667     screen->AddDirty(0, 0, 320, 200);
    668 
    669     event ev;
     667    main_screen->AddDirty(0, 0, 320, 200);
     668
     669    Event ev;
    670670
    671671    int stop_menu=0;
     
    684684            inm->handle_event(ev,NULL);
    685685            if (ev.type==EV_KEY && ev.key==JK_ESC)
    686                 wm->push_event(new event(ID_QUIT,NULL));
     686                wm->Push(new Event(ID_QUIT,NULL));
    687687
    688688            menu_handler(ev,inm);
  • abuse/trunk/src/morpher.cpp

    r642 r643  
    2626    int32_t rx,ry;
    2727    the_game->game_to_mouse(who->x-(cx>>16),who->y-(cy>>16),v,rx,ry);
    28     mor->show(screen,rx,ry,color_table,pal,1000);
     28    mor->show(main_screen,rx,ry,color_table,pal,1000);
    2929    cx+=dcx;
    3030    cy+=dcy;
  • abuse/trunk/src/net/engine.cpp

    r555 r643  
    155155
    156156
    157   unlink(DIN_NAME);    // remove any previous files if they exsists
     157  unlink(DIN_NAME);    // remove any previous files if they existss
    158158  unlink(DOUT_NAME);
    159159
  • abuse/trunk/src/net/gserver.cpp

    r555 r643  
    6363  int last_count=0;
    6464  Jwindow *stat=NULL;
    65   event ev;
     65  Event ev;
    6666  int abort=0;
    6767  while (!abort && total_players()<main_net_cfg->min_players)
  • abuse/trunk/src/net/undrv.cpp

    r555 r643  
    9191    unlink(DLOCK_NAME);
    9292  }
    93   unlink(DIN_NAME);    // remove any previous files if they exsists
     93  unlink(DIN_NAME);    // remove any previous files if they existss
    9494  unlink(DOUT_NAME);
    9595  return 1;
  • abuse/trunk/src/netcfg.cpp

    r629 r643  
    6666  Jwindow *j=wm->new_window(-1,0,-1,-1,new info_field(0, 0, 0, msg,
    6767      new button(0, 30,CFG_ERR_OK,symbol_str("ok_button"),NULL)),symbol_str("input_error"));
    68   event ev;
     68  Event ev;
    6969  do
    7070  {
     
    188188                        NULL)))),symbol_str("Networking"));
    189189
    190   event ev;
     190  Event ev;
    191191  int done=0;
    192192  do
     
    270270void net_configuration::error(char const *message)
    271271{
    272   image *screen_backup=screen->copy();
     272  image *screen_backup = main_screen->copy();
    273273
    274274  image *ns=cache.img(cache.reg("art/frame.spe","net_screen",SPEC_IMAGE,1));
    275275  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    276276  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    277   ns->put_image(screen,x,y);
     277  ns->put_image(main_screen,x,y);
    278278  JCFont *fnt=wm->font();
    279279
    280280  uint8_t *remap=white_light+30*256;
    281281
    282   uint8_t *sl=screen->scan_line(0);
    283   int xx=screen->Size().x*screen->Size().y;
     282  uint8_t *sl = main_screen->scan_line(0);
     283  int xx = main_screen->Size().x * main_screen->Size().y;
    284284  for (; xx; xx--,sl++) *sl=remap[*sl];
    285285
     
    287287    fy=y+ns_h/2-fnt->height();
    288288
    289   fnt->put_string(screen,fx+1,fy+1,message,wm->black());
    290   fnt->put_string(screen,fx,fy,message,wm->bright_color());
     289  fnt->put_string(main_screen,fx+1,fy+1,message,wm->black());
     290  fnt->put_string(main_screen,fx,fy,message,wm->bright_color());
    291291
    292292
     
    299299    button *sb=new button(bx,by,NET_SERVER,ok,NULL);
    300300
    301     InputManager inm(screen,sb);
     301    InputManager inm(main_screen, sb);
    302302    inm.allow_no_selections();
    303303    inm.clear_current();
    304304
    305305    int done=0;
    306     event ev;
     306    Event ev;
    307307    do
    308308    {
     
    315315  }
    316316
    317   screen_backup->put_image(screen,0,0);
     317  screen_backup->put_image(main_screen, 0, 0);
    318318  wm->flush_screen();
    319319  delete screen_backup;
     
    340340  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    341341  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    342   ns->put_image(screen,x,y);
     342  ns->put_image(main_screen,x,y);
    343343  JCFont *fnt=wm->font();
    344344  image *ok_image=cache.img(cache.reg("art/frame.spe","dev_ok",SPEC_IMAGE,1))->copy(),
     
    419419
    420420  {
    421     InputManager inm(screen,list);
     421    InputManager inm(main_screen, list);
    422422    inm.allow_no_selections();
    423423    inm.clear_current();
    424424
    425425    int done=0;
    426     event ev;
     426    Event ev;
    427427    do
    428428    {
     
    455455  int ret=0;
    456456#if !defined __CELLOS_LV2__
    457   screen->clear();
     457  main_screen->clear();
    458458
    459459  image *ns=cache.img(cache.reg("art/frame.spe","net_screen",SPEC_IMAGE,1));
    460460  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    461461  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    462   ns->put_image(screen,x,y);
     462  ns->put_image(main_screen, x, y);
    463463  char const *nw_s = symbol_str("Networking");
    464464  JCFont *fnt=wm->font();
    465465
    466466
    467   wm->font()->put_string(screen,x+ns_w/2-strlen(nw_s)*fnt->width()/2,y+21/2-fnt->height()/2,
     467  wm->font()->put_string(main_screen,x+ns_w/2-strlen(nw_s)*fnt->width()/2,y+21/2-fnt->height()/2,
    468468      nw_s,wm->medium_color());
    469469  {
     
    475475      sb=new button(x+40,y+ns_h-9-fnt->height(),NET_SINGLE,symbol_str("single_play"),sb);
    476476
    477     InputManager inm(screen,sb);
     477    InputManager inm(main_screen,sb);
    478478
    479479    inm.allow_no_selections();
     
    481481
    482482
    483     event ev;
     483    Event ev;
    484484    int done=0;
    485485    int button_y=25,total_games=0;
  • abuse/trunk/src/objects.cpp

    r642 r643  
    110110      if (t->tiv<=number || !t->vars[number])
    111111      {
    112     lbreak("access : variable does not exsist for this class\n");
     112    lbreak("access : variable does not exists for this class\n");
    113113    return 0;
    114114      }
     
    393393
    394394    for (i=sy1; i<=sy2; i++)
    395       p->PutScanLine(screen,vec2i(sx,i),0);
     395      p->PutScanLine(main_screen,vec2i(sx,i),0);
    396396  }
    397397}
     
    669669{
    670670  TransImage *cpict=picture();
    671   cpict->PutFade(screen,
     671  cpict->PutFade(main_screen,
    672672          vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    673673                y-cpict->Size().y+1-current_vyadd),
     
    681681  TransImage *cpict=picture();
    682682  if (fade_count())
    683     cpict->PutFadeTint(screen,
     683    cpict->PutFadeTint(main_screen,
    684684               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    685685                     y-cpict->Size().y+1-current_vyadd),
     
    690690
    691691  else
    692     cpict->PutRemap(screen,
     692    cpict->PutRemap(main_screen,
    693693               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    694694                     y-cpict->Size().y+1-current_vyadd),
     
    701701  TransImage *cpict=picture();
    702702  if (fade_count())
    703     cpict->PutFadeTint(screen,
     703    cpict->PutFadeTint(main_screen,
    704704               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    705705                     y-cpict->Size().y+1-current_vyadd),
     
    710710
    711711  else
    712     cpict->PutDoubleRemap(screen,
     712    cpict->PutDoubleRemap(main_screen,
    713713               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    714714                     y-cpict->Size().y+1-current_vyadd),
     
    722722{
    723723  TransImage *cpict=picture();
    724   cpict->PutPredator(screen,
     724  cpict->PutPredator(main_screen,
    725725             vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    726726                   y-cpict->Size().y+1-current_vyadd));
     
    745745    {
    746746      TransImage *cpict=picture();
    747       cpict->PutImage(screen,
     747      cpict->PutImage(main_screen,
    748748               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    749749                     y-cpict->Size().y+1-current_vyadd));
  • abuse/trunk/src/particle.cpp

    r635 r643  
    165165  for (part_animation *p=first_anim; p; p=p->next)
    166166  {
    167     cache.part(p->seq->frames[p->frame])->draw(screen,p->x-v->xoff()+v->cx1,p->y-v->yoff()+v->cy1,p->dir);
     167    cache.part(p->seq->frames[p->frame])->draw(main_screen,p->x-v->xoff()+v->cx1,p->y-v->yoff()+v->cy1,p->dir);
    168168  }
    169169}
     
    210210{
    211211    int cx1, cy1, cx2, cy2;
    212     screen->GetClip(cx1, cy1, cx2, cy2);
     212    main_screen->GetClip(cx1, cy1, cx2, cy2);
    213213
    214214    int t = abs( x2 - x1 ) > abs( y2 - y1 ) ? abs( x2 - x1 ) + 1 : abs( y2 - y1 ) + 1;
     
    219219    s = ( 15 - s );
    220220
    221     screen->Lock();
     221    main_screen->Lock();
    222222    while( t-- )
    223223    {
     
    226226        if( !( x < cx1 || y < cy1 || x >= cx2 || y >= cy2 ) )
    227227        {
    228             *(screen->scan_line( y ) + x ) = c;
     228            *(main_screen->scan_line( y ) + x ) = c;
    229229        }
    230230        xo += dx;
    231231        yo += dy;
    232232    }
    233     screen->Unlock();
     233    main_screen->Unlock();
    234234}
    235235
     
    239239{
    240240    int cx1, cy1, cx2, cy2;
    241     screen->GetClip(cx1, cy1, cx2, cy2);
     241    main_screen->GetClip(cx1, cy1, cx2, cy2);
    242242
    243243    int t = abs( x2 - x1 ) > abs( y2 - y1 ) ? abs( x2 - x1 ) + 1 : abs( y2 - y1 ) + 1;
     
    248248    s = ( 15 - s );
    249249
    250     screen->Lock();
    251 
    252     int w = screen->Size().x;
     250    main_screen->Lock();
     251
     252    int w = main_screen->Size().x;
    253253    uint8_t *addr;
    254254
     
    261261        if( !( x <= cx1 || y <= cy1 || x >= cx2 - 1 || y >= cy2 - 1) )
    262262        {
    263             addr = screen->scan_line( y ) + x;
     263            addr = main_screen->scan_line( y ) + x;
    264264            *addr = c1;
    265265            *(addr + w) = c2;
     
    272272    }
    273273
    274     screen->Unlock();
    275 }
    276 
     274    main_screen->Unlock();
     275}
     276
  • abuse/trunk/src/profile.cpp

    r555 r643  
    4444}
    4545
    46 int profile_handle_event(event &ev)
     46int profile_handle_event(Event &ev)
    4747{
    4848  if (ev.type==EV_CLOSE_WINDOW && ev.window==prof_win)
  • abuse/trunk/src/profile.h

    r555 r643  
    2020void profile_update();
    2121void profile_toggle();
    22 int profile_handle_event(event &ev);
     22int profile_handle_event(Event &ev);
    2323int profiling();
    2424
  • abuse/trunk/src/sdlport/event.cpp

    r577 r643  
    3636#include "game.h"
    3737
    38 extern int get_key_binding( char const *dir, int i );
     38extern int get_key_binding(char const *dir, int i);
    3939extern int mouse_xscale, mouse_yscale;
    4040short mouse_buttons[5] = { 0, 0, 0, 0, 0 };
    4141
    4242// Pre-declarations
    43 void handle_mouse( event &ev );
     43void handle_mouse(Event &ev);
    4444
    4545//
    4646// Constructor
    4747//
    48 event_handler::event_handler( image *screen, palette *pal )
    49 {
    50     CHECK( screen && pal );
    51     mouse = new JCMouse( screen, pal );
    52     mhere = mouse->exsist();
     48EventHandler::EventHandler(image *screen, palette *pal)
     49{
     50    CHECK(screen && pal);
     51    mouse = new JCMouse(screen, pal);
     52    mhere = mouse->exists();
    5353    last_keystat = get_key_flags();
    5454    ewaiting = 0;
    5555
    5656    // Ignore activate events
    57     SDL_EventState( SDL_ACTIVEEVENT, SDL_IGNORE );
    58 }
    59 
    60 //
    61 // Destructor
    62 //
    63 event_handler::~event_handler()
    64 {
    65     delete mouse;
    66 }
    67 
    68 //
    69 // flush_screen()
    70 // Redraw the screen
    71 //
    72 void event_handler::flush_screen()
    73 {
    74     update_dirty( screen );
     57    SDL_EventState(SDL_ACTIVEEVENT, SDL_IGNORE);
    7558}
    7659
     
    7962// Return the flag for the key modifiers
    8063//
    81 int event_handler::get_key_flags()
     64int EventHandler::get_key_flags()
    8265{
    8366    SDLMod key_flag;
     
    8568    key_flag = SDL_GetModState();
    8669
    87     return ( ( key_flag & KMOD_SHIFT ) != 0 ) << 3 |
    88            ( ( key_flag & KMOD_CTRL ) != 0 ) << 2 |
    89            ( ( key_flag & KMOD_ALT ) != 0 ) << 1;
     70    return ((key_flag & KMOD_SHIFT) != 0) << 3 |
     71           ((key_flag & KMOD_CTRL) != 0) << 2 |
     72           ((key_flag & KMOD_ALT) != 0) << 1;
    9073}
    9174
     
    9477// Are there any events in the queue?
    9578//
    96 int event_handler::event_waiting()
    97 {
    98     if( ewaiting )
     79int EventHandler::event_waiting()
     80{
     81    if(ewaiting)
    9982    {
    10083        return 1;
    10184    }
    102     if( SDL_PollEvent( NULL ) )
     85    if(SDL_PollEvent(NULL))
    10386    {
    10487        ewaiting = 1;
    10588    }
    10689    return ewaiting;
    107 }
    108 
    109 //
    110 // add_redraw()
    111 // Add a redraw rectangle.
    112 //
    113 void event_handler::add_redraw( int X1, int Y1, int X2, int Y2, void *Start )
    114 {
    115     event *ev;
    116     ev = new event;
    117     ev->type = EV_REDRAW;
    118     ev->redraw.x1 = X1;
    119     ev->redraw.x2 = X2;
    120     ev->redraw.y1 = Y1;
    121     ev->redraw.y2 = Y2;
    122     ev->redraw.start = Start;
    123     events.add_end(ev);
    12490}
    12591
     
    12894// Get and handle waiting events
    12995//
    130 void event_handler::get_event( event &ev )
    131 {
    132     event *ep;
    133     while( !ewaiting )
     96void EventHandler::Get(Event &ev)
     97{
     98    Event *ep;
     99    while(!ewaiting)
    134100    {
    135101        event_waiting();
     
    142108    }
    143109
    144     ep = (event *)events.first();
    145     if( ep )
     110    ep = (Event *)m_events.first();
     111    if(ep)
    146112    {
    147113        ev = *ep;
    148         events.unlink(ep);
     114        m_events.unlink(ep);
    149115        delete ep;
    150         ewaiting = events.first() != NULL;
     116        ewaiting = m_events.first() != NULL;
    151117    }
    152118    else
     
    159125
    160126        // Gather events
    161         SDL_Event event;
    162         if( SDL_PollEvent( &event ) )
     127        SDL_Event Event;
     128        if(SDL_PollEvent(&Event))
    163129        {
    164130            // always sort the mouse out
    165             handle_mouse( ev );
    166             mouse->update( ev.mouse_move.x, ev.mouse_move.y, ev.mouse_button );
    167 
    168             switch( event.type )
     131            handle_mouse(ev);
     132            mouse->update(ev.mouse_move.x, ev.mouse_move.y, ev.mouse_button);
     133
     134            switch(Event.type)
    169135            {
    170136                case SDL_QUIT:
     
    175141                case SDL_MOUSEBUTTONUP:
    176142                {
    177                     switch( event.button.button )
     143                    switch(Event.button.button)
    178144                    {
    179145                        case 4:        // Mouse wheel goes up...
    180146                        {
    181                             ev.key = get_key_binding( "b4", 0 );
     147                            ev.key = get_key_binding("b4", 0);
    182148                            ev.type = EV_KEYRELEASE;
    183149                            break;
     
    185151                        case 5:        // Mouse wheel goes down...
    186152                        {
    187                             ev.key = get_key_binding( "b3", 0 );
     153                            ev.key = get_key_binding("b3", 0);
    188154                            ev.type = EV_KEYRELEASE;
    189155                            break;
     
    194160                case SDL_MOUSEBUTTONDOWN:
    195161                {
    196                     switch( event.button.button )
     162                    switch(Event.button.button)
    197163                    {
    198164                        case 4:        // Mouse wheel goes up...
    199165                        {
    200                             ev.key = get_key_binding( "b4", 0 );
     166                            ev.key = get_key_binding("b4", 0);
    201167                            ev.type = EV_KEY;
    202168                            break;
     
    204170                        case 5:        // Mouse wheel goes down...
    205171                        {
    206                             ev.key = get_key_binding( "b3", 0 );
     172                            ev.key = get_key_binding("b3", 0);
    207173                            ev.type = EV_KEY;
    208174                            break;
     
    216182                    // Default to EV_SPURIOUS
    217183                    ev.key = EV_SPURIOUS;
    218                     if( event.type == SDL_KEYDOWN )
     184                    if(Event.type == SDL_KEYDOWN)
    219185                    {
    220186                        ev.type = EV_KEY;
     
    224190                        ev.type = EV_KEYRELEASE;
    225191                    }
    226                     switch( event.key.keysym.sym )
     192                    switch(Event.key.keysym.sym)
    227193                    {
    228194                        case SDLK_DOWN:            ev.key = JK_DOWN; break;
     
    266232                        {
    267233                            // Only handle key down
    268                             if( ev.type == EV_KEY )
     234                            if(ev.type == EV_KEY)
    269235                            {
    270236                                // Toggle fullscreen
    271                                 SDL_WM_ToggleFullScreen( SDL_GetVideoSurface() );
     237                                SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
    272238                            }
    273239                            ev.key = EV_SPURIOUS;
     
    277243                        {
    278244                            // Only handle key down
    279                             if( ev.type == EV_KEY )
     245                            if(ev.type == EV_KEY)
    280246                            {
    281247                                // Toggle grab mouse
    282                                 if( SDL_WM_GrabInput( SDL_GRAB_QUERY ) == SDL_GRAB_ON )
    283                                 {
    284                                     the_game->show_help( "Grab Mouse: OFF\n" );
    285                                     SDL_WM_GrabInput( SDL_GRAB_OFF );
     248                                if(SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
     249                                {
     250                                    the_game->show_help("Grab Mouse: OFF\n");
     251                                    SDL_WM_GrabInput(SDL_GRAB_OFF);
    286252                                }
    287253                                else
    288254                                {
    289                                     the_game->show_help( "Grab Mouse: ON\n" );
    290                                     SDL_WM_GrabInput( SDL_GRAB_ON );
     255                                    the_game->show_help("Grab Mouse: ON\n");
     256                                    SDL_WM_GrabInput(SDL_GRAB_ON);
    291257                                }
    292258                            }
     
    297263                        {
    298264                            // Only handle key down
    299                             if( ev.type == EV_KEY )
     265                            if(ev.type == EV_KEY)
    300266                            {
    301267                                // Grab a screenshot
    302                                 SDL_SaveBMP( SDL_GetVideoSurface(), "screenshot.bmp" );
    303                                 the_game->show_help( "Screenshot saved to: screenshot.bmp.\n" );
     268                                SDL_SaveBMP(SDL_GetVideoSurface(), "screenshot.bmp");
     269                                the_game->show_help("Screenshot saved to: screenshot.bmp.\n");
    304270                            }
    305271                            ev.key = EV_SPURIOUS;
     
    308274                        default:
    309275                        {
    310                             ev.key = (int)event.key.keysym.sym;
     276                            ev.key = (int)Event.key.keysym.sym;
    311277                            // Need to handle the case of shift being pressed
    312278                            // There has to be a better way
    313                             if( (event.key.keysym.mod & KMOD_SHIFT) != 0 )
     279                            if((Event.key.keysym.mod & KMOD_SHIFT) != 0)
    314280                            {
    315                                 if( event.key.keysym.sym >= SDLK_a &&
    316                                     event.key.keysym.sym <= SDLK_z )
     281                                if(Event.key.keysym.sym >= SDLK_a &&
     282                                    Event.key.keysym.sym <= SDLK_z)
    317283                                {
    318284                                    ev.key -= 32;
    319285                                }
    320                                 else if( event.key.keysym.sym >= SDLK_1 &&
    321                                          event.key.keysym.sym <= SDLK_5 )
     286                                else if(Event.key.keysym.sym >= SDLK_1 &&
     287                                         Event.key.keysym.sym <= SDLK_5)
    322288                                {
    323289                                    ev.key -= 16;
     
    325291                                else
    326292                                {
    327                                     switch( event.key.keysym.sym )
     293                                    switch(Event.key.keysym.sym)
    328294                                    {
    329295                                        case SDLK_6:
     
    371337// able to detect that.
    372338//
    373 void handle_mouse( event &ev )
     339void handle_mouse(Event &ev)
    374340{
    375341    Uint8 buttons;
     
    377343
    378344    // always sort the mouse out
    379     buttons = SDL_GetMouseState( &x, &y );
    380     x = (x << 16) / mouse_xscale;
    381     y = (y << 16) / mouse_yscale;
    382     if( x > screen->Size().x - 1 )
    383     {
    384         x = screen->Size().x - 1;
    385     }
    386     if( y > screen->Size().y - 1 )
    387     {
    388         y = screen->Size().y - 1;
    389     }
     345    buttons = SDL_GetMouseState(&x, &y);
     346    x = Min((x << 16) / mouse_xscale, main_screen->Size().x - 1);
     347    y = Min((y << 16) / mouse_yscale, main_screen->Size().y - 1);
    390348    ev.mouse_move.x = x;
    391349    ev.mouse_move.y = y;
     
    393351
    394352    // Left button
    395     if( (buttons & SDL_BUTTON(1)) && !mouse_buttons[1] )
     353    if((buttons & SDL_BUTTON(1)) && !mouse_buttons[1])
    396354    {
    397355        ev.type = EV_MOUSE_BUTTON;
     
    399357        ev.mouse_button |= LEFT_BUTTON;
    400358    }
    401     else if( !(buttons & SDL_BUTTON(1)) && mouse_buttons[1] )
     359    else if(!(buttons & SDL_BUTTON(1)) && mouse_buttons[1])
    402360    {
    403361        ev.type = EV_MOUSE_BUTTON;
    404362        mouse_buttons[1] = !mouse_buttons[1];
    405         ev.mouse_button &= ( 0xff - LEFT_BUTTON );
     363        ev.mouse_button &= (0xff - LEFT_BUTTON);
    406364    }
    407365
    408366    // Middle button
    409     if( (buttons & SDL_BUTTON(2)) && !mouse_buttons[2] )
     367    if((buttons & SDL_BUTTON(2)) && !mouse_buttons[2])
    410368    {
    411369        ev.type = EV_MOUSE_BUTTON;
     
    414372        ev.mouse_button |= RIGHT_BUTTON;
    415373    }
    416     else if( !(buttons & SDL_BUTTON(2)) && mouse_buttons[2] )
     374    else if(!(buttons & SDL_BUTTON(2)) && mouse_buttons[2])
    417375    {
    418376        ev.type = EV_MOUSE_BUTTON;
    419377        mouse_buttons[2] = !mouse_buttons[2];
    420         ev.mouse_button &= ( 0xff - LEFT_BUTTON );
    421         ev.mouse_button &= ( 0xff - RIGHT_BUTTON );
     378        ev.mouse_button &= (0xff - LEFT_BUTTON);
     379        ev.mouse_button &= (0xff - RIGHT_BUTTON);
    422380    }
    423381
    424382    // Right button
    425     if( (buttons & SDL_BUTTON(3)) && !mouse_buttons[3] )
     383    if((buttons & SDL_BUTTON(3)) && !mouse_buttons[3])
    426384    {
    427385        ev.type = EV_MOUSE_BUTTON;
     
    429387        ev.mouse_button |= RIGHT_BUTTON;
    430388    }
    431     else if( !(buttons & SDL_BUTTON(3)) && mouse_buttons[3] )
     389    else if(!(buttons & SDL_BUTTON(3)) && mouse_buttons[3])
    432390    {
    433391        ev.type = EV_MOUSE_BUTTON;
    434392        mouse_buttons[3] = !mouse_buttons[3];
    435         ev.mouse_button &= ( 0xff - RIGHT_BUTTON );
    436     }
    437 }
     393        ev.mouse_button &= (0xff - RIGHT_BUTTON);
     394    }
     395}
  • abuse/trunk/src/sdlport/video.cpp

    r555 r643  
    4343
    4444SDL_Surface *window = NULL, *surface = NULL;
    45 image *screen = NULL;
     45image *main_screen = NULL;
    4646int win_xscale, win_yscale, mouse_xscale, mouse_yscale;
    4747int xres, yres;
     
    123123
    124124    // Create the screen image
    125     screen = new image(vec2i(xres, yres), NULL, 2);
    126     if(screen == NULL)
     125    main_screen = new image(vec2i(xres, yres), NULL, 2);
     126    if(main_screen == NULL)
    127127    {
    128128        // Our screen image is no good, we have to bail.
     
    130130        exit(1);
    131131    }
    132     screen->clear();
     132    main_screen->clear();
    133133
    134134    if (flags.gl)
     
    203203        SDL_WM_GrabInput(SDL_GRAB_ON);
    204204
    205     update_dirty(screen);
     205    update_dirty(main_screen);
    206206}
    207207
     
    223223        SDL_FreeSurface(texture);
    224224#endif
    225     delete screen;
     225    delete main_screen;
    226226}
    227227
  • abuse/trunk/src/statbar.cpp

    r555 r643  
    8686
    8787  int n=num/100;
    88   scale_put(cache.img(offset[n]),screen,x,y,dw,dh);
     88  scale_put(cache.img(offset[n]),main_screen,x,y,dw,dh);
    8989  num-=n*100;
    9090
    9191  x+=dw; n=num/10;
    92   scale_put(cache.img(offset[n]),screen,x,y,dw,dh);
     92  scale_put(cache.img(offset[n]),main_screen,x,y,dw,dh);
    9393  num-=n*10;
    9494
    9595  x+=dw;
    96   scale_put(cache.img(offset[num]),screen,x,y,dw,dh);
     96  scale_put(cache.img(offset[num]),main_screen,x,y,dw,dh);
    9797}
    9898
     
    264264
    265265    if (need_rf)
    266       redraw(screen);
     266      redraw(main_screen);
    267267  }
    268268}
  • abuse/trunk/src/view.cpp

    r635 r643  
    308308      {
    309309    last_weapons[i]=weapons[i];
    310         sbar.draw_ammo(screen,i,weapons[i],current_weapon==i);
     310        sbar.draw_ammo(main_screen,i,weapons[i],current_weapon==i);
    311311      }
    312312  }
     
    637637}
    638638
    639 int view::handle_event(event &ev)
     639int view::handle_event(Event &ev)
    640640{
    641641    if( ev.type == EV_KEY )
     
    721721        int h = focus->hp();
    722722        last_hp=h;
    723         sbar.draw_health( screen, focus->hp() );
     723        sbar.draw_health( main_screen, focus->hp() );
    724724    }
    725725    else
    726726    {
    727         sbar.draw_health( screen, 0 );
     727        sbar.draw_health( main_screen, 0 );
    728728    }
    729729}
     
    738738                                 // when adding or deleting local players
    739739{
    740   if (screen)
     740  if (main_screen)
    741741  {
    742742    int t=total_local_players();
     
    907907      current_object=o;
    908908    }
    909     sbar.redraw(screen);
     909    sbar.redraw(main_screen);
    910910
    911911    int i;
  • abuse/trunk/src/view.h

    r555 r643  
    103103  void note_upkey();
    104104  void note_downkey();
    105   int handle_event(event &ev);
     105  int handle_event(Event &ev);
    106106  void update_scroll();
    107107  void draw_hp();
Note: See TracChangeset for help on using the changeset viewer.