Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10516 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 30, 2007, 9:17:21 PM (18 years ago)
Author:
patrick
Message:

merged playability back to trunk

Location:
trunk/src
Files:
19 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/util/hud.cc

    r10449 r10516  
    515515    pos.x -= ySize;
    516516    //PRINTF(0)("secweaponwidget y-size: %f/n", (*weaponWidget)->getSizeY2D());
    517     (*weaponWidget)->setAbsCoor2D(pos.x + this->rightRect->getAbsCoor2D().x, pos.y);
     517    (*weaponWidget)->setAbsCoor2D(pos.x, pos.y);//+this->rightRect->getAbsCoor2D().x, pos.y);
    518518    (*weaponWidget)->show();
    519519    //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
  • trunk/src/world_entities/WorldEntities.am

    r10453 r10516  
    3434                \
    3535                world_entities/questGUI/quest_gui.cc \
    36                 world_entities/questGUI/quest.cc \
     36                world_entities/questGUI/quest.cc \
    3737                \
    3838                world_entities/weapons/weapon_slot.cc \
  • trunk/src/world_entities/elements/glgui_energywidgetvertical.cc

    r10421 r10516  
    6464    this->_image->setWidgetSize(30,30);
    6565    this->_image->setForegroundColor(Color(1,1,1,0.6));
     66    this->_image->setBackgroundTexture(Texture());
    6667    this->_image->setBackgroundColor(Color(1,1,1,0));
    67     this->_image->setBackgroundTexture(Texture());
    6868    this->_image->loadImageFromFile("textures/evil-flower.png");
    6969    //this->_image.setRelCoor2D(borderLeft(), borderTop() + this->_bar.getSizeX2D());
  • trunk/src/world_entities/elements/glgui_radar.cc

    r10368 r10516  
    4141  {
    4242    this->setBackgroundTexture("textures/gui/gui_radar.png");
     43    this->setBackgroundColor(Color(1.0,1.0,1.0,0.5));
    4344
    4445    this->_updateInterval = .01f;
  • trunk/src/world_entities/particles/particle_system.cc

    r10515 r10516  
    136136      if (emitter->isA(ParticleEmitter::staticClassID()))
    137137      {
    138         // init the emitertter with the coordinates of the system
    139         dynamic_cast<ParticleEmitter*>(emitter)->setAbsCoor(this->getAbsCoor());
    140138        this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
    141139      }
  • trunk/src/world_entities/player.cc

    r10368 r10516  
    100100  //this->_hud.updateWeaponManager();
    101101
    102   if (dynamic_cast<SpaceShip*>(this->playable) != 0)
    103       this->_hud.setWeaponManager(&this->playable->getWeaponManager(), &dynamic_cast<SpaceShip*>(this->playable)->getWeaponManagerSecondary());
    104     else
    105       this->_hud.setWeaponManager(&this->playable->getWeaponManager());
     102  if (dynamic_cast<SpaceShip*>(this->playable) != NULL)
     103    this->_hud.setWeaponManager(&this->playable->getWeaponManager(), &dynamic_cast<SpaceShip*>(this->playable)->getWeaponManagerSecondary());
     104  else
     105    this->_hud.setWeaponManager(&this->playable->getWeaponManager());
    106106}
    107107
  • trunk/src/world_entities/space_ships/space_ship.cc

    r10512 r10516  
    174174  Weapon* cannon = new SwarmLauncher();
    175175  cannon->setName( "SwarmLauncher");
    176 
     176/*
    177177  Weapon* spike = new SpikeThrower();
    178178  spike->setName( "SpikeThrower" );
     
    183183
    184184  Weapon* acid1 = new AcidLauncher();
    185   acid1->setName( "AcidSplasher" );
     185  acid1->setName( "AcidSplasher" );*/
    186186
    187187
     
    194194  this->weaponMan.addWeapon( wpLeft3, 2, 4);
    195195  this->weaponMan.addWeapon( wpRight3, 2, 5);
    196 /*
     196
    197197  this->weaponMan.addWeapon( wpLeft1, 3, 0);
    198198  this->weaponMan.addWeapon( wpRight1, 3, 1);
     
    203203  this->weaponMan.addWeapon( wpLeft3, 3, 4);
    204204  this->weaponMan.addWeapon( wpRight3, 3, 5);
    205 */
    206 
    207   this->weaponMan.addWeapon( acid0, 3, 0);
    208   this->weaponMan.addWeapon( acid1, 3, 1);
     205
     206
     207//   this->weaponMan.addWeapon( acid0, 3, 0);
     208//   this->weaponMan.addWeapon( acid1, 3, 1);
    209209
    210210
    211211  this->secWeaponMan.addWeapon( cannon, 0, 2);
    212   this->secWeaponMan.addWeapon( spike, 1, 3);
     212//   this->secWeaponMan.addWeapon( spike, 1, 3);
    213213//   this->secWeaponMan.addWeapon( acid0, 2, 2);
    214214//   this->secWeaponMan.addWeapon( acid1, 2, 3);
    215215
    216216
    217   this->weaponMan.changeWeaponConfig(3);
    218   this->secWeaponMan.changeWeaponConfig(1);
     217  this->weaponMan.changeWeaponConfig(0);
     218  this->secWeaponMan.changeWeaponConfig(0);
     219
    219220
    220221  curWeaponPrimary    = 0;
    221   curWeaponSecondary  = 1;
     222  curWeaponSecondary  = 0;
    222223
    223224  Playable::weaponConfigChanged();
     
    226227
    227228  weaponEnergyRegen = 10;       // 10 einheiten pro Sekunde
    228   engineSpeedBase   = 5;
     229  engineSpeedBase   = 15;
    229230  shieldRegen       = 2;
    230231
     
    246247
    247248
    248 /*  this->loadModel("models/ships/mantawing.obj");*/
     249 this->loadModel("models/spaceships/human_spaceship_fighter.obj", .25);
    249250  //this->setVisibiliy(false);
    250251
     
    10871088void SpaceShip::previousWeaponConfig()
    10881089{
     1090  /*
    10891091  this->curWeaponPrimary    = (this->curWeaponPrimary + 1) % 3;
    10901092  this->weaponMan.changeWeaponConfig(this->curWeaponPrimary);
     1093  */
     1094  this->weaponMan.previousWeaponConfig();
    10911095  Playable::weaponConfigChanged();
    10921096}
  • trunk/src/world_entities/space_ships/space_ship.h

    r10368 r10516  
    8282    void setPlaymodeXML(const std::string& playmode); //recieves the playmode from a string (useful for script implementation)
    8383    void setActionWidthPercentage(int i);
     84    void setTravelSpeed(float f);
    8485    void updateTravelDistance();
    8586    virtual void movement (float dt);
  • trunk/src/world_entities/weapons/acid_launcher.cc

    r10419 r10516  
    3232
    3333#include "util/loading/factory.h"
     34
     35#include "elements/glgui_energywidgetvertical.h"
    3436
    3537
     
    122124void AcidLauncher::tick(float dt)
    123125{
     126  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     127  {
     128    this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png");
     129    this->isEnergyWidgetInitialized = true;
     130  }
     131
    124132  if (!Weapon::tickW(dt))
    125133    return;
  • trunk/src/world_entities/weapons/heavy_blaster.cc

    r10499 r10516  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315CREATE_FACTORY(HeavyBlaster);
     
    9395
    9496  this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
    95   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
     97//   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
    9698  this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
    9799
    98100  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
    99   this->setProjectileTypeC("HBolt");   // FIXME temp project type until the blaste class exist
    100 //   this->setProjectileTypeC("SpikeBall");   // FIXME temp project type until the blaste class exist
     101  this->setProjectileTypeC("HBolt");
    101102  this->prepareProjectiles(5);
    102103
     
    104105  this->setSegs(2);
    105106  this->activeBarrel = 0;
    106 //   this->init2();
    107107
    108108
     
    239239  glPushMatrix();
    240240    glTranslatef (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
     241    static_cast<StaticModel*>(this->getModel())->draw(2);
     242  glPopMatrix();
     243
     244  glPushMatrix();
     245    glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z);
     246    static_cast<StaticModel*>(this->getModel())->draw(3);
     247  glPopMatrix();
     248
     249  glPushMatrix();
     250    glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z);
    241251    static_cast<StaticModel*>(this->getModel())->draw(1);
    242   glPopMatrix();
    243 
    244   glPushMatrix();
    245     glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z);
    246     static_cast<StaticModel*>(this->getModel())->draw(2);
    247   glPopMatrix();
    248 
    249   glPushMatrix();
    250     glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z);
    251     static_cast<StaticModel*>(this->getModel())->draw(0);
    252252  glPopMatrix();
    253253
     
    264264  glPushMatrix();
    265265    glTranslatef (this->objComp[2][1]->getAbsCoor().x, this->objComp[2][1]->getAbsCoor().y, this->objComp[2][1]->getAbsCoor().z);
    266     static_cast<StaticModel*>(this->getModel())->draw(3);
    267   glPopMatrix();
    268 
    269   glPopMatrix();
    270 }
     266    static_cast<StaticModel*>(this->getModel())->draw(0);
     267  glPopMatrix();
     268
     269  glPopMatrix();
     270}
     271
     272void HeavyBlaster::tick(float dt)
     273{
     274  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     275  {
     276    this->energyWidget->setDisplayedImage("textures/gui/gui_heavy_bolt.png");
     277    this->setEnergyWidgetInitialized(true);
     278  }
     279}
  • trunk/src/world_entities/weapons/heavy_blaster.h

    r10499 r10516  
    2929    virtual void fire();
    3030
     31    virtual void tick(float dt);
     32
    3133    virtual void draw() const;
    3234
  • trunk/src/world_entities/weapons/light_blaster.cc

    r10471 r10516  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315CREATE_FACTORY(LightBlaster);
     
    4345   delete [] this->shootAnim;
    4446   delete [] this->objComp;
    45 /*
    46     for(int j = 0; j < this->getSegs(); j++)
    47     {
    48       delete this->shootAnim[i][j];
    49       delete this->objComp[i][j];
    50     }
    51     delete this->shootAnim[i];
    52     delete this->objComp[i];
    53     delete this->emissionPoint[i];
    54   }*/
    5547
    56 //  this->deconstr();
    57       // model will be deleted from WorldEntity-destructor
    5848}
    5949
     
    7969
    8070  this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
    81   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
     71//   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
    8272  this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
    8373
    8474  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
    85   //this->setProjectileTypeC("RailProjectile");   // FIXME temp project type until the blaste class exist
    86   this->setProjectileTypeC("LBolt");   // Working; FIXME: add textures
    87 //   this->setProjectileTypeC("Spike");   // Working; FIXME: add textures
     75  this->setProjectileTypeC("LBolt");
    8876  this->prepareProjectiles(100);
    8977
     
    137125}
    138126
    139 
    140127void LightBlaster::fire()
    141128{
     
    187174    static_cast<StaticModel*>(this->getModel())->draw();
    188175  glPopMatrix();
     176
    189177}
     178
     179void LightBlaster::tick(float dt)
     180{
     181  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     182  {
     183    this->energyWidget->setDisplayedImage("textures/gui/gui_light_bolt.png");
     184    this->setEnergyWidgetInitialized(true);
     185  }
     186}
  • trunk/src/world_entities/weapons/light_blaster.h

    r10368 r10516  
    2626    virtual void fire();
    2727
     28    virtual void tick(float dt);
     29
    2830    virtual void draw() const;
    2931
  • trunk/src/world_entities/weapons/medium_blaster.cc

    r10415 r10516  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315//
     
    138140}
    139141
     142
    140143/**
    141144 *  this activates the weapon
     
    158161  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    159162
    160   static_cast<StaticModel*>(this->getModel())->draw(2);
     163  static_cast<StaticModel*>(this->getModel())->draw(0);
    161164
    162165  glPushMatrix();
     
    167170  glPushMatrix();
    168171    glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);
    169     static_cast<StaticModel*>(this->getModel())->draw(0);
     172    static_cast<StaticModel*>(this->getModel())->draw(2);
    170173  glPopMatrix();
    171174
    172175  glPopMatrix();
    173176}
     177
     178void MediumBlaster::tick(float dt)
     179{
     180  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     181  {
     182    this->energyWidget->setDisplayedImage("textures/gui/gui_medium_bold.png");
     183    this->setEnergyWidgetInitialized(true);
     184  }
     185}
  • trunk/src/world_entities/weapons/medium_blaster.h

    r10368 r10516  
    2626    virtual void fire();
    2727
     28    virtual void tick(float dt);
     29
    2830    virtual void draw() const;
    2931
  • trunk/src/world_entities/weapons/spike_thrower.cc

    r10419 r10516  
    3434
    3535#include "util/loading/factory.h"
     36
     37#include "elements/glgui_energywidgetvertical.h"
    3638
    3739
     
    125127void SpikeThrower::tick(float dt)
    126128{
     129  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     130  {
     131    this->energyWidget->setDisplayedImage("textures/gui/gui_spikeball.png");
     132    this->isEnergyWidgetInitialized = true;
     133  }
     134
    127135  if (!Weapon::tickW(dt))
    128136    return;
  • trunk/src/world_entities/weapons/swarm_launcher.cc

    r10419 r10516  
    3333
    3434#include "util/loading/factory.h"
     35
     36#include "elements/glgui_energywidgetvertical.h"
    3537
    3638
     
    141143
    142144  this->setAbsDirSoft(quat, 5);
     145
     146  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     147  {
     148    this->energyWidget->setDisplayedImage("textures/gui/gui_swarm_missiles.png");
     149    this->setEnergyWidgetInitialized(true);
     150  }
    143151}
    144152
  • trunk/src/world_entities/weapons/weapon.cc

    r10443 r10516  
    154154
    155155  this->energyWidget = NULL;
     156  isEnergyWidgetInitialized = false;
    156157
    157158  // set this object to be synchronized over network
  • trunk/src/world_entities/weapons/weapon.h

    r10443 r10516  
    190190    inline int getPreferedSlot() { return this->preferedSlot; }
    191191
     192    inline void setEnergyWidgetInitialized(bool b) {this->isEnergyWidgetInitialized = b;};
     193
    192194
    193195  protected:
     
    207209
    208210    void setPreferedSlot(int slot, int side) { this->preferedSlot = slot; this->preferedSide = side; }
     211
     212    //gui
     213    OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
     214    bool  isEnergyWidgetInitialized;
    209215
    210216
     
    238244    float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
    239245
    240     OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
     246    //OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
    241247
    242248    PNode*               defaultTarget;                    //!< A target for targeting Weapons.
Note: See TracChangeset for help on using the changeset viewer.