Changeset 1211 for code/branches/camera/src
- Timestamp:
- May 1, 2008, 6:09:05 PM (17 years ago)
- 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 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
Note: See TracChangeset
for help on using the changeset viewer.