Changeset 1211
- Timestamp:
- May 1, 2008, 6:09:05 PM (17 years ago)
- Location:
- code/branches/camera
- Files:
-
- 4 deleted
- 14 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/camera/CMakeLists.txt
r1101 r1211 32 32 33 33 #set binary output directories 34 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_ BINARY_DIR}/bin)35 SET(LIBRARY_OUTPUT_PATH ${PROJECT_ BINARY_DIR}/bin/lib)34 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) 35 SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/lib) 36 36 37 37 # global compiler/linker flags. force -O2! … … 43 43 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") 44 44 45 #Create verbose makefile output when compiling 46 SET(CMAKE_VERBOSE_MAKEFILE TRUE) 45 #use 'cmake -D make_verb:1 path' to get verbose make output when compiling 46 IF (MAKE_VERB) 47 SET(CMAKE_VERBOSE_MAKEFILE TRUE) 48 ENDIF (MAKE_VERB) 47 49 48 50 … … 79 81 ${ENet_INCLUDE_DIR} 80 82 ${Boost_INCLUDE_DIRS} 81 ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR} 83 ${OPENAL_INCLUDE_DIR} 84 ${ALUT_INCLUDE_DIR} 85 ${VORBIS_INCLUDE_DIR} 86 ${OGG_INCLUDE_DIR} 82 87 ${Lua_INCLUDE_DIR} 83 88 ) 84 85 86 ################ Source files ###################87 88 #if on a windows box, you have to generate the tolua bind files yourself89 IF(NOT WIN32)90 91 #At first, build lua92 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 files97 EXECUTE_PROCESS(COMMAND bin/./tolua-exec-script)98 99 ENDIF(NOT WIN32)100 89 101 90 #add main source dir -
code/branches/camera/cmake/FindLua.cmake
r1076 r1211 1 # Find Lua includes and library1 # Find Lua header and library files 2 2 # 3 # This module defines4 # Lua_INCLUDE_DIR 5 # Lua_LIBRARIES , the libraries to link against to use Lua.6 # Lua_ LIB_DIR, the location of the libraries7 # Lua_ FOUND, If false, do not try to use Lua3 # When called, this script tries to define: 4 # Lua_INCLUDE_DIR Header files directory 5 # Lua_LIBRARIES library files (or file when using lua 5.1) 6 # Lua_FOUND defined (true) if lua was found 7 # Lua_VERSION either 5.1 or 5.0 or undefined 8 8 # 9 # Copyright © 2007, Matt Williams 10 # 11 # Redistribution and use is allowed according to the terms of the BSD license. 9 # authors: Benjamin Knecht, Reto Grieder 12 10 13 MESSAGE(STATUS "lua libs in cache: ${Lua_LIBRARIES}")14 11 IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) 15 SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent 12 13 # Already in cache, be silent 14 SET(Lua_FOUND TRUE) 15 SET(Lua_FIND_QUIETLY TRUE) 16 MESSAGE(STATUS "Lua was found.") 17 18 ELSE (Lua_LIBRARIES AND Lua_INCLUDE_DIR) 19 20 FIND_PATH(Lua_INCLUDE_DIR_51 lua.h 21 /usr/include/lua5.1 22 /usr/local/include/lua5.1 23 ../libs/lua-5.1.3/src) 24 25 FIND_PATH(Lua_INCLUDE_DIR_50 lua.h 26 /usr/include/lua50 27 /usr/local/include/lua50 28 /usr/pack/lua-5.0.3-sd/include) 29 30 FIND_LIBRARY(Lua_LIBRARY_51 NAMES lua5.1 lua PATHS 31 /usr/lib 32 /usr/local/lib 33 ../libs/lua-5.1.3/lib) 34 35 FIND_LIBRARY(Lua_LIBRARY_1_50 NAMES lua50 lua PATHS 36 /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis 37 /usr/lib 38 /usr/local/lib) 39 40 FIND_LIBRARY(Lua_LIBRARY_2_50 NAMES lualib50 lualib PATHS 41 /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis 42 /usr/lib 43 /usr/local/lib) 44 45 46 IF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51) 47 48 # Found newer lua 5.1 libs 49 SET(Lua_FOUND TRUE) 50 SET(Lua_VERSION 5.1 CACHE STRING "") 51 SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_51} CACHE PATH "") 52 SET(Lua_LIBRARIES ${Lua_LIBRARY_51} CACHE FILEPATH "") 53 54 ELSEIF(Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50) 55 56 # Found older lua 5.0 libs 57 SET(Lua_FOUND TRUE) 58 SET(Lua_VERSION 5.0 CACHE STRING "") 59 SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_50} CACHE PATH "") 60 SET(Lua_LIBRARIES ${Lua_LIBRARY_1_50} ${Lua_LIBRARY_2_50} CACHE FILEPATH "") 61 62 ENDIF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51) 63 64 65 IF (Lua_FOUND) 66 MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}") 67 ELSE (Lua_FOUND) 68 IF (Lua_FIND_REQUIRED) 69 MESSAGE(FATAL_ERROR "Could not find Lua") 70 ENDIF (Lua_FIND_REQUIRED) 71 ENDIF (Lua_FOUND) 72 16 73 ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) 17 74 18 FIND_PATH(Lua_INCLUDE_DIR lua.h19 /usr/include/lua5.120 /usr/local/include/lua5.121 ../libs/lua-5.1.3/src)22 23 FIND_LIBRARY(Lua_LIBRARIES lua5.124 /usr/lib25 /usr/local/lib26 ../libs/lua-5.1.3/lib)27 28 IF (NOT Lua_INCLUDE_DIR)29 FIND_PATH(Lua_INCLUDE_DIR lua.h30 /usr/include/lua5031 /usr/local/include/lua5032 /usr/pack/lua-5.0.3-sd/include)33 ENDIF (NOT Lua_INCLUDE_DIR)34 35 IF (NOT Lua_LIBRARIES)36 FIND_LIBRARY(Lua_LIBRARIES lua5037 /usr/lib38 /usr/local/lib)39 40 FIND_LIBRARY(Lua_LIBRARY lualib5041 /usr/lib42 /usr/local/lib)43 44 #SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})45 ENDIF (NOT Lua_LIBRARIES)46 47 #especially for tardis48 IF (NOT Lua_LIBRARIES)49 FIND_LIBRARY(Lua_LIBRARIES lua50 /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)51 52 FIND_LIBRARY(Lua_LIBRARY lualib53 /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)54 55 #SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})56 ENDIF (NOT Lua_LIBRARIES)57 58 IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)59 SET(Lua_FOUND TRUE)60 ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)61 62 IF (Lua_FOUND)63 MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")64 MESSAGE(STATUS "Found Lua: ${Lua_LIBRARY}")65 ELSE (Lua_FOUND)66 IF (Lua_FIND_REQUIRED)67 MESSAGE(FATAL_ERROR "Could not find Lua")68 ENDIF (Lua_FIND_REQUIRED)69 ENDIF (Lua_FOUND) -
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 1 SET(CORE_SRC_FILES 5 2 OrxonoxClass.cc 6 3 BaseObject.cc … … 29 26 Tickable.cc 30 27 Script.cc 31 ${TOLUA_BIND_FILES} 28 tolua/tolua_bind.cc 29 #tolua/tolua_bind.h 32 30 ) 33 31 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 #) 35 39 36 TARGET_LINK_LIBRARIES( core 40 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION) 41 ADD_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 48 ADD_LIBRARY(core SHARED ${CORE_SRC_FILES}) 49 50 TARGET_LINK_LIBRARIES(core 51 ${Lua_LIBRARIES} 52 ${OIS_LIBRARIES} 53 ${OGRE_LIBRARIES} 37 54 util 38 ${Lua_LIBRARIES}39 ${Lua_LIBRARY}40 ${OIS_LIBRARIES}41 55 ) -
code/branches/camera/src/core/ConfigFileManager.h
r1064 r1211 63 63 { 64 64 public: 65 virtual ~ConfigFileEntry() {}; 65 66 virtual void setValue(const std::string& value) = 0; 66 67 virtual std::string getValue() const = 0; -
code/branches/camera/src/core/Script.cc
r1102 r1211 60 60 luaopen_debug(luaState_); 61 61 #endif 62 tolua_ orxonox_open(luaState_);62 tolua_core_open(luaState_); 63 63 output_ = ""; 64 64 } -
code/branches/camera/src/core/Script.h
r1201 r1211 57 57 public: 58 58 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; }; 60 60 61 61 void loadFile(std::string filename, bool luaTags); -
code/branches/camera/src/orxonox/CMakeLists.txt
r1201 r1211 31 31 # objects/weapon/BulletManager.cc 32 32 # objects/weapon/WeaponStation.cc 33 tolua/tolua_bind.cc 34 # tolua/tolua_bind.h 33 35 ) 34 36 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 45 GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION) 46 ADD_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 35 53 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} ) 36 54 -
code/branches/camera/src/orxonox/Orxonox.cc
r1092 r1211 54 54 //#include "util/Sleep.h" 55 55 #include "util/ArgReader.h" 56 #include "util/ExprParser.h" 56 57 57 58 // core … … 123 124 InputBuffer* ib_; 124 125 }; 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); 125 148 126 149 /** … … 299 322 300 323 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); 305 327 hudOverlay->show(); 306 328 … … 410 432 return; 411 433 } 434 Ogre::Root& ogreRoot = Ogre::Root::getSingleton(); 435 412 436 413 437 // Contains the times of recently fired events … … 429 453 { 430 454 // Pump messages in all registered RenderWindows 455 // This calls the WindowEventListener objects. 431 456 Ogre::WindowEventUtilities::messagePump(); 432 457 … … 452 477 // don't forget to call _fireFrameStarted in ogre to make sure 453 478 // everything goes smoothly 454 Ogre::Root::getSingleton()._fireFrameStarted(evt);479 ogreRoot._fireFrameStarted(evt); 455 480 456 481 // server still renders at the moment 457 482 //if (mode_ != SERVER) 458 Ogre::Root::getSingleton()._updateAllRenderTargets(); // only render in non-server mode483 ogreRoot._updateAllRenderTargets(); // only render in non-server mode 459 484 460 485 // get current time … … 466 491 467 492 // again, just to be sure ogre works fine 468 Ogre::Root::getSingleton()._fireFrameEnded(evt);493 ogreRoot._fireFrameEnded(evt); 469 494 } 470 495 } -
code/branches/camera/src/util/CMakeLists.txt
r1085 r1211 1 AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES) 2 3 SET (UTIL_SRC_FILES 1 SET(UTIL_SRC_FILES 4 2 ArgReader.cc 3 Clipboard.cc 4 ExprParser.cc 5 5 Math.cc 6 String.cc7 Clipboard.cc8 SubString.cc9 6 MultiTypePrimitive.cc 10 7 MultiTypeString.cc 11 8 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 12 18 tolua/tolua_event.c 13 19 tolua/tolua_is.c … … 15 21 tolua/tolua_push.c 16 22 tolua/tolua_to.c 17 ${TINYXML_SRC_FILES}18 23 ) 19 24 20 ADD_LIBRARY( util SHARED ${UTIL_SRC_FILES})25 ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES}) 21 26 22 27 IF(TESTING_ENABLED) … … 24 29 ENDIF(TESTING_ENABLED) 25 30 26 TARGET_LINK_LIBRARIES( 31 TARGET_LINK_LIBRARIES(util 27 32 ${OGRE_LIBRARIES} 28 33 ${Lua_LIBRARIES} 29 ${Lua_LIBRARY}30 34 ) 31 35 36 ADD_SUBDIRECTORY(tolua) 37 -
code/branches/camera/src/util/String.cc
r1064 r1211 274 274 if (str.size() == 0) 275 275 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 } 276 284 277 285 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 1 SET(TOLUA_SRC_FILES 52 2 tolua.c 53 3 tolua_event.c … … 59 9 ) 60 10 61 ADD_EXECUTABLE( tolua ${TOLUA_SRC_FILES})11 ADD_EXECUTABLE(tolua ${TOLUA_SRC_FILES}) 62 12 63 TARGET_LINK_LIBRARIES( 13 TARGET_LINK_LIBRARIES(tolua 64 14 ${Lua_LIBRARIES} 65 ${Lua_LIBRARY}66 15 m 67 16 ) 17 -
code/branches/camera/visual_studio/vc8/core.vcproj
r1084 r1211 258 258 RelativePath="..\..\src\core\tolua\tolua_bind.cc" 259 259 > 260 <FileConfiguration261 Name="Debug|Win32"262 >263 <Tool264 Name="VCCLCompilerTool"265 />266 </FileConfiguration>267 260 </File> 268 261 </Filter> -
code/branches/camera/visual_studio/vc8/orxonox.vcproj
r1035 r1211 384 384 </File> 385 385 </Filter> 386 <Filter 387 Name="tolua" 388 > 389 <File 390 RelativePath="..\..\src\orxonox\tolua\tolua_bind.cc" 391 > 392 <FileConfiguration 393 Name="Debug|Win32" 394 > 395 <Tool 396 Name="VCCLCompilerTool" 397 UsePrecompiledHeader="0" 398 /> 399 </FileConfiguration> 400 </File> 401 </Filter> 386 402 </Filter> 387 403 <Filter … … 511 527 <File 512 528 RelativePath="..\..\src\orxonox\tools\Timer.h" 529 > 530 </File> 531 </Filter> 532 <Filter 533 Name="tolua" 534 > 535 <File 536 RelativePath="..\..\src\orxonox\tolua\tolua_bind.h" 513 537 > 514 538 </File> -
code/branches/camera/visual_studio/vc8/util.vcproj
r1064 r1211 157 157 </File> 158 158 <File 159 RelativePath="..\..\src\util\ExprParser.cc" 160 > 161 </File> 162 <File 159 163 RelativePath="..\..\src\util\Math.cc" 160 164 > … … 199 203 </File> 200 204 <File 205 RelativePath="..\..\src\util\ExprParser.h" 206 > 207 </File> 208 <File 201 209 RelativePath="..\..\src\util\Math.h" 202 210 >
Note: See TracChangeset
for help on using the changeset viewer.