Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 2, 2006, 4:53:38 PM (18 years ago)
Author:
bensch
Message:

less debug output

Location:
branches/new_class_id/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/weapons/aim.cc

    r9715 r9863  
    5151Aim::~Aim ()
    5252{
    53 /*  if (this->text != NULL)
    54     delete this->text;*/
     53  /*  if (this->text != NULL)
     54      delete this->text;*/
    5555}
    5656
     
    8080
    8181
    82 /*  this->text = new Text();
    83   this->text->setLayer(this->getLayer());
    84   this->text->setParent2D(this);
    85   this->text->setRelCoor2D(10, -50);
    86   this->text->setParentMode2D(E2D_PARENT_MOVEMENT);
    87   this->text->setText("Testing");*/
     82  /*  this->text = new Text();
     83    this->text->setLayer(this->getLayer());
     84    this->text->setParent2D(this);
     85    this->text->setRelCoor2D(10, -50);
     86    this->text->setParentMode2D(E2D_PARENT_MOVEMENT);
     87    this->text->setText("Testing");*/
    8888}
    8989
     
    9393
    9494  LoadParam(root, "texture", this, Aim, setTexture)
    95       .describe("the texture-file to load onto the Aim");
     95  .describe("the texture-file to load onto the Aim");
    9696
    9797  LoadParam(root, "size", this, Aim, setSize)
    98       .describe("the size of the Aim in Pixels");
     98  .describe("the size of the Aim in Pixels");
    9999
    100100  LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed)
    101       .describe("the Speed with which the Aim should rotate");
     101  .describe("the Speed with which the Aim should rotate");
    102102
    103103  LoadParam(root, "target-group", this, Aim, setTargetGroupS);
     
    118118      //if (this->getParent() != (*entity))
    119119      {
    120         printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
     120        //        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
    121121        this->anim->replay();
    122122        this->setParentSoft(*entity, 5);
     
    126126  }
    127127
    128    //if no target found:
    129    this->setParent(PNode::getNullParent());
     128  //if no target found:
     129  this->setParent(PNode::getNullParent());
    130130}
    131131
     
    166166  this->shiftDir2D(dt * rotationSpeed);
    167167
    168 //   char outputText[100];
    169 //   sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len());
    170 //   this->text->setText(outputText);
    171 
    172 
    173 //  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
     168  //   char outputText[100];
     169  //   sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len());
     170  //   this->text->setText(outputText);
     171
     172
     173  //  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
    174174  diffVec = ( this->getAbsCoor() - this->source->getAbsCoor() );
    175 //only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
    176    if(this->getParent() == PNode::getNullParent() ||
     175  //only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
     176  if(this->getParent() == PNode::getNullParent() ||
    177177      diffVec.len() > range )// ||
    178      //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
    179     {
    180      this->setParentSoft(PNode::getNullParent(),5);
    181      this->searchTarget();
    182     }
    183 
    184 //   float z = 0.0f;
    185 //   glReadPixels ((int)this->getAbsCoor2D().x,
    186 //                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
    187 //                  1,
    188 //                  1,
    189 //                  GL_DEPTH_COMPONENT,
    190 //                  GL_FLOAT,
    191 //                  &z);
    192 //
    193 //
    194 //   GLdouble objX=.0, objY=.0, objZ=.0;
    195 //   gluUnProject(this->getAbsCoor2D().x,
    196 //                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
    197 //                .99,  // z
    198 //                GraphicsEngine::modMat,
    199 //                GraphicsEngine::projMat,
    200 //                GraphicsEngine::viewPort,
    201 //                &objX,
    202 //                &objY,
    203 //                &objZ );
    204 //aa
    205 //   this->setAbsCoor(objX, objY, objZ);
     178    //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
     179  {
     180    this->setParentSoft(PNode::getNullParent(),5);
     181    this->searchTarget();
     182  }
     183
     184  //   float z = 0.0f;
     185  //   glReadPixels ((int)this->getAbsCoor2D().x,
     186  //                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
     187  //                  1,
     188  //                  1,
     189  //                  GL_DEPTH_COMPONENT,
     190  //                  GL_FLOAT,
     191  //                  &z);
     192  //
     193  //
     194  //   GLdouble objX=.0, objY=.0, objZ=.0;
     195  //   gluUnProject(this->getAbsCoor2D().x,
     196  //                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
     197  //                .99,  // z
     198  //                GraphicsEngine::modMat,
     199  //                GraphicsEngine::projMat,
     200  //                GraphicsEngine::viewPort,
     201  //                &objX,
     202  //                &objY,
     203  //                &objZ );
     204  //aa
     205  //   this->setAbsCoor(objX, objY, objZ);
    206206}
    207207
     
    212212{
    213213
    214  if( this->getParent() != PNode::getNullParent() )
     214  if( this->getParent() != PNode::getNullParent() )
    215215  {
    216   glPushMatrix();
    217   glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
    218 
    219   glRotatef(this->getAbsDir2D(), 0,0,1);
    220   this->material.select();
    221   glBegin(GL_TRIANGLE_STRIP);
    222   glTexCoord2f(0, 0);
    223   glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
    224   glTexCoord2f(1, 0);
    225   glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
    226   glTexCoord2f(0, 1);
    227   glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
    228   glTexCoord2f(1, 1);
    229   glVertex2f(this->getSizeX2D(), this->getSizeY2D());
    230   glEnd();
    231   glPopMatrix();
     216    glPushMatrix();
     217    glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
     218
     219    glRotatef(this->getAbsDir2D(), 0,0,1);
     220    this->material.select();
     221    glBegin(GL_TRIANGLE_STRIP);
     222    glTexCoord2f(0, 0);
     223    glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
     224    glTexCoord2f(1, 0);
     225    glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
     226    glTexCoord2f(0, 1);
     227    glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
     228    glTexCoord2f(1, 1);
     229    glVertex2f(this->getSizeX2D(), this->getSizeY2D());
     230    glEnd();
     231    glPopMatrix();
    232232  }
    233233
  • branches/new_class_id/src/world_entities/weapons/weapon_manager.cc

    r9757 r9863  
    1717*/
    1818
    19 #define DEBUG_SPECIAL_MODULE 4 //DEBUG_MODULE_WEAPON
     19#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
    2020
    2121#include "weapon_manager.h"
     
    302302    weapon->setDefaultTarget(this->crosshair);
    303303  }
    304   PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
     304  PRINTF(4)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
    305305  return true;
    306306}
Note: See TracChangeset for help on using the changeset viewer.