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
Files:
9 edited
6 copied

Legend:

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

    r1084 r1211  
    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}
     28  tolua/tolua_bind.cc
     29#tolua/tolua_bind.h
    3230)
    3331
    34 ADD_LIBRARY( core SHARED ${CORE_SRC_FILES})
     32#SET_SOURCE_FILES_PROPERTIES(tolua/tolua_bind.h
     33#  PROPERTIES
     34#  OBJECT_DEPENDS tolua/tolua_bind.h
     35#  OBJECT_DEPENDS tolua/tolua_bind.cc
     36#  GENERATED true
     37#  HEADER_FILE_ONLY true
     38#)
    3539
    36 TARGET_LINK_LIBRARIES( core
     40GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
     41ADD_CUSTOM_COMMAND(
     42  OUTPUT tolua/tolua_bind.cc tolua/tolua_bind.h
     43  COMMAND ${TOLUA_EXE} -n core -o ../../src/core/tolua/tolua_bind.cc -H ../../src/core/tolua/tolua_bind.h ../../src/core/tolua/tolua.pkg
     44  DEPENDS tolua
     45  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib
     46)
     47
     48ADD_LIBRARY(core SHARED ${CORE_SRC_FILES})
     49
     50TARGET_LINK_LIBRARIES(core
     51  ${Lua_LIBRARIES}
     52  ${OIS_LIBRARIES}
     53  ${OGRE_LIBRARIES}
    3754  util
    38   ${Lua_LIBRARIES}
    39   ${Lua_LIBRARY}
    40   ${OIS_LIBRARIES}
    4155)
  • code/branches/camera/src/core/ConfigFileManager.h

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

    r1102 r1211  
    6060    luaopen_debug(luaState_);
    6161#endif
    62     tolua_orxonox_open(luaState_);
     62    tolua_core_open(luaState_);
    6363    output_ = "";
    6464  }
  • code/branches/camera/src/core/Script.h

    r1201 r1211  
    5757    public:
    5858      inline static Script* getInstance() { if (!Script::singletonRef) Script::singletonRef = new Script(); return Script::singletonRef; } // tolua_export
    59       inline ~Script() { Script::singletonRef = NULL; }
     59      inline ~Script() { Script::singletonRef = NULL; };
    6060
    6161    void loadFile(std::string filename, bool luaTags);
  • 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  }
  • code/branches/camera/src/util/CMakeLists.txt

    r1085 r1211  
    1 AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
    2 
    3 SET (UTIL_SRC_FILES
     1SET(UTIL_SRC_FILES
    42  ArgReader.cc
     3  Clipboard.cc
     4  ExprParser.cc
    55  Math.cc
    6   String.cc
    7   Clipboard.cc
    8   SubString.cc
    96  MultiTypePrimitive.cc
    107  MultiTypeString.cc
    118  MultiTypeMath.cc
     9  String.cc
     10  SubString.cc
     11
     12  tinyxml/ticpp.cc
     13  tinyxml/tinystr.cc
     14  tinyxml/tinyxml.cc
     15  tinyxml/tinyxmlerror.cc
     16  tinyxml/tinyxmlparser.cc
     17
    1218  tolua/tolua_event.c
    1319  tolua/tolua_is.c
     
    1521  tolua/tolua_push.c
    1622  tolua/tolua_to.c
    17   ${TINYXML_SRC_FILES}
    1823)
    1924
    20 ADD_LIBRARY( util SHARED ${UTIL_SRC_FILES} )
     25ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES})
    2126
    2227IF(TESTING_ENABLED)
     
    2429ENDIF(TESTING_ENABLED)
    2530
    26 TARGET_LINK_LIBRARIES( util
     31TARGET_LINK_LIBRARIES(util
    2732  ${OGRE_LIBRARIES}
    2833  ${Lua_LIBRARIES}
    29   ${Lua_LIBRARY}
    3034)
    3135
     36ADD_SUBDIRECTORY(tolua)
     37
  • code/branches/camera/src/util/String.cc

    r1064 r1211  
    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 = "";
  • code/branches/camera/src/util/tolua/CMakeLists.txt

    r1076 r1211  
    1 PROJECT(ToLua)
    2 
    3 #This sets where to look for modules (e.g. "Find*.cmake" files)
    4 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/)
    5 
    6 #Check whether we are on a tardis box
    7 INCLUDE(CheckTardis)
    8 
    9 ########## Compiler/Linker options ##############
    10 
    11 # if on tardis change compiler and reset boost include directory
    12 IF(IS_TARDIS)
    13   MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
    14   # force-set the compiler on tardis machines, as default points to g++-3.3
    15   SET(CMAKE_CXX_COMPILER "g++-4.1.1")
    16 ENDIF(IS_TARDIS)
    17 
    18 #set binary output directories
    19 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../../../bin)
    20 SET(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/../../../bin)
    21 
    22 # global compiler/linker flags. force -O2!
    23 SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O2 -Wall -g -ggdb")
    24 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O2 -Wall -g -ggdb")
    25 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
    26 SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined")
    27 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
    28 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
    29 
    30 #Create verbose makefile output when compiling
    31 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
    32 
    33 
    34 ############### Library finding #################
    35 
    36 #Performs the search and sets the variables
    37 FIND_PACKAGE(Lua)
    38 
    39 #Set the search paths for the linking
    40 LINK_DIRECTORIES(
    41 )
    42 
    43 #Set the search paths for include files
    44 INCLUDE_DIRECTORIES(
    45   ${Lua_INCLUDE_DIR}
    46 )
    47 
    48 
    49 ################ Source files ###################
    50 
    51 SET (TOLUA_SRC_FILES
     1SET(TOLUA_SRC_FILES
    522  tolua.c
    533  tolua_event.c
     
    599)
    6010
    61 ADD_EXECUTABLE( tolua ${TOLUA_SRC_FILES} )
     11ADD_EXECUTABLE(tolua ${TOLUA_SRC_FILES})
    6212
    63 TARGET_LINK_LIBRARIES( tolua
     13TARGET_LINK_LIBRARIES(tolua
    6414  ${Lua_LIBRARIES}
    65   ${Lua_LIBRARY}
    6615  m
    6716)
     17
Note: See TracChangeset for help on using the changeset viewer.