Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1089


Ignore:
Timestamp:
Apr 17, 2008, 1:25:06 PM (16 years ago)
Author:
rgrieder
Message:
  • bugfix in audiomanager
  • added CCOUT(level): like COUT, but prints "* Classname: " in front
Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/bin/levels/sample.oxw

    r1086 r1089  
    1 <Namespace name="test" />
    2 <Namespace name="blub" />
    3 <Namespace name="rofl" />
    4 
    5 <Namespace name="ns1">
    6   <Namespace name="ns11">
    7     <Namespace name="ns111">
    8     </Namespace>
    9     <Namespace name="ns112">
    10     </Namespace>
    11   </Namespace>
    12   <Namespace name="ns12">
    13     <Namespace name="ns121">
    14     </Namespace>
    15     <Namespace name="ns122">
    16     </Namespace>
    17   </Namespace>
    18 </Namespace>
    19 
    20 <Namespace name="ns1::ns12::ns121">
    21   <Namespace name="ns1211">
    22   </Namespace>
    23 </Namespace>
    24 <Namespace name="ns1::ns12::ns122::ns1221" />
    25 
    26 <!--
    27  <audio>
    28                 <ambient>
    29                         <ogg src="allgorythm-lift_up" />
    30                         <ogg src="allgorythm-resonance_blaster" />
    31                         <ogg src="luke_grey_-_hypermode" />
    32                         <ogg src="task_horizon_-_menu1" />
    33                         <ogg src="tha_silent_partner_-_void" />
    34                 </ambient>
    35   </audio>
    36 
    37 -->
     1 <!--audio>
     2        <ambient>
     3                <ogg src="allgorythm-lift_up" />
     4                <ogg src="allgorythm-resonance_blaster" />
     5                <ogg src="luke_grey_-_hypermode" />
     6                <ogg src="task_horizon_-_menu1" />
     7                <ogg src="tha_silent_partner_-_void" />
     8        </ambient>
     9  </audio-->
    3810
    3911<Ambient colourvalue="1,1,1" />
     
    4820<NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
    4921
    50 <!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" /-->
    51 <!--Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
     22<!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
     23<Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
    5224  <attached>
    5325    <Model name="drone2" position="200,-100,-500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
     
    5729    </Model>
    5830  </attached>
    59 </Model -->
     31</Model-->
    6032
    6133<Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
     
    6638
    6739
    68 <Namespace name="test" />
    69 <Namespace name="blub">
    70 </Namespace>
    71 <Namespace name="rofl">
    72   <Namespace name="lol">
    73   </Namespace>
    74 </Namespace>
    75 
    76 <Namespace name="ns1">
    77   <Namespace name="ns11">
    78     <Namespace name="ns111">
    79       <Namespace name="ns1111">
    80       </Namespace>
    81     </Namespace>
    82   </Namespace>
    83   <Namespace name="ns13">
    84   </Namespace>
    85 </Namespace>
    86 
    87 <Namespace name="ns1 ns2">
    88   <Namespace name="abc" />
    89 </Namespace>
    90 
    91 <Namespace name="ns1::ns11 ns1::ns12 ns1::ns12::ns121">
    92   <Namespace name="muhahaha" />
    93 </Namespace>
    94 
    95 <Namespace name="test">
    96   <Namespace name="test" />
    97 </Namespace>
    98 
    99 <Namespace name="ns1::ns13">
    100   <Namespace name="..::ns14" />
    101   <Namespace name="..::..::ns3" />
    102 </Namespace>
    103 
    104 <Namespace name="AAA::BBB::..::CCC::..::DDD::..::BBB::BBBBBB::..::BBBBBBBBBBBBBBBBBBB::..::..::EEE" />
    105 
    106 <Namespace name="..::justatest" />
    107 
    108 <Namespace name="@file.oxw::anothertest" />
    109 
    110 <Namespace name="justonemoretest::@file.oxw::gagagaga" />
    111 
    112 <Namespace name="AAA::BBB, AAA::CCC; AAA::DDD,AAA::EEE">
    113   <Namespace name="hax" />
    114 </Namespace>
    115 
    11640<!--?lua
    11741for i = 1, 226, 1
  • code/trunk/src/audio/AudioManager.cc

    r1064 r1089  
    6060        {
    6161//              currentBgSound = 0;
    62     currentBgSound = rand() % bgSounds.size();
    6362                if (bgSounds.size() > 0)
    6463                {
     64      currentBgSound = rand() % bgSounds.size();
    6565                        if(!bgSounds[currentBgSound]->playback())
    6666                        {
     
    7272                        }
    7373                }
    74 
    7574        }
    7675
  • code/trunk/src/core/Debug.h

    r1062 r1089  
    260260#endif /* ifndef COUT */
    261261
     262
     263/////////////////////////////////////////////////////////////////////
     264///  CCOUT: Prints output with std::cout and adds the classname   ///
     265/////////////////////////////////////////////////////////////////////
     266
     267#define CCOUT_EXEC(x) \
     268  orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
     269  << "*** " << this->getIdentifier()->getName() << ": "
     270
     271#ifndef CCOUT
     272 #if ORX_PRINT_DEBUG_OUTPUT
     273  #define CCOUT(x) \
     274   CCOUT ## x
     275
     276  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
     277   #define CCOUT1  \
     278    if (getSoftDebugLevel() >= ORX_ERROR)  \
     279     CCOUT_EXEC(1)
     280  #else
     281   #define CCOUT1 if (ORX_NONE)\
     282    CCOUT_EXEC(1)
     283  #endif
     284
     285  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
     286   #define CCOUT2 \
     287    if (getSoftDebugLevel() >= ORX_WARNING) \
     288     CCOUT_EXEC(2)
     289  #else
     290   #define CCOUT2 if (ORX_NONE) \
     291    CCOUT_EXEC(2)
     292  #endif
     293
     294  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
     295   #define CCOUT3 \
     296    if (getSoftDebugLevel() >= ORX_INFO) \
     297     CCOUT_EXEC(3)
     298  #else
     299   #define CCOUT3 if (ORX_NONE) \
     300    CCOUT_EXEC(3)
     301  #endif
     302
     303  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
     304   #define CCOUT4 \
     305    if (getSoftDebugLevel() >= ORX_DEBUG) \
     306     CCOUT_EXEC(4)
     307  #else
     308   #define CCOUT4 if (ORX_NONE) \
     309    CCOUT_EXEC(4)
     310  #endif
     311
     312  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
     313   #define CCOUT5 \
     314    if (getSoftDebugLevel() >= ORX_vDEBUG) \
     315     CCOUT_EXEC(5)
     316  #else
     317   #define CCOUT5 if (ORX_NONE) \
     318    CCOUT_EXEC(5)
     319  #endif
     320
     321 #else /* if ORX_PRINT_DEBUG_OUTPUT */
     322  #define CCOUT(x) if (ORX_NONE) \
     323   CCOUT_EXEC(5)
     324 #endif /* if ORX_PRINT_DEBUG_OUTPUT */
     325
     326 #define CCOUT0 \
     327  CCOUT_EXEC(0)
     328#endif /* ifndef CCOUT */
     329
    262330#endif /* _Debug_H__ */
  • code/trunk/src/core/InputManager.cc

    r1084 r1089  
    5353      handlerGUI_(0), handlerBuffer_(0), handlerGame_(0)
    5454  {
     55    RegisterObject(InputManager);
    5556  }
    5657
  • code/trunk/src/orxonox/Orxonox.cc

    r1084 r1089  
    7575#include "tools/Timer.h"
    7676#include "hud/HUD.h"
    77 //#include "objects/weapon/BulletManager.h"
    7877
    7978// FIXME: is this really file scope?
     
    140139    this->auMan_ = 0;
    141140    this->inputHandler_ = 0;
    142     //this->root_ = 0;
    143141    // turn on frame smoothing by setting a value different from 0
    144142    this->frameSmoothingTime_ = 0.0f;
     
    153151  {
    154152    // keep in mind: the order of deletion is very important!
    155 //    if (this->bulletMgr_)
    156 //      delete this->bulletMgr_;
    157153    if (this->orxonoxHUD_)
    158154      delete this->orxonoxHUD_;
     
    172168
    173169  /**
    174    * error kills orxonox
    175    */
    176   void Orxonox::abortImmediate(/* some error code */)
    177   {
    178     //TODO: destroy and destruct everything and print nice error msg
     170    @brief Immediately deletes the orxonox object.
     171    Never use if you can help it while rendering!
     172  */
     173  void Orxonox::abortImmediateForce()
     174  {
     175    COUT(1) << "*** Orxonox Error: Orxonox object was unexpectedly destroyed." << std::endl;
    179176    delete this;
    180177  }
     
    185182  void Orxonox::abortRequest()
    186183  {
     184    COUT(3) << "*** Orxonox: Abort requested." << std::endl;
    187185    bAbort_ = true;
    188186  }
     
    225223    ar.checkArgument("data", this->dataPath_, false);
    226224    ar.checkArgument("ip", serverIp_, false);
    227     if(ar.errorHandling()) abortImmediate();
     225    if(ar.errorHandling()) abortImmediateForce();
    228226    if(mode == std::string("client"))
    229227    {
     
    248246    ogre_->setup();
    249247    //root_ = ogre_->getRoot();
    250     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     248    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    251249
    252250    server_g = new network::Server();
     
    263261    else
    264262      client_g = new network::Client(serverIp_, NETWORK_PORT);
    265     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     263    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    266264  }
    267265
     
    272270    ogre_->setConfigPath(path);
    273271    ogre_->setup();
    274     //root_ = ogre_->getRoot();
    275     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     272    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    276273  }
    277274
     
    301298    auMan_ = new audio::AudioManager();
    302299
    303     //bulletMgr_ = new BulletManager();
    304 
    305300    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    306301    HUD* orxonoxHud;
     
    350345    auMan_ = new audio::AudioManager();
    351346
    352     //bulletMgr_ = new BulletManager();
    353 
    354347    // load this file from config
    355348    Level* startlevel = new Level("levels/sample.oxw");
     
    380373    if (!inputHandler_->initialise(ogre_->getWindowHandle(),
    381374          ogre_->getWindowWidth(), ogre_->getWindowHeight()))
    382       abortImmediate();
     375      abortImmediateForce();
    383376    inputHandler_->setInputMode(IM_INGAME);
    384377  }
     
    414407    if (Ogre::Root::getSingletonPtr() == 0)
    415408    {
    416       COUT(2) << "Error: Could not start rendering. No Ogre root object found" << std::endl;
     409      COUT(2) << "*** Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl;
    417410      return;
    418411    }
  • code/trunk/src/orxonox/Orxonox.h

    r1056 r1089  
    6161      void init(int argc, char **argv, std::string path);
    6262      void start();
    63       // not sure if this should be private
    64       void abortImmediate(/* some error code */);
     63      void abortImmediateForce();
    6564      void abortRequest();
    6665      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
  • code/trunk/visual_studio/base_properties_debug.vsprops

    r1084 r1089  
    1313                BasicRuntimeChecks="3"
    1414                RuntimeLibrary="3"
    15                 DebugInformationFormat="3"
     15                DebugInformationFormat="4"
    1616        />
    1717        <Tool
  • code/trunk/visual_studio/vc8/tolua++.vcproj

    r1084 r1089  
    131131                        >
    132132                        <File
    133                                 RelativePath="..\..\src\util\tolua\tolua.c"
    134                                 >
    135                                 <FileConfiguration
    136                                         Name="Debug|Win32"
    137                                         ExcludedFromBuild="true"
    138                                         >
    139                                         <Tool
    140                                                 Name="VCCLCompilerTool"
    141                                         />
    142                                 </FileConfiguration>
    143                         </File>
    144                         <File
    145133                                RelativePath="..\..\src\util\tolua\tolua_event.c"
    146134                                >
     
    162150                                >
    163151                        </File>
    164                         <File
    165                                 RelativePath="..\..\src\util\tolua\toluabind.c"
    166                                 >
    167                                 <FileConfiguration
    168                                         Name="Debug|Win32"
    169                                         ExcludedFromBuild="true"
    170                                         >
    171                                         <Tool
    172                                                 Name="VCCLCompilerTool"
    173                                         />
    174                                 </FileConfiguration>
    175                         </File>
    176152                </Filter>
    177153                <Filter
     
    188164                                >
    189165                        </File>
    190                         <File
    191                                 RelativePath="..\..\src\util\tolua\toluabind.h"
    192                                 >
    193                         </File>
    194                         <File
    195                                 RelativePath="..\..\src\util\tolua\toluabind_default.h"
    196                                 >
    197                         </File>
    198166                </Filter>
    199167        </Files>
Note: See TracChangeset for help on using the changeset viewer.