Ignore:
Timestamp:
May 16, 2011, 2:37:51 AM (11 years ago)
Author:
Sam Hocevar
Message:

game: prefix a few class members with m_ to avoid confusion.

File:
1 edited

Legend:

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

    r668 r676  
    5353  for (; f; f=f->next)
    5454  {
    55     if (f->focus)
    56     {
    57       int32_t tmp_d=abs(f->focus->x-who->x)+abs(f->focus->y-who->y);
     55    if (f->m_focus)
     56    {
     57      int32_t tmp_d=abs(f->m_focus->x-who->x)+abs(f->m_focus->y-who->y);
    5858      if (tmp_d<d)
    5959      {
    6060    d=tmp_d;
    61     c=f->focus;
     61    c=f->m_focus;
    6262      }
    6363    }
     
    7777game_object *level::main_character()
    7878{
    79   return the_game->first_view->focus;
     79  return the_game->first_view->m_focus;
    8080}
    8181
     
    8989  view *f=player_list;
    9090  for (; f; f=f->next)
    91     if (f->focus)
    92       current_level->remove_object(f->focus);
     91    if (f->m_focus)
     92      current_level->remove_object(f->m_focus);
    9393
    9494  while (first)
     
    131131  for (o=first; f && o; o=o->next)
    132132  {
    133     while (f && !f->focus) f=f->next;
     133    while (f && !f->m_focus) f=f->next;
    134134    if (f)
    135135    {
     
    137137      {
    138138    if (!found) found=o;
    139     f->focus->x=o->x;
    140     f->focus->y=o->y;
    141     f->focus->set_hp(get_ability(f->focus->otype,start_hp));
    142     f->focus->set_state(stopped);
     139    f->m_focus->x=o->x;
     140    f->m_focus->y=o->y;
     141    f->m_focus->set_hp(get_ability(f->m_focus->otype,start_hp));
     142    f->m_focus->set_state(stopped);
    143143    f=f->next;
    144144      }
     
    147147  while (f)
    148148  {
    149     if (f->focus)
    150     {
    151       f->focus->x=found->x;
    152       f->focus->y=found->y;
    153       f->focus->set_hp(get_ability(f->focus->otype,start_hp));
    154       f->focus->set_state(stopped);
     149    if (f->m_focus)
     150    {
     151      f->m_focus->x=found->x;
     152      f->m_focus->y=found->y;
     153      f->m_focus->set_hp(get_ability(f->m_focus->otype,start_hp));
     154      f->m_focus->set_state(stopped);
    155155    }
    156156    f=f->next;
     
    163163/*  int i;
    164164  for (i=0; i<total_objs; i++)
    165     if (obj[i]==the_game->first_view->focus)
     165    if (obj[i]==the_game->first_view->m_focus)
    166166    {
    167167      int tries=total_objs;
     
    171171    if (i==total_objs)
    172172      i=0;
    173     the_game->first_view->focus=obj[i];
    174       }  while ((!the_game->first_view->focus->is_playable() ||
    175          the_game->first_view->focus->hp<=0) && tries--);
     173    the_game->first_view->m_focus=obj[i];
     174      }  while ((!the_game->first_view->m_focus->is_playable() ||
     175         the_game->first_view->m_focus->hp<=0) && tries--);
    176176      return ;
    177177    }            */
     
    310310    {
    311311      f=new view(create(use_type,o->x,o->y),f,num); num++;
    312       f->focus->set_controller(f);
    313       add_object_after(f->focus,o);
     312      f->m_focus->set_controller(f);
     313      add_object_after(f->m_focus,o);
    314314      j++;
    315315      last_start=o;
     
    324324    if (startable)
    325325    {
    326       game_object *o=create(use_type,f->focus->x,f->focus->y);
     326      game_object *o=create(use_type,f->m_focus->x,f->m_focus->y);
    327327      f=new view(o,f,num); num++;
    328       f->focus->set_controller(f);
     328      f->m_focus->set_controller(f);
    329329      add_object_after(o,last_start);
    330330    }
     
    16671667
    16681668  for (v=player_list; v; v=v->next)
    1669     fp->write_uint32(object_to_number_in_list(v->focus,save_list));
     1669    fp->write_uint32(object_to_number_in_list(v->m_focus,save_list));
    16701670
    16711671  int tv=total_view_vars();
     
    17211721    {
    17221722      v=player_list;
    1723       if (v->focus)
    1724       {
    1725         if (v->focus->controller())
    1726          v->focus->set_controller(NULL);
    1727     delete v->focus;
     1723      if (v->m_focus)
     1724      {
     1725        if (v->m_focus->controller())
     1726         v->m_focus->set_controller(NULL);
     1727    delete v->m_focus;
    17281728      }
    17291729
     
    18291829      for (f=player_list; f; f=f->next)
    18301830      {
    1831     if (f->focus)
    1832     {
    1833       current_object = f->focus;
     1831    if (f->m_focus)
     1832    {
     1833      current_object = f->m_focus;
    18341834      void *m = LSpace::Tmp.Mark();
    18351835      fun->EvalFunction(NULL);
     
    30943094    if (st)
    30953095    {
    3096       f->focus->x=st->x;
    3097       f->focus->y=st->y;
    3098     }
    3099     add_object_after(f->focus,st);
     3096      f->m_focus->x=st->x;
     3097      f->m_focus->y=st->y;
     3098    }
     3099    add_object_after(f->m_focus,st);
    31003100  }
    31013101
Note: See TracChangeset for help on using the changeset viewer.