Ignore:
Timestamp:
Apr 17, 2011, 10:28:52 AM (11 years ago)
Author:
Sam Hocevar
Message:

lisp: rename core classes to slightly shorter names (LispObject? -> LObject).

File:
1 edited

Legend:

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

    r491 r492  
    228228  PtrRef r1(list);
    229229  push_onto_list(new_lisp_pointer(target),list);
    230   push_onto_list(LispNumber::Create(angle),list);
    231   push_onto_list(LispNumber::Create(y2),list);
    232   push_onto_list(LispNumber::Create(x2),list);
    233   push_onto_list(LispNumber::Create(type),list);
     230  push_onto_list(LNumber::Create(angle),list);
     231  push_onto_list(LNumber::Create(y2),list);
     232  push_onto_list(LNumber::Create(x2),list);
     233  push_onto_list(LNumber::Create(type),list);
    234234  push_onto_list(new_lisp_pointer(o->get_object(0)),list);
    235   eval_function((LispSymbol *)l_fire_object,list);
     235  eval_function((LSymbol *)l_fire_object,list);
    236236  o->lvars[top_just_fired]=1;
    237237  other->lvars[just_fired]=1;
     
    260260    o->lvars[fire_delay1]=3;
    261261    if (player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off))
    262           ret=LispNumber::Create(-1);
    263     else ret=LispNumber::Create(0);
     262          ret=LNumber::Create(-1);
     263    else ret=LNumber::Create(0);
    264264      } else
    265265      {
    266266    o->lvars[fire_delay1]=5;                  // no ammo, set large fire delay for next shot
    267267    player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off);
    268     ret=LispNumber::Create(0);
     268    ret=LNumber::Create(0);
    269269      }
    270     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     270    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    271271  }
    272272  return ret;
     
    303303    if (player_fire_weapon(o,ammo_type(o->otype),NULL,o->lvars[point_angle],
    304304                   o->otype==DFRIS ? large_fire_off : small_fire_off ))   
    305           ret=LispNumber::Create(-1);
    306     else ret=LispNumber::Create(0);
    307       } else ret=LispNumber::Create(0);
    308     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     305          ret=LNumber::Create(-1);
     306    else ret=LNumber::Create(0);
     307      } else ret=LNumber::Create(0);
     308    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    309309  }
    310310  return ret;
     
    329329    o->lvars[fire_delay1]=2;
    330330    if (player_fire_weapon(o,PLASMA,NULL,o->lvars[point_angle],small_fire_off))   
    331           ret=LispNumber::Create(-1);
    332     else ret=LispNumber::Create(0);
    333       } else ret=LispNumber::Create(0);
    334     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     331          ret=LNumber::Create(-1);
     332    else ret=LNumber::Create(0);
     333      } else ret=LNumber::Create(0);
     334    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    335335  }
    336336  return ret;
     
    354354    if (player_fire_weapon(o,LSABER,NULL,o->lvars[point_angle]+(current_level->tick_counter()&7)-8,
    355355                   small_fire_off))
    356           ret=LispNumber::Create(-1);
    357     else ret=LispNumber::Create(0);
    358       } else ret=LispNumber::Create(0);
    359     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     356          ret=LNumber::Create(-1);
     357    else ret=LNumber::Create(0);
     358      } else ret=LNumber::Create(0);
     359    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    360360  }
    361361  return ret;
     
    403403    }
    404404    if (player_fire_weapon(o,ROCKET,target,o->lvars[point_angle],large_fire_off))   
    405           ret=LispNumber::Create(-1);
    406     else ret=LispNumber::Create(0);
    407 
    408       } else ret=LispNumber::Create(0);
    409     } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
     405          ret=LNumber::Create(-1);
     406    else ret=LNumber::Create(0);
     407
     408      } else ret=LNumber::Create(0);
     409    } else ret=LNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    410410  }
    411411  return ret;
     
    658658      view *v=o->controller();
    659659
    660       push_onto_list(LispNumber::Create(v->weapon_total(v->current_weapon)),args);
     660      push_onto_list(LNumber::Create(v->weapon_total(v->current_weapon)),args);
    661661      push_onto_list(l_FIRE,args);
    662662
    663663      current_object=top;
    664       void *ret=eval_function((LispSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN),args);   
     664      void *ret=eval_function((LSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN),args);   
    665665      current_object=o;
    666666      v->add_ammo(v->current_weapon,lnumber_value(ret));   
     
    672672      {
    673673        // call the user function to reset the player
    674     eval_function((LispSymbol *)l_restart_player,NULL);
     674    eval_function((LSymbol *)l_restart_player,NULL);
    675675    o->controller()->reset_player();
    676676    o->set_aistate(0);
     
    681681  }
    682682
    683   return LispNumber::Create(ret);
     683  return LNumber::Create(ret);
    684684}
    685685
     
    727727    if (o->lvars[just_fired_var])
    728728    {
    729       o->draw_double_tint(lnumber_value(((LispArray *)((LispSymbol *)l_player_tints)->GetValue())->Get(num)), S_bright_tint);
     729      o->draw_double_tint(lnumber_value(((LArray *)((LSymbol *)l_player_tints)->GetValue())->Get(num)), S_bright_tint);
    730730      o->lvars[just_fired_var]=0;
    731731    } else
    732       o->draw_tint(lnumber_value(((LispArray *)((LispSymbol *)l_player_tints)->GetValue())->Get(num)));
     732      o->draw_tint(lnumber_value(((LArray *)((LSymbol *)l_player_tints)->GetValue())->Get(num)));
    733733  }
    734734  return NULL;
     
    755755      PtrRef r1(ret);
    756756
    757       push_onto_list(LispNumber::Create(bot->get_tint()),ret);
     757      push_onto_list(LNumber::Create(bot->get_tint()),ret);
    758758
    759759      if (bot->lvars[special_power]==SNEAKY_POWER)
     
    766766      o->draw_predator();
    767767      } else
    768         eval_function((LispSymbol *)l_player_draw,ret);
     768        eval_function((LSymbol *)l_player_draw,ret);
    769769
    770770      o->y=oldy;
     
    829829      case FAST_POWER :
    830830      {
    831     eval_function((LispSymbol *)l_draw_fast,NULL);
     831    eval_function((LSymbol *)l_draw_fast,NULL);
    832832    int old_state=o->state;
    833833    switch (o->state)
     
    10211021    for (i=0;i<tp;i++)
    10221022    {
    1023       int color=lnumber_value(((LispArray *)((LispSymbol *)l_player_text_color)->GetValue())->Get(sorted_players[i]->get_tint()));
     1023      int color=lnumber_value(((LArray *)((LSymbol *)l_player_text_color)->GetValue())->Get(sorted_players[i]->get_tint()));
    10241024      sprintf(msg,"%3ld %s",(long)sorted_players[i]->kills,sorted_players[i]->name);
    10251025      if (sorted_players[i]==local)
     
    10621062  {
    10631063    enum { NAME_LEN=18 } ;
    1064     int color=lnumber_value(((LispArray *)((LispSymbol *)l_player_text_color)->GetValue())->Get(v->get_tint()));
     1064    int color=lnumber_value(((LArray *)((LSymbol *)l_player_text_color)->GetValue())->Get(v->get_tint()));
    10651065    char max_name[NAME_LEN];
    10661066    strncpy(max_name,v->name,NAME_LEN-1);
Note: See TracChangeset for help on using the changeset viewer.