Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1122


Ignore:
Timestamp:
Apr 21, 2008, 7:42:58 PM (17 years ago)
Author:
rgrieder
Message:

merged trunk into cmake branch

Location:
code/branches/cmake
Files:
6 deleted
8 edited
16 copied

Legend:

Unmodified
Added
Removed
  • code/branches/cmake/CMakeLists.txt

    r1101 r1122  
    7979  ${ENet_INCLUDE_DIR}
    8080  ${Boost_INCLUDE_DIRS}
    81   ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}
     81  ${OPENAL_INCLUDE_DIR}
     82  ${ALUT_INCLUDE_DIR}
     83  ${VORBIS_INCLUDE_DIR}
     84  ${OGG_INCLUDE_DIR}
    8285  ${Lua_INCLUDE_DIR}
    8386)
    84 
    85 
    86 ################ Source files ###################
    87 
    88 #if on a windows box, you have to generate the tolua bind files yourself
    89 IF(NOT WIN32)
    90 
    91   #At first, build lua
    92   MESSAGE(STATUS "\n******************* Building tolua... ******************\n\n")
    93   EXECUTE_PROCESS(COMMAND ./tolua-build)
    94   MESSAGE(STATUS "\n\n******************* Building tolua done ****************\n")
    95 
    96   #generate lua bind source files
    97   EXECUTE_PROCESS(COMMAND bin/./tolua-exec-script)
    98 
    99 ENDIF(NOT WIN32)
    10087
    10188#add main source dir
  • code/branches/cmake/src/CMakeLists.txt

    r1076 r1122  
    11INCLUDE_DIRECTORIES(.)
    22INCLUDE_DIRECTORIES(orxonox)
    3 INCLUDE_DIRECTORIES(util/tolua)
     3INCLUDE_DIRECTORIES(tolua)
    44
     5ADD_SUBDIRECTORY(tolua)
    56ADD_SUBDIRECTORY(util)
    67ADD_SUBDIRECTORY(core)
  • code/branches/cmake/src/core/CMakeLists.txt

    r1084 r1122  
    1 #get the created files
    2 AUX_SOURCE_DIRECTORY(tolua TOLUA_BIND_FILES)
    3 
    4 SET( CORE_SRC_FILES
     1SET(CORE_SRC_FILES
    52  OrxonoxClass.cc
    63  BaseObject.cc
     
    2926  Tickable.cc
    3027  Script.cc
    31   ${TOLUA_BIND_FILES}
    3228)
    3329
    34 ADD_LIBRARY( core SHARED ${CORE_SRC_FILES})
     30ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
    3531
    36 TARGET_LINK_LIBRARIES( core
     32TARGET_LINK_LIBRARIES(core
    3733  util
     34  tolualib
    3835  ${Lua_LIBRARIES}
    3936  ${Lua_LIBRARY}
  • code/branches/cmake/src/core/ConfigFileManager.h

    r1064 r1122  
    6363    {
    6464        public:
     65            virtual ~ConfigFileEntry() {};
    6566            virtual void setValue(const std::string& value) = 0;
    6667            virtual std::string getValue() const = 0;
  • code/branches/cmake/src/core/Script.cc

    r1102 r1122  
    3939}
    4040
    41 #include "tolua++.h"
     41#include "tolua/tolua++.h"
    4242#include "tolua/tolua_bind.h"
    4343
  • code/branches/cmake/src/orxonox/Orxonox.cc

    r1092 r1122  
    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/cmake/src/util/CMakeLists.txt

    r1085 r1122  
    11AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
    22
    3 SET (UTIL_SRC_FILES
     3SET(UTIL_SRC_FILES
    44  ArgReader.cc
    55  Math.cc
     
    77  Clipboard.cc
    88  SubString.cc
     9  ExprParser.cc
    910  MultiTypePrimitive.cc
    1011  MultiTypeString.cc
    1112  MultiTypeMath.cc
    12   tolua/tolua_event.c
    13   tolua/tolua_is.c
    14   tolua/tolua_map.c
    15   tolua/tolua_push.c
    16   tolua/tolua_to.c
    1713  ${TINYXML_SRC_FILES}
    1814)
    1915
    20 ADD_LIBRARY( util SHARED ${UTIL_SRC_FILES} )
     16ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES})
    2117
    2218IF(TESTING_ENABLED)
     
    2420ENDIF(TESTING_ENABLED)
    2521
    26 TARGET_LINK_LIBRARIES( util
     22TARGET_LINK_LIBRARIES(util
    2723  ${OGRE_LIBRARIES}
    28   ${Lua_LIBRARIES}
    29   ${Lua_LIBRARY}
    3024)
    3125
  • code/branches/cmake/src/util/String.cc

    r1064 r1122  
    274274    if (str.size() == 0)
    275275        return str;
     276    else if (str.size() == 1)
     277    {
     278      //TODO: decide whether we need the commented code
     279      /*if (str[0] != '\\')
     280        return "";
     281      else*/
     282      return str;
     283    }
    276284
    277285    std::string output = "";
Note: See TracChangeset for help on using the changeset viewer.