Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2006, 7:23:23 PM (18 years ago)
Author:
patrick
Message:

cr: other interface, no stdarg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cr/src/world_entities/world_entity.cc

    r7970 r7989  
    7676
    7777  // registering default reactions:
    78   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, 1, CL_WORLD_ENTITY);
    79   this->subscribeReaction(CREngine::CR_PHYSICS_GROUND, 1, CL_TERRAIN);
     78  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
     79  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND, CL_TERRAIN);
    8080
    8181  this->toList(OM_NULL);
     
    249249 * subscribes this world entity to a collision reaction
    250250 *  @param type the type of reaction to subscribe to
     251 *  @param target1 a filter target (classID)
     252 */
     253void WorldEntity::subscribeReaction(CREngine::CRType type, long target1)
     254{
     255  this->subscribeReaction(type);
     256
     257  // add the target filter
     258  this->collisionHandles[type]->addTarget(target1);
     259}
     260
     261
     262/**
     263 * subscribes this world entity to a collision reaction
     264 *  @param type the type of reaction to subscribe to
     265 *  @param target1 a filter target (classID)
     266 */
     267void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2)
     268{
     269  this->subscribeReaction(type);
     270
     271  // add the target filter
     272  this->collisionHandles[type]->addTarget(target1);
     273  this->collisionHandles[type]->addTarget(target2);
     274}
     275
     276
     277/**
     278 * subscribes this world entity to a collision reaction
     279 *  @param type the type of reaction to subscribe to
     280 *  @param target1 a filter target (classID)
     281 */
     282void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3)
     283{
     284  this->subscribeReaction(type);
     285
     286  // add the target filter
     287  this->collisionHandles[type]->addTarget(target1);
     288  this->collisionHandles[type]->addTarget(target2);
     289  this->collisionHandles[type]->addTarget(target3);
     290}
     291
     292
     293/**
     294 * subscribes this world entity to a collision reaction
     295 *  @param type the type of reaction to subscribe to
     296 *  @param target1 a filter target (classID)
     297 */
     298void WorldEntity::subscribeReaction(CREngine::CRType type, long target1, long target2, long target3, long target4)
     299{
     300  this->subscribeReaction(type);
     301
     302  // add the target filter
     303  this->collisionHandles[type]->addTarget(target1);
     304  this->collisionHandles[type]->addTarget(target2);
     305  this->collisionHandles[type]->addTarget(target3);
     306  this->collisionHandles[type]->addTarget(target4);
     307}
     308
     309
     310/**
     311 * subscribes this world entity to a collision reaction
     312 *  @param type the type of reaction to subscribe to
    251313 *  @param nrOfTargets number of target filters
    252314 *  @param ... the targets as classIDs
    253315 */
    254 void WorldEntity::subscribeReaction(CREngine::CRType type, int nrOfTargets, long target...)
     316void WorldEntity::subscribeReaction(CREngine::CRType type)
    255317{
    256318  if( this->collisionHandles[type] != NULL)  {
     
    260322
    261323  this->collisionHandles[type] = CREngine::getInstance()->subscribeReaction(this, type);
    262 
    263   // add the target filter
    264   va_list itemlist;
    265   va_start (itemlist, target);
    266   for (int i = 0; i < nrOfTargets; i++)
    267     this->collisionHandles[type]->addTarget(va_arg(itemlist, long));
    268   va_end(itemlist);
    269324
    270325  // now there is at least one collision reaction subsribed
Note: See TracChangeset for help on using the changeset viewer.