Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 22, 2008, 7:26:43 PM (17 years ago)
Author:
rgrieder
Message:

trunk —> console

Location:
code/branches/console/src
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/CMakeLists.txt

    r1115 r1133  
    3434  tolualib
    3535  ${Lua_LIBRARIES}
    36   ${Lua_LIBRARY}
    3736  ${OIS_LIBRARIES}
    3837)
  • code/branches/console/src/orxonox/Orxonox.cc

    r1092 r1133  
    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  /**
     
    410433      return;
    411434    }
     435    Ogre::Root& ogreRoot = Ogre::Root::getSingleton();
     436
    412437
    413438    // Contains the times of recently fired events
     
    429454          {
    430455                  // Pump messages in all registered RenderWindows
     456      // This calls the WindowEventListener objects.
    431457      Ogre::WindowEventUtilities::messagePump();
    432458
     
    452478      // don't forget to call _fireFrameStarted in ogre to make sure
    453479      // everything goes smoothly
    454       Ogre::Root::getSingleton()._fireFrameStarted(evt);
     480      ogreRoot._fireFrameStarted(evt);
    455481
    456482      // server still renders at the moment
    457483      //if (mode_ != SERVER)
    458       Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode
     484      ogreRoot._updateAllRenderTargets(); // only render in non-server mode
    459485
    460486      // get current time
     
    466492
    467493      // again, just to be sure ogre works fine
    468       Ogre::Root::getSingleton()._fireFrameEnded(evt);
     494      ogreRoot._fireFrameEnded(evt);
    469495          }
    470496  }
  • code/branches/console/src/tolua/CMakeLists.txt

    r1115 r1133  
    1414TARGET_LINK_LIBRARIES(tolua
    1515  ${Lua_LIBRARIES}
    16   ${Lua_LIBRARY}
    1716  m
    1817)
     
    4140ADD_CUSTOM_COMMAND(
    4241  OUTPUT tolua_bind.h tolua_bind.cc
    43   COMMAND ${TOLUA_EXE} -n orxonox -o ../../src/tolua/tolua_bind.cc -H ../../src/tolua/tolua_bind.h ../../src/tolua/tolua.pkg
     42  COMMAND ${TOLUA_EXE} -n orxonox -o tolua/tolua_bind.cc -H tolua/tolua_bind.h tolua/tolua.pkg
    4443  DEPENDS tolua
    45   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
     44  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
    4645)
    4746
     
    5049TARGET_LINK_LIBRARIES(tolualib
    5150  ${Lua_LIBRARIES}
    52   ${Lua_LIBRARY}
    5351)
    5452
  • code/branches/console/src/tolua/tolua.pkg

    r1115 r1133  
    1 $cfile "../../src/core/Script_clean.h"
     1$cfile "core/Script_clean.h"
  • code/branches/console/src/util/CMakeLists.txt

    r1115 r1133  
    77  Clipboard.cc
    88  SubString.cc
     9  ExprParser.cc
    910  MultiTypePrimitive.cc
    1011  MultiTypeString.cc
Note: See TracChangeset for help on using the changeset viewer.