Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7810 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
May 24, 2006, 3:57:04 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Weather effects back here

Location:
trunk/src
Files:
2 deleted
15 edited
20 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r7661 r7810  
    4141                lib/particles/plane_emitter.cc \
    4242                lib/graphics/effects/fog_effect.cc \
     43                lib/graphics/effects/volfog_effect.cc \
     44                lib/graphics/effects/rain_effect.cc \
     45                lib/graphics/effects/snow_effect.cc \
     46                lib/graphics/effects/cloud_effect.cc \
     47                lib/graphics/effects/lightening_effect.cc \
    4348                lib/graphics/effects/lense_flare.cc \
    4449                \
  • trunk/src/defs/class_id.h

    r7785 r7810  
    127127  CL_NETWORK_MANAGER            =    0x00000050,
    128128  CL_SHARED_NETWORK_DATA        =    0x00000051,
    129 
     129  CL_ATMOSPHERIC_ENGINE         =    0x00000061,
    130130
    131131  /// StoryEntities (range from 0x00000100 to 0x000001ff)
     
    224224
    225225  CL_IMAGE_ENTITY               =    0x00000513,
    226   CL_BILLBOARD                  =    0x00000514,
     226  CL_IMAGE_PLANE                =    0x00000514,
    227227  CL_MODEL_ENTITY               =    0x00000515,
    228228  CL_TEXT_ELEMENT               =    0x00000516, /// TODO MOVE
     
    286286  CL_LIGHT                      =    0x00000821,
    287287
     288  CL_BILLBOARD                  =    0x00000a01,
     289
    288290  CL_GRAPHICS_EFFECT            =    0x00a01000,
    289 
     291  CL_SUN_EFFECT                 =    0x00a02000,
     292  CL_WEATHER_EFFECT             =    0x00a04000,
    290293  CL_FOG_EFFECT                 =    0x00000a10,
     294  CL_VOLFOG_EFFECT              =    0x00000a11,
    291295  CL_LENSE_FLARE                =    0x00000a12,
     296  CL_RAIN_EFFECT                =    0x00000a13,
     297  CL_SNOW_EFFECT                =    0x00000a14,
     298  CL_CLOUD_EFFECT               =    0x00000a15,
     299  CL_LIGHTENING_EFFECT          =    0x00000a16,
    292300  CL_EXPLOSION                  =    0x00000a20,
    293301  CL_LIGHTNING_BOLT             =    0x00000a21,
     302       
    294303
    295304
  • trunk/src/lib/graphics/Makefile.am

    r7450 r7810  
    44noinst_LIBRARIES = libORXgraphics.a
    55
    6 libORXgraphics_a_SOURCES = \
    7                 graphics_engine.cc \
    8                 light.cc \
    9                 shader.cc \
    10                 \
    11                 render2D/render_2d.cc \
    12                 render2D/element_2d.cc \
    13                 render2D/billboard.cc \
    14                 \
    15                 text_engine/text_engine.cc \
    16                 text_engine/text.cc \
    17                 text_engine/multi_line_text.cc \
    18                 text_engine/font.cc \
    19                 \
    20                 effects/graphics_effect.cc \
    21                 effects/fog_effect.cc \
    22                 effects/lense_flare.cc
     6libORXgraphics_a_SOURCES = graphics_engine.cc \
     7                           light.cc \
     8                           shader.cc \
     9                           \
     10                           render2D/render_2d.cc \
     11                           render2D/element_2d.cc \
     12                           render2D/image_plane.cc \
     13                           \
     14                           text_engine/text_engine.cc \
     15                           text_engine/text.cc \
     16                           text_engine/multi_line_text.cc \
     17                           text_engine/font.cc \
     18                           \
     19                           effects/graphics_effect.cc \
     20                           effects/atmospheric_engine.cc \
     21                           effects/weather_effect.cc \
     22                           effects/sun_effect.cc \
     23                           effects/fog_effect.cc \
     24                           effects/volfog_effect.cc \
     25                           effects/rain_effect.cc \
     26                           effects/snow_effect.cc \
     27                           effects/cloud_effect.cc \
     28                           effects/lightening_effect.cc \
     29                           effects/lense_flare.cc
    2330
    24 
    25 noinst_HEADERS = \
    26                 graphics_engine.h \
    27                 light.h \
    28                 shader.h \
    29                 \
    30                 render2D/render_2d.h \
    31                 render2D/element_2d.h \
    32                 render2D/billboard.h \
    33                 \
    34                 text_engine/text_engine.h \
    35                 text_engine/text.h \
    36                 text_engine/multi_line_text.cc \
    37                 text_engine/font.h \
    38                 text_engine/default_font.xpm \
    39                 \
    40                 effects/graphics_effect.h \
    41                 effects/fog_effect.h \
    42                 effects/lense_flare.h
     31noinst_HEADERS = graphics_engine.h \
     32                 light.h \
     33                 shader.h \
     34                 \
     35                 render2D/render_2d.h \
     36                 render2D/element_2d.h \
     37                 render2D/image_plane.h \
     38                 \
     39                 text_engine/text_engine.h \
     40                 text_engine/text.h \
     41                 text_engine/multi_line_text.h \
     42                 text_engine/font.h \
     43                 text_engine/default_font.xpm \
     44                 \
     45                 effects/graphics_effect.h \
     46                 effects/atmospheric_engine.h \
     47                 effects/weather_effect.h \
     48                 effects/sun_effect.h \
     49                 effects/fog_effect.h \
     50                 effects/volfog_effect.h \
     51                 effects/rain_effect.h \
     52                 effects/snow_effect.h \
     53                 effects/cloud_effect.h \
     54                 effects/lightening_effect.h \
     55                 effects/lense_flare.h
    4356
    4457
  • trunk/src/lib/graphics/effects/fog_effect.cc

    r7221 r7810  
     1/*
     2        orxonox - the future of 3D-vertical-scrollers
    13
     4        Copyright (C) 2004 orx
    25
    3 /*
    4    orxonox - the future of 3D-vertical-scrollers
    5 
    6    Copyright (C) 2004 orx
    7 
    8    This program is free software; you can redistribute it and/or modify
    9    it under the terms of the GNU General Public License as published by
    10    the Free Software Foundation; either version 2, or (at your option)
    11    any later version.
     6        This program is free software; you can redistribute it and/or modify
     7        it under the terms of the GNU General Public License as published by
     8        the Free Software Foundation; either version 2, or (at your option)
     9        any later version.
    1210
    1311### File Specific:
    14    main-programmer: Patrick Boenzli
     12        main-programmer: hdavid, amaechler
    1513*/
    16 
    17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
    1814
    1915#include "fog_effect.h"
     
    2420#include "glincl.h"
    2521
    26 
     22/*#include "shell_command.h"
     23SHELL_COMMAND(activateFog, FogEffect, FogEffect::activate)
     24        ->setAlias("aFog");
     25SHELL_COMMAND(deactivateFog, FogEffect, FogEffect::deactivate)
     26        ->setAlias("dFog");*/
    2727
    2828using namespace std;
     
    3030CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
    3131
     32FogEffect::FogEffect(const TiXmlElement* root)
     33{
     34        this->setClassID(CL_FOG_EFFECT, "FogEffect");
    3235
    33 /**
    34  *  default constructor
    35  * @param root The XML-element to load the FogEffect from
    36  */
    37  FogEffect::FogEffect(const TiXmlElement* root)
    38 {
    39   this->setClassID(CL_FOG_EFFECT, "FogEffect");
     36        this->init();
    4037
    41   this->fogMode = GL_LINEAR;
    42   this->fogDensity = 0.001f;
    43   this->fogStart = 10.0f;
    44   this->fogEnd = 1000.0f;
     38        if (root != NULL)
     39                this->loadParams(root);
    4540
    46   if (root != NULL)
    47     this->loadParams(root);
    48 
    49   this->activate();
     41        this->activate();
    5042}
    5143
    5244
    53 /**
    54  *  destroys a FogEffect
    55  */
    5645FogEffect::~FogEffect()
    5746{
    58   this->deactivate();
     47        this->deactivate();
    5948}
    6049
    6150
    62 /**
    63  * @param root The XML-element to load the FogEffect from
    64  */
    6551void FogEffect::loadParams(const TiXmlElement* root)
    6652{
    67   GraphicsEffect::loadParams(root);
     53        WeatherEffect::loadParams(root);
    6854
     55        LoadParam(root, "mode", this, FogEffect, setFogMode);
     56        LoadParam(root, "density", this, FogEffect, setFogDensity);
     57        LoadParam(root, "range", this, FogEffect, setFogRange);
     58        LoadParam(root, "color", this, FogEffect, setFogColor);
     59}
    6960
    70   LoadParam(root, "fog-mode", this, FogEffect, setFogMode)
    71       .describe("sets the the fog mode {GL_LINEAR, GL_EXP, GL_EXP2}");
    72 
    73   LoadParam(root, "fog-density", this, FogEffect, setFogDensity)
    74       .describe("sets the the fog density of the exponentionl functions");
    75 
    76   LoadParam(root, "fog-color", this, FogEffect, setFogColor)
    77       .describe("sets the fog color");
    78 
     61bool FogEffect::init()
     62{
     63        //default values
     64        this->fogMode = GL_EXP2;
     65        this->fogDensity = 0.001;
     66        this->fogStart = 0;
     67        this->fogEnd = 5000;
     68  this->colorVector = Vector(0.7, 0.7, 0.7);
    7969}
    8070
    8171
    82 /**
    83  * initializes the fog effect
    84  */
    85 bool FogEffect::init()
    86 {}
    8772
    88 
    89 /**
    90  * activates the fog effect
    91  */
    9273bool FogEffect::activate()
    9374{
    94   PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity,
    95              this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
     75        PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
    9676
    97   glEnable(GL_FOG);
    98   {
    99 //     GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};
    100     GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
     77        glEnable(GL_FOG);
     78        {
     79                GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
    10180
    102     glFogi(GL_FOG_MODE, this->fogMode);
    103     glFogfv(GL_FOG_COLOR, fogColor);
    104     glFogf(GL_FOG_DENSITY, this->fogDensity);
    105     glHint(GL_FOG_HINT, GL_DONT_CARE);
    106     glFogf(GL_FOG_START, this->fogStart);
    107     glFogf(GL_FOG_END, this->fogEnd);
    108 
    109     //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE);
    110   }
    111   glClearColor(0.5, 0.5, 0.5, 1.0);
     81                glFogi(GL_FOG_MODE, this->fogMode);
     82                glFogfv(GL_FOG_COLOR, fogColor);
     83                glFogf(GL_FOG_DENSITY, this->fogDensity);
     84                glHint(GL_FOG_HINT, GL_DONT_CARE);
     85                glFogf(GL_FOG_START, this->fogStart);
     86                glFogf(GL_FOG_END, this->fogEnd);
     87        }
     88        glClearColor(0.5, 0.5, 0.5, 1.0);
    11289}
    11390
    11491
    115 /**
    116  * deactivates the fog effect
    117  */
    11892bool FogEffect::deactivate()
    11993{
    120   glDisable(GL_FOG);
     94        PRINTF(0)("Deactivating FogEffect\n");
     95        glDisable(GL_FOG);
    12196}
    12297
    12398
    124 /**
    125  * converts a gl mode char to a GLint
    126  * @param mode the mode character
    127  */
    12899GLint FogEffect::stringToFogMode(const std::string& mode)
    129100{
    130   if(mode == "GL_LINEAR")
    131     return GL_LINEAR;
    132   else if(mode == "GL_EXP")
    133     return GL_EXP;
    134   else if(mode == "GL_EXP2" )
    135     return GL_EXP2;
    136   else
    137     return -1;
     101        if(mode == "GL_LINEAR")
     102                return GL_LINEAR;
     103        else if(mode == "GL_EXP")
     104                return GL_EXP;
     105        else if(mode == "GL_EXP2" )
     106                return GL_EXP2;
     107        else
     108                return -1;
    138109}
    139110
     111
  • trunk/src/lib/graphics/effects/fog_effect.h

    r7221 r7810  
    11/**
    2  * @file fog_effect.h
    3  *  atmospheric fog
    4  */
     2* @file fog_effect.h
     3*/
    54
    65#ifndef _FOG_EFFECT
     
    87
    98#include "vector.h"
    10 #include "graphics_effect.h"
    119
    12 class TiXmlElement;
     10#include "weather_effect.h"
    1311
    14 //! A class that handles FogEffects. The FogEffectManager operates on this.
    15 class FogEffect : public GraphicsEffect
     12class FogEffect : public WeatherEffect
    1613{
    17   public:
    18     FogEffect(const TiXmlElement* root = NULL);
    19     virtual ~FogEffect();
     14        public:
     15                FogEffect(const TiXmlElement* root = NULL);
     16                virtual ~FogEffect();
    2017
    21     virtual void loadParams(const TiXmlElement* root);
     18                virtual void loadParams(const TiXmlElement* root);
    2219
    23     virtual bool init();
     20                virtual bool init();
    2421
    25     virtual bool activate();
    26     virtual bool deactivate();
     22                virtual bool activate();
     23                virtual bool deactivate();
    2724
    28     inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
    29     inline void setFogDensity(float density) { this->fogDensity = density; }
    30     inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
    31     inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
     25                inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
     26                inline void setFogDensity(float density) { this->fogDensity = density; }
     27                inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
     28                inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
    3229
     30        private:
     31                GLint stringToFogMode(const std::string& mode);
    3332
    34   private:
    35     GLint stringToFogMode(const std::string& mode);
    36 
    37 
    38   private:
    39     GLint                   fogMode;
    40     GLfloat                 fogDensity;
    41     GLfloat                 fogStart;
    42     GLfloat                 fogEnd;
    43     Vector                  colorVector;
     33        private:
     34                GLint                   fogMode;
     35                GLfloat                 fogDensity;
     36                GLfloat                 fogStart;
     37                GLfloat                 fogEnd;
     38                Vector                  colorVector;
    4439};
    4540
    4641
    47 #endif /* _FOG_EFFECT */
     42#endif  /* _FOG_EFFECT */
  • trunk/src/lib/graphics/effects/lense_flare.cc

    r7316 r7810  
    2828#include "state.h"
    2929
    30 #include "render2D/billboard.h"
     30#include "render2D/image_plane.h"
    3131
    3232#include "light.h"
     
    8080LenseFlare::~LenseFlare()
    8181{
    82   std::vector<Billboard*>::iterator it;
     82  std::vector<ImagePlane*>::iterator it;
    8383  for( it = flares.begin(); it != flares.end(); it++)
    8484    delete (*it);
     
    155155  }
    156156
    157   Billboard* bb = new Billboard(NULL);
     157  ImagePlane* bb = new ImagePlane(NULL);
    158158  bb->setTexture(textureName);
    159159  bb->setSize(50, 50);
    160160  this->flares.push_back(bb);
    161   PRINTF(4)("Added a Lenseflare Billboard with texture %s\n", textureName.c_str());
     161  PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str());
    162162
    163163  // the first flare belongs to the light source
     
    178178  float dist = this->frustumPlane.distancePoint(this->lightSource->getAbsCoor());
    179179  PRINTF(0)("dist: %f\n", dist);
    180   std::vector<Billboard*>::const_iterator it;
     180  std::vector<ImagePlane*>::const_iterator it;
    181181    for(it = flares.begin(); it != flares.end(); it++)
    182182      (*it)->setVisibility(visibility);
     
    220220
    221221  // now calculate the new coordinates of the billboards
    222   std::vector<Billboard*>::iterator it;
     222  std::vector<ImagePlane*>::iterator it;
    223223  int i;
    224224  for( it = flares.begin(), i = 0; it != flares.end(); it++, i++)
  • trunk/src/lib/graphics/effects/lense_flare.h

    r7316 r7810  
    2020class TiXmlElement;
    2121class Light;
    22 class Billboard;
     22class ImagePlane;
    2323
    2424//! A class that handles LenseFlares. The LenseFlareManager operates on this.
     
    5050    float                    isVisible;          //!< Checks visibility
    5151    Light*                   lightSource;        //!< reference to the sun (or primary light source)
    52     std::vector<Billboard*>  flares;             //!< the flares array
     52    std::vector<ImagePlane*>  flares;             //!< the flares array
    5353
    5454    Vector2D                 flareVector;        //!< the axis to draw the flares on
  • trunk/src/lib/graphics/effects/rain_effect.cc

    r7808 r7810  
    4747        if (this->rainBuffer != NULL)
    4848                ResourceManager::getInstance()->unload(this->rainBuffer);
    49         this->rainBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV);
     49        this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV);
    5050
    5151        //load wind sound
     
    5353                if (this->windBuffer != NULL)
    5454                        ResourceManager::getInstance()->unload(this->windBuffer);
    55                 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
     55                this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
    5656        }
    5757
  • trunk/src/lib/graphics/effects/rain_effect.h

    r7808 r7810  
    6161                bool                                                                                                                    rainMove;
    6262
    63                 SoundSource                                                                                             soundSource;
    64                 SoundBuffer*                                                                                    rainBuffer;
    65                 SoundBuffer*                                                                                    windBuffer;
     63                OrxSound::SoundSource                   soundSource;
     64                OrxSound::SoundBuffer*                  rainBuffer;
     65                OrxSound::SoundBuffer*                  windBuffer;
    6666};
    6767
  • trunk/src/lib/graphics/effects/snow_effect.cc

    r7808 r7810  
    5050                if (this->windBuffer != NULL)
    5151                        ResourceManager::getInstance()->unload(this->windBuffer);
    52                 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
     52                        this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
    5353        }
    5454
  • trunk/src/lib/graphics/effects/snow_effect.h

    r7808 r7810  
    1717class PNode;
    1818
     19#include "sound_source.h"
    1920#include "sound_buffer.h"
    20 #include "sound_source.h"
    2121
    2222class SnowEffect : public WeatherEffect
     
    7070
    7171                static SpriteParticles*                                                 snowParticles;
     72                OrxSound::SoundSource              soundSource;
     73                OrxSound::SoundBuffer*             windBuffer;
    7274
    73                 SoundSource                                                                                                     soundSource;
    74                 SoundBuffer*                                                                                            windBuffer;
    7575};
    7676
  • trunk/src/lib/sound/sound_source.cc

    r7729 r7810  
    122122        alSourceStop(this->sourceID);
    123123      alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
    124       alSourcePlay(this->sourceID);
     124    alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
     125    alSourcePlay(this->sourceID);
    125126
    126127      if (DEBUG_LEVEL >= 3)
     
    143144    }
    144145
    145     alSourceStop(this->sourceID);
    146     alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
    147     alSourcePlay(this->sourceID);
     146  alSourceStop(this->sourceID);
     147  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
     148  alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
     149  alSourcePlay(this->sourceID);
    148150
    149151    if (unlikely(this->buffer != NULL))
     
    156158
    157159
    158   /**
    159    * @brief Stops playback of a SoundSource
    160    */
    161   void SoundSource::stop()
     160/**
     161 * @brief Plays and loops buffer on this Source
     162 * @param buffer the buffer to play back on this Source
     163 */
     164void SoundSource::loop(const SoundBuffer* buffer)
     165{
     166  if (this->buffer && this->retrieveSource())
     167  {
     168    if (this->bPlay)
     169      alSourceStop(this->sourceID);
     170
     171    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
     172    alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE  );
     173    alSourcePlay(this->sourceID);
     174
     175    if (DEBUG_LEVEL >= 3)
     176      SoundEngine::checkError("Play LoopSource", __LINE__);
     177    this->bPlay = true;
     178  }
     179}
     180
     181
     182/**
     183 * @brief Stops playback of a SoundSource
     184 */
     185void SoundSource::stop()
     186{
     187  this->bPlay = false;
     188  if (this->sourceID != 0)
    162189  {
    163190    this->bPlay = false;
     
    173200    }
    174201  }
    175 
     202}
    176203
    177204  /**
  • trunk/src/lib/sound/sound_source.h

    r7460 r7810  
    2929    void play();
    3030    void play(const SoundBuffer* buffer);
     31    void loop();
     32    void loop(const SoundBuffer* buffer);
    3133    void stop();
    3234    void pause();
  • trunk/src/story_entities/game_world.cc

    r7785 r7810  
    4343
    4444#include "graphics_engine.h"
     45#include "effects/atmospheric_engine.h"
    4546#include "event_handler.h"
    4647#include "sound_engine.h"
     
    384385
    385386    GraphicsEngine::getInstance()->tick(this->dtS);
     387    AtmosphericEngine::getInstance()->tick(this->dtS);
    386388
    387389    if( likely(this->dataTank->gameRule != NULL))
     
    524526  GraphicsEngine* engine = GraphicsEngine::getInstance();
    525527
     528  AtmosphericEngine::getInstance()->draw();
     529
    526530  // set camera
    527531  this->dataTank->localCamera->apply ();
  • trunk/src/story_entities/game_world_data.cc

    r7488 r7810  
    4545
    4646#include "graphics_engine.h"
     47#include "effects/atmospheric_engine.h"
    4748#include "event_handler.h"
    4849#include "sound_engine.h"
     
    322323  LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
    323324  LoadParamXML(root, "GraphicsEngine", GraphicsEngine::getInstance(), GraphicsEngine, loadParams);
     325  LoadParamXML(root, "AtmosphericEngine", AtmosphericEngine::getInstance(), AtmosphericEngine, loadParams);
    324326
    325327  LoadParam(root, "Music", this, GameWorldData, setSoundTrack);
     
    346348  /* delete some garphics and scene eingines */
    347349  delete LightManager::getInstance();
     350  delete AtmosphericEngine::getInstance();
    348351
    349352  if (this->music != NULL)
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7221 r7810  
    2020#include "util/loading/factory.h"
    2121
    22 #include "render2D/billboard.h"
     22#include "render2D/image_plane.h"
    2323#include "state.h"
    2424#include "class_list.h"
     
    5353  this->timeout = 0.0f;
    5454
    55   this->deathScreen = new Billboard();
     55  this->deathScreen = new ImagePlane();
    5656  this->deathScreen->setSize(State::getResX()/4.0, State::getResY()/4.0);
    5757  this->deathScreen->setAbsCoor2D(State::getResX()/2.0f, State::getResY()/2.0f);
  • trunk/src/util/multiplayer_team_deathmatch.h

    r7221 r7810  
    1616class ObjectManager;
    1717class Player;
    18 class Billboard;
     18class ImagePlane;
    1919
    2020
     
    5252    int                teamBKills;                 //!< kills of team B
    5353
    54     Billboard*         deathScreen;                //!< the death screen
     54    ImagePlane*         deathScreen;                //!< the death screen
    5555};
    5656
  • trunk/src/world_entities/space_ships/helicopter.cc

    r7337 r7810  
    2525
    2626#include "util/loading/factory.h"
     27#include "util/loading/resource_manager.h"
     28
    2729#include "key_mapper.h"
    2830#include "event_handler.h"
     
    4951{
    5052  this->setPlayer(NULL);
     53
     54  if (this->chopperBuffer != NULL)
     55    ResourceManager::getInstance()->unload(this->chopperBuffer);
    5156}
    5257
     
    96101  this->getWeaponManager().changeWeaponConfig(1);
    97102  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
     103
     104  //load sound
     105  if (this->chopperBuffer != NULL)
     106    ResourceManager::getInstance()->unload(this->chopperBuffer);
     107  this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/chopper.wav", WAV);
     108
    98109}
    99110
     
    205216  State::getCameraNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
    206217  State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
     218
     219  this->soundSource.loop(this->chopperBuffer);
     220  // PRINTF(0)( "Playing ChopperSound\n" );
    207221}
    208222
     
    211225  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    212226  this->detachCamera();
    213 
     227  this->soundSource.stop();
    214228}
    215229
  • trunk/src/world_entities/space_ships/helicopter.h

    r7346 r7810  
    1010#include "playable.h"
    1111
     12#include "sound_buffer.h"
     13#include "sound_source.h"
    1214
    1315class Helicopter : public Playable
     
    7173    float                 airViscosity;
    7274
     75    OrxSound::SoundSource soundSource;
     76    OrxSound::SoundBuffer*chopperBuffer;
     77
    7378};
    7479
Note: See TracChangeset for help on using the changeset viewer.