Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 1, 2008, 6:09:05 PM (17 years ago)
Author:
scheusso
Message:

merged trunk changes from 1101 to 1202 into camera branch

Location:
code/branches/camera/src/orxonox
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/camera/src/orxonox/CMakeLists.txt

    r1201 r1211  
    3131#  objects/weapon/BulletManager.cc
    3232#  objects/weapon/WeaponStation.cc
     33  tolua/tolua_bind.cc
     34#  tolua/tolua_bind.h
    3335)
    3436
     37#SET_SOURCE_FILES_PROPERTIES(tolua/tolua_bind.h
     38#  PROPERTIES
     39#  OBJECT_DEPENDS tolua/tolua_bind.h
     40#  OBJECT_DEPENDS tolua/tolua_bind.cc
     41#  GENERATED true
     42#  HEADER_FILE_ONLY true
     43#)
     44
     45GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
     46ADD_CUSTOM_COMMAND(
     47  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
     48  COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/orxonox/tolua/tolua_bind.cc -H ../../src/orxonox/tolua/tolua_bind.h ../../src/orxonox/tolua/tolua.pkg
     49  DEPENDS tolua
     50  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
     51)
     52       
    3553ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
    3654
  • code/branches/camera/src/orxonox/Orxonox.cc

    r1092 r1211  
    5454//#include "util/Sleep.h"
    5555#include "util/ArgReader.h"
     56#include "util/ExprParser.h"
    5657
    5758// core
     
    123124      InputBuffer* ib_;
    124125  };
     126
     127  class Calculator
     128  {
     129  public:
     130    static void calculate(const std::string& calculation)
     131    {
     132      ExprParser expr(calculation);
     133      if (expr.getSuccess())
     134      {
     135        if (expr.getResult() == 42.0)
     136          std::cout << "Greetings from the restaurant at the end of the universe." << std::endl;
     137        // FIXME: insert modifier to display in full precision
     138        std::cout << "Result is: " << expr.getResult() << std::endl;
     139        if (expr.getRemains() != "")
     140          std::cout << "Warning: Expression could not be parsed to the end! Remains: '"
     141              << expr.getRemains() << "'" << std::endl;
     142      }
     143      else
     144        std::cout << "Cannot calculate expression: Parse error" << std::endl;
     145    }
     146  };
     147  ConsoleCommandShortcut(Calculator, calculate, AccessLevel::None);
    125148
    126149  /**
     
    299322
    300323    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    301     HUD* orxonoxHud;
    302     orxonoxHud = new HUD();
    303     orxonoxHud->setEnergyValue(20);
    304     orxonoxHud->setEnergyDistr(20,20,60);
     324    orxonoxHUD_ = new HUD();
     325    orxonoxHUD_->setEnergyValue(20);
     326    orxonoxHUD_->setEnergyDistr(20,20,60);
    305327    hudOverlay->show();
    306328
     
    410432      return;
    411433    }
     434    Ogre::Root& ogreRoot = Ogre::Root::getSingleton();
     435
    412436
    413437    // Contains the times of recently fired events
     
    429453          {
    430454                  // Pump messages in all registered RenderWindows
     455      // This calls the WindowEventListener objects.
    431456      Ogre::WindowEventUtilities::messagePump();
    432457
     
    452477      // don't forget to call _fireFrameStarted in ogre to make sure
    453478      // everything goes smoothly
    454       Ogre::Root::getSingleton()._fireFrameStarted(evt);
     479      ogreRoot._fireFrameStarted(evt);
    455480
    456481      // server still renders at the moment
    457482      //if (mode_ != SERVER)
    458       Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode
     483      ogreRoot._updateAllRenderTargets(); // only render in non-server mode
    459484
    460485      // get current time
     
    466491
    467492      // again, just to be sure ogre works fine
    468       Ogre::Root::getSingleton()._fireFrameEnded(evt);
     493      ogreRoot._fireFrameEnded(evt);
    469494          }
    470495  }
Note: See TracChangeset for help on using the changeset viewer.