Thread: [Yake-svn] SF.net SVN: yake: [1516] trunk/yake (Page 2)
Status: Beta
Brought to you by:
psyclonist
From: <psy...@us...> - 2006-12-06 23:50:03
|
Revision: 1516 http://svn.sourceforge.net/yake/?rev=1516&view=rev Author: psyclonist Date: 2006-12-06 15:49:58 -0800 (Wed, 06 Dec 2006) Log Message: ----------- drastically reduced compile times for core, various cleanup operations, modified includes, removed deprecated code Modified Paths: -------------- trunk/yake/src/yake/base/math/yakeMath.cpp trunk/yake/src/yake/base/math/yakeQuaternion.cpp trunk/yake/src/yake/base/math/yakeVector3.cpp trunk/yake/src/yake/base/templates/yakeSmartAssert.cpp trunk/yake/src/yake/base/yakeMovable.cpp trunk/yake/src/yake/base/yakeUniqueName.cpp trunk/yake/src/yake/net/detail/netCommon.cpp trunk/yake/src/yake/plugins/inputOgre/InputSystemOgre.cpp trunk/yake/src/yapp/plugins/ceguiOgreRendererAdapter/plugin.cpp trunk/yake/src/yapp/raf/yakeApplication.cpp trunk/yake/yake/base/templates/yakeSmartAssert.h trunk/yake/yake/base/yake.h trunk/yake/yake/base/yakeException.h trunk/yake/yake/base/yakeLibrary.h trunk/yake/yake/base/yakeMovable.h trunk/yake/yake/base/yakePCH.h trunk/yake/yake/base/yakeParamHolder.h trunk/yake/yake/base/yakePrerequisites.h Added Paths: ----------- trunk/yake/src/yake/base/templates/yakeSmartAssertHandlers.cpp trunk/yake/yake/base/templates/yakeSmartAssertHandlers.h trunk/yake/yake/base/yakeNoncopyable.h Removed Paths: ------------- trunk/yake/src/yake/base/yakeCriticalSection.cpp trunk/yake/src/yake/base/yakeLock.cpp trunk/yake/yake/base/yakeCriticalSection.h trunk/yake/yake/base/yakeLock.h Modified: trunk/yake/src/yake/base/math/yakeMath.cpp =================================================================== --- trunk/yake/src/yake/base/math/yakeMath.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/math/yakeMath.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -28,6 +28,7 @@ // IMPLEMENTATION HEADERS //============================================================================ #include <yake/base/yakePCH.h> +#include <yake/base/math/yakeMath.h> #include <stdlib.h> // for RAND_MAX Modified: trunk/yake/src/yake/base/math/yakeQuaternion.cpp =================================================================== --- trunk/yake/src/yake/base/math/yakeQuaternion.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/math/yakeQuaternion.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -375,10 +375,10 @@ return rkP; real fSin = Math::Sin(fAngle); - real fInvSin = 1.0/fSin; - real fCoeff0 = Math::Sin((1.0-fT)*fAngle)*fInvSin; + real fInvSin = real(1.0)/fSin; + real fCoeff0 = Math::Sin((real(1.0)-fT)*fAngle)*fInvSin; // Do we need to invert rotation? - if (fCos < 0.0f && shortestPath) + if (fCos < real(0.) && shortestPath) { fCoeff0 = -fCoeff0; } @@ -397,8 +397,8 @@ real fSin = Math::Sin(fAngle); real fPhase = Math::PI*iExtraSpins*fT; - real fInvSin = 1.0/fSin; - real fCoeff0 = Math::Sin((1.0-fT)*fAngle - fPhase)*fInvSin; + real fInvSin = real(1.0)/fSin; + real fCoeff0 = Math::Sin((real(1.0)-fT)*fAngle - fPhase)*fInvSin; real fCoeff1 = Math::Sin(fT*fAngle + fPhase)*fInvSin; return fCoeff0*rkP + fCoeff1*rkQ; } @@ -424,7 +424,7 @@ const Quaternion& rkP, const Quaternion& rkA, const Quaternion& rkB, const Quaternion& rkQ, bool shortestPath) { - real fSlerpT = 2.0*fT*(1.0-fT); + real fSlerpT = real(2.0)*fT*(real(1.0)-fT); Quaternion kSlerpP = Slerp(fT, rkP, rkQ, shortestPath); Quaternion kSlerpQ = Slerp(fT, rkA, rkB); return Slerp(fSlerpT, kSlerpP ,kSlerpQ); Modified: trunk/yake/src/yake/base/math/yakeVector3.cpp =================================================================== --- trunk/yake/src/yake/base/math/yakeVector3.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/math/yakeVector3.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -28,6 +28,7 @@ // IMPLEMENTATION HEADERS //============================================================================ #include <yake/base/yakePCH.h> +#include <yake/base/math/yakeVector3.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES Modified: trunk/yake/src/yake/base/templates/yakeSmartAssert.cpp =================================================================== --- trunk/yake/src/yake/base/templates/yakeSmartAssert.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/templates/yakeSmartAssert.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -31,6 +31,7 @@ #include <yake/base/templates/yakeSmartAssert.h> #include <yake/base/native/yakeNative.h> #include <boost/function.hpp> +#include <yake/base/templates/yakeSmartAssertHandlers.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES @@ -169,27 +170,11 @@ } //----------------------------------------------------- - SmartAssert::HandlerMap SmartAssert::mHandlers; - - //----------------------------------------------------- - SmartAssert::SMARTASSERT_HANDLER_FUN SmartAssert::getHandler() - { - if (mHandlers.size() < 4) - { - // set defaults - mHandlers[ AL_WARNING ] = defaultHandler; - mHandlers[ AL_DEBUG ] = defaultHandler; - mHandlers[ AL_ERROR ] = defaultHandler; - mHandlers[ AL_FATAL ] = defaultHandler; - } - return mHandlers[ mCtx.getLevel() ]; - } - - //----------------------------------------------------- SmartAssert::~SmartAssert() { - if (getHandler()) - getHandler()( mCtx ); + assert::SMARTASSERT_HANDLER_FUN handlerFn = assert::SmartAssertHandlerManager::instance().getHandler( mCtx.getLevel() ); + if (handlerFn) + handlerFn( mCtx ); else { std::ostringstream out; Added: trunk/yake/src/yake/base/templates/yakeSmartAssertHandlers.cpp =================================================================== --- trunk/yake/src/yake/base/templates/yakeSmartAssertHandlers.cpp (rev 0) +++ trunk/yake/src/yake/base/templates/yakeSmartAssertHandlers.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -0,0 +1,85 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#include <yake/base/yakePCH.h> +#include <yake/base/templates/yakeSmartAssertHandlers.h> +#include <yake/base/native/yakeNative.h> + +namespace yake { +namespace assert { + + //----------------------------------------------------- + void defaultHandler( const SmartAssertContext& ctx ) + { + // print all messages to "cout" + std::ostringstream out; + ctx.toStream( out ); + std::cout << std::endl << out.str(); + + bool IgnoreAlways = false; + + if (ctx.getLevel() != AL_WARNING) // "warning" assertions are logged only. + { + if( !native::debug_AssertFailed( + ctx.getMessage().c_str(), + ctx.getExpression().c_str(), + ctx.getFile().c_str(), + ctx.getLine(), + IgnoreAlways ) + && !IgnoreAlways ) + { + abort(); + } + } + + if (ctx.getLevel() == AL_ERROR || ctx.getLevel() == AL_FATAL) + abort(); + } + + //----------------------------------------------------- + SmartAssertHandlerManager::HandlerMap SmartAssertHandlerManager::mHandlers; + SmartAssertHandlerManager SmartAssertHandlerManager::mInstance; + + //----------------------------------------------------- + SMARTASSERT_HANDLER_FUN SmartAssertHandlerManager::getHandler(const AssertionLevel lvl) const + { + return mHandlers.find( lvl )->second; + } + SmartAssertHandlerManager::SmartAssertHandlerManager() + { + // set defaults + mHandlers[ AL_WARNING ] = defaultHandler; + mHandlers[ AL_DEBUG ] = defaultHandler; + mHandlers[ AL_ERROR ] = defaultHandler; + mHandlers[ AL_FATAL ] = defaultHandler; + } + SmartAssertHandlerManager& SmartAssertHandlerManager::instance() + { + return mInstance; + } + +} // assert +} // yake Deleted: trunk/yake/src/yake/base/yakeCriticalSection.cpp =================================================================== --- trunk/yake/src/yake/base/yakeCriticalSection.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/yakeCriticalSection.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -1,68 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -#include <yake/base/yakePCH.h> -#include <yake/base/yakeCriticalSection.h> -#include <yake/base/yakeException.h> -#include <yake/base/native/yakeNative.h> - - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake { - -CriticalSection::CriticalSection() -{ - YAKE_DECLARE_FUNCTION( CriticalSection ) - mHandle = native::criticalSection_Create(); - - if( 0 == mHandle ) - YAKE_EXCEPT( "Couldn't create critical section." ); -} - -CriticalSection::~CriticalSection() -{ - if( 0 != mHandle ) - native::criticalSection_Delete( mHandle ); -} - - -void CriticalSection::enter() -{ - native::criticalSection_Enter( mHandle ); -} - -void CriticalSection::leave() -{ - native::criticalSection_Leave( mHandle ); -} - -} // yake Deleted: trunk/yake/src/yake/base/yakeLock.cpp =================================================================== --- trunk/yake/src/yake/base/yakeLock.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/yakeLock.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -1,51 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -#include <yake/base/yakePCH.h> -#include <yake/base/yakeLock.h> -#include <yake/base/yakeCriticalSection.h> - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake { - -Lock::Lock( CriticalSection& rCriticalSection ) -: mrCriticalSection( rCriticalSection ) -{ - mrCriticalSection.enter(); -} - -Lock::~Lock() -{ - mrCriticalSection.leave(); -} - -} // yake Modified: trunk/yake/src/yake/base/yakeMovable.cpp =================================================================== --- trunk/yake/src/yake/base/yakeMovable.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/yakeMovable.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/base/yakePCH.h> +#include <yake/base/yakeMovable.h> namespace yake { Modified: trunk/yake/src/yake/base/yakeUniqueName.cpp =================================================================== --- trunk/yake/src/yake/base/yakeUniqueName.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/base/yakeUniqueName.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -28,6 +28,7 @@ // IMPLEMENTATION HEADERS //============================================================================ #include <yake/base/yakePCH.h> +#include <yake/base/yakeString.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES @@ -35,15 +36,14 @@ namespace yake { namespace uniqueName { -String create( const String& rPre, const String& rPost ) -{ - static uint32 iIndex = 0; - String final = rPre; - final << iIndex++; - return final + rPost; -} + YAKE_BASE_API String create( const String& rPre, const String& rPost ) + { + static uint32 iIndex = 0; + String final = rPre; + final << iIndex++; + return final + rPost; + } - } // uniqueName } // yake Modified: trunk/yake/src/yake/net/detail/netCommon.cpp =================================================================== --- trunk/yake/src/yake/net/detail/netCommon.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/net/detail/netCommon.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -270,5 +270,11 @@ return time_; } + + PacketPtr createPacket(const void* data, const size_t size) + { + return PacketPtr( new Packet(data,size) ); + } + } // namespace net } // namespace yake Modified: trunk/yake/src/yake/plugins/inputOgre/InputSystemOgre.cpp =================================================================== --- trunk/yake/src/yake/plugins/inputOgre/InputSystemOgre.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yake/plugins/inputOgre/InputSystemOgre.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -27,13 +27,8 @@ #include <yake/plugins/inputOgre/yakePCH.h> #include <yake/input/yakeInputSystem.h> #include <yake/plugins/inputOgre/InputSystemOgre.h> - -#include <OgreMemoryMacros.h> #include <Ogre.h> -#ifdef OGRE_MEMORY_MACROS -#pragma message("disabling OGRE's memory macros") -# include <OgreNoMemoryMacros.h> -#endif +//#include <OgreNoMemoryMacros.h> // unfortunately, this doesn't really seem to work well... namespace yake { namespace input { Modified: trunk/yake/src/yapp/plugins/ceguiOgreRendererAdapter/plugin.cpp =================================================================== --- trunk/yake/src/yapp/plugins/ceguiOgreRendererAdapter/plugin.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yapp/plugins/ceguiOgreRendererAdapter/plugin.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -26,7 +26,7 @@ */ #include <yapp/plugins/ceguiOgreRendererAdapter/pch.h> #include "OgreNoMemoryMacros.h" -#include <CEGUI/CEGUI.h> +#include <CEGUI.h> #include <Ogre.h> #include "OgreCEGUIRenderer.h" #include <yapp/common/yakeCEGUIRendererAdapter.h> Modified: trunk/yake/src/yapp/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/yapp/raf/yakeApplication.cpp 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/src/yapp/raf/yakeApplication.cpp 2006-12-06 23:49:58 UTC (rev 1516) @@ -29,8 +29,8 @@ #include <yapp/raf/yakeApplicationState.h> #include <yapp/raf/yakeApplication.h> #if YAKE_RAF_USES_CEGUI == 1 -#include <CEGUI/CEGUI.h> -#include <CEGUI/CEGUISystem.h> +#include <CEGUI.h> +#include <CEGUISystem.h> #include <yapp/common/yakeCEGUIRendererAdapter.h> #include <yapp/common/yakeCEGUIHelpers.h> #ifdef YAKE_DEBUG @@ -39,6 +39,7 @@ # pragma comment(lib,"CEGUIBase.lib") #endif #endif +#include <OgreNoMemoryMacros.h> namespace yake { namespace raf { Modified: trunk/yake/yake/base/templates/yakeSmartAssert.h =================================================================== --- trunk/yake/yake/base/templates/yakeSmartAssert.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/templates/yakeSmartAssert.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -32,7 +32,6 @@ //============================================================================ #include <yake/base/yakePrerequisites.h> #include <yake/base/yakeString.h> -#include <boost/function.hpp> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES @@ -128,14 +127,8 @@ SmartAssert& YAKE_ASSERT_A; SmartAssert& YAKE_ASSERT_B; - /** Assertion handler. - */ - typedef ::boost::function< void(const ::yake::SmartAssertContext&) > SMARTASSERT_HANDLER_FUN; private: SmartAssertContext mCtx; - - typedef std::map< AssertionLevel, SMARTASSERT_HANDLER_FUN > HandlerMap; - static HandlerMap mHandlers; public: SmartAssert( const char * strExpr ) : YAKE_ASSERT_A(*this), YAKE_ASSERT_B(*this), mCtx(strExpr) {} ~SmartAssert(); @@ -160,8 +153,6 @@ void error( const String & msg ); void fatal( const String & msg ); SmartAssert& msg( const String & msg ); - private: - SMARTASSERT_HANDLER_FUN getHandler(); }; Added: trunk/yake/yake/base/templates/yakeSmartAssertHandlers.h =================================================================== --- trunk/yake/yake/base/templates/yakeSmartAssertHandlers.h (rev 0) +++ trunk/yake/yake/base/templates/yakeSmartAssertHandlers.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -0,0 +1,56 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_BASESMARTASSERTHANDLERS_H +#define YAKE_BASESMARTASSERTHANDLERS_H + +#include <yake/base/yakePrerequisites.h> +#include <yake/base/templates/yakeSmartAssert.h> +#include <yake/base/yakeNoncopyable.h> +#include <boost/function.hpp> + +namespace yake { +namespace assert { + + typedef ::boost::function< void(const ::yake::SmartAssertContext&) > SMARTASSERT_HANDLER_FUN; + struct YAKE_BASE_API SmartAssertHandlerManager : public noncopyable + { + private: + typedef std::map< AssertionLevel, SMARTASSERT_HANDLER_FUN > HandlerMap; + static HandlerMap mHandlers; + + SmartAssertHandlerManager(); + static SmartAssertHandlerManager mInstance; + public: + static SmartAssertHandlerManager& instance(); + + SMARTASSERT_HANDLER_FUN getHandler(const AssertionLevel) const; + }; + +} // assert +} // yake + +#endif // YAKE_BASESMARTASSERT_H Modified: trunk/yake/yake/base/yake.h =================================================================== --- trunk/yake/yake/base/yake.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yake.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -34,19 +34,54 @@ #include "yakePrerequisites.h" #include "yakePCH.h" +#include <boost/function.hpp> + +#include "templates/yakeSmartAssert.h" +#include "templates/yakeRegistry.h" +#include "templates/yakeVector.h" +#include "templates/yakePointer.h" +#include <yake/base/templates/yakeDeque.h> +#include <yake/base/templates/delete.h> +#include <yake/base/templates/yakeVariant.h> +#include "templates/yakeAlgorithms.h" + +#include <yake/base/mpl/yakeAbstractFactory.h> +#include <yake/base/mpl/sequences.h> + +#include "yakeVersion.h" +#include "yakeString.h" +#include "yakeException.h" +#include "yakeLog.h" +#include "yakeOutputStream.h" +#include "yakeUniqueName.h" +#include "yakePlugin.h" +//#include "yakeDebugOutputStream.h" +#include "yakeLibrary.h" +#include <yake/base/type_info.h> + +#include "math/yakeQuaternion.h" +#include "math/yakeVector3.h" +#include "math/yakeVector4.h" +#include "math/yakeMatrix3.h" +#include "math/yakeMatrix4.h" +#include "math/yakeColor.h" +#include "math/yakeGeometry.h" +#include "math/yakeSimpleSpline.h" +#include "math/yakePlane.h" +#include "math/yakeRay.h" + +#include "yakeParamHolder.h" +#include "yakeMovable.h" + +#include "yakeTimer.h" + //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES //============================================================================ -# if YAKE_COMPILER == COMPILER_MSVC -#pragma comment(lib, "base.lib") -# endif +namespace yake { +namespace base { -namespace yake -{ -namespace base -{ - extern YAKE_BASE_API Version linktime; const Version compiletime ( 0, 6, 0 ); Deleted: trunk/yake/yake/base/yakeCriticalSection.h =================================================================== --- trunk/yake/yake/base/yakeCriticalSection.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeCriticalSection.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -1,65 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_BASE_CRITICALSECTION_H -#define YAKE_BASE_CRITICALSECTION_H - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include "yakePrerequisites.h" -#endif -// Yake -#include <yake/base/native/yakeNative.h> - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake { - -class YAKE_BASE_API CriticalSection -{ -YAKE_DECLARE_CLASS( yake::base::CriticalSection ) -// Class -public: - CriticalSection(); - ~CriticalSection(); - -// Methods -public: - void enter(); - void leave(); - -// Data -private: - native::CriticalSectionHandle mHandle; -}; - -} // yake - -#endif // YAKE_BASE_CRITICALSECTION_H Modified: trunk/yake/yake/base/yakeException.h =================================================================== --- trunk/yake/yake/base/yakeException.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeException.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -39,6 +39,7 @@ #endif // Yake #include <yake/base/mpl/yakeCast.h> +#include <yake/base/yakeString.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES Modified: trunk/yake/yake/base/yakeLibrary.h =================================================================== --- trunk/yake/yake/base/yakeLibrary.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeLibrary.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -37,41 +37,32 @@ // Yake #include <yake/base/native/yakeNative.h> #include <yake/base/yakeString.h> +#include <yake/base/yakeNoncopyable.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES //============================================================================ -namespace yake -{ -namespace base -{ +namespace yake { +namespace base { -class YAKE_BASE_API Library -{ -YAKE_DECLARE_CLASS( yake::base::Library ) -// Class -public: - Library( const String& rFilename ); - virtual ~Library(); + class YAKE_BASE_API Library : public noncopyable + { + public: + /** Loads the library with the given name. + @remarks Throws Exception on failure. + */ + Library( const String& rFilename ); + virtual ~Library(); -// Methods -public: - void* getSymbol( const String& rFunction ); + /** Returns pointer for the given symbol name. */ + void* getSymbol( const String& rFunction ); -// Data -private: - native::LibraryHandle mHandle; -}; + private: + native::LibraryHandle mHandle; + }; } // base } // yake -// todo platform independent library extension? -// windows : ".dll" -// linux : ".so" -#define YAKE_USE_LIB( dllname ) \ - yake::SharedPtr< yake::base::Library > pDynLib##dllname( new yake::base::Library( ## #dllname ".dll" ) ); \ - YAKE_ASSERT( pDynLib##dllname ).debug( "Out of memory." ); - #endif // YAKE_BASE_LIBRARY_H Deleted: trunk/yake/yake/base/yakeLock.h =================================================================== --- trunk/yake/yake/base/yakeLock.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeLock.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -1,60 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_BASE_LOCK_H -#define YAKE_BASE_LOCK_H - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include "yakePrerequisites.h" -#endif -// Yake - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake { - -class CriticalSection; - -class YAKE_BASE_API Lock -{ -// Class -public: - Lock( CriticalSection& rCriticalSection ); - ~Lock(); - - // Data -private: - CriticalSection& mrCriticalSection; -}; - -} // yake - -#endif // YAKE_BASE_LOCK_H Modified: trunk/yake/yake/base/yakeMovable.h =================================================================== --- trunk/yake/yake/base/yakeMovable.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeMovable.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -31,7 +31,8 @@ // IMPLEMENTATION HEADERS //============================================================================ // Standard headers -#include "yakePrerequisites.h" +#include <yake/base/yakePrerequisites.h> +#include <yake/base/math/yakeVector3.h> // Yake //============================================================================ Added: trunk/yake/yake/base/yakeNoncopyable.h =================================================================== --- trunk/yake/yake/base/yakeNoncopyable.h (rev 0) +++ trunk/yake/yake/base/yakeNoncopyable.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -0,0 +1,45 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_BASE_NONCOPYABLE_H +#define YAKE_BASE_NONCOPYABLE_H + +namespace yake { + + /** Base class for non-copyable types. */ + struct YAKE_BASE_API noncopyable + { + ~noncopyable() {} + protected: + noncopyable() {} + private: + noncopyable(const noncopyable&); + noncopyable& operator=(const noncopyable&); + }; + +} // namespace yake + +#endif // YAKE_BASE_NONCOPYABLE_H Modified: trunk/yake/yake/base/yakePCH.h =================================================================== --- trunk/yake/yake/base/yakePCH.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakePCH.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -27,51 +27,7 @@ #ifndef YAKE_BASE_PCH_H #define YAKE_BASE_PCH_H -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ #include "yakePrerequisites.h" +#include <yake/base/templates/yakeSmartAssert.h> -#include "templates/yakeSmartAssert.h" -#include "templates/yakeRegistry.h" -#include "templates/yakeVector.h" -#include "templates/yakePointer.h" -#include <yake/base/templates/yakeDeque.h> -#include <yake/base/templates/delete.h> -#include <yake/base/templates/yakeVariant.h> -#include "templates/yakeAlgorithms.h" - -#include <yake/base/mpl/yakeAbstractFactory.h> -#include <yake/base/mpl/sequences.h> - -#include "yakePrerequisites.h" -#include "yakeVersion.h" -#include "yakeString.h" -#include "yakeException.h" -#include "yakeLog.h" -#include "yakeOutputStream.h" -#include "yakeUniqueName.h" -#include "yakePlugin.h" -//#include "yakeDebugOutputStream.h" -#include "yakeLibrary.h" -#include <yake/base/type_info.h> - -#include "math/yakeQuaternion.h" -#include "math/yakeVector3.h" -#include "math/yakeVector4.h" -#include "math/yakeMatrix3.h" -#include "math/yakeMatrix4.h" -#include "math/yakeColor.h" -#include "math/yakeGeometry.h" -#include "math/yakeSimpleSpline.h" -#include "math/yakePlane.h" -#include "math/yakeRay.h" - -#include "yakeParamHolder.h" -#include "yakeMovable.h" - -#include "yakeTimer.h" - - - #endif // YAKE_BASE_PCH_H Modified: trunk/yake/yake/base/yakeParamHolder.h =================================================================== --- trunk/yake/yake/base/yakeParamHolder.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakeParamHolder.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -27,7 +27,10 @@ #ifndef YAKE_BASE_PARAMHOLDER_H #define YAKE_BASE_PARAMHOLDER_H -#include "yakePrerequisites.h" +#include <yake/base/yakePrerequisites.h> +#include <yake/base/templates/yakeVector.h> +#include <yake/base/yakeString.h> +#include <boost/any.hpp> namespace yake { Modified: trunk/yake/yake/base/yakePrerequisites.h =================================================================== --- trunk/yake/yake/base/yakePrerequisites.h 2006-12-06 23:42:16 UTC (rev 1515) +++ trunk/yake/yake/base/yakePrerequisites.h 2006-12-06 23:49:58 UTC (rev 1516) @@ -149,6 +149,4 @@ #define YAKE_FOR_EACH(ITER_TYPE,ITER_NAME,CTR) \ for (ITER_TYPE ITER_NAME = CTR.begin(); ITER_NAME != CTR.end(); ++ITER_NAME) -#include <boost/function.hpp> - #endif // YAKE_BASE_PREREQUISITES_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-07 20:35:03
|
Revision: 1527 http://svn.sourceforge.net/yake/?rev=1527&view=rev Author: psyclonist Date: 2006-12-07 12:34:59 -0800 (Thu, 07 Dec 2006) Log Message: ----------- reorganization Added Paths: ----------- trunk/yake/samples/application/ trunk/yake/samples/audio/ trunk/yake/samples/base/ trunk/yake/samples/base/abstract_factory_pars/ trunk/yake/samples/base/abstractfactory/ trunk/yake/samples/base/data/ trunk/yake/samples/base/ent/ trunk/yake/samples/base/graphics/ trunk/yake/samples/base/model/ trunk/yake/samples/base/msg/ trunk/yake/samples/base/net/ trunk/yake/samples/base/physics/ trunk/yake/samples/base/rx/ trunk/yake/samples/base/scripting/ trunk/yake/samples/base/statemachine/ trunk/yake/samples/base/thread/ trunk/yake/samples/graphics/ trunk/yake/samples/gui/ trunk/yake/samples/misc/ trunk/yake/samples/model/ trunk/yake/samples/physics/ trunk/yake/samples/raf/ trunk/yake/samples/statemachine/ trunk/yake/src/plugins/audioOpenAL/ trunk/yake/src/plugins/baseLuaBindings/ trunk/yake/src/plugins/entLua/ trunk/yake/src/plugins/graphicsLuaBindings/ trunk/yake/src/plugins/graphicsOgre/ trunk/yake/src/plugins/inputOgre/ trunk/yake/src/plugins/physicsNX/ trunk/yake/src/plugins/physicsODE/ trunk/yake/src/plugins/scriptingLua/ trunk/yake/src/plugins/scriptingLuaBindings/ trunk/yake/src/yapp/yappbase/ trunk/yake/yake/common/common/ trunk/yake/yake/gui/ trunk/yake/yake/gui_adapter/ trunk/yake/yake/gui_addons/ trunk/yake/yake/plugins/ceguiOgreRendererAdapter/ trunk/yake/yake/plugins/gui_cegui/ trunk/yake/yake/plugins/modelLua/ trunk/yake/yake/plugins/renderer_adapter_cegui_ogre/ trunk/yake/yake/raf/ trunk/yake/yake/vehicle/ trunk/yake/yapp/yappbase/ trunk/yake/yapp/yappmsg/ Removed Paths: ------------- trunk/yake/src/yake/plugins/audioOpenAL/ trunk/yake/src/yake/plugins/baseLuaBindings/ trunk/yake/src/yake/plugins/entLua/ trunk/yake/src/yake/plugins/graphicsLuaBindings/ trunk/yake/src/yake/plugins/graphicsOgre/ trunk/yake/src/yake/plugins/inputOgre/ trunk/yake/src/yake/plugins/physicsNX/ trunk/yake/src/yake/plugins/physicsODE/ trunk/yake/src/yake/plugins/scriptingLua/ trunk/yake/src/yake/plugins/scriptingLuaBindings/ trunk/yake/src/yake/registryPluginInterface/ trunk/yake/src/yake/samples/application/ trunk/yake/src/yake/samples/audio/ trunk/yake/src/yake/samples/base/abstract_factory_pars/ trunk/yake/src/yake/samples/base/abstractfactory/ trunk/yake/src/yake/samples/base/container/ trunk/yake/src/yake/samples/base/debug/ trunk/yake/src/yake/samples/base/registry/ trunk/yake/src/yake/samples/base/registryPlugin/ trunk/yake/src/yake/samples/base/registryPluginManual/ trunk/yake/src/yake/samples/data/ trunk/yake/src/yake/samples/ent/ trunk/yake/src/yake/samples/graphics/ trunk/yake/src/yake/samples/model/ trunk/yake/src/yake/samples/msg/ trunk/yake/src/yake/samples/net/ trunk/yake/src/yake/samples/physics/ trunk/yake/src/yake/samples/rx/ trunk/yake/src/yake/samples/scripting/ trunk/yake/src/yake/samples/statemachine/ trunk/yake/src/yake/samples/thread/ trunk/yake/src/yapp/samples/base/ trunk/yake/src/yapp/samples/graphics/ trunk/yake/src/yapp/samples/gui/ trunk/yake/src/yapp/samples/misc/ trunk/yake/src/yapp/samples/model/ trunk/yake/src/yapp/samples/physics/ trunk/yake/src/yapp/samples/raf/ trunk/yake/src/yapp/samples/statemachine/ trunk/yake/src/yapp/yapp/ trunk/yake/yapp/base/ trunk/yake/yapp/common/ trunk/yake/yapp/gui/ trunk/yake/yapp/gui_adapter/ trunk/yake/yapp/gui_addons/ trunk/yake/yapp/msg/ trunk/yake/yapp/plugins/ceguiOgreRendererAdapter/ trunk/yake/yapp/plugins/gui_cegui/ trunk/yake/yapp/plugins/modelLua/ trunk/yake/yapp/plugins/renderer_adapter_cegui_ogre/ trunk/yake/yapp/raf/ trunk/yake/yapp/vehicle/ Copied: trunk/yake/samples/application (from rev 1525, trunk/yake/src/yake/samples/application) Copied: trunk/yake/samples/audio (from rev 1525, trunk/yake/src/yake/samples/audio) Copied: trunk/yake/samples/base (from rev 1525, trunk/yake/src/yapp/samples/base) Copied: trunk/yake/samples/base/abstract_factory_pars (from rev 1525, trunk/yake/src/yake/samples/base/abstract_factory_pars) Copied: trunk/yake/samples/base/abstractfactory (from rev 1525, trunk/yake/src/yake/samples/base/abstractfactory) Copied: trunk/yake/samples/base/data (from rev 1525, trunk/yake/src/yake/samples/data) Copied: trunk/yake/samples/base/ent (from rev 1525, trunk/yake/src/yake/samples/ent) Copied: trunk/yake/samples/base/graphics (from rev 1525, trunk/yake/src/yake/samples/graphics) Copied: trunk/yake/samples/base/model (from rev 1525, trunk/yake/src/yake/samples/model) Copied: trunk/yake/samples/base/msg (from rev 1525, trunk/yake/src/yake/samples/msg) Copied: trunk/yake/samples/base/net (from rev 1525, trunk/yake/src/yake/samples/net) Copied: trunk/yake/samples/base/physics (from rev 1525, trunk/yake/src/yake/samples/physics) Copied: trunk/yake/samples/base/rx (from rev 1525, trunk/yake/src/yake/samples/rx) Copied: trunk/yake/samples/base/scripting (from rev 1525, trunk/yake/src/yake/samples/scripting) Copied: trunk/yake/samples/base/statemachine (from rev 1525, trunk/yake/src/yake/samples/statemachine) Copied: trunk/yake/samples/base/thread (from rev 1525, trunk/yake/src/yake/samples/thread) Copied: trunk/yake/samples/graphics (from rev 1525, trunk/yake/src/yapp/samples/graphics) Copied: trunk/yake/samples/gui (from rev 1525, trunk/yake/src/yapp/samples/gui) Copied: trunk/yake/samples/misc (from rev 1525, trunk/yake/src/yapp/samples/misc) Copied: trunk/yake/samples/model (from rev 1525, trunk/yake/src/yapp/samples/model) Copied: trunk/yake/samples/physics (from rev 1525, trunk/yake/src/yapp/samples/physics) Copied: trunk/yake/samples/raf (from rev 1525, trunk/yake/src/yapp/samples/raf) Copied: trunk/yake/samples/statemachine (from rev 1525, trunk/yake/src/yapp/samples/statemachine) Copied: trunk/yake/src/plugins/audioOpenAL (from rev 1525, trunk/yake/src/yake/plugins/audioOpenAL) Copied: trunk/yake/src/plugins/baseLuaBindings (from rev 1525, trunk/yake/src/yake/plugins/baseLuaBindings) Copied: trunk/yake/src/plugins/entLua (from rev 1525, trunk/yake/src/yake/plugins/entLua) Copied: trunk/yake/src/plugins/graphicsLuaBindings (from rev 1525, trunk/yake/src/yake/plugins/graphicsLuaBindings) Copied: trunk/yake/src/plugins/graphicsOgre (from rev 1525, trunk/yake/src/yake/plugins/graphicsOgre) Copied: trunk/yake/src/plugins/inputOgre (from rev 1525, trunk/yake/src/yake/plugins/inputOgre) Copied: trunk/yake/src/plugins/physicsNX (from rev 1525, trunk/yake/src/yake/plugins/physicsNX) Copied: trunk/yake/src/plugins/physicsODE (from rev 1525, trunk/yake/src/yake/plugins/physicsODE) Copied: trunk/yake/src/plugins/scriptingLua (from rev 1525, trunk/yake/src/yake/plugins/scriptingLua) Copied: trunk/yake/src/plugins/scriptingLuaBindings (from rev 1525, trunk/yake/src/yake/plugins/scriptingLuaBindings) Copied: trunk/yake/src/yapp/yappbase (from rev 1525, trunk/yake/src/yapp/yapp) Copied: trunk/yake/yake/common/common (from rev 1522, trunk/yake/yapp/common) Copied: trunk/yake/yake/gui (from rev 1522, trunk/yake/yapp/gui) Copied: trunk/yake/yake/gui_adapter (from rev 1522, trunk/yake/yapp/gui_adapter) Copied: trunk/yake/yake/gui_addons (from rev 1522, trunk/yake/yapp/gui_addons) Copied: trunk/yake/yake/plugins/ceguiOgreRendererAdapter (from rev 1522, trunk/yake/yapp/plugins/ceguiOgreRendererAdapter) Copied: trunk/yake/yake/plugins/gui_cegui (from rev 1522, trunk/yake/yapp/plugins/gui_cegui) Copied: trunk/yake/yake/plugins/modelLua (from rev 1522, trunk/yake/yapp/plugins/modelLua) Copied: trunk/yake/yake/plugins/renderer_adapter_cegui_ogre (from rev 1522, trunk/yake/yapp/plugins/renderer_adapter_cegui_ogre) Copied: trunk/yake/yake/raf (from rev 1522, trunk/yake/yapp/raf) Copied: trunk/yake/yake/vehicle (from rev 1522, trunk/yake/yapp/vehicle) Copied: trunk/yake/yapp/yappbase (from rev 1522, trunk/yake/yapp/base) Copied: trunk/yake/yapp/yappmsg (from rev 1522, trunk/yake/yapp/msg) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-07 20:39:40
|
Revision: 1528 http://svn.sourceforge.net/yake/?rev=1528&view=rev Author: psyclonist Date: 2006-12-07 12:39:41 -0800 (Thu, 07 Dec 2006) Log Message: ----------- reorganization Added Paths: ----------- trunk/yake/samples/base/events/yakePCH.h trunk/yake/samples/base/ved/yakeDemoApp.h trunk/yake/samples/base/ved/yakePCH.h trunk/yake/samples/common/ trunk/yake/samples/graphics/scripted/yakePCH.h trunk/yake/samples/gui/basics/CEGUIOgre_TestDriver1_REPLACE.h trunk/yake/samples/gui/basics/forward_buffer.h trunk/yake/samples/gui/basics/gui_test.h trunk/yake/samples/misc/cmdrmayhem/yakePCH.h trunk/yake/samples/misc/scripted/yakePCH.h trunk/yake/samples/misc/vehicle/yakePCH.h trunk/yake/samples/model/yakePCH.h trunk/yake/samples/raf/demo1/yakePCH.h trunk/yake/samples/raf/minimal/yakePCH.h Removed Paths: ------------- trunk/yake/samples/common/yakeHelper.h trunk/yake/yapp/plugins/terrainPhysMgr/ trunk/yake/yapp/samples/GUI/basics/CEGUIOgre_TestDriver1_REPLACE.h trunk/yake/yapp/samples/GUI/basics/forward_buffer.h trunk/yake/yapp/samples/GUI/basics/gui_test.h trunk/yake/yapp/samples/base/events/yakePCH.h trunk/yake/yapp/samples/base/ved/yakeDemoApp.h trunk/yake/yapp/samples/base/ved/yakePCH.h trunk/yake/yapp/samples/common/ trunk/yake/yapp/samples/graphics/scripted/yakePCH.h trunk/yake/yapp/samples/misc/cmdrmayhem/yakePCH.h trunk/yake/yapp/samples/misc/scripted/yakePCH.h trunk/yake/yapp/samples/misc/vehicle/yakePCH.h trunk/yake/yapp/samples/model/yakePCH.h trunk/yake/yapp/samples/raf/demo1/yakePCH.h trunk/yake/yapp/samples/raf/minimal/yakePCH.h Copied: trunk/yake/samples/base/events/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/base/events/yakePCH.h) =================================================================== --- trunk/yake/samples/base/events/yakePCH.h (rev 0) +++ trunk/yake/samples/base/events/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,15 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/base/yakeDebugOutputStream.h> +#include <yake/base/yakeLog.h> +#include <yake/base/yakeLibrary.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yake/graphics/yakeGraphicsSystem.h> + +#include <yake/samples/common/yakeExampleApplication.h> +#include <yake/data/yakeData.h> Copied: trunk/yake/samples/base/ved/yakeDemoApp.h (from rev 1522, trunk/yake/yapp/samples/base/ved/yakeDemoApp.h) =================================================================== --- trunk/yake/samples/base/ved/yakeDemoApp.h (rev 0) +++ trunk/yake/samples/base/ved/yakeDemoApp.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,238 @@ +#ifndef YAPP_DEMO_VED_H +#define YAPP_DEMO_VED_H +#include <yapp/samples/common/yakeHelper.h> +#include <yapp/common/yakeCEGUIRendererAdapter.h> + +using namespace yake; +using namespace yake::base::templates; +using namespace yake::base::math; +using namespace yake::graphics; +using namespace yake::data; + +using namespace yapp; +using namespace yake::app; + +namespace yake { + class RoadCreator; + class TrailCreator; +} +class TheApp : public yake::exapp::ExampleApplication +{ +//private: +public: + yake::ceguiadapter::RendererAdapterPlugin* mAdapterPlugin; + CameraFollowController* mpCfc; + + task::TaskManager mTaskMgr; + // task: render + class RenderTask : public task::DefTask + { + private: + IGraphicalWorld* mWorld; + public: + RenderTask( IGraphicalWorld* pWorld ); + virtual void execute(real timeElapsed); + + typedef Signal1< void(real) > PreSignal; + void subscribeToPre( const PreSignal::slot_type & slot ) + { mPreSig.connect( slot ); } + private: + PreSignal mPreSig; + }; + RenderTask* mRenderTask; + + // task: physics + class PhysicsTask : public task::DefTask + { + private: + physics::IWorld* mWorld; + public: + PhysicsTask( physics::IWorld* pWorld ); + virtual void execute(real timeElapsed); + + typedef Signal0< void > VoidSignal; + void subscribeToPre( const VoidSignal::slot_type & slot ) + { mPreSignal.connect( slot ); } + void subscribeToPost( const VoidSignal::slot_type & slot ) + { mPostSignal.connect( slot ); } + private: + VoidSignal mPreSignal; + VoidSignal mPostSignal; + }; + PhysicsTask* mPhysicsTask; + + // task: vehicle sim + class VehicleSimTask : public task::DefTask + { + private: + model::complex::vehicle::LandVehicle* mCar; + public: + VehicleSimTask( model::complex::vehicle::LandVehicle* theCar ); + virtual void execute(real timeElapsed); + }; + VehicleSimTask* mVehicleSimTask; + + // task: input + class InputTask : public task::DefTask + { + private: + TheApp* mApp; + model::complex::vehicle::LandVehicle* mCar; + + public: + InputTask( TheApp* theApp, model::complex::vehicle::LandVehicle* theCar ); + virtual void execute(real timeElapsed); + }; + InputTask* mInputTask; + + Vector<std::pair<IViewport*,ICamera*> > mVPs; + SharedPtr< IGraphicalWorld > mGWorld; + physics::IWorld* mPWorld; + audio::IWorld* mpAWorld; + + physics::IComplexObject* dbgChassis; + + audio::IListener* mpAListener; + audio::ISource* mpASource; + audio::ISoundData* mpAData; + + graphics::ISceneNode* mLightOneNode; + graphics::IParticleSystem* mSmoke; + + struct SimpleOne { + graphics::ISceneNode* pSN; + graphics::IEntity* pE; + physics::IComplexObject* pCO; + model::MovableUpdateController* updCtrl; + }; + SimpleOne mGround; + model::complex::Model* mCarModel; + model::complex::vehicle::LandVehicle* mCar; + SimpleOne mBall; + + RoadCreator* mRoadCreator; + TrailCreator* mSkidCreator; + + real mCurrentSimTime; +public: + TheApp() : ExampleApplication( true /*graphics*/, + true /*physics*/, + false /*scripting*/, + true /*input*/, + false /*script bindings*/, + false /*audio*/), + mCarModel(0), + mCar(0), + mpAWorld(0), + mpASource(0), + mpAListener(0), + mpAData(0), + mLightOneNode(0), + mRenderTask(0), + mPhysicsTask(0), + mInputTask(0), + mVehicleSimTask(0), + mAdapterPlugin(0), + mRoadCreator(0), + mSkidCreator(0), + mCurrentSimTime(0), + mpCfc(0) + { + } + + InputTask* getInputTask() const + { + return mInputTask; + } + RenderTask* getRenderTask() const + { + return mRenderTask; + } + PhysicsTask* getPhysicsTask() const + { + return mPhysicsTask; + } + + real getSimulationTime() + { + return mCurrentSimTime; + } + + void preRender( real timeElapsed ); + + void handleInput( real timeElapsed ); + + void onKey(const yake::input::KeyboardEvent & e) + { + if (e.keyCode == input::KC_ESCAPE) + requestShutdown(); + } + void onMBUp(uint8 btn) + { + CEGUI::System::getSingleton().injectMouseButtonUp( CEGUI::LeftButton ); + } + void onMBDown(uint8 btn) + { + CEGUI::System::getSingleton().injectMouseButtonDown( CEGUI::LeftButton ); + } + void onMouseMoved( const Vector3 & position ) + { + real scale = 1; + static Vector3 lastPosition = position; + Vector3 diff = position - lastPosition; + lastPosition = position; + + CEGUI::System::getSingleton().injectMouseMove(diff.x*scale, diff.y*scale); + //CEGUI::Renderer* rend = CEGUI::System::getSingleton().getRenderer(); + //CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * rend->getWidth(), e->getRelY() * rend->getHeight()); + } + + int createCameraViewportPair( real sx, real sy, real w, real h, int z ); + void setupDotScene(); + void setupGround(); + void setupAudio(); + void cleanUpAudio(); + + void setupBall(); + void cleanUpBall(); + + void createWheel( + model::complex::vehicle::Wheel *& pWheel, + physics::IComplexObject *& pCO, + SharedPtr<physics::IJoint> & pJ, + physics::IComplexObject* pCOChassis, + const real radius, + const Vector3 & position, + const Quaternion & orientation, + const Vector3 & anchorPt, + const Vector3 & hingeSteeringAxis, + const Vector3 & hingeSuspensionAxis, + const real suspSpring, + const real suspDamping, + const real wheelMass ); + model::complex::vehicle::Wheel* createWheel( + const Vector3 & position, + const Quaternion & orientation, + physics::IComplexObject* pCOChassis, + SharedPtr<model::Physical> & pPhysical, + const real radius, + const real suspSpring, + const real suspDamping, + const real wheelMass, + Vector<graphics::ISceneNode*> & nodeList, + SharedMUCList & mucList, + const String & wheelMesh = "wheel1.mesh"); + void setupCar(); + void setupLights(); + void setupGui(); + void cleanUpGui(); + void createGuiWindows(); + + void setupRoad(); + void cleanUpRoad(); + + virtual void run(); +}; + + +#endif \ No newline at end of file Copied: trunk/yake/samples/base/ved/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/base/ved/yakePCH.h) =================================================================== --- trunk/yake/samples/base/ved/yakePCH.h (rev 0) +++ trunk/yake/samples/base/ved/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,18 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/base/yakeDebugOutputStream.h> +#include <yake/base/yakeLog.h> +#include <yake/base/yakeLibrary.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yake/graphics/yakeGraphicsSystem.h> + +#include <yake/samples/common/yakeExampleApplication.h> +#include <yake/data/yakeData.h> + +#include <yapp/base/yapp.h> +#include "CEGUI.h" Copied: trunk/yake/samples/common (from rev 1522, trunk/yake/yapp/samples/common) Deleted: trunk/yake/samples/common/yakeHelper.h =================================================================== --- trunk/yake/yapp/samples/common/yakeHelper.h 2006-12-07 20:06:03 UTC (rev 1522) +++ trunk/yake/samples/common/yakeHelper.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,159 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_SAMPLES_HELPER_H -#define YAPP_SAMPLES_HELPER_H - -using namespace yake; -using namespace yake::templates; -using namespace yake::math; -using namespace yake::graphics; - -namespace yake { - - class CameraFollowController - { - private: - Movable* mCamMovable; - Movable* mTarget; - public: - CameraFollowController( Movable* pCamMovable, Movable* pTarget ) : - mTarget(pTarget), mCamMovable(pCamMovable) - {} - - void update( real timeElapsed ) - { - YAKE_ASSERT( mCamMovable ); - YAKE_ASSERT( mTarget ); - - Vector3 targetDir = mTarget->getOrientation() * (Vector3::kUnitZ); - //mCamMovable->setPosition( mTarget->getPosition() + Vector3(0,7,14) ); - mCamMovable->setPosition( mTarget->getPosition() + Vector3(0,1.7,7) ); - //mCamMovable->setOrientation( mTarget->getOrientation() ); - } - }; - - model::MovableUpdateController* createMovableUpdateController( - Movable* pSrc, Movable* pTgt, bool position, bool orientation ) - { - YAKE_ASSERT( pSrc ); - YAKE_ASSERT( pTgt ); - YAKE_ASSERT( position || orientation ); - model::MovableUpdateController* pMUC = new model::MovableUpdateController(); - YAKE_ASSERT( pMUC ); - pMUC->setUpdateSource( pSrc ); - if (position) - pMUC->subscribeToPositionChanged( pTgt ); - if (orientation) - pMUC->subscribeToOrientationChanged( pTgt ); - return pMUC; - } - - typedef Vector<SharedPtr<graphics::ISceneNode> > SharedSceneNodeList; - typedef Vector<SharedPtr<model::MovableUpdateController> > SharedMUCList; - - void createDebugGeometryForComplexPhysical( - const physics::IActor* pComplex, - graphics::IWorld* pWorld, - Vector<graphics::ISceneNode*> & nodes, - SharedMUCList & ctrlrs, - const String & overrideMesh = "", - real overrideMeshScaleFactor = 1. ) - { - //YAKE_ASSERT( pComplex ); - //YAKE_ASSERT( pWorld ); - //const physics::IShapePtrList geoms = pComplex->getShapes(); - //if (geoms.size() == 0) - // return; - //ConstVectorIterator< physics::IShapePtrList > it( geoms.begin(), geoms.end() ); - //while (it.hasMoreElements()) - //{ - // physics::IShape* pGeom = it.getNext(); - // YAKE_ASSERT( pGeom ); - - // graphics::ISceneNode* pSN = pWorld->createSceneNode(); - // YAKE_ASSERT( pSN ); - // graphics::IEntity* pE = 0; - - // switch (pGeom->getType()) - // { - // case physics::ST_BOX: - // { - // pE = pWorld->createEntity( (overrideMesh == "") ? "box_1x1x1.mesh" : overrideMesh ); - // pE->setCastsShadow( true ); - // Vector3 dim = pGeom->boxGetDimensions(); - // pSN->setScale( dim ); - // } - // break; - // case physics::ST_SPHERE: - // { - // pE = pWorld->createEntity( (overrideMesh == "") ? "sphere_d1.mesh": overrideMesh); - // pE->setCastsShadow( true ); - // real scale = overrideMeshScaleFactor * 2 /* x2 because diameter is 1, therefore radius is 0.5 by default*/ * pGeom->sphereGetRadius(); - // if (scale < 0.0001) - // scale = 1.; - // pSN->setScale( Vector3(scale,scale,scale) ); - // } - // break; - // default: - // YAKE_ASSERT( 1==0 ).error("unhandled debug geometry."); - // break; - // } - - // YAKE_ASSERT( pE ); - // pSN->attachEntity( pE ); - // nodes.push_back( pSN ); - - // model::MovableUpdateController* pMUC = new model::MovableUpdateController(); - // YAKE_ASSERT( pMUC ); - // pMUC->setUpdateSource( pGeom ); - // pMUC->subscribeToPositionChanged( pSN ); - // pMUC->subscribeToOrientationChanged( pSN ); - // ctrlrs.push_back( SharedPtr<model::MovableUpdateController>(pMUC) ); - //} - } - - void createDebugGeometryForComplexPhysical( - const physics::IActor* pComplex, - graphics::IWorld* pWorld, - SharedSceneNodeList & nodes, - SharedMUCList & ctrlrs, - const String & overrideMesh = "", - real overrideMeshScaleFactor = 1.) - { - Vector<graphics::ISceneNode*> newNodes; - createDebugGeometryForComplexPhysical( pComplex, pWorld, newNodes, ctrlrs, overrideMesh, overrideMeshScaleFactor ); - VectorIterator< Vector<graphics::ISceneNode*> > it( newNodes.begin(), newNodes.end() ); - while (it.hasMoreElements()) - { - graphics::ISceneNode* pSN = it.getNext(); - nodes.push_back( SharedPtr<graphics::ISceneNode>( pSN ) ); - } - } - -} // yake - -#endif Copied: trunk/yake/samples/graphics/scripted/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/graphics/scripted/yakePCH.h) =================================================================== --- trunk/yake/samples/graphics/scripted/yakePCH.h (rev 0) +++ trunk/yake/samples/graphics/scripted/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,13 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yake/graphics/yakeGraphicsSystem.h> +#include <yake/data/yakeData.h> +#include <yapp/base/yapp.h> + +#include <yake/samples/common/yakeExampleApplication.h> Copied: trunk/yake/samples/gui/basics/CEGUIOgre_TestDriver1_REPLACE.h (from rev 1522, trunk/yake/yapp/samples/GUI/basics/CEGUIOgre_TestDriver1_REPLACE.h) =================================================================== --- trunk/yake/samples/gui/basics/CEGUIOgre_TestDriver1_REPLACE.h (rev 0) +++ trunk/yake/samples/gui/basics/CEGUIOgre_TestDriver1_REPLACE.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,173 @@ +#ifndef _CEGUIOgre_TestDriver1_h_ +#define _CEGUIOgre_TestDriver1_h_ + +#include <boost/shared_ptr.hpp> + +#include "CEGUI.h" +#include "renderers/OgreGUIRenderer/ogrerenderer.h" +#include "ExampleApplication.h" +#include "OgreEventQueue.h" + +#include "gui_test.h" + +class CEGUIOgre_FrameListener : public ExampleFrameListener, Ogre::MouseMotionListener, Ogre::MouseListener +{ +public: + CEGUIOgre_FrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener(win, cam) + { + mEventProcessor = new EventProcessor(); + mEventProcessor->initialise(win); + mEventProcessor->startProcessingEvents(); + mEventProcessor->addKeyListener(this); + mEventProcessor->addMouseMotionListener(this); + mEventProcessor->addMouseListener(this); + mInputDevice = mEventProcessor->getInputReader(); + + mQuit = false; + mSkipCount = 0; + mUpdateFreq = 0; + } + + + virtual void mouseMoved (MouseEvent *e) + { + CEGUI::Renderer* rend = CEGUI::System::getSingleton().getRenderer(); + CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * rend->getWidth(), e->getRelY() * rend->getHeight()); + e->consume(); + } + + + virtual void mouseDragged (MouseEvent *e) + { + mouseMoved(e); + } + + + virtual void keyPressed (KeyEvent *e) + { + // give 'quitting' priority + if (e->getKey() == KC_ESCAPE) + { + mQuit = true; + e->consume(); + return; + } + + // do event injection + CEGUI::System& cegui = CEGUI::System::getSingleton(); + + // key down + cegui.injectKeyDown(e->getKey()); + + // now character + cegui.injectChar(e->getKeyChar()); + + e->consume(); + } + + + virtual void keyReleased (KeyEvent *e) + { + CEGUI::System::getSingleton().injectKeyUp(e->getKey()); + } + + + + virtual void mousePressed (MouseEvent *e) + { + CEGUI::System::getSingleton().injectMouseButtonDown(convertOgreButtonToCegui(e->getButtonID())); + e->consume(); + } + + + virtual void mouseReleased (MouseEvent *e) + { + CEGUI::System::getSingleton().injectMouseButtonUp(convertOgreButtonToCegui(e->getButtonID())); + e->consume(); + } + + // do-nothing events + virtual void keyClicked (KeyEvent *e) {} + virtual void mouseClicked (MouseEvent *e) {} + virtual void mouseEntered (MouseEvent *e) {} + virtual void mouseExited (MouseEvent *e) {} + + + bool frameStarted(const FrameEvent& evt); + +protected: + CEGUI::MouseButton convertOgreButtonToCegui(int ogre_button_id) + { + switch (ogre_button_id) + { + case MouseEvent::BUTTON0_MASK: + return CEGUI::LeftButton; + break; + + case MouseEvent::BUTTON1_MASK: + return CEGUI::RightButton; + break; + + case MouseEvent::BUTTON2_MASK: + return CEGUI::MiddleButton; + break; + + case MouseEvent::BUTTON3_MASK: + return CEGUI::X1Button; + break; + + default: + return CEGUI::LeftButton; + break; + } + + } + +protected: + float mSkipCount; + float mUpdateFreq; + + bool mQuit; +}; + +class CEGUIOgre_TestDriver1 : public ExampleApplication +{ +public: + CEGUIOgre_TestDriver1(void) + : mGUIRenderer(NULL) + {} + + virtual bool configure() + { + if(mRoot->restoreConfig()) + { + mWindow = mRoot->initialise(true); + return true; + } + else + { + return false; + } + } + + virtual void cleanup(void); + +protected: + /************************************************************************* + Methods + *************************************************************************/ + virtual void createScene(void); + virtual void createFrameListener(void); + + // new demo methods + void createDemoWindows(void); + + /************************************************************************* + Data + *************************************************************************/ + CEGUI::OgreRenderer * mGUIRenderer; + boost::shared_ptr<yake::gui_test> m_gui_test; +}; + + +#endif // end of guard _CEGUIOgre_TestDriver1_h_ Copied: trunk/yake/samples/gui/basics/forward_buffer.h (from rev 1522, trunk/yake/yapp/samples/GUI/basics/forward_buffer.h) =================================================================== --- trunk/yake/samples/gui/basics/forward_buffer.h (rev 0) +++ trunk/yake/samples/gui/basics/forward_buffer.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,34 @@ +#ifndef _FORWARD_BUFFER_H_ +#define _FORWARD_BUFFER_H_ + +// todo: what is causing this mess? +#ifdef realloc +# undef realloc +#endif + +#include <iostream> +#include <string> +#include <boost/io/stream_facade.hpp> +#include <boost/io/categories.hpp> +#include <boost/function.hpp> + + +struct forward_sink +{ + typedef char char_type; + typedef boost::io::sink_tag category; + typedef boost::function<void (const std::string &)> forward_fnc; + + forward_sink(forward_fnc fnc) : m_forward_fnc( fnc ) + {} + + void write(const char * s, std::streamsize n) + { m_forward_fnc(std::string(s, n)); } + +private: + forward_fnc m_forward_fnc; +}; + +typedef boost::io::streambuf_facade<forward_sink> forward_buf; + +#endif // _FORWARD_BUFFER_H_ Copied: trunk/yake/samples/gui/basics/gui_test.h (from rev 1522, trunk/yake/yapp/samples/GUI/basics/gui_test.h) =================================================================== --- trunk/yake/samples/gui/basics/gui_test.h (rev 0) +++ trunk/yake/samples/gui/basics/gui_test.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,117 @@ +#ifndef _GUI_TEST_H_ +#define _GUI_TEST_H_ + +#include <string> + +#include <reflection.h> +#include <bind_lua/bind_lua.h> +#undef free // todo: find conflict with tnl and move to bind_network.h +//#include <bind_network/bind_network.h> // todo: remove + +#include <Ogre.h> + +#include "default_window.h" +#include "forward_buffer.h" +#include "editor/widget_editor.h" + +namespace yake +{ +using namespace gui; + +button_base * get_fire_button(); +multi_line_edit_box_base * get_cout_box(); + +void forward_cout_here(const std::string & data); +void forward_cout_here_lua(const std::string & data); + +struct forward_cout +{ + forward_cout() + : m_forward_buf(&forward_cout_here), + m_temp_cout(*std::cout.rdbuf()) + { + // forward cout + std::cout.rdbuf(&m_forward_buf); + } + + ~forward_cout() + { + // reset cout + std::cout.rdbuf(&m_temp_cout); + } + + forward_buf m_forward_buf; + std::streambuf & m_temp_cout; +}; + +struct test_entity +{ + test_entity() {} + virtual ~test_entity() {}; + + CLASS(test_entity, reflection::NullClass); + EVENT(public, birth, (const std::string &)); +}; + +struct pawn : public reflection::Registered, public test_entity +{ + pawn() {} + pawn(const char * name) : reflection::Registered(name) {} + + CLASS(pawn, reflection::Registered); + + METHOD(public, void, on_birth, (const std::string & cry)) + { std::cout << ".on_birth( \"" << cry << "\" )" << std::endl; } + + METHOD(public, void, on_close, (const bool funky)) + { std::cout << ".on_close( " << ( funky ? "true" : "false" ) << " )" << std::endl; } + + METHOD(public, void, on_click, (const int funky)) + { std::cout << ".on_click( " << funky << " )" << std::endl; } + + METHOD(public, void, on_clicked, (const control_base & widget)) + { std::cout << getName() << ".on_clicked( " << widget.getImpl().getName().c_str() << " ): C++ here I am!" << std::endl; } +}; + +static bool handle_error_box(const CEGUI::EventArgs & e); +static void do_error_box(const char * text); + +class gui_test +{ +public: + gui_test(); + + bool on_clicked(const gui::control_base & widget); + + void handle_soft_wire(const gui::control_base & widget); + void handle_quit(const gui::control_base & widget); + void handle_events_window(const gui::control_base & widget); + void handle_codegen_window(const gui::control_base & widget); + void handle_editor_window(const gui::control_base & widget); + void handle_console_window(const gui::control_base & widget); + void handle_playground_window(const gui::control_base & widget); + + void handle_events_run_lua(const gui::control_base & widget); + void handle_playground_run_lua(const gui::control_base & widget); + +private: + forward_cout m_forward_cout; + + default_window m_win_menu; + default_window m_win_console; + default_window m_win_events; + default_window m_win_codegen; + default_window m_win_editor; + default_window m_win_editable; + default_window m_win_playground; + + multi_line_edit_box_base * m_events_win_lua_code_widget; + multi_line_edit_box_base * m_playground_win_lua_code_widget; + + pawn m_pawn; + boost::shared_ptr<widget_editor> m_editor; +}; + +} // namespace yake + +#endif // _GUI_TEST_H_ Copied: trunk/yake/samples/misc/cmdrmayhem/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/misc/cmdrmayhem/yakePCH.h) =================================================================== --- trunk/yake/samples/misc/cmdrmayhem/yakePCH.h (rev 0) +++ trunk/yake/samples/misc/cmdrmayhem/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,10 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yapp/base/yapp.h> +#include <yake/ent/ent.h> Copied: trunk/yake/samples/misc/scripted/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/misc/scripted/yakePCH.h) =================================================================== --- trunk/yake/samples/misc/scripted/yakePCH.h (rev 0) +++ trunk/yake/samples/misc/scripted/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,14 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yake/graphics/yakeGraphicsSystem.h> +#include <yake/data/yakeData.h> +#include <yake/samples/common/yakeExampleApplication.h> +// Yapp +#include <yapp/base/yapp.h> +#include <yapp/base/event/yakeEvent.h> Copied: trunk/yake/samples/misc/vehicle/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/misc/vehicle/yakePCH.h) =================================================================== --- trunk/yake/samples/misc/vehicle/yakePCH.h (rev 0) +++ trunk/yake/samples/misc/vehicle/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,9 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yapp/base/yapp.h> Copied: trunk/yake/samples/model/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/model/yakePCH.h) =================================================================== --- trunk/yake/samples/model/yakePCH.h (rev 0) +++ trunk/yake/samples/model/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,40 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/base/yakeDebugOutputStream.h> +#include <yake/base/yakeLog.h> +#include <yake/base/yakeLibrary.h> +#include <yake/physics/yakePhysics.h> + +#include <yake/samples/common/yakeExampleApplication.h> +#include <yake/data/yakeData.h> Copied: trunk/yake/samples/raf/demo1/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/raf/demo1/yakePCH.h) =================================================================== --- trunk/yake/samples/raf/demo1/yakePCH.h (rev 0) +++ trunk/yake/samples/raf/demo1/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,9 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yapp/base/yapp.h> Copied: trunk/yake/samples/raf/minimal/yakePCH.h (from rev 1522, trunk/yake/yapp/samples/raf/minimal/yakePCH.h) =================================================================== --- trunk/yake/samples/raf/minimal/yakePCH.h (rev 0) +++ trunk/yake/samples/raf/minimal/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -0,0 +1,9 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yapp/base/yapp.h> Deleted: trunk/yake/yapp/samples/GUI/basics/CEGUIOgre_TestDriver1_REPLACE.h =================================================================== --- trunk/yake/yapp/samples/GUI/basics/CEGUIOgre_TestDriver1_REPLACE.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/GUI/basics/CEGUIOgre_TestDriver1_REPLACE.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,173 +0,0 @@ -#ifndef _CEGUIOgre_TestDriver1_h_ -#define _CEGUIOgre_TestDriver1_h_ - -#include <boost/shared_ptr.hpp> - -#include "CEGUI.h" -#include "renderers/OgreGUIRenderer/ogrerenderer.h" -#include "ExampleApplication.h" -#include "OgreEventQueue.h" - -#include "gui_test.h" - -class CEGUIOgre_FrameListener : public ExampleFrameListener, Ogre::MouseMotionListener, Ogre::MouseListener -{ -public: - CEGUIOgre_FrameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener(win, cam) - { - mEventProcessor = new EventProcessor(); - mEventProcessor->initialise(win); - mEventProcessor->startProcessingEvents(); - mEventProcessor->addKeyListener(this); - mEventProcessor->addMouseMotionListener(this); - mEventProcessor->addMouseListener(this); - mInputDevice = mEventProcessor->getInputReader(); - - mQuit = false; - mSkipCount = 0; - mUpdateFreq = 0; - } - - - virtual void mouseMoved (MouseEvent *e) - { - CEGUI::Renderer* rend = CEGUI::System::getSingleton().getRenderer(); - CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * rend->getWidth(), e->getRelY() * rend->getHeight()); - e->consume(); - } - - - virtual void mouseDragged (MouseEvent *e) - { - mouseMoved(e); - } - - - virtual void keyPressed (KeyEvent *e) - { - // give 'quitting' priority - if (e->getKey() == KC_ESCAPE) - { - mQuit = true; - e->consume(); - return; - } - - // do event injection - CEGUI::System& cegui = CEGUI::System::getSingleton(); - - // key down - cegui.injectKeyDown(e->getKey()); - - // now character - cegui.injectChar(e->getKeyChar()); - - e->consume(); - } - - - virtual void keyReleased (KeyEvent *e) - { - CEGUI::System::getSingleton().injectKeyUp(e->getKey()); - } - - - - virtual void mousePressed (MouseEvent *e) - { - CEGUI::System::getSingleton().injectMouseButtonDown(convertOgreButtonToCegui(e->getButtonID())); - e->consume(); - } - - - virtual void mouseReleased (MouseEvent *e) - { - CEGUI::System::getSingleton().injectMouseButtonUp(convertOgreButtonToCegui(e->getButtonID())); - e->consume(); - } - - // do-nothing events - virtual void keyClicked (KeyEvent *e) {} - virtual void mouseClicked (MouseEvent *e) {} - virtual void mouseEntered (MouseEvent *e) {} - virtual void mouseExited (MouseEvent *e) {} - - - bool frameStarted(const FrameEvent& evt); - -protected: - CEGUI::MouseButton convertOgreButtonToCegui(int ogre_button_id) - { - switch (ogre_button_id) - { - case MouseEvent::BUTTON0_MASK: - return CEGUI::LeftButton; - break; - - case MouseEvent::BUTTON1_MASK: - return CEGUI::RightButton; - break; - - case MouseEvent::BUTTON2_MASK: - return CEGUI::MiddleButton; - break; - - case MouseEvent::BUTTON3_MASK: - return CEGUI::X1Button; - break; - - default: - return CEGUI::LeftButton; - break; - } - - } - -protected: - float mSkipCount; - float mUpdateFreq; - - bool mQuit; -}; - -class CEGUIOgre_TestDriver1 : public ExampleApplication -{ -public: - CEGUIOgre_TestDriver1(void) - : mGUIRenderer(NULL) - {} - - virtual bool configure() - { - if(mRoot->restoreConfig()) - { - mWindow = mRoot->initialise(true); - return true; - } - else - { - return false; - } - } - - virtual void cleanup(void); - -protected: - /************************************************************************* - Methods - *************************************************************************/ - virtual void createScene(void); - virtual void createFrameListener(void); - - // new demo methods - void createDemoWindows(void); - - /************************************************************************* - Data - *************************************************************************/ - CEGUI::OgreRenderer * mGUIRenderer; - boost::shared_ptr<yake::gui_test> m_gui_test; -}; - - -#endif // end of guard _CEGUIOgre_TestDriver1_h_ Deleted: trunk/yake/yapp/samples/GUI/basics/forward_buffer.h =================================================================== --- trunk/yake/yapp/samples/GUI/basics/forward_buffer.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/GUI/basics/forward_buffer.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,34 +0,0 @@ -#ifndef _FORWARD_BUFFER_H_ -#define _FORWARD_BUFFER_H_ - -// todo: what is causing this mess? -#ifdef realloc -# undef realloc -#endif - -#include <iostream> -#include <string> -#include <boost/io/stream_facade.hpp> -#include <boost/io/categories.hpp> -#include <boost/function.hpp> - - -struct forward_sink -{ - typedef char char_type; - typedef boost::io::sink_tag category; - typedef boost::function<void (const std::string &)> forward_fnc; - - forward_sink(forward_fnc fnc) : m_forward_fnc( fnc ) - {} - - void write(const char * s, std::streamsize n) - { m_forward_fnc(std::string(s, n)); } - -private: - forward_fnc m_forward_fnc; -}; - -typedef boost::io::streambuf_facade<forward_sink> forward_buf; - -#endif // _FORWARD_BUFFER_H_ Deleted: trunk/yake/yapp/samples/GUI/basics/gui_test.h =================================================================== --- trunk/yake/yapp/samples/GUI/basics/gui_test.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/GUI/basics/gui_test.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,117 +0,0 @@ -#ifndef _GUI_TEST_H_ -#define _GUI_TEST_H_ - -#include <string> - -#include <reflection.h> -#include <bind_lua/bind_lua.h> -#undef free // todo: find conflict with tnl and move to bind_network.h -//#include <bind_network/bind_network.h> // todo: remove - -#include <Ogre.h> - -#include "default_window.h" -#include "forward_buffer.h" -#include "editor/widget_editor.h" - -namespace yake -{ -using namespace gui; - -button_base * get_fire_button(); -multi_line_edit_box_base * get_cout_box(); - -void forward_cout_here(const std::string & data); -void forward_cout_here_lua(const std::string & data); - -struct forward_cout -{ - forward_cout() - : m_forward_buf(&forward_cout_here), - m_temp_cout(*std::cout.rdbuf()) - { - // forward cout - std::cout.rdbuf(&m_forward_buf); - } - - ~forward_cout() - { - // reset cout - std::cout.rdbuf(&m_temp_cout); - } - - forward_buf m_forward_buf; - std::streambuf & m_temp_cout; -}; - -struct test_entity -{ - test_entity() {} - virtual ~test_entity() {}; - - CLASS(test_entity, reflection::NullClass); - EVENT(public, birth, (const std::string &)); -}; - -struct pawn : public reflection::Registered, public test_entity -{ - pawn() {} - pawn(const char * name) : reflection::Registered(name) {} - - CLASS(pawn, reflection::Registered); - - METHOD(public, void, on_birth, (const std::string & cry)) - { std::cout << ".on_birth( \"" << cry << "\" )" << std::endl; } - - METHOD(public, void, on_close, (const bool funky)) - { std::cout << ".on_close( " << ( funky ? "true" : "false" ) << " )" << std::endl; } - - METHOD(public, void, on_click, (const int funky)) - { std::cout << ".on_click( " << funky << " )" << std::endl; } - - METHOD(public, void, on_clicked, (const control_base & widget)) - { std::cout << getName() << ".on_clicked( " << widget.getImpl().getName().c_str() << " ): C++ here I am!" << std::endl; } -}; - -static bool handle_error_box(const CEGUI::EventArgs & e); -static void do_error_box(const char * text); - -class gui_test -{ -public: - gui_test(); - - bool on_clicked(const gui::control_base & widget); - - void handle_soft_wire(const gui::control_base & widget); - void handle_quit(const gui::control_base & widget); - void handle_events_window(const gui::control_base & widget); - void handle_codegen_window(const gui::control_base & widget); - void handle_editor_window(const gui::control_base & widget); - void handle_console_window(const gui::control_base & widget); - void handle_playground_window(const gui::control_base & widget); - - void handle_events_run_lua(const gui::control_base & widget); - void handle_playground_run_lua(const gui::control_base & widget); - -private: - forward_cout m_forward_cout; - - default_window m_win_menu; - default_window m_win_console; - default_window m_win_events; - default_window m_win_codegen; - default_window m_win_editor; - default_window m_win_editable; - default_window m_win_playground; - - multi_line_edit_box_base * m_events_win_lua_code_widget; - multi_line_edit_box_base * m_playground_win_lua_code_widget; - - pawn m_pawn; - boost::shared_ptr<widget_editor> m_editor; -}; - -} // namespace yake - -#endif // _GUI_TEST_H_ Deleted: trunk/yake/yapp/samples/base/events/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/base/events/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/base/events/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,15 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/base/yakeDebugOutputStream.h> -#include <yake/base/yakeLog.h> -#include <yake/base/yakeLibrary.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yake/graphics/yakeGraphicsSystem.h> - -#include <yake/samples/common/yakeExampleApplication.h> -#include <yake/data/yakeData.h> Deleted: trunk/yake/yapp/samples/base/ved/yakeDemoApp.h =================================================================== --- trunk/yake/yapp/samples/base/ved/yakeDemoApp.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/base/ved/yakeDemoApp.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,238 +0,0 @@ -#ifndef YAPP_DEMO_VED_H -#define YAPP_DEMO_VED_H -#include <yapp/samples/common/yakeHelper.h> -#include <yapp/common/yakeCEGUIRendererAdapter.h> - -using namespace yake; -using namespace yake::base::templates; -using namespace yake::base::math; -using namespace yake::graphics; -using namespace yake::data; - -using namespace yapp; -using namespace yake::app; - -namespace yake { - class RoadCreator; - class TrailCreator; -} -class TheApp : public yake::exapp::ExampleApplication -{ -//private: -public: - yake::ceguiadapter::RendererAdapterPlugin* mAdapterPlugin; - CameraFollowController* mpCfc; - - task::TaskManager mTaskMgr; - // task: render - class RenderTask : public task::DefTask - { - private: - IGraphicalWorld* mWorld; - public: - RenderTask( IGraphicalWorld* pWorld ); - virtual void execute(real timeElapsed); - - typedef Signal1< void(real) > PreSignal; - void subscribeToPre( const PreSignal::slot_type & slot ) - { mPreSig.connect( slot ); } - private: - PreSignal mPreSig; - }; - RenderTask* mRenderTask; - - // task: physics - class PhysicsTask : public task::DefTask - { - private: - physics::IWorld* mWorld; - public: - PhysicsTask( physics::IWorld* pWorld ); - virtual void execute(real timeElapsed); - - typedef Signal0< void > VoidSignal; - void subscribeToPre( const VoidSignal::slot_type & slot ) - { mPreSignal.connect( slot ); } - void subscribeToPost( const VoidSignal::slot_type & slot ) - { mPostSignal.connect( slot ); } - private: - VoidSignal mPreSignal; - VoidSignal mPostSignal; - }; - PhysicsTask* mPhysicsTask; - - // task: vehicle sim - class VehicleSimTask : public task::DefTask - { - private: - model::complex::vehicle::LandVehicle* mCar; - public: - VehicleSimTask( model::complex::vehicle::LandVehicle* theCar ); - virtual void execute(real timeElapsed); - }; - VehicleSimTask* mVehicleSimTask; - - // task: input - class InputTask : public task::DefTask - { - private: - TheApp* mApp; - model::complex::vehicle::LandVehicle* mCar; - - public: - InputTask( TheApp* theApp, model::complex::vehicle::LandVehicle* theCar ); - virtual void execute(real timeElapsed); - }; - InputTask* mInputTask; - - Vector<std::pair<IViewport*,ICamera*> > mVPs; - SharedPtr< IGraphicalWorld > mGWorld; - physics::IWorld* mPWorld; - audio::IWorld* mpAWorld; - - physics::IComplexObject* dbgChassis; - - audio::IListener* mpAListener; - audio::ISource* mpASource; - audio::ISoundData* mpAData; - - graphics::ISceneNode* mLightOneNode; - graphics::IParticleSystem* mSmoke; - - struct SimpleOne { - graphics::ISceneNode* pSN; - graphics::IEntity* pE; - physics::IComplexObject* pCO; - model::MovableUpdateController* updCtrl; - }; - SimpleOne mGround; - model::complex::Model* mCarModel; - model::complex::vehicle::LandVehicle* mCar; - SimpleOne mBall; - - RoadCreator* mRoadCreator; - TrailCreator* mSkidCreator; - - real mCurrentSimTime; -public: - TheApp() : ExampleApplication( true /*graphics*/, - true /*physics*/, - false /*scripting*/, - true /*input*/, - false /*script bindings*/, - false /*audio*/), - mCarModel(0), - mCar(0), - mpAWorld(0), - mpASource(0), - mpAListener(0), - mpAData(0), - mLightOneNode(0), - mRenderTask(0), - mPhysicsTask(0), - mInputTask(0), - mVehicleSimTask(0), - mAdapterPlugin(0), - mRoadCreator(0), - mSkidCreator(0), - mCurrentSimTime(0), - mpCfc(0) - { - } - - InputTask* getInputTask() const - { - return mInputTask; - } - RenderTask* getRenderTask() const - { - return mRenderTask; - } - PhysicsTask* getPhysicsTask() const - { - return mPhysicsTask; - } - - real getSimulationTime() - { - return mCurrentSimTime; - } - - void preRender( real timeElapsed ); - - void handleInput( real timeElapsed ); - - void onKey(const yake::input::KeyboardEvent & e) - { - if (e.keyCode == input::KC_ESCAPE) - requestShutdown(); - } - void onMBUp(uint8 btn) - { - CEGUI::System::getSingleton().injectMouseButtonUp( CEGUI::LeftButton ); - } - void onMBDown(uint8 btn) - { - CEGUI::System::getSingleton().injectMouseButtonDown( CEGUI::LeftButton ); - } - void onMouseMoved( const Vector3 & position ) - { - real scale = 1; - static Vector3 lastPosition = position; - Vector3 diff = position - lastPosition; - lastPosition = position; - - CEGUI::System::getSingleton().injectMouseMove(diff.x*scale, diff.y*scale); - //CEGUI::Renderer* rend = CEGUI::System::getSingleton().getRenderer(); - //CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * rend->getWidth(), e->getRelY() * rend->getHeight()); - } - - int createCameraViewportPair( real sx, real sy, real w, real h, int z ); - void setupDotScene(); - void setupGround(); - void setupAudio(); - void cleanUpAudio(); - - void setupBall(); - void cleanUpBall(); - - void createWheel( - model::complex::vehicle::Wheel *& pWheel, - physics::IComplexObject *& pCO, - SharedPtr<physics::IJoint> & pJ, - physics::IComplexObject* pCOChassis, - const real radius, - const Vector3 & position, - const Quaternion & orientation, - const Vector3 & anchorPt, - const Vector3 & hingeSteeringAxis, - const Vector3 & hingeSuspensionAxis, - const real suspSpring, - const real suspDamping, - const real wheelMass ); - model::complex::vehicle::Wheel* createWheel( - const Vector3 & position, - const Quaternion & orientation, - physics::IComplexObject* pCOChassis, - SharedPtr<model::Physical> & pPhysical, - const real radius, - const real suspSpring, - const real suspDamping, - const real wheelMass, - Vector<graphics::ISceneNode*> & nodeList, - SharedMUCList & mucList, - const String & wheelMesh = "wheel1.mesh"); - void setupCar(); - void setupLights(); - void setupGui(); - void cleanUpGui(); - void createGuiWindows(); - - void setupRoad(); - void cleanUpRoad(); - - virtual void run(); -}; - - -#endif \ No newline at end of file Deleted: trunk/yake/yapp/samples/base/ved/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/base/ved/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/base/ved/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,18 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/base/yakeDebugOutputStream.h> -#include <yake/base/yakeLog.h> -#include <yake/base/yakeLibrary.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yake/graphics/yakeGraphicsSystem.h> - -#include <yake/samples/common/yakeExampleApplication.h> -#include <yake/data/yakeData.h> - -#include <yapp/base/yapp.h> -#include "CEGUI.h" Deleted: trunk/yake/yapp/samples/graphics/scripted/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/graphics/scripted/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/graphics/scripted/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,13 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yake/graphics/yakeGraphicsSystem.h> -#include <yake/data/yakeData.h> -#include <yapp/base/yapp.h> - -#include <yake/samples/common/yakeExampleApplication.h> Deleted: trunk/yake/yapp/samples/misc/cmdrmayhem/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/misc/cmdrmayhem/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/misc/cmdrmayhem/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,10 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> -#include <yake/ent/ent.h> Deleted: trunk/yake/yapp/samples/misc/scripted/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/misc/scripted/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/misc/scripted/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,14 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yake/graphics/yakeGraphicsSystem.h> -#include <yake/data/yakeData.h> -#include <yake/samples/common/yakeExampleApplication.h> -// Yapp -#include <yapp/base/yapp.h> -#include <yapp/base/event/yakeEvent.h> Deleted: trunk/yake/yapp/samples/misc/vehicle/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/misc/vehicle/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/misc/vehicle/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,9 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> Deleted: trunk/yake/yapp/samples/model/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/model/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/model/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,40 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/base/yakeDebugOutputStream.h> -#include <yake/base/yakeLog.h> -#include <yake/base/yakeLibrary.h> -#include <yake/physics/yakePhysics.h> - -#include <yake/samples/common/yakeExampleApplication.h> -#include <yake/data/yakeData.h> Deleted: trunk/yake/yapp/samples/raf/demo1/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/raf/demo1/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/raf/demo1/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,9 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> Deleted: trunk/yake/yapp/samples/raf/minimal/yakePCH.h =================================================================== --- trunk/yake/yapp/samples/raf/minimal/yakePCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yapp/samples/raf/minimal/yakePCH.h 2006-12-07 20:39:41 UTC (rev 1528) @@ -1,9 +0,0 @@ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// STL -#include <iostream> -// Yake -#include <yake/base/yake.h> -#include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-07 20:44:11
|
Revision: 1530 http://svn.sourceforge.net/yake/?rev=1530&view=rev Author: psyclonist Date: 2006-12-07 12:44:10 -0800 (Thu, 07 Dec 2006) Log Message: ----------- reorganization Added Paths: ----------- trunk/yake/yake/yappbase/ trunk/yake/yake/yappbase/event/ trunk/yake/yake/yappbase/yakeTask.h trunk/yake/yake/yappbase/yapp.h trunk/yake/yake/yappbase/yappPCH.h trunk/yake/yake/yappbase/yappPrerequisites.h trunk/yake/yake/yappmsg/ trunk/yake/yake/yappmsg/yakeCommon.h trunk/yake/yake/yappmsg/yakeCommonIds.h trunk/yake/yake/yappmsg/yakeMessage.h trunk/yake/yake/yappmsg/yakeMessageHandler.h trunk/yake/yake/yappmsg/yakeMessageId.h trunk/yake/yake/yappmsg/yakeMessageIdManager.h trunk/yake/yake/yappmsg/yakeMessageManager.h trunk/yake/yake/yappmsg/yakeMessageQ.h trunk/yake/yake/yappmsg/yakeMsg.h trunk/yake/yake/yappmsg/yakePCH.h Removed Paths: ------------- trunk/yake/src/yapp/ trunk/yake/yake/yappbase/event/ trunk/yake/yake/yappbase/yakeTask.h trunk/yake/yake/yappbase/yapp.h trunk/yake/yake/yappbase/yappPCH.h trunk/yake/yake/yappbase/yappPrerequisites.h trunk/yake/yake/yappmsg/yakeCommon.h trunk/yake/yake/yappmsg/yakeCommonIds.h trunk/yake/yake/yappmsg/yakeMessage.h trunk/yake/yake/yappmsg/yakeMessageHandler.h trunk/yake/yake/yappmsg/yakeMessageId.h trunk/yake/yake/yappmsg/yakeMessageIdManager.h trunk/yake/yake/yappmsg/yakeMessageManager.h trunk/yake/yake/yappmsg/yakeMessageQ.h trunk/yake/yake/yappmsg/yakeMsg.h trunk/yake/yake/yappmsg/yakePCH.h trunk/yake/yapp/plugins/ trunk/yake/yapp/samples/ trunk/yake/yapp/yappbase/ trunk/yake/yapp/yappmsg/ Copied: trunk/yake/yake/yappbase (from rev 1527, trunk/yake/yapp/yappbase) Copied: trunk/yake/yake/yappbase/event (from rev 1529, trunk/yake/yapp/yappbase/event) Deleted: trunk/yake/yake/yappbase/yakeTask.h =================================================================== --- trunk/yake/yapp/yappbase/yakeTask.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappbase/yakeTask.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,166 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_TASK_H -#define YAPP_TASK_H - -namespace yake { - using namespace base; - using namespace base::templates; -namespace task { - - typedef uint8 TaskPriority; - - const TaskPriority TASKPRIO_LOW = 63; - const TaskPriority TASKPRIO_MEDIUM = 127; - const TaskPriority TASKPRIO_HIGH = 191; - - /** Represents a task. Derived classes have to override two functions. - @Remarks This task system is *not* a real multithreaded task system. - It emulates something like that in a very remote way, though. - */ - class YAPP_BASE_API ITask - { - public: - virtual ~ITask() {} - - /** Execute this task. */ - virtual void execute(real timeElapsed) = 0; - - /** Return this tasks current priority. */ - virtual TaskPriority getPriority() const = 0; - - /** Return the frequency this task gets executed (in Hz). */ - virtual real getExecutionFrequency() const = 0; - }; - - class YAPP_BASE_API DefTask : public ITask - { - protected: - DefTask( real freq, TaskPriority prio = TASKPRIO_MEDIUM ) : - mFreq(freq), - mPrio(prio) - {} - public: - virtual TaskPriority getPriority() const - { return mPrio; } - - virtual real getExecutionFrequency() const - { return mFreq; } - private: - real mFreq; - TaskPriority mPrio; - }; - - /** Manages tasks. :) */ - class YAPP_BASE_API TaskManager - { - public: - ~TaskManager(); - - ///@name Operations - //@{ - void addTask( ITask* pTask, bool bExecuteOnlyOnce = false ); - void removeTask( ITask* pTask ); - //@} - - void update(real timeElapsed); - private: - static const uint32 TE_SINGLE_EXEC; - struct TaskEntry - { - ITask* pTask; - uint32 flags; - real timeLeft; - - bool operator == (const TaskEntry & rhs) - { - return ( pTask == rhs.pTask && - flags == rhs.flags && - timeLeft == rhs.timeLeft ); - } - - bool operator == (const ITask* pRhsTask) - { - return ( pTask == pRhsTask ); - } - - ///@name Sorting - //@{ - //operator > - static bool sortDescending( const TaskEntry & rStart, const TaskEntry & rEnd) - { - YAKE_ASSERT( rStart.pTask ); - YAKE_ASSERT( rEnd.pTask ); - return (rStart.pTask->getPriority() > rEnd.pTask->getPriority()); - } - //@} - }; - typedef Deque<TaskEntry> TaskList; - TaskList mTasks; - bool mTaskListNeedsSorting; - }; - -/* class PhysicsTask : public DefTask - { - public: - PhysicsTask( physics::IWorld* pWorld, const real freq, const TaskPriority prio = TASKPRIO_MEDIUM ) : - DefTask( freq, prio ), - mWorld(pWorld) - { - YAKE_ASSERT( mWorld ); - } - ~PhysicsTasks(); - virtual void execute() - { - YAKE_ASSERT( mWorld ); - mWorld->step( timeElapsed ); - } - private: - physics::IWorld* mWorld; - }; - - App: - -mTaskPhysics: PhysicsTask - -mTaskGraphics: GraphicsTask - +setupTasks: - mTaskPhysics.reset( new PhysicsTask(mPWorld.get(), 50.) ); - mTaskGraphics.reset( new GraphicsTask(mGWorld.get(), 72. ) ); // limit to refresh rate 72Hz - OR - mTaskGraphics.reset( new GraphicsTask(mGWorld.get(), 0. ) ); // unlimited - - mTaskMgr->addTask( mTaskPhysics.get() ); - mTaskMgr->addTask( mTaskGraphics.get() ); - - +run: - in loop: - mTaskMgr->update(timeElapsed); -*/ - -} // task -} // yake - -#endif Copied: trunk/yake/yake/yappbase/yakeTask.h (from rev 1529, trunk/yake/yapp/yappbase/yakeTask.h) =================================================================== --- trunk/yake/yake/yappbase/yakeTask.h (rev 0) +++ trunk/yake/yake/yappbase/yakeTask.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,166 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAPP_TASK_H +#define YAPP_TASK_H + +namespace yake { + using namespace base; + using namespace base::templates; +namespace task { + + typedef uint8 TaskPriority; + + const TaskPriority TASKPRIO_LOW = 63; + const TaskPriority TASKPRIO_MEDIUM = 127; + const TaskPriority TASKPRIO_HIGH = 191; + + /** Represents a task. Derived classes have to override two functions. + @Remarks This task system is *not* a real multithreaded task system. + It emulates something like that in a very remote way, though. + */ + class YAPP_BASE_API ITask + { + public: + virtual ~ITask() {} + + /** Execute this task. */ + virtual void execute(real timeElapsed) = 0; + + /** Return this tasks current priority. */ + virtual TaskPriority getPriority() const = 0; + + /** Return the frequency this task gets executed (in Hz). */ + virtual real getExecutionFrequency() const = 0; + }; + + class YAPP_BASE_API DefTask : public ITask + { + protected: + DefTask( real freq, TaskPriority prio = TASKPRIO_MEDIUM ) : + mFreq(freq), + mPrio(prio) + {} + public: + virtual TaskPriority getPriority() const + { return mPrio; } + + virtual real getExecutionFrequency() const + { return mFreq; } + private: + real mFreq; + TaskPriority mPrio; + }; + + /** Manages tasks. :) */ + class YAPP_BASE_API TaskManager + { + public: + ~TaskManager(); + + ///@name Operations + //@{ + void addTask( ITask* pTask, bool bExecuteOnlyOnce = false ); + void removeTask( ITask* pTask ); + //@} + + void update(real timeElapsed); + private: + static const uint32 TE_SINGLE_EXEC; + struct TaskEntry + { + ITask* pTask; + uint32 flags; + real timeLeft; + + bool operator == (const TaskEntry & rhs) + { + return ( pTask == rhs.pTask && + flags == rhs.flags && + timeLeft == rhs.timeLeft ); + } + + bool operator == (const ITask* pRhsTask) + { + return ( pTask == pRhsTask ); + } + + ///@name Sorting + //@{ + //operator > + static bool sortDescending( const TaskEntry & rStart, const TaskEntry & rEnd) + { + YAKE_ASSERT( rStart.pTask ); + YAKE_ASSERT( rEnd.pTask ); + return (rStart.pTask->getPriority() > rEnd.pTask->getPriority()); + } + //@} + }; + typedef Deque<TaskEntry> TaskList; + TaskList mTasks; + bool mTaskListNeedsSorting; + }; + +/* class PhysicsTask : public DefTask + { + public: + PhysicsTask( physics::IWorld* pWorld, const real freq, const TaskPriority prio = TASKPRIO_MEDIUM ) : + DefTask( freq, prio ), + mWorld(pWorld) + { + YAKE_ASSERT( mWorld ); + } + ~PhysicsTasks(); + virtual void execute() + { + YAKE_ASSERT( mWorld ); + mWorld->step( timeElapsed ); + } + private: + physics::IWorld* mWorld; + }; + + App: + -mTaskPhysics: PhysicsTask + -mTaskGraphics: GraphicsTask + +setupTasks: + mTaskPhysics.reset( new PhysicsTask(mPWorld.get(), 50.) ); + mTaskGraphics.reset( new GraphicsTask(mGWorld.get(), 72. ) ); // limit to refresh rate 72Hz + OR + mTaskGraphics.reset( new GraphicsTask(mGWorld.get(), 0. ) ); // unlimited + + mTaskMgr->addTask( mTaskPhysics.get() ); + mTaskMgr->addTask( mTaskGraphics.get() ); + + +run: + in loop: + mTaskMgr->update(timeElapsed); +*/ + +} // task +} // yake + +#endif Deleted: trunk/yake/yake/yappbase/yapp.h =================================================================== --- trunk/yake/yapp/yappbase/yapp.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappbase/yapp.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,47 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_H -#define YAPP_H - -#if !defined(YAPP_BASE_EXPORTS) -# if YAKE_PLATFORM == PLATFORM_WIN32 -# pragma comment(lib, "yapp.lib") -# endif -#endif - -#include <yapp/base/yappPrerequisites.h> -#include <yake/base/yake.h> -#include <yapp/base/event/yakeEvent.h> -#include <yapp/base/yakeTask.h> -/* -#include <yapp/gui/yappGUIVisual.h> -#include <yapp/gui/yappButton.h> -#include <yapp/gui/yappContainer.h> -#include <yapp/gui/yappMiscWidgets.h> -#include <yapp/gui/yappIntersectionManager.h> -*/ -#endif Copied: trunk/yake/yake/yappbase/yapp.h (from rev 1529, trunk/yake/yapp/yappbase/yapp.h) =================================================================== --- trunk/yake/yake/yappbase/yapp.h (rev 0) +++ trunk/yake/yake/yappbase/yapp.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,47 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAPP_H +#define YAPP_H + +#if !defined(YAPP_BASE_EXPORTS) +# if YAKE_PLATFORM == PLATFORM_WIN32 +# pragma comment(lib, "yapp.lib") +# endif +#endif + +#include <yapp/base/yappPrerequisites.h> +#include <yake/base/yake.h> +#include <yapp/base/event/yakeEvent.h> +#include <yapp/base/yakeTask.h> +/* +#include <yapp/gui/yappGUIVisual.h> +#include <yapp/gui/yappButton.h> +#include <yapp/gui/yappContainer.h> +#include <yapp/gui/yappMiscWidgets.h> +#include <yapp/gui/yappIntersectionManager.h> +*/ +#endif Deleted: trunk/yake/yake/yappbase/yappPCH.h =================================================================== --- trunk/yake/yapp/yappbase/yappPCH.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappbase/yappPCH.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,34 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_PCH_H -#define YAPP_PCH_H - -#include <yapp/base/yappPrerequisites.h> -#include <yake/base/yake.h> - - -#endif Copied: trunk/yake/yake/yappbase/yappPCH.h (from rev 1529, trunk/yake/yapp/yappbase/yappPCH.h) =================================================================== --- trunk/yake/yake/yappbase/yappPCH.h (rev 0) +++ trunk/yake/yake/yappbase/yappPCH.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,34 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAPP_PCH_H +#define YAPP_PCH_H + +#include <yapp/base/yappPrerequisites.h> +#include <yake/base/yake.h> + + +#endif Deleted: trunk/yake/yake/yappbase/yappPrerequisites.h =================================================================== --- trunk/yake/yapp/yappbase/yappPrerequisites.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappbase/yappPrerequisites.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,50 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_PREREQUISITES_H -#define YAPP_PREREQUISITES_H - -#if defined(YAPP_BASE_EXPORTS) -# define YAPP_BASE_API DLLEXPORT -#else -# define YAPP_BASE_API DLLIMPORT -#endif - -#if defined(YAPP_GUI_EXPORTS) -# define YAPP_GUI_API DLLEXPORT -#else -# define YAPP_GUI_API DLLIMPORT -#endif - -#define YAKE_MEMBER_SIGNAL( NAME, TYPE, ACCESS ) \ - private: \ - typedef ttl::sig::signal< TYPE > SigType##NAME; \ - SigType##NAME mSig##NAME; \ - ACCESS: \ - yake::SignalConnection connectTo##NAME( const SigType##NAME::slot_type& slot ) \ - { return mSig##NAME.connect(slot); } - -#endif Copied: trunk/yake/yake/yappbase/yappPrerequisites.h (from rev 1529, trunk/yake/yapp/yappbase/yappPrerequisites.h) =================================================================== --- trunk/yake/yake/yappbase/yappPrerequisites.h (rev 0) +++ trunk/yake/yake/yappbase/yappPrerequisites.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,50 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAPP_PREREQUISITES_H +#define YAPP_PREREQUISITES_H + +#if defined(YAPP_BASE_EXPORTS) +# define YAPP_BASE_API DLLEXPORT +#else +# define YAPP_BASE_API DLLIMPORT +#endif + +#if defined(YAPP_GUI_EXPORTS) +# define YAPP_GUI_API DLLEXPORT +#else +# define YAPP_GUI_API DLLIMPORT +#endif + +#define YAKE_MEMBER_SIGNAL( NAME, TYPE, ACCESS ) \ + private: \ + typedef ttl::sig::signal< TYPE > SigType##NAME; \ + SigType##NAME mSig##NAME; \ + ACCESS: \ + yake::SignalConnection connectTo##NAME( const SigType##NAME::slot_type& slot ) \ + { return mSig##NAME.connect(slot); } + +#endif Copied: trunk/yake/yake/yappmsg (from rev 1527, trunk/yake/yapp/yappmsg) Deleted: trunk/yake/yake/yappmsg/yakeCommon.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeCommon.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeCommon.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,55 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_COMMON_H -#define YAKE_MSG_COMMON_H - -#if YAKE_PLATFORM == PLATFORM_WIN32 -# if defined(YAKE_MSG_EXPORTS) -# define YAKE_MSG_API DLLEXPORT -# else -# define YAKE_MSG_API DLLIMPORT -# pragma comment(lib, "msg.lib") -# endif -#else -# define YAKE_MSG_API -#endif - -namespace yake { -namespace msg { - - enum ResultCode - { - kHandled, - kUnhandled, - kMessageIsCorrupt - }; - -} // namespace yake -} // namespace ent - -#endif - Copied: trunk/yake/yake/yappmsg/yakeCommon.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeCommon.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeCommon.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeCommon.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,55 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_COMMON_H +#define YAKE_MSG_COMMON_H + +#if YAKE_PLATFORM == PLATFORM_WIN32 +# if defined(YAKE_MSG_EXPORTS) +# define YAKE_MSG_API DLLEXPORT +# else +# define YAKE_MSG_API DLLIMPORT +# pragma comment(lib, "msg.lib") +# endif +#else +# define YAKE_MSG_API +#endif + +namespace yake { +namespace msg { + + enum ResultCode + { + kHandled, + kUnhandled, + kMessageIsCorrupt + }; + +} // namespace yake +} // namespace ent + +#endif + Deleted: trunk/yake/yake/yappmsg/yakeCommonIds.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeCommonIds.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeCommonIds.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,42 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_COMMONIDS_H -#define YAKE_MSG_COMMONIDS_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - extern const MessageId MSGID_Invalid; - extern const MessageId MSGID_Any; - -} // namespace msg -} // namespace yake - -#endif - Copied: trunk/yake/yake/yappmsg/yakeCommonIds.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeCommonIds.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeCommonIds.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeCommonIds.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,42 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_COMMONIDS_H +#define YAKE_MSG_COMMONIDS_H + +#include <yapp/msg/yakeCommon.h> + +namespace yake { +namespace msg { + + extern const MessageId MSGID_Invalid; + extern const MessageId MSGID_Any; + +} // namespace msg +} // namespace yake + +#endif + Deleted: trunk/yake/yake/yappmsg/yakeMessage.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeMessage.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeMessage.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,68 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_MESSAGE_H -#define YAKE_MSG_MESSAGE_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - /** Represents a message instance. - */ - class YAKE_MSG_API Message - { - friend class MessageManager; - protected: - bool mCanBeDeleted; - MessageId mId; - const void* mSource; - private: - Message(const Message&); - Message& operator = (const Message&); - public: - Message(const MessageId& id, const void* source = 0, const bool canBeDeleted = true) : mId(id), mSource(source), mCanBeDeleted(canBeDeleted) - {} - Message(const bool canBeDeleted = true) : mId(MSGID_Invalid), mSource(0), mCanBeDeleted(canBeDeleted) - {} - virtual ~Message() {} - bool canBeDeleted() const - { - return mCanBeDeleted; - } - const void* getSource() const - { return mSource; } - void setSource(const void* source) - { mSource = source; } - MessageId id() const - { return mId; } - }; - -} // namespace msg -} // namespace yake - -#endif Copied: trunk/yake/yake/yappmsg/yakeMessage.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeMessage.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeMessage.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeMessage.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,68 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_MESSAGE_H +#define YAKE_MSG_MESSAGE_H + +#include <yapp/msg/yakeCommon.h> + +namespace yake { +namespace msg { + + /** Represents a message instance. + */ + class YAKE_MSG_API Message + { + friend class MessageManager; + protected: + bool mCanBeDeleted; + MessageId mId; + const void* mSource; + private: + Message(const Message&); + Message& operator = (const Message&); + public: + Message(const MessageId& id, const void* source = 0, const bool canBeDeleted = true) : mId(id), mSource(source), mCanBeDeleted(canBeDeleted) + {} + Message(const bool canBeDeleted = true) : mId(MSGID_Invalid), mSource(0), mCanBeDeleted(canBeDeleted) + {} + virtual ~Message() {} + bool canBeDeleted() const + { + return mCanBeDeleted; + } + const void* getSource() const + { return mSource; } + void setSource(const void* source) + { mSource = source; } + MessageId id() const + { return mId; } + }; + +} // namespace msg +} // namespace yake + +#endif Deleted: trunk/yake/yake/yappmsg/yakeMessageHandler.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeMessageHandler.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeMessageHandler.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,61 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_MESSAGEHANDLER_H -#define YAKE_MSG_MESSAGEHANDLER_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - /** A functor which represents a message handler. - @see MessageHandler - */ - typedef boost::function<ResultCode(const Message&)> MessageHandlerFn; - - /** A message handler object. - @see MessageHandler - @see MessageManager - */ - struct MessageHandler - { - friend class MessageManager; - virtual ~MessageHandler() {} - - /** Override this in derived classes to handle messages. */ - virtual ResultCode onMessage(const Message& msg) = 0; - private: - void doMessage(const Message& msg) - { - onMessage( msg ); - } - }; - -} // namespace msg -} // namespace yake - -#endif Copied: trunk/yake/yake/yappmsg/yakeMessageHandler.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeMessageHandler.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeMessageHandler.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeMessageHandler.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,61 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_MESSAGEHANDLER_H +#define YAKE_MSG_MESSAGEHANDLER_H + +#include <yapp/msg/yakeCommon.h> + +namespace yake { +namespace msg { + + /** A functor which represents a message handler. + @see MessageHandler + */ + typedef boost::function<ResultCode(const Message&)> MessageHandlerFn; + + /** A message handler object. + @see MessageHandler + @see MessageManager + */ + struct MessageHandler + { + friend class MessageManager; + virtual ~MessageHandler() {} + + /** Override this in derived classes to handle messages. */ + virtual ResultCode onMessage(const Message& msg) = 0; + private: + void doMessage(const Message& msg) + { + onMessage( msg ); + } + }; + +} // namespace msg +} // namespace yake + +#endif Deleted: trunk/yake/yake/yappmsg/yakeMessageId.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeMessageId.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeMessageId.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,75 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_MESSAGEID_H -#define YAKE_MSG_MESSAGEID_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - /** Represents a message id. - New message id's can only be constructed via the MessageIdManager. - */ - struct YAKE_MSG_API MessageId - { - protected: - MessageId(const uint16 id) : mId(id) - {} - private: - MessageId(); - public: - MessageId(const MessageId& other) : mId(other.mId) - {} - friend struct MessageIdManager; - operator uint16() - { - return mId; - } - uint16 id() const - { - return mId; - } - bool operator < (const MessageId& rhs) const - { - return mId < rhs.mId; - } - MessageId& operator = (const MessageId& rhs) - { - if (&rhs == this) - return *this; - mId = rhs.mId; - return *this; - } - private: - uint16 mId; - }; - -} // namespace msg -} // namespace yake - -#endif Copied: trunk/yake/yake/yappmsg/yakeMessageId.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeMessageId.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeMessageId.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeMessageId.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,75 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_MESSAGEID_H +#define YAKE_MSG_MESSAGEID_H + +#include <yapp/msg/yakeCommon.h> + +namespace yake { +namespace msg { + + /** Represents a message id. + New message id's can only be constructed via the MessageIdManager. + */ + struct YAKE_MSG_API MessageId + { + protected: + MessageId(const uint16 id) : mId(id) + {} + private: + MessageId(); + public: + MessageId(const MessageId& other) : mId(other.mId) + {} + friend struct MessageIdManager; + operator uint16() + { + return mId; + } + uint16 id() const + { + return mId; + } + bool operator < (const MessageId& rhs) const + { + return mId < rhs.mId; + } + MessageId& operator = (const MessageId& rhs) + { + if (&rhs == this) + return *this; + mId = rhs.mId; + return *this; + } + private: + uint16 mId; + }; + +} // namespace msg +} // namespace yake + +#endif Deleted: trunk/yake/yake/yappmsg/yakeMessageIdManager.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeMessageIdManager.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeMessageIdManager.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,70 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_MESSAGEIDMANAGER_H -#define YAKE_MSG_MESSAGEIDMANAGER_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - /** Manages creation and conversion of message identifiers, both strings and numeric. - It also defines special IDs representing "invalid" or "any" message ids. - @todo Make non-singleton. - */ - struct YAKE_MSG_API MessageIdManager - { - private: - MessageIdManager(); - MessageIdManager(const MessageIdManager&); - public: - /** Registers a new message for the given name. The new id is returned. - */ - static MessageId newId(const String& name); - - /** Returns the message id that represents invalid message ids. - This id is often used when message ids have to be returned. - */ - static const MessageId& idInvalid(); - - /** Returns the message id that represents any other message id. - It is used, for example, for message handlers that want to subscribe to - all registered messages. - */ - static const MessageId& idAny(); - - String toString(const MessageId& id) const; - MessageId fromString(const String& msgName) const; - private: - typedef std::map<String,uint32> StringIdMap; - typedef std::map<uint32,String> IdStringMap; - }; - -} // namespace msg -} // namespace yake - -#endif Copied: trunk/yake/yake/yappmsg/yakeMessageIdManager.h (from rev 1529, trunk/yake/yapp/yappmsg/yakeMessageIdManager.h) =================================================================== --- trunk/yake/yake/yappmsg/yakeMessageIdManager.h (rev 0) +++ trunk/yake/yake/yappmsg/yakeMessageIdManager.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -0,0 +1,70 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_MSG_MESSAGEIDMANAGER_H +#define YAKE_MSG_MESSAGEIDMANAGER_H + +#include <yapp/msg/yakeCommon.h> + +namespace yake { +namespace msg { + + /** Manages creation and conversion of message identifiers, both strings and numeric. + It also defines special IDs representing "invalid" or "any" message ids. + @todo Make non-singleton. + */ + struct YAKE_MSG_API MessageIdManager + { + private: + MessageIdManager(); + MessageIdManager(const MessageIdManager&); + public: + /** Registers a new message for the given name. The new id is returned. + */ + static MessageId newId(const String& name); + + /** Returns the message id that represents invalid message ids. + This id is often used when message ids have to be returned. + */ + static const MessageId& idInvalid(); + + /** Returns the message id that represents any other message id. + It is used, for example, for message handlers that want to subscribe to + all registered messages. + */ + static const MessageId& idAny(); + + String toString(const MessageId& id) const; + MessageId fromString(const String& msgName) const; + private: + typedef std::map<String,uint32> StringIdMap; + typedef std::map<uint32,String> IdStringMap; + }; + +} // namespace msg +} // namespace yake + +#endif Deleted: trunk/yake/yake/yappmsg/yakeMessageManager.h =================================================================== --- trunk/yake/yapp/yappmsg/yakeMessageManager.h 2006-12-07 20:34:59 UTC (rev 1527) +++ trunk/yake/yake/yappmsg/yakeMessageManager.h 2006-12-07 20:44:10 UTC (rev 1530) @@ -1,126 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_MSG_MESSAGEMANAGER_H -#define YAKE_MSG_MESSAGEMANAGER_H - -#include <yapp/msg/yakeCommon.h> - -namespace yake { -namespace msg { - - /** Manages creation, destruction, posting and dispatching of messages as well - as message handler registration. - @todo fix mem leaks - */ - class YAKE_MSG_API MessageManager - { - MessageManager(const MessageManager&); - MessageManager& operator = (const MessageManager&); - public: - MessageManager(); - virtual ~MessageManager(); - - typedef boost::function<bool(const Message&,const std::ostream&)> MessageSerNetFn; - void regMessageSerializerForNetworking(const MessageId& id, const MessageSerNetFn& fn); - - /** @defgroup Message handler registration */ - //@{ - /** Add a message handler. - @param id Message id to register this handler for. - If id is MSGID_Any then the message handler is registered for all messages. - If id is invalid (or even MSGID_Invalid) then nothing is done. - @param source If non-0 this specifies a specific message source. If source is 0 then all sources are used. - */ - void addMessageHandler(const MessageId& id, const MessageHandlerFn& fn, const void* source = 0); - /** @copydoc addMessageHandler(const MessageId& id, const MessageHandlerFn& fn, const void* source = 0) - */ - void addMessageHandler(const MessageId& id, const MessageHandler* pHandler, const void* source = 0); - - /** Add a message handler for all messages of a specific source (if source is non-0) or of all sources. - */ - void addMessageHandler(const void* source, const MessageHandlerFn& fn); - - /** @copydoc addMessageHandler(const void* source, const MessageHandlerFn& fn) - */ - void addMessageHandler(const void* source, const MessageHandler* pHandler); - //@} - - /** Creates a message instance for the given message id and message source. - This message can then either be posted or it can be destroyed using destroyMessage. - If a message is neither posted nor explicitely destroyed when the manager is destroyed, - then the manager will take care of destruction. - @see postMessage - @see destroyMessage - */ - Message* createMessage(const MessageId& id, const void* source = 0); - - /** Destroys the given manager. - @Remarks The message must have been created using this manager! - */ - void destroyMessage(Message* pMessage); - - /** Posts a message instance. - @Remarks Messages are not instantly processed. They are queued until execute is called. - */ - void postMessage(Message* pMessage); - - /** Processes all mqueued (read: posted) messages. - @Remarks It is safe to post messages while the manager is executing them. - These messages will be added to a cache which will be executed wh... [truncated message content] |
From: <psy...@us...> - 2006-12-07 20:51:21
|
Revision: 1532 http://svn.sourceforge.net/yake/?rev=1532&view=rev Author: psyclonist Date: 2006-12-07 12:51:20 -0800 (Thu, 07 Dec 2006) Log Message: ----------- deleted .am files Removed Paths: ------------- trunk/yake/samples/base/Makefile.am trunk/yake/samples/base/events/Makefile.am trunk/yake/samples/graphics/scripted/Makefile.am trunk/yake/samples/gui/console/Makefile.am trunk/yake/samples/model/Makefile.am trunk/yake/samples/model/dotLink/Makefile.am trunk/yake/scripts/linux/Makefile.am trunk/yake/src/Makefile.am trunk/yake/src/base/Makefile.am trunk/yake/src/base/math/Makefile.am trunk/yake/src/base/native/Linux/Makefile.am trunk/yake/src/base/native/Makefile.am trunk/yake/src/base/templates/Makefile.am trunk/yake/src/graphics/Makefile.am trunk/yake/src/physics/Makefile.am trunk/yake/src/plugins/baseLuaBindings/Makefile.am trunk/yake/src/plugins/graphicsLuaBindings/Makefile.am trunk/yake/src/plugins/graphicsOgre/Makefile.am trunk/yake/src/plugins/inputOgre/Makefile.am trunk/yake/src/plugins/modelLua/Makefile.am trunk/yake/src/plugins/scriptingLua/Makefile.am trunk/yake/src/plugins/scriptingLuaBindings/Makefile.am trunk/yake/src/yappbase/Makefile.am trunk/yake/src/yappbase/event/Makefile.am trunk/yake/yake/base/Makefile.am trunk/yake/yake/gui_addons/Makefile.am trunk/yake/yake/gui_addons/console/Makefile.am trunk/yake/yake/gui_addons/console/cegui/Makefile.am trunk/yake/yake/plugins/baseLuaBindings/Makefile.am trunk/yake/yake/plugins/graphicsLuaBindings/Makefile.am trunk/yake/yake/plugins/modelLua/Makefile.am Deleted: trunk/yake/samples/base/Makefile.am =================================================================== --- trunk/yake/samples/base/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/base/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,4 +0,0 @@ -INCLUDES = $(all_includes) -METASOURCES = AUTO - -SUBDIRS = vehicle Deleted: trunk/yake/samples/base/events/Makefile.am =================================================================== --- trunk/yake/samples/base/events/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/base/events/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,6 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -bin_PROGRAMS = EventsDemo -EventsDemo_SOURCES = yakeDemo.cpp yakePCH.cpp -EventsDemo_LDADD = $(top_builddir)/src/yapp/base/libyappBase.la\ - $(top_builddir)/src/yake/base/libyakeBase.la Deleted: trunk/yake/samples/graphics/scripted/Makefile.am =================================================================== --- trunk/yake/samples/graphics/scripted/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/graphics/scripted/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,10 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/luabind -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -bin_PROGRAMS = scriptedGraphics -scriptedGraphics_SOURCES = yakeScriptedGraphicsDemo.cpp -scriptedGraphics_LDADD = $(top_builddir)/src/yapp/model/libyappModel.la \ - $(top_builddir)/src/yake/scripting/libyakeScripting.la $(top_builddir)/src/yake/physics/libyakePhysics.la \ - $(top_builddir)/src/yake/input/libyakeInput.la $(top_builddir)/src/yake/graphics/libyakeGraphics.la \ - $(top_builddir)/src/yake/base/libyakeBase.la $(top_builddir)/src/yake/audio/libyakeAudio.la \ - $(top_builddir)/src/yake/data/libyakeData.la $(top_builddir)/src/yapp/ent/libyappEnt.la -llua -llualib -lluabind Deleted: trunk/yake/samples/gui/console/Makefile.am =================================================================== --- trunk/yake/samples/gui/console/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/gui/console/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,12 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/OGRE -I$(top_srcdir)/dependencies/luabind -I$(top_srcdir)/dependencies/ttl \ - -I/usr/include/CEGUI -I/usr/local/include/CEGUI $(all_includes) -METASOURCES = AUTO -bin_PROGRAMS = consoleDemo -consoleDemo_SOURCES = yakeConsoleDemo.cpp -consoleDemo_LDADD = \ - $(top_builddir)/src/yapp/plugins/ceguiOgreRendererAdapter/libyakeCEGUIOgreAdapter.la $(top_builddir)/src/yapp/base/libyappBase.la \ - $(top_builddir)/src/yake/scripting/libyakeScripting.la $(top_builddir)/src/yake/physics/libyakePhysics.la \ - $(top_builddir)/src/yake/input/libyakeInput.la $(top_builddir)/src/yake/graphics/libyakeGraphics.la \ - $(top_builddir)/src/yake/data/libyakeData.la $(top_builddir)/src/yake/audio/libyakeAudio.la -llua -llualib -lluabind \ - -lCEGUIOgreRenderer Deleted: trunk/yake/samples/model/Makefile.am =================================================================== --- trunk/yake/samples/model/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/model/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,3 +0,0 @@ -INCLUDES = $(all_includes) -METASOURCES = AUTO -SUBDIRS = XODE dotLink Deleted: trunk/yake/samples/model/dotLink/Makefile.am =================================================================== --- trunk/yake/samples/model/dotLink/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/samples/model/dotLink/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,11 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -bin_PROGRAMS = dotLinkDemo -dotLinkDemo_SOURCES = yakeDotLinkDemo.cpp -dotLinkDemo_LDADD = $(top_builddir)/src/yapp/loader/libyappLoader.la \ - $(top_builddir)/src/yapp/model/libyappModel.la $(top_builddir)/src/yapp/base/libyappBase.la \ - $(top_builddir)/src/yake/physics/libyakePhysics.la $(top_builddir)/src/yake/input/libyakeInput.la \ - $(top_builddir)/src/yake/graphics/libyakeGraphics.la $(top_builddir)/src/yake/data/libyakeData.la \ - $(top_builddir)/src/yake/base/libyakeBase.la $(top_builddir)/src/yake/audio/libyakeAudio.la \ - $(top_builddir)/src/yake/scripting/libyakeScripting.la Deleted: trunk/yake/scripts/linux/Makefile.am =================================================================== --- trunk/yake/scripts/linux/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/scripts/linux/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,5 +0,0 @@ -# not a GNU package. You can remove this line, if -# have all needed files, that a GNU package needs -AUTOMAKE_OPTIONS = foreign 1.4 - -SUBDIRS = src yake dependencies yapp Deleted: trunk/yake/src/Makefile.am =================================================================== --- trunk/yake/src/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,7 +0,0 @@ - -# set the include path found by configure -INCLUDES= $(all_includes) - -# the library search path. -SUBDIRS = yake yapp - Deleted: trunk/yake/src/base/Makefile.am =================================================================== --- trunk/yake/src/base/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/base/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,11 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -SUBDIRS = native math templates -METASOURCES = AUTO -lib_LTLIBRARIES = libyakeBase.la -libyakeBase_la_SOURCES = yakeDataChunk.cpp yakeDebugLogAppender.cpp \ - yakeException.cpp yakeInputStream.cpp yakeLock.cpp yakeLog.cpp yakeMimeTypeManager.cpp \ - yakeOutputStream.cpp yakePCH.cpp yakeString.cpp yakeUniqueId.cpp yakeUniqueName.cpp \ - yakeMovable.cpp yakeCriticalSection.cpp yakeLibrary.cpp yakeParamHolder.cpp -libyakeBase_la_LIBADD = \ - $(top_builddir)/src/yake/base/native/Linux/libyakeNativeLinux.la $(top_builddir)/src/yake/base/templates/libyakeTemplates.la \ - $(top_builddir)/src/yake/base/math/libyakeMath.la -lboost_signals Deleted: trunk/yake/src/base/math/Makefile.am =================================================================== --- trunk/yake/src/base/math/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/base/math/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,6 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO - -lib_LTLIBRARIES = libyakeMath.la -libyakeMath_la_SOURCES = yakeMath.cpp yakeMatrix3.cpp yakeQuaternion.cpp \ - yakeRand.cpp yakeVector3.cpp yakeSimpleSpline.cpp Deleted: trunk/yake/src/base/native/Linux/Makefile.am =================================================================== --- trunk/yake/src/base/native/Linux/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/base/native/Linux/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,11 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO - - - -lib_LTLIBRARIES = libyakeNativeLinux.la -libyakeNativeLinux_la_SOURCES = yakeApplication.cpp yakeCriticalSection.cpp yakeDebug.cpp yakeLibrary.cpp yakeTime.cpp - -AM_CXXFLAGS = -rdynamic - -libyakeNativeLinux_la_LIBADD = -ldl Deleted: trunk/yake/src/base/native/Makefile.am =================================================================== --- trunk/yake/src/base/native/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/base/native/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,3 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -SUBDIRS = Linux Deleted: trunk/yake/src/base/templates/Makefile.am =================================================================== --- trunk/yake/src/base/templates/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/base/templates/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,5 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -AM_CXXFLAGS = -rdynamic -lib_LTLIBRARIES = libyakeTemplates.la -libyakeTemplates_la_SOURCES = yakeSingleton.cpp yakeSmartAssert.cpp Deleted: trunk/yake/src/graphics/Makefile.am =================================================================== --- trunk/yake/src/graphics/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/graphics/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,6 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -lib_LTLIBRARIES = libyakeGraphics.la -libyakeGraphics_la_SOURCES = yakeGraphicsSystem.cpp - -libyakeGraphics_la_LIBADD = $(top_builddir)/src/yake/base/libyakeBase.la Deleted: trunk/yake/src/physics/Makefile.am =================================================================== --- trunk/yake/src/physics/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/physics/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,8 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -lib_LTLIBRARIES = libyakePhysics.la - -libyakePhysics_la_SOURCES = yakePCH.cpp yakePhysicsAffectors.cpp \ - yakePhysicsSystem.cpp - -libyakePhysics_la_LIBADD = $(top_builddir)/src/yake/base/libyakeBase.la Deleted: trunk/yake/src/plugins/baseLuaBindings/Makefile.am =================================================================== --- trunk/yake/src/plugins/baseLuaBindings/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/baseLuaBindings/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,8 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/ttl -I$(top_srcdir)/dependencies/luabind $(all_includes) - -lib_LTLIBRARIES = libyakebaseLuaBindings.la -libyakebaseLuaBindings_la_SOURCES = yakeLuaBinder.cpp -libyakebaseLuaBindings_la_LIBADD = \ - $(top_builddir)/src/yake/scripting/libyakeScripting.la $(top_builddir)/src/yake/plugins/scriptingLua/libyakescriptingLua.la \ - -lluabind Deleted: trunk/yake/src/plugins/graphicsLuaBindings/Makefile.am =================================================================== --- trunk/yake/src/plugins/graphicsLuaBindings/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/graphicsLuaBindings/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,9 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/luabind -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO - -lib_LTLIBRARIES = libyakegraphicsLuaBindings.la -libyakegraphicsLuaBindings_la_SOURCES = yakeLuaBinder.cpp -libyakegraphicsLuaBindings_la_LIBADD = \ - $(top_builddir)/src/yake/scripting/libyakeScripting.la $(top_builddir)/src/yake/plugins/scriptingLua/libyakescriptingLua.la \ - -lluabind Deleted: trunk/yake/src/plugins/graphicsOgre/Makefile.am =================================================================== --- trunk/yake/src/plugins/graphicsOgre/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/graphicsOgre/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,12 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/OGRE -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -lib_LTLIBRARIES = libyakegraphicsOgre.la -libyakegraphicsOgre_la_LIBADD = -lOgreMain -AM_CXXFLAGS = -DEXT_HASH -DGCC_3_1 -libyakegraphicsOgre_la_SOURCES = graphicsOgreCamera.cpp graphicsOgreCore.cpp\ - graphicsOgreEntity.cpp graphicsOgreGeometryAccess.cpp\ - graphicsOgreLight.cpp graphicsOgreNode.cpp\ - graphicsOgreParticleSystem.cpp graphicsOgreSkeleton.cpp\ - graphicsOgreViewport.cpp yakeGraphicsSystem.cpp yakeGraphicsWorld.cpp\ - yakePCH.cpp Deleted: trunk/yake/src/plugins/inputOgre/Makefile.am =================================================================== --- trunk/yake/src/plugins/inputOgre/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/inputOgre/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,8 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/OGRE \ - -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -AM_CXXFLAGS = -DEXT_HASH -DGCC_3_1 -lib_LTLIBRARIES = libyakeinputOgre.la -libyakeinputOgre_la_SOURCES = InputSystemOgre.cpp yakePCH.cpp -libyakeinputOgre_la_LIBADD = $(top_builddir)/src/yake/base/libyakeBase.la\ - -lOgreMain Deleted: trunk/yake/src/plugins/modelLua/Makefile.am =================================================================== --- trunk/yake/src/plugins/modelLua/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/modelLua/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,9 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/luabind \ - -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -lib_LTLIBRARIES = libyappmodelLuaBindings.la -libyappmodelLuaBindings_la_SOURCES = yakeLuaBinder.cpp -libyappmodelLuaBindings_la_LIBADD =\ - $(top_builddir)/src/yake/scripting/libyakeScripting.la\ - $(top_builddir)/src/yake/plugins/scriptingLua/libyakescriptingLua.la\ - -lluabind Deleted: trunk/yake/src/plugins/scriptingLua/Makefile.am =================================================================== --- trunk/yake/src/plugins/scriptingLua/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/scriptingLua/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,13 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies \ - -I$(top_srcdir)/dependencies/ttl -I$(top_srcdir)/dependencies/luabind $(all_includes) -METASOURCES = AUTO - - - - - - -lib_LTLIBRARIES = libyakescriptingLua.la -libyakescriptingLua_la_SOURCES = ScriptingSystemLua.cpp yakePCH.cpp -libyakescriptingLua_la_LIBADD = $(top_builddir)/src/yake/base/libyakeBase.la \ - -lluabind -llualib -llua Deleted: trunk/yake/src/plugins/scriptingLuaBindings/Makefile.am =================================================================== --- trunk/yake/src/plugins/scriptingLuaBindings/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/plugins/scriptingLuaBindings/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,10 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/luabind \ - -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO - - - -lib_LTLIBRARIES = libyakescriptingBindingsLua.la -libyakescriptingBindingsLua_la_SOURCES = pch.cpp yakeBinder.cpp -libyakescriptingBindingsLua_la_LIBADD = \ - $(top_builddir)/src/yake/base/libyakeBase.la -lluabind -llualib -llua Deleted: trunk/yake/src/yappbase/Makefile.am =================================================================== --- trunk/yake/src/yappbase/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/yappbase/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,8 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -SUBDIRS = event -lib_LTLIBRARIES = libyappBase.la -libyappBase_la_SOURCES = yapp.cpp yappPCH.cpp -libyappBase_la_LIBADD = $(top_builddir)/src/yapp/base/event/libyappEvents.la\ - $(top_builddir)/src/yake/base/libyakeBase.la - Deleted: trunk/yake/src/yappbase/event/Makefile.am =================================================================== --- trunk/yake/src/yappbase/event/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/src/yappbase/event/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,7 +0,0 @@ -INCLUDES = -I$(top_srcdir)/. -I$(top_srcdir)/dependencies/ttl $(all_includes) -METASOURCES = AUTO -lib_LTLIBRARIES = libyappEvents.la -libyappEvents_la_SOURCES = yakeMessageId.cpp yakeMessageInstance.cpp \ - yakeMessageManager.cpp yakeMessageQ.cpp - -AM_CXXFLAGS = -rdynamic Deleted: trunk/yake/yake/base/Makefile.am =================================================================== --- trunk/yake/yake/base/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/base/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,10 +0,0 @@ -INCLUDES = -METASOURCES = AUTO -include_HEADERS = yakeByteSwapInputStreamDecorator.h \ - yakeByteSwapOutputStreamDecorator.h yakeConfigFile.h yakeCriticalSection.h yakeDataChunk.h \ - yakeDebugLogAppender.h yakeDebugOutputStream.h yakeException.h yake.h \ - yakeInputStreamDecorator.h yakeInputStream.h yakeLibrary.h yakeLock.h yakeLog.h \ - yakeMimeTypeManager.h yakeMovable.h yakeOutputStreamDecorator.h yakeOutputStream.h yakePCH.h \ - yakePlatform.h yakePlugin.h yakePrerequisites.h yakeProcessor.h yakeResource.h \ - yakeSerializable.h yakeString.h yakeTimer.h yakeUniqueId.h yakeUniqueName.h yakeVersion.h -SUBDIRS = prerequisites templates mpl native math Deleted: trunk/yake/yake/gui_addons/Makefile.am =================================================================== --- trunk/yake/yake/gui_addons/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/gui_addons/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,3 +0,0 @@ -INCLUDES = -METASOURCES = AUTO -SUBDIRS = console Deleted: trunk/yake/yake/gui_addons/console/Makefile.am =================================================================== --- trunk/yake/yake/gui_addons/console/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/gui_addons/console/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,3 +0,0 @@ -INCLUDES = yakeGenericConsole.h yakeDefaultHistory.h yakeConsoleLuaProcessor.h -METASOURCES = AUTO -SUBDIRS = cegui Deleted: trunk/yake/yake/gui_addons/console/cegui/Makefile.am =================================================================== --- trunk/yake/yake/gui_addons/console/cegui/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/gui_addons/console/cegui/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,3 +0,0 @@ -INCLUDES = yakeCEGUIInputArea.h yakeCEGUIOutputArea.h -METASOURCES = AUTO - Deleted: trunk/yake/yake/plugins/baseLuaBindings/Makefile.am =================================================================== --- trunk/yake/yake/plugins/baseLuaBindings/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/plugins/baseLuaBindings/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,2 +0,0 @@ -INCLUDES = -METASOURCES = AUTO Deleted: trunk/yake/yake/plugins/graphicsLuaBindings/Makefile.am =================================================================== --- trunk/yake/yake/plugins/graphicsLuaBindings/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/plugins/graphicsLuaBindings/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,2 +0,0 @@ -INCLUDES = -METASOURCES = AUTO Deleted: trunk/yake/yake/plugins/modelLua/Makefile.am =================================================================== --- trunk/yake/yake/plugins/modelLua/Makefile.am 2006-12-07 20:45:48 UTC (rev 1531) +++ trunk/yake/yake/plugins/modelLua/Makefile.am 2006-12-07 20:51:20 UTC (rev 1532) @@ -1,2 +0,0 @@ -INCLUDES = -METASOURCES = AUTO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-07 23:30:00
|
Revision: 1533 http://svn.sourceforge.net/yake/?rev=1533&view=rev Author: psyclonist Date: 2006-12-07 15:29:59 -0800 (Thu, 07 Dec 2006) Log Message: ----------- reorganization Modified Paths: -------------- trunk/yake/scripts/premake/tools.lua trunk/yake/scripts/premake/yake.lua trunk/yake/src/base/native/win32/yakeConfig.cpp trunk/yake/src/base/yakeLibrary.cpp trunk/yake/src/raf/pch.cpp trunk/yake/src/raf/yakeApplication.cpp trunk/yake/src/raf/yakeApplicationState.cpp trunk/yake/src/raf/yakeRaf.cpp trunk/yake/src/raf/yakeRtApplicationState.cpp trunk/yake/src/vehicle/yakeDotVehicle.cpp trunk/yake/src/vehicle/yakeMountPoint.cpp trunk/yake/src/vehicle/yakeNativeOde.cpp trunk/yake/src/vehicle/yakeOdeEngine.cpp trunk/yake/src/vehicle/yakePCH.cpp trunk/yake/src/vehicle/yakeVehicle.cpp trunk/yake/src/vehicle/yakeVehicleModelComponent.cpp trunk/yake/src/vehicle/yakeVehicleModelComponentCreator.cpp trunk/yake/yake/base/native/yakeNative.h trunk/yake/yake/base/prerequisites/yakePrerequisitesVC.h trunk/yake/yake/base/yake.h trunk/yake/yake/base/yakeException.h trunk/yake/yake/base/yakeLibrary.h trunk/yake/yake/base/yakeNoncopyable.h trunk/yake/yake/base/yakePCH.h trunk/yake/yake/base/yakeString.h trunk/yake/yake/data/yakeDataPrerequisites.h trunk/yake/yake/graphics/yakeGraphics.h trunk/yake/yake/loader/prerequisites.h trunk/yake/yake/model/prerequisites.h trunk/yake/yake/net/netPrerequisites.h trunk/yake/yake/netsvc/netPrerequisites.h trunk/yake/yake/plugins/physicsODE/yakePrerequisites.h trunk/yake/yake/plugins/scriptingLua/ScriptingSystemLua.h trunk/yake/yake/raf/pch.h trunk/yake/yake/raf/yakeApplicationState.h trunk/yake/yake/raf/yakePrerequisites.h trunk/yake/yake/raf/yakeRaf.h trunk/yake/yake/vehicle/yakeInterfaces.h trunk/yake/yake/vehicle/yakeMountPoint.h trunk/yake/yake/vehicle/yakeNativeOde.h trunk/yake/yake/vehicle/yakePCH.h trunk/yake/yake/vehicle/yakeTemplates.h trunk/yake/yake/vehicle/yakeVehicle.h trunk/yake/yake/vehicle/yakeVehicleModelComponent.h trunk/yake/yake/vehicle/yakeVehicleSystem.h trunk/yake/yake/yappbase/event/yakeEvent.h trunk/yake/yake/yappbase/event/yakeMessageInstance.h trunk/yake/yake/yappbase/event/yakeMessageManager.h trunk/yake/yake/yappbase/yapp.h trunk/yake/yake/yappmsg/yakeCommon.h trunk/yake/yake/yappmsg/yakeCommonIds.h trunk/yake/yake/yappmsg/yakeMessage.h trunk/yake/yake/yappmsg/yakeMessageHandler.h trunk/yake/yake/yappmsg/yakeMessageId.h trunk/yake/yake/yappmsg/yakeMessageIdManager.h trunk/yake/yake/yappmsg/yakeMessageManager.h trunk/yake/yake/yappmsg/yakeMessageQ.h trunk/yake/yake/yappmsg/yakeMsg.h Added Paths: ----------- trunk/yake/src/base/native/win32/yakeNativeLibrary.cpp trunk/yake/src/base/yake.cpp trunk/yake/yake/common/yakeCEGUIHelpers.h trunk/yake/yake/common/yakeCEGUIRendererAdapter.h trunk/yake/yake/common/yakeCameraControllers.h trunk/yake/yake/common/yakePawn.h Removed Paths: ------------- trunk/yake/common/lib/debug/ trunk/yake/common/lib/release/ trunk/yake/src/base/native/win32/yakeLibrary.cpp trunk/yake/yake/common/common/yakeCEGUIHelpers.h trunk/yake/yake/common/common/yakeCEGUIRendererAdapter.h trunk/yake/yake/common/common/yakeCameraControllers.h trunk/yake/yake/common/common/yakePawn.h Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/scripts/premake/tools.lua 2006-12-07 23:29:59 UTC (rev 1533) @@ -14,11 +14,11 @@ tinsert(package.files,matchrecursive(rootdir..filter)) end function addDependency(lib,cfg) - if (cfg) then - tinsert(package.config[cfg].links,lib) - else - tinsert(package.links,lib) - end + if (cfg) then + tinsert(package.config[cfg].links,lib) + else + tinsert(package.links,lib) + end end function addDefine(name) tinsert(package.defines,name) @@ -114,10 +114,10 @@ function doMakeComponent(name,exportDefine,pathOffset) makePackage(name) - local componentPath = "yake/"..(pathOffset)..name.."/" + local componentPath = (pathOffset)..name.."/" package.files = { - matchrecursive(rootdir..componentPath.."*.h"), - matchrecursive(rootdir..componentPath.."*.inl"), + matchrecursive(rootdir.."yake/"..componentPath.."*.h"), + matchrecursive(rootdir.."yake/"..componentPath.."*.inl"), matchrecursive(rootdir.."src/"..componentPath.."*.cpp") } if (exportDefine) then Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/scripts/premake/yake.lua 2006-12-07 23:29:59 UTC (rev 1533) @@ -25,15 +25,15 @@ makePackage("base") -- we cannot use makeDLLComponent() because of native .cpp addDefine("YAKE_BASE_EXPORTS") package.pchheader = rootdir.."yake/base/yakePCH.h" - package.pchsource = rootdir.."src/yake/base/yakePCH.cpp" + package.pchsource = rootdir.."src/base/yakePCH.cpp" addMatching("yake/base/*.h") addMatching("yake/base/*.inl") addMatching("yake/base/*.rc") - addMatching("src/yake/base/*.cpp") - addMatching("src/yake/base/math/*.cpp") - addMatching("src/yake/base/templates/*.cpp") + addMatching("src/base/*.cpp") + addMatching("src/base/math/*.cpp") + addMatching("src/base/templates/*.cpp") if (windows) then - addMatching("src/yake/base/native/win32/*.cpp") + addMatching("src/base/native/win32/*.cpp") addDependency("winmm") addDependency("user32") addDependency("gdi32") @@ -82,22 +82,50 @@ makeComponentPlugin("scriptingLua","YAKE_SCRIPTINGLUA_EXPORTS") addDependency("base") addDependency("scripting") +addIncludePath("dependencies/lua/include") +addIncludePath("dependencies/luabind") +addLibraryPath("dependencies/lua/lib") +addLibraryPath("dependencies/luabind/lib") +addDependency("lua","Release") +addDependency("lua","ReleaseWithSymbols") +addDependency("luad","Debug") +addDependency("luabind","Release") +addDependency("luabind","ReleaseWithSymbols") +addDependency("luabindd","Debug") -------------------------------------- +makeComponent("data","YAKE_DATA_EXPORTS") +addMatching("dependencies/tinyxml/*.h") +addMatching("dependencies/tinyxml/*.cpp") +addDependency("base") + +-------------------------------------- makeComponent("model","YAKE_MODEL_EXPORTS") addDependency("base") +addDependency("data") +addDependency("loader") +addDependency("graphics") +addDependency("physics") -------------------------------------- makeComponent("loader","YAKE_LOADER_EXPORTS") addDependency("base") +addDependency("data") -------------------------------------- makeComponent("net","YAKE_NET_EXPORTS") addDependency("base") +addIncludePath("dependencies/enet/include") +addMatching("dependencies/enet/*.c") -- Yes, ENet is compiled into 'net'. +if (windows) then + addDependency("ws2_32") + addDependency("winmm") +end -------------------------------------- makeComponent("netsvc","YAKE_NETSVC_EXPORTS") addDependency("base") +addDependency("net") -------------------------------------- makeComponent("ent","YAKE_ENT_EXPORTS") @@ -105,6 +133,38 @@ addDependency("model") -------------------------------------- +makeComponent("vehicle","YAKE_VEHICLE_EXPORTS") +addDependency("base") +addDependency("data") +addDependency("model") +addDependency("physics") +addDependency("physicsODE") +addDependency("ent") + +addDependency("ode") +addIncludePath("dependencies/ode/include") +addLibraryPath("dependencies/ode/lib/debugdll","Debug") +addLibraryPath("dependencies/ode/lib/debugdll","DebugLib") +addLibraryPath("dependencies/ode/lib/releasedll","Release") +addLibraryPath("dependencies/ode/lib/releasedll","ReleaseLib") +addLibraryPath("dependencies/ode/lib/releasedll","ReleaseWithSymbols") + +-------------------------------------- +makeComponent("raf","YAKE_RAF_EXPORTS") +addDependency("base") +addDependency("audio") +addDependency("input") +addDependency("graphics") +addDependency("physics") +addDependency("model") +addDependency("ent") + +addLibraryPath("dependencies/CEGUI/lib") +addDependency("CEGUIBase","Release") +addDependency("CEGUIBase","ReleaseWithSymbols") +addDependency("CEGUIBase_d","Debug") + +-------------------------------------- makeComponentPlugin("physicsODE","YAKEPHYSICSODE_EXPORTS") addDependency("base") addDependency("physics") @@ -119,12 +179,5 @@ addLibraryPath("dependencies/ode/lib/releasedll","Release") addLibraryPath("dependencies/ode/lib/releasedll","ReleaseLib") addLibraryPath("dependencies/ode/lib/releasedll","ReleaseWithSymbols") - --------------------------------------- -makeComponent("data","YAKE_DATA_EXPORTS") -addMatching("dependencies/tinyxml/*.h") -addMatching("dependencies/tinyxml/*.cpp") -addDependency("base") - -- the end Modified: trunk/yake/src/base/native/win32/yakeConfig.cpp =================================================================== --- trunk/yake/src/base/native/win32/yakeConfig.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/base/native/win32/yakeConfig.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -38,20 +38,18 @@ //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES //============================================================================ -namespace yake -{ -namespace native -{ -namespace win32 -{ +namespace yake { +namespace native { +namespace win32 { -HINSTANCE g_hInstance = 0; + HINSTANCE g_hInstance = 0; } // win32 } // native } // yake -#ifdef DLL_BUILD +#pragma message("WARNING: g_hInstance is not set") +#if defined(_DLL) && 0 BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID ) { if( dwReason == DLL_PROCESS_ATTACH ) Deleted: trunk/yake/src/base/native/win32/yakeLibrary.cpp =================================================================== --- trunk/yake/src/base/native/win32/yakeLibrary.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/base/native/win32/yakeLibrary.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -1,78 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// stl -#include <cassert> -#include <locale> -// yake -#include <yake/base/yakePCH.h> -#include <yake/base/native/win32/yakeConfig.h> -#include <yake/base/templates/yakeSmartAssert.h> -#include <yake/base/yakeException.h> - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace native -{ - -LibraryHandle library_Load(const char * filename) -{ - YAKE_ASSERT(filename).debug("Invalid filename."); - // load library - LibraryHandle handle = (LibraryHandle)::LoadLibraryA(filename); - - // todo: http://yake.org/forum/viewtopic.php?t=340 - if (!handle) - YAKE_EXCEPT("Couldn't load library " + String(filename) + "."); - return handle; -} - -void * library_GetSymbol(LibraryHandle library, const char * function) -{ - YAKE_ASSERT(library).debug("Invalid library handle."); - YAKE_ASSERT(function).debug("Invalid library function."); - // get the procedure's address - void * address = (void *)(::GetProcAddress((HMODULE) library, function)); - return address; -} - -void library_Free(LibraryHandle library) -{ - YAKE_ASSERT(library).debug("Invalid library handle."); - // free library - ::FreeLibrary((HMODULE) library); -} - - -} // native -} // yake Copied: trunk/yake/src/base/native/win32/yakeNativeLibrary.cpp (from rev 1532, trunk/yake/src/base/native/win32/yakeLibrary.cpp) =================================================================== --- trunk/yake/src/base/native/win32/yakeNativeLibrary.cpp (rev 0) +++ trunk/yake/src/base/native/win32/yakeNativeLibrary.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -0,0 +1,75 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ + +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// stl +#include <cassert> +#include <locale> +// yake +#include <yake/base/yakePCH.h> +#include <yake/base/native/win32/yakeConfig.h> +#include <yake/base/templates/yakeSmartAssert.h> +#include <yake/base/yakeException.h> + +//============================================================================ +// INTERFACE STRUCTURES / UTILITY CLASSES +//============================================================================ +namespace yake { +namespace native { + + LibraryHandle library_Load(const char * filename) + { + YAKE_ASSERT(filename).debug("Invalid filename."); + // load library + LibraryHandle handle = (LibraryHandle)::LoadLibraryA(filename); + + // todo: http://yake.org/forum/viewtopic.php?t=340 + if (!handle) + YAKE_EXCEPT("Couldn't load library " + String(filename) + "."); + return handle; + } + + void * library_GetSymbol(LibraryHandle library, const char * function) + { + YAKE_ASSERT(library).debug("Invalid library handle."); + YAKE_ASSERT(function).debug("Invalid library function."); + // get the procedure's address + void * address = (void *)(::GetProcAddress((HMODULE) library, function)); + return address; + } + + void library_Free(LibraryHandle library) + { + YAKE_ASSERT(library).debug("Invalid library handle."); + // free library + ::FreeLibrary((HMODULE) library); + } + +} // native +} // yake Added: trunk/yake/src/base/yake.cpp =================================================================== --- trunk/yake/src/base/yake.cpp (rev 0) +++ trunk/yake/src/base/yake.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -0,0 +1,28 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#include <yake/base/yakePCH.h> +#include <yake/base/yake.h> Modified: trunk/yake/src/base/yakeLibrary.cpp =================================================================== --- trunk/yake/src/base/yakeLibrary.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/base/yakeLibrary.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -25,42 +25,36 @@ ------------------------------------------------------------------------------------ */ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ #include <yake/base/yakePCH.h> -#include <yake/base/yakeLibrary.h> #include <yake/base/yakeException.h> +#include <yake/base/yakeLibrary.h> -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace base -{ +namespace yake { +namespace base { -Library::Library( const String& rFilename ) -{ - mHandle = native::library_Load( rFilename.c_str() ); -} + Library::Library( const String& rFilename ) + { + mHandle = native::library_Load( rFilename.c_str() ); + if (!mHandle) + YAKE_EXCEPT( "Failed to load library \"" + rFilename + "\"" ); + } -Library::~Library() -{ - if( 0 != mHandle ) - native::library_Free( mHandle ); -} + Library::~Library() + { + if( 0 != mHandle ) + native::library_Free( mHandle ); + } -void* Library::getSymbol( const String& rFunction ) -{ - void* pAddress = native::library_GetSymbol( mHandle, rFunction.c_str() ); + void* Library::getSymbol( const String& rFunction ) const + { + void* pAddress = native::library_GetSymbol( mHandle, rFunction.c_str() ); - if( 0 == pAddress ) - YAKE_EXCEPT( "Couldn't get address for function \"" + rFunction + "\"" ); + if( 0 == pAddress ) + YAKE_EXCEPT( "Couldn't get address for function \"" + rFunction + "\"" ); - return pAddress; -} + return pAddress; + } } // base } // yake Modified: trunk/yake/src/raf/pch.cpp =================================================================== --- trunk/yake/src/raf/pch.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/raf/pch.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,5 +24,5 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/raf/pch.h> +#include <yake/raf/pch.h> Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/raf/yakeApplication.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,19 +24,19 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/raf/pch.h> -#include <yapp/raf/yakePrerequisites.h> -#include <yapp/raf/yakeApplicationState.h> -#include <yapp/raf/yakeApplication.h> +#include <yake/raf/pch.h> +#include <yake/raf/yakePrerequisites.h> +#include <yake/raf/yakeApplicationState.h> +#include <yake/raf/yakeApplication.h> #if YAKE_RAF_USES_CEGUI == 1 #include <CEGUI.h> #include <CEGUISystem.h> -#include <yapp/common/yakeCEGUIRendererAdapter.h> -#include <yapp/common/yakeCEGUIHelpers.h> +#include <yake/common/yakeCEGUIRendererAdapter.h> +#include <yake/common/yakeCEGUIHelpers.h> #ifdef YAKE_DEBUG -# pragma comment(lib,"CEGUIBase_d.lib") +//# pragma comment(lib,"CEGUIBase_d.lib") #else -# pragma comment(lib,"CEGUIBase.lib") +//# pragma comment(lib,"CEGUIBase.lib") #endif #endif #include <OgreNoMemoryMacros.h> Modified: trunk/yake/src/raf/yakeApplicationState.cpp =================================================================== --- trunk/yake/src/raf/yakeApplicationState.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/raf/yakeApplicationState.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,8 +24,8 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/raf/pch.h> -#include <yapp/raf/yakeApplicationState.h> +#include <yake/raf/pch.h> +#include <yake/raf/yakeApplicationState.h> namespace yake { namespace raf { Modified: trunk/yake/src/raf/yakeRaf.cpp =================================================================== --- trunk/yake/src/raf/yakeRaf.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/raf/yakeRaf.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,8 +24,8 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/raf/pch.h> -#include <yapp/raf/yakeRaf.h> +#include <yake/raf/pch.h> +#include <yake/raf/yakeRaf.h> namespace yake { namespace raf { Modified: trunk/yake/src/raf/yakeRtApplicationState.cpp =================================================================== --- trunk/yake/src/raf/yakeRtApplicationState.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/raf/yakeRtApplicationState.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,10 +24,10 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/raf/pch.h> -#include <yapp/raf/yakeApplicationState.h> -#include <yapp/raf/yakeRtApplicationState.h> -#include <yapp/raf/yakeApplication.h> +#include <yake/raf/pch.h> +#include <yake/raf/yakeApplicationState.h> +#include <yake/raf/yakeRtApplicationState.h> +#include <yake/raf/yakeApplication.h> namespace yake { namespace raf { Modified: trunk/yake/src/vehicle/yakeDotVehicle.cpp =================================================================== --- trunk/yake/src/vehicle/yakeDotVehicle.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeDotVehicle.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,9 +24,9 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> -#include <yapp/vehicle/yakeDotVehicle.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeDotVehicle.h> #include <yake/data/yakeData.h> namespace yake { Modified: trunk/yake/src/vehicle/yakeMountPoint.cpp =================================================================== --- trunk/yake/src/vehicle/yakeMountPoint.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeMountPoint.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,9 +24,9 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> -#include <yapp/vehicle/yakeNativeOde.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeNativeOde.h> namespace yake { namespace vehicle { Modified: trunk/yake/src/vehicle/yakeNativeOde.cpp =================================================================== --- trunk/yake/src/vehicle/yakeNativeOde.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeNativeOde.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,10 +24,10 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> -#include <yapp/vehicle/yakeNativeOde.h> -#include <yapp/vehicle/yakeDotVehicle.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeNativeOde.h> +#include <yake/vehicle/yakeDotVehicle.h> #if defined(YAKE_VEHICLE_USE_ODE) # include <ode/ode.h> @@ -36,11 +36,11 @@ # include <yake/plugins/physicsODE/OdeJoint.h> # include <yake/plugins/physicsODE/OdeBody.h> # include <yake/plugins/physicsODE/OdeWorld.h> -# pragma comment(lib, "physicsODE.lib") +//# pragma comment(lib, "physicsODE.lib") # ifdef YAKE_DEBUG -# pragma comment(lib, "ode.lib") +//# pragma comment(lib, "ode.lib") # else -# pragma comment(lib, "ode.lib") +//# pragma comment(lib, "ode.lib") # endif #endif // #if defined(YAKE_VEHICLE_USE_ODE) Modified: trunk/yake/src/vehicle/yakeOdeEngine.cpp =================================================================== --- trunk/yake/src/vehicle/yakeOdeEngine.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeOdeEngine.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,9 +24,9 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> -#include <yapp/vehicle/yakeNativeOde.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeNativeOde.h> namespace yake { namespace vehicle { Modified: trunk/yake/src/vehicle/yakePCH.cpp =================================================================== --- trunk/yake/src/vehicle/yakePCH.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakePCH.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,4 +24,4 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> +#include <yake/vehicle/yakePCH.h> Modified: trunk/yake/src/vehicle/yakeVehicle.cpp =================================================================== --- trunk/yake/src/vehicle/yakeVehicle.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeVehicle.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,9 +24,9 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> -#include <yapp/vehicle/yakeNativeOde.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeNativeOde.h> namespace yake { namespace vehicle { Modified: trunk/yake/src/vehicle/yakeVehicleModelComponent.cpp =================================================================== --- trunk/yake/src/vehicle/yakeVehicleModelComponent.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeVehicleModelComponent.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,8 +24,8 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> namespace yake { namespace vehicle { Modified: trunk/yake/src/vehicle/yakeVehicleModelComponentCreator.cpp =================================================================== --- trunk/yake/src/vehicle/yakeVehicleModelComponentCreator.cpp 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/src/vehicle/yakeVehicleModelComponentCreator.cpp 2006-12-07 23:29:59 UTC (rev 1533) @@ -24,8 +24,8 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/vehicle/yakePCH.h> -#include <yapp/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakePCH.h> +#include <yake/vehicle/yakeVehicle.h> namespace yake { namespace vehicle { Modified: trunk/yake/yake/base/native/yakeNative.h =================================================================== --- trunk/yake/yake/base/native/yakeNative.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/native/yakeNative.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -33,13 +33,9 @@ //============================================================================ -#define YAKE_BASE_NATIVE_API YAKE_BASE_API +namespace yake { +namespace native { -namespace yake -{ -namespace native -{ - // Library Interface. typedef const void * LibraryHandle; YAKE_BASE_API LibraryHandle library_Load(const char * filemame); Modified: trunk/yake/yake/base/prerequisites/yakePrerequisitesVC.h =================================================================== --- trunk/yake/yake/base/prerequisites/yakePrerequisitesVC.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/prerequisites/yakePrerequisitesVC.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -34,14 +34,14 @@ // Include platform specific configuration files #if (YAKE_PLATFORM == PLATFORM_WIN32) && (YAKE_COMPILER == COMPILER_MSVC) # if (YAKE_COMP_VER == 1310) -# pragma message("Yake platform/compiler config: yake.prerequisites.vc71") +# //pragma message("Yake platform/compiler config: yake.prerequisites.vc71") # include "yakePrerequisitesVC71Warnings.h" # include <wchar.h> # include <hash_map> # include <xhash> # include "yakePrerequisitesVC71Types.h" # elif(YAKE_COMP_VER == 1400) -# pragma message("Yake platform/compiler config: yake.prerequisites.vc8") +# //pragma message("Yake platform/compiler config: yake.prerequisites.vc8") # include "yakePrerequisitesVC8Warnings.h" # include <wchar.h> # include <hash_map> Modified: trunk/yake/yake/base/yake.h =================================================================== --- trunk/yake/yake/base/yake.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yake.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -75,6 +75,8 @@ #include "yakeTimer.h" +#include "native/yakeNative.h" + //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES //============================================================================ Modified: trunk/yake/yake/base/yakeException.h =================================================================== --- trunk/yake/yake/base/yakeException.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yakeException.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -34,9 +34,7 @@ // IMPLEMENTATION HEADERS //============================================================================ // Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include <yake/base/yakePrerequisites.h> -#endif +#include <yake/base/yakePrerequisites.h> // Yake #include <yake/base/mpl/yakeCast.h> #include <yake/base/yakeString.h> Modified: trunk/yake/yake/base/yakeLibrary.h =================================================================== --- trunk/yake/yake/base/yakeLibrary.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yakeLibrary.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -31,13 +31,11 @@ // IMPLEMENTATION HEADERS //============================================================================ // Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include "yakePrerequisites.h" -#endif +#include <yake/base/yakePrerequisites.h> // Yake -#include <yake/base/native/yakeNative.h> #include <yake/base/yakeString.h> #include <yake/base/yakeNoncopyable.h> +#include <yake/base/native/yakeNative.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES @@ -52,10 +50,13 @@ @remarks Throws Exception on failure. */ Library( const String& rFilename ); + /** Unloads the library. */ virtual ~Library(); - /** Returns pointer for the given symbol name. */ - void* getSymbol( const String& rFunction ); + /** Returns pointer for the given symbol name. + @remarks Throws Exception on failure. + */ + void* getSymbol( const String& rFunction ) const; private: native::LibraryHandle mHandle; Modified: trunk/yake/yake/base/yakeNoncopyable.h =================================================================== --- trunk/yake/yake/base/yakeNoncopyable.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yakeNoncopyable.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -27,6 +27,8 @@ #ifndef YAKE_BASE_NONCOPYABLE_H #define YAKE_BASE_NONCOPYABLE_H +#include <yake/base/yakePrerequisites.h> + namespace yake { /** Base class for non-copyable types. */ Modified: trunk/yake/yake/base/yakePCH.h =================================================================== --- trunk/yake/yake/base/yakePCH.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yakePCH.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -27,7 +27,7 @@ #ifndef YAKE_BASE_PCH_H #define YAKE_BASE_PCH_H -#include "yakePrerequisites.h" +#include <yake/base/yakePrerequisites.h> #include <yake/base/templates/yakeSmartAssert.h> #endif // YAKE_BASE_PCH_H Modified: trunk/yake/yake/base/yakeString.h =================================================================== --- trunk/yake/yake/base/yakeString.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/base/yakeString.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -31,9 +31,7 @@ // IMPLEMENTATION HEADERS //============================================================================ // Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include <yake/base/yakePrerequisites.h> -#endif +#include <yake/base/yakePrerequisites.h> #include <yake/base/templates/yakeVector.h> #include <yake/base/templates/yakeFastMap.h> Deleted: trunk/yake/yake/common/common/yakeCEGUIHelpers.h =================================================================== --- trunk/yake/yake/common/common/yakeCEGUIHelpers.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/common/common/yakeCEGUIHelpers.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -1,177 +0,0 @@ -#ifndef YAKE_CEGUI_HELPERS_H -#define YAKE_CEGUI_HELPERS_H - -#include <CEGUI/CEGUIInputEvent.h> - -namespace yake { - /** - * Convert Yake button id to corresponding CEGUI button id - * @param buttonID Yake button id - * @return CEGUI button id - */ - CEGUI::MouseButton convertYakeButtonToCegui( int buttonID ) - { - switch (buttonID) - { - case 0: - return CEGUI::LeftButton; - case 1: - return CEGUI::RightButton; - case 2: - return CEGUI::MiddleButton; - case 3: - return CEGUI::X1Button; - default: - return CEGUI::LeftButton; - } - } - - /** - * Get character corresponding to passed keycode. - * @param keyCode - * @param modifiers Shows if shift button was pressed - * @return Character - * @todo move this into yake::input - * @remarks Taken from the mighty OGRE3D :) - */ - char getKeyChar(int keyCode, long modifiers) - { - //HACK ripped from OgreInput - //TODO Ogre is rendering engine... should Yake input system contain this method? - using namespace yake::input; - - if (modifiers == 0) - { - switch (keyCode) - { - case KC_1: return '1'; - case KC_2: return '2'; - case KC_3: return '3'; - case KC_4: return '4'; - case KC_5: return '5'; - case KC_6: return '6'; - case KC_7: return '7'; - case KC_8: return '8'; - case KC_9: return '9'; - case KC_0: return '0'; - case KC_MINUS: return '-'; /* - on main keyboard */ - case KC_EQUALS: return '='; - case KC_Q: return 'q'; - case KC_W: return 'w'; - case KC_E: return 'e'; - case KC_R: return 'r'; - case KC_T: return 't'; - case KC_Y: return 'y'; - case KC_U: return 'u'; - case KC_I: return 'i'; - case KC_O: return 'o'; - case KC_P: return 'p'; - case KC_LBRACKET: return '['; - case KC_RBRACKET: return ']'; - case KC_A: return 'a'; - case KC_S: return 's'; - case KC_D: return 'd'; - case KC_F: return 'f'; - case KC_G: return 'g'; - case KC_H: return 'h'; - case KC_J: return 'j'; - case KC_K: return 'k'; - case KC_L: return 'l'; - case KC_SEMICOLON: return ';'; - case KC_APOSTROPHE: return '\''; - case KC_GRAVE: return '`'; /* accent grave */ - case KC_BACKSLASH: return '\\'; - case KC_Z: return 'z'; - case KC_X: return 'x'; - case KC_C: return 'c'; - case KC_V: return 'v'; - case KC_B: return 'b'; - case KC_N: return 'n'; - case KC_M: return 'm'; - case KC_COMMA: return ','; - case KC_PERIOD: return '.'; /* . on main keyboard */ - case KC_SLASH: return '/'; /* '/' on main keyboard */ - case KC_MULTIPLY: return '*'; /* * on numeric keypad */ - case KC_SPACE: return ' '; - case KC_NUMPAD7: return '7'; - case KC_NUMPAD8: return '8'; - case KC_NUMPAD9: return '9'; - case KC_SUBTRACT: return '-'; /* - on numeric keypad */ - case KC_NUMPAD4: return '4'; - case KC_NUMPAD5: return '5'; - case KC_NUMPAD6: return '6'; - case KC_ADD: return '+'; /* + on numeric keypad */ - case KC_NUMPAD1: return '1'; - case KC_NUMPAD2: return '2'; - case KC_NUMPAD3: return '3'; - case KC_NUMPAD0: return '0'; - case KC_DECIMAL: return '.'; /* . on numeric keypad */ - case KC_NUMPADEQUALS: return '='; /* = on numeric keypad (NEC PC98) */ - case KC_AT: return '@'; /* (NEC PC98) */ - case KC_COLON: return ':'; /* (NEC PC98) */ - case KC_UNDERLINE: return '_'; /* (NEC PC98) */ - case KC_NUMPADCOMMA: return ','; /* , on numeric keypad (NEC PC98) */ - case KC_DIVIDE: return '/'; /* / on numeric keypad */ - } - } - else //HACK if ( modifiers == InputEvent::SHIFT_MASK) - { - switch (keyCode) - { - case KC_1: return '!'; - case KC_2: return '@'; - case KC_3: return '#'; - case KC_4: return '$'; - case KC_5: return '%'; - case KC_6: return '^'; - case KC_7: return '&'; - case KC_8: return '*'; - case KC_9: return '('; - case KC_0: return ')'; - case KC_MINUS: return '_'; - case KC_EQUALS: return '+'; - case KC_Q: return 'Q'; - case KC_W: return 'W'; - case KC_E: return 'E'; - case KC_R: return 'R'; - case KC_T: return 'T'; - case KC_Y: return 'Y'; - case KC_U: return 'U'; - case KC_I: return 'I'; - case KC_O: return 'O'; - case KC_P: return 'P'; - case KC_LBRACKET: return '{'; - case KC_RBRACKET: return '}'; - case KC_A: return 'A'; - case KC_S: return 'S'; - case KC_D: return 'D'; - case KC_F: return 'F'; - case KC_G: return 'G'; - case KC_H: return 'H'; - case KC_J: return 'J'; - case KC_K: return 'K'; - case KC_L: return 'L'; - case KC_SEMICOLON: return ':'; - case KC_APOSTROPHE: return '"'; - case KC_GRAVE: return '~'; /* accent grave */ - case KC_BACKSLASH: return '|'; - case KC_Z: return 'Z'; - case KC_X: return 'X'; - case KC_C: return 'C'; - case KC_V: return 'V'; - case KC_B: return 'B'; - case KC_N: return 'N'; - case KC_M: return 'M'; - case KC_COMMA: return '<'; - case KC_PERIOD: return '>'; /* . on main keyboard */ - case KC_SLASH: return '?'; /* '/' on main keyboard */ - case KC_MULTIPLY: return '*'; /* * on numeric keypad */ - case KC_SPACE: return ' '; - } - } - return 0; - } - -} // namespace yake - -#endif Deleted: trunk/yake/yake/common/common/yakeCEGUIRendererAdapter.h =================================================================== --- trunk/yake/yake/common/common/yakeCEGUIRendererAdapter.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/common/common/yakeCEGUIRendererAdapter.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -1,47 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_CEGUIRENDERERADAPTER_H -#define YAKE_CEGUIRENDERERADAPTER_H - -namespace CEGUI { - class Renderer; -} - -namespace yake { -namespace ceguiadapter { - - class RendererAdapterPlugin : public base::Plugin - { - public: - virtual CEGUI::Renderer* getRenderer() = 0; - }; - -} -} - -#endif - Deleted: trunk/yake/yake/common/common/yakeCameraControllers.h =================================================================== --- trunk/yake/yake/common/common/yakeCameraControllers.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/common/common/yakeCameraControllers.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -1,180 +0,0 @@ -#ifndef YAKE_CAMERACONTROLLERS_H -#define YAKE_CAMERACONTROLLERS_H - -namespace yake { - - struct CameraControllerBase : public boost::noncopyable - { - void setCamera(graphics::ICamera*); - graphics::ICamera* getCamera() const; - - virtual void update(const real dt) = 0; - protected: - CameraControllerBase(); - private: - graphics::ICamera* mCam; - }; - CameraControllerBase::CameraControllerBase() : mCam(0) - { - } - void CameraControllerBase::setCamera(graphics::ICamera* cam) - { - mCam = cam; - } - graphics::ICamera* CameraControllerBase::getCamera() const - { - return mCam; - } - /** Can probably be used for first person, too. */ - class ThirdPersonCameraController : public CameraControllerBase - { - public: - ThirdPersonCameraController(); - - virtual void update(const real dt); - - void setTargetPosition( const Point3& ); - void setTargetOrientation( const Quaternion& ); - - /** relative to target object's orientation */ - void setOffsetFromTarget( const Vector3& ); - void setCurrentOffsetFromTarget( const Vector3& ); - const Vector3& getOffsetFromTarget() const; - - void setOffsetOrientation( const Quaternion& ); - void setCurrentOffsetOrientation( const Quaternion& ); - const Quaternion& getOffsetOrientation() const; - private: - Point3 mTargetPos; - Quaternion mTargetRot; - - Vector3 mOffsetFromTarget; - Vector3 mCurrentOffsetFromTarget; - - Quaternion mOffsetRot; - Quaternion mCurrentOffsetRot; - }; - ThirdPersonCameraController::ThirdPersonCameraController() - { - } - void ThirdPersonCameraController::setTargetPosition(const Point3& pt) - { - mTargetPos = pt; - } - void ThirdPersonCameraController::setTargetOrientation(const Quaternion& q) - { - mTargetRot = q; - } - void ThirdPersonCameraController::setOffsetFromTarget(const Vector3& offset) - { - mOffsetFromTarget = offset; - } - const Vector3& ThirdPersonCameraController::getOffsetFromTarget() const - { - return mOffsetFromTarget; - } - void ThirdPersonCameraController::setCurrentOffsetFromTarget(const Vector3& offset) - { - mOffsetFromTarget = offset; - } - void ThirdPersonCameraController::setOffsetOrientation(const Quaternion& offset) - { - mOffsetRot = offset; - } - const Quaternion& ThirdPersonCameraController::getOffsetOrientation() const - { - return mOffsetRot; - } - void ThirdPersonCameraController::setCurrentOffsetOrientation(const Quaternion& offset) - { - mCurrentOffsetRot = offset; - } - void ThirdPersonCameraController::update(const real dt) - { - graphics::ICamera* cam = this->getCamera(); - if (!cam) - return; - - // interpolate positional offset - //@todo make the first factor configurable [0.05 .. 1] - mCurrentOffsetFromTarget += real(0.5) * (mOffsetFromTarget - mCurrentOffsetFromTarget) * dt; - - // interpolate position - const Point3 targetCamPos = mTargetPos + mTargetRot * mCurrentOffsetFromTarget; - cam->translate( 0.5 * (targetCamPos - cam->getPosition()) ); //@todo make factor configurable - - // orientation - - // invert (rotate 180\xB0 around 'up' axis) - Quaternion camRot( 3.14, mTargetRot * Vector3::kUnitY/*up*/ ); - camRot = camRot * mTargetRot; - - // interpolate offset - mCurrentOffsetRot = Quaternion::Slerp( 0.5 * dt, mCurrentOffsetRot, mOffsetRot, true ); - - // apply offset - camRot = camRot * mCurrentOffsetRot; - - cam->setOrientation( camRot ); //@todo interpolate orientation - } - class TopDownCameraController : public CameraControllerBase - { - public: - TopDownCameraController(); - - virtual void update(const real dt); - - void setTarget( const Point3& ); - void setOffset( const Vector3& ); - Vector3 getOffset() const; - void setTargetOffset( const Vector3& ); - Vector3 getTargetOffset() const; - private: - Point3 mTargetPos; - Vector3 mCamOffset; - Vector3 mTargetOffset; - }; - /** @todo move into .inl file! */ - TopDownCameraController::TopDownCameraController() : - mTargetPos(Point3::kZero), - mCamOffset(Vector3(2,0,2)), - mTargetOffset(Vector3(2,0,2)) - { - } - void TopDownCameraController::setTarget( const Point3& pt ) - { - mTargetPos = pt; - } - void TopDownCameraController::setOffset( const Vector3& offset ) - { - mCamOffset = offset; - } - Vector3 TopDownCameraController::getOffset() const - { - return mCamOffset; - } - void TopDownCameraController::setTargetOffset( const Vector3& offset ) - { - mTargetOffset = offset; - } - Vector3 TopDownCameraController::getTargetOffset() const - { - return mTargetOffset; - } - void TopDownCameraController::update(const real dt) - { - graphics::ICamera* cam = this->getCamera(); - if (!cam) - return; - - mCamOffset += real(0.8) * (mTargetOffset - mCamOffset) * dt; //@todo make the first factor configurable [0.05 .. 1] - - const Point3 targetCamPos = mTargetPos + mCamOffset; - cam->translate( 0.5 * (targetCamPos - cam->getPosition()) ); - cam->lookAt( mTargetPos ); - } - -} // namespace yake - -#endif - Deleted: trunk/yake/yake/common/common/yakePawn.h =================================================================== --- trunk/yake/yake/common/common/yakePawn.h 2006-12-07 20:51:20 UTC (rev 1532) +++ trunk/yake/yake/common/common/yakePawn.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -1,60 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright \xA9 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAPP_MODEL_PAWN_H -#define YAPP_MODEL_PAWN_H - -namespace yake { -namespace model { - - /** Simple entity/actor that has a physical representation. - */ - class Pawn : public model::Actor - { - public: - Pawn(); - virtual ~Pawn(); - void setModel( model::complex::Model* pComplex ); - void setMovable( physics::IActor* pMovable ); - - //@{ name model::Actor interface - virtual void onSense(); - virtual void onThink(); - virtual void onAct(); - //@} - - void onPostPhysics(const real timeElapsed); - private: - void updateControllers( const real timeElapsed ); - private: - model::complex::Model* mComplex; - physics::IActor* mMovable; - }; - -} -} - -#endif \ No newline at end of file Copied: trunk/yake/yake/common/yakeCEGUIHelpers.h (from rev 1532, trunk/yake/yake/common/common/yakeCEGUIHelpers.h) =================================================================== --- trunk/yake/yake/common/yakeCEGUIHelpers.h (rev 0) +++ trunk/yake/yake/common/yakeCEGUIHelpers.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -0,0 +1,177 @@ +#ifndef YAKE_CEGUI_HELPERS_H +#define YAKE_CEGUI_HELPERS_H + +#include <CEGUIInputEvent.h> + +namespace yake { + /** + * Convert Yake button id to corresponding CEGUI button id + * @param buttonID Yake button id + * @return CEGUI button id + */ + CEGUI::MouseButton convertYakeButtonToCegui( int buttonID ) + { + switch (buttonID) + { + case 0: + return CEGUI::LeftButton; + case 1: + return CEGUI::RightButton; + case 2: + return CEGUI::MiddleButton; + case 3: + return CEGUI::X1Button; + default: + return CEGUI::LeftButton; + } + } + + /** + * Get character corresponding to passed keycode. + * @param keyCode + * @param modifiers Shows if shift button was pressed + * @return Character + * @todo move this into yake::input + * @remarks Taken from the mighty OGRE3D :) + */ + char getKeyChar(int keyCode, long modifiers) + { + //HACK ripped from OgreInput + //TODO Ogre is rendering engine... should Yake input system contain this method? + using namespace yake::input; + + if (modifiers == 0) + { + switch (keyCode) + { + case KC_1: return '1'; + case KC_2: return '2'; + case KC_3: return '3'; + case KC_4: return '4'; + case KC_5: return '5'; + case KC_6: return '6'; + case KC_7: return '7'; + case KC_8: return '8'; + case KC_9: return '9'; + case KC_0: return '0'; + case KC_MINUS: return '-'; /* - on main keyboard */ + case KC_EQUALS: return '='; + case KC_Q: return 'q'; + case KC_W: return 'w'; + case KC_E: return 'e'; + case KC_R: return 'r'; + case KC_T: return 't'; + case KC_Y: return 'y'; + case KC_U: return 'u'; + case KC_I: return 'i'; + case KC_O: return 'o'; + case KC_P: return 'p'; + case KC_LBRACKET: return '['; + case KC_RBRACKET: return ']'; + case KC_A: return 'a'; + case KC_S: return 's'; + case KC_D: return 'd'; + case KC_F: return 'f'; + case KC_G: return 'g'; + case KC_H: return 'h'; + case KC_J: return 'j'; + case KC_K: return 'k'; + case KC_L: return 'l'; + case KC_SEMICOLON: return ';'; + case KC_APOSTROPHE: return '\''; + case KC_GRAVE: return '`'; /* accent grave */ + case KC_BACKSLASH: return '\\'; + case KC_Z: return 'z'; + case KC_X: return 'x'; + case KC_C: return 'c'; + case KC_V: return 'v'; + case KC_B: return 'b'; + case KC_N: return 'n'; + case KC_M: return 'm'; + case KC_COMMA: return ','; + case KC_PERIOD: return '.'; /* . on main keyboard */ + case KC_SLASH: return '/'; /* '/' on main keyboard */ + case KC_MULTIPLY: return '*'; /* * on numeric keypad */ + case KC_SPACE: return ' '; + case KC_NUMPAD7: return '7'; + case KC_NUMPAD8: return '8'; + case KC_NUMPAD9: return '9'; + case KC_SUBTRACT: return '-'; /* - on numeric keypad */ + case KC_NUMPAD4: return '4'; + case KC_NUMPAD5: return '5'; + case KC_NUMPAD6: return '6'; + case KC_ADD: return '+'; /* + on numeric keypad */ + case KC_NUMPAD1: return '1'; + case KC_NUMPAD2: return '2'; + case KC_NUMPAD3: return '3'; + case KC_NUMPAD0: return '0'; + case KC_DECIMAL: return '.'; /* . on numeric keypad */ + case KC_NUMPADEQUALS: return '='; /* = on numeric keypad (NEC PC98) */ + case KC_AT: return '@'; /* (NEC PC98) */ + case KC_COLON: return ':'; /* (NEC PC98) */ + case KC_UNDERLINE: return '_'; /* (NEC PC98) */ + case KC_NUMPADCOMMA: return ','; /* , on numeric keypad (NEC PC98) */ + case KC_DIVIDE: return '/'; /* / on numeric keypad */ + } + } + else //HACK if ( modifiers == InputEvent::SHIFT_MASK) + { + switch (keyCode) + { + case KC_1: return '!'; + case KC_2: return '@'; + case KC_3: return '#'; + case KC_4: return '$'; + case KC_5: return '%'; + case KC_6: return '^'; + case KC_7: return '&'; + case KC_8: return '*'; + case KC_9: return '('; + case KC_0: return ')'; + case KC_MINUS: return '_'; + case KC_EQUALS: return '+'; + case KC_Q: return 'Q'; + case KC_W: return 'W'; + case KC_E: return 'E'; + case KC_R: return 'R'; + case KC_T: return 'T'; + case KC_Y: return 'Y'; + case KC_U: return 'U'; + case KC_I: return 'I'; + case KC_O: return 'O'; + case KC_P: return 'P'; + case KC_LBRACKET: return '{'; + case KC_RBRACKET: return '}'; + case KC_A: return 'A'; + case KC_S: return 'S'; + case KC_D: return 'D'; + case KC_F: return 'F'; + case KC_G: return 'G'; + case KC_H: return 'H'; + case KC_J: return 'J'; + case KC_K: return 'K'; + case KC_L: return 'L'; + case KC_SEMICOLON: return ':'; + case KC_APOSTROPHE: return '"'; + case KC_GRAVE: return '~'; /* accent grave */ + case KC_BACKSLASH: return '|'; + case KC_Z: return 'Z'; + case KC_X: return 'X'; + case KC_C: return 'C'; + case KC_V: return 'V'; + case KC_B: return 'B'; + case KC_N: return 'N'; + case KC_M: return 'M'; + case KC_COMMA: return '<'; + case KC_PERIOD: return '>'; /* . on main keyboard */ + case KC_SLASH: return '?'; /* '/' on main keyboard */ + case KC_MULTIPLY: return '*'; /* * on numeric keypad */ + case KC_SPACE: return ' '; + } + } + return 0; + } + +} // namespace yake + +#endif Copied: trunk/yake/yake/common/yakeCEGUIRendererAdapter.h (from rev 1532, trunk/yake/yake/common/common/yakeCEGUIRendererAdapter.h) =================================================================== --- trunk/yake/yake/common/yakeCEGUIRendererAdapter.h (rev 0) +++ trunk/yake/yake/common/yakeCEGUIRendererAdapter.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -0,0 +1,47 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_CEGUIRENDERERADAPTER_H +#define YAKE_CEGUIRENDERERADAPTER_H + +namespace CEGUI { + class Renderer; +} + +namespace yake { +namespace ceguiadapter { + + class RendererAdapterPlugin : public base::Plugin + { + public: + virtual CEGUI::Renderer* getRenderer() = 0; + }; + +} +} + +#endif + Copied: trunk/yake/yake/common/yakeCameraControllers.h (from rev 1532, trunk/yake/yake/common/common/yakeCameraControllers.h) =================================================================== --- trunk/yake/yake/common/yakeCameraControllers.h (rev 0) +++ trunk/yake/yake/common/yakeCameraControllers.h 2006-12-07 23:29:59 UTC (rev 1533) @@ -0,0 +1,180 @@ +#ifndef YAKE_CAMERACONTROLLERS_H +#define YAKE_CAMERACONTROLLERS_H + +namespace yake { + + struct CameraControllerBase : public boost::noncopyable + { + void setCamera(graphics::ICamera*); + graphics::ICamera* getCamera() const; + + virtual void update(const real dt) = 0; + protected: + CameraControllerBase(); + private: + graphics::ICamera* mCam; + }; + CameraControllerBase::CameraControllerBase() : mCam(0) + { + } + void CameraControllerBase::setCamera(graphics::ICamera* cam) + { + mCam = cam; + } + graphics::ICamera* CameraControllerBase::getCamera() const + { + return mCam; + } + /** Can probably be used for first person, too. */ + class ThirdPersonCameraController : public CameraControllerBase + { + public: + ThirdPersonCameraController(); + + virtual void update(const real dt); + + void setTargetPosition( const Point3& ); + void setTargetOrientation( const Quaternion& ); + + /** relative to target object's orientation */ + void setOffsetFromTarget( const Vector3& ); + void setCurrentOffsetFromTarget( const Vector3& ); + const Vector3& getOffsetFromTarget() const; + + void setOffsetOrientation( const Quaternion& ); + void setCurrentOffsetOrientation( const Quaternion& ); + const Quaternion& getOffsetOrientation() const; + private: + Point3 mTargetPos; + Quaternion mTargetRot; + + Vector3 mOffsetFromTarget; + Vector3 mCurrentOffsetFromTarget; + + Quater... [truncated message content] |
From: <psy...@us...> - 2006-12-07 23:40:26
|
Revision: 1534 http://svn.sourceforge.net/yake/?rev=1534&view=rev Author: psyclonist Date: 2006-12-07 15:40:25 -0800 (Thu, 07 Dec 2006) Log Message: ----------- updated build readme, updated build script generation Modified Paths: -------------- trunk/yake/BUILD trunk/yake/scripts/premake/yake.lua Modified: trunk/yake/BUILD =================================================================== --- trunk/yake/BUILD 2006-12-07 23:29:59 UTC (rev 1533) +++ trunk/yake/BUILD 2006-12-07 23:40:25 UTC (rev 1534) @@ -18,31 +18,32 @@ You can find it here: http://www.yake.org/wiki/ . +For help visit the Forums: http://www.yake.org/forum/ . +For reporting/tracking bugs visit http://bugs.yake.org/ . + + 1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS -------------------------------------------- -Last modified: 21/06/2006 by Stephan Kaiser (psy) +Last modified: 08/12/2006 by Stephan Kaiser (psy) -Please refer to the manual for detailed instructions. +* Install premake and put the premake.exe into /yake/scripts/premake. +* Change to /yake/scripts/premake -1.1 Building with Microsoft Visual C++ 2003/2005 (7.1/8.0) +1.1 Configuration ---------------------------------------------------------- -In essence, opening the workspace for Yake and starting -a complete 'Build' is what you want to do. +If you need to configure the build process you find the available +options in /yake/scripts/premake/config.lua. -You can find the workspaces for MSVC 2003 (7.1) and MSVC 2005 (8.0) -respectively here: +1.2 Building with Microsoft Visual C++ 2003/2005 (7.1/8.0) +---------------------------------------------------------- - /yake/scripts/msvc71/yake.sln - /yake/scripts/msvc8/yake.sln +* Run build_vs2005.cmd or build_vs2003.cmd + build solutions for MSVC 2005 or MSVC 2003. +* Open yake.sln in MSVC and start 'Build All' -The project files for the samples can be found here: - - /yake/scripts/msvc71/samples.sln - /yake/scripts/msvc8/samples.sln - For stable releases of Yake prebuilt dependencies packages are available. If you don't have or don't want to use the dependencies package @@ -50,12 +51,13 @@ See the file /yake/dependencies/DEPENDENCIES for more information. -1.2 Building with Code::Blocks +1.3 Building with Code::Blocks ------------------------------ The Code Blocks project files can be found in this directory: -/yake/scripts/cb/ +* Run build_cb.cmd +* Open resulting cb solution and build it from the IDE 2. BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2006-12-07 23:29:59 UTC (rev 1533) +++ trunk/yake/scripts/premake/yake.lua 2006-12-07 23:40:25 UTC (rev 1534) @@ -158,6 +158,7 @@ addDependency("physics") addDependency("model") addDependency("ent") +addDependency("scripting") addLibraryPath("dependencies/CEGUI/lib") addDependency("CEGUIBase","Release") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-12 22:02:20
|
Revision: 1538 http://svn.sourceforge.net/yake/?rev=1538&view=rev Author: psyclonist Date: 2006-12-12 14:02:15 -0800 (Tue, 12 Dec 2006) Log Message: ----------- updated include paths Modified Paths: -------------- trunk/yake/src/plugins/modelLua/pch.cpp trunk/yake/src/plugins/modelLua/yakeLuaBinder.cpp trunk/yake/yake/plugins/modelLua/pch.h Modified: trunk/yake/src/plugins/modelLua/pch.cpp =================================================================== --- trunk/yake/src/plugins/modelLua/pch.cpp 2006-12-12 22:01:09 UTC (rev 1537) +++ trunk/yake/src/plugins/modelLua/pch.cpp 2006-12-12 22:02:15 UTC (rev 1538) @@ -24,4 +24,4 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yapp/plugins/modelLua/pch.h> +#include <yake/plugins/modelLua/pch.h> Modified: trunk/yake/src/plugins/modelLua/yakeLuaBinder.cpp =================================================================== --- trunk/yake/src/plugins/modelLua/yakeLuaBinder.cpp 2006-12-12 22:01:09 UTC (rev 1537) +++ trunk/yake/src/plugins/modelLua/yakeLuaBinder.cpp 2006-12-12 22:02:15 UTC (rev 1538) @@ -18,8 +18,8 @@ http://www.gnu.org/copyleft/lesser.txt. ------------------------------------------------------------------------------------ */ -#include <yapp/plugins/modelLua/pch.h> -#include <yapp/plugins/modelLua/yakeLuaBinder.h> +#include <yake/plugins/modelLua/pch.h> +#include <yake/plugins/modelLua/yakeLuaBinder.h> #include <luabind/luabind.hpp> #include <yake/model/model.h> Modified: trunk/yake/yake/plugins/modelLua/pch.h =================================================================== --- trunk/yake/yake/plugins/modelLua/pch.h 2006-12-12 22:01:09 UTC (rev 1537) +++ trunk/yake/yake/plugins/modelLua/pch.h 2006-12-12 22:02:15 UTC (rev 1538) @@ -25,7 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/base/yake.h> -#include <yapp/base/yapp.h> +#include <yake/yappbase/yapp.h> #include <yake/scripting/yakeScriptingSystem.h> #include <yake/plugins/scriptingLua/ScriptingSystemLua.h> //#include <luabind/luabind.hpp> <= doesn't behave to well in a precompiled header! problems: objects in luabind namespace cannot be found! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-19 20:17:55
|
Revision: 1562 http://svn.sourceforge.net/yake/?rev=1562&view=rev Author: psyclonist Date: 2006-12-19 12:17:53 -0800 (Tue, 19 Dec 2006) Log Message: ----------- refacted logging interface, added sampleLog, removed deprecated code, added native::getCurrentThreadId() Modified Paths: -------------- trunk/yake/scripts/premake/samples.lua trunk/yake/src/base/yakeLog.cpp trunk/yake/yake/base/native/yakeNative.h trunk/yake/yake/base/prerequisites/yakePrerequisitesVC71Warnings.h trunk/yake/yake/base/prerequisites/yakePrerequisitesVC8Warnings.h trunk/yake/yake/base/yakeLog.h Added Paths: ----------- trunk/yake/samples/sampleLog/ trunk/yake/samples/sampleLog/demo.cpp trunk/yake/src/base/native/win32/yakeThreads.cpp Removed Paths: ------------- trunk/yake/src/base/yakeDebugLogAppender.cpp trunk/yake/yake/base/yakeDebugLogAppender.h Added: trunk/yake/samples/sampleLog/demo.cpp =================================================================== --- trunk/yake/samples/sampleLog/demo.cpp (rev 0) +++ trunk/yake/samples/sampleLog/demo.cpp 2006-12-19 20:17:53 UTC (rev 1562) @@ -0,0 +1,25 @@ +#include "yake/base/yake.h" + +using namespace yake; + +int main(int argc, char* argv[]) +{ + try + { + yake::logging::setProcessId("demo"); + YAKE_LOG_INFORMATION("aloha"); + YAKE_LOG_WARNING("aloha"); + yake::logging::log( yake::logging::S_ERROR, "Batman, help! ", 42 ); + } + catch (yake::Exception& ex) + { + std::cout << "Demo caught exception: \n" << ex.what(); + } +#if defined(YAKE_DEBUG) + { + std::cout << "\nPress ENTER...\n"; + std::cin.get(); + } +#endif +} + Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/scripts/premake/samples.lua 2006-12-19 20:17:53 UTC (rev 1562) @@ -33,6 +33,10 @@ -------------------------------------- -------------------------------------- +makeSample("sampleLog","samples/sampleLog") +useComponent("base") + +-------------------------------------- makeSample("sampleEntFsm","samples/ent/sampleEntFsm") useComponent("base") useComponent("scripting") Added: trunk/yake/src/base/native/win32/yakeThreads.cpp =================================================================== --- trunk/yake/src/base/native/win32/yakeThreads.cpp (rev 0) +++ trunk/yake/src/base/native/win32/yakeThreads.cpp 2006-12-19 20:17:53 UTC (rev 1562) @@ -0,0 +1,49 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ + +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// stl +#include <cassert> +#include <locale> +// yake +#include <yake/base/yakePCH.h> +#include <yake/base/native/win32/yakeConfig.h> +#include <yake/base/templates/yakeSmartAssert.h> +#include <yake/base/yakeException.h> + +namespace yake { +namespace native { + + threadid_t getCurrentThreadId() + { + return ::GetCurrentThreadId(); + } + +} // native +} // yake Deleted: trunk/yake/src/base/yakeDebugLogAppender.cpp =================================================================== --- trunk/yake/src/base/yakeDebugLogAppender.cpp 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/src/base/yakeDebugLogAppender.cpp 2006-12-19 20:17:53 UTC (rev 1562) @@ -1,55 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -#include <yake/base/yakePCH.h> -#include <yake/base/yakeDebugLogAppender.h> -#include <yake/base/native/yakeNative.h> - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace base -{ - void DebugLogAppender::onLog( const Log::Message& message ) - { - static native::DebugLog::Severity severityTranslationTable[] = - { - native::DebugLog::INFORMATIONS, - native::DebugLog::WARNINGS, - native::DebugLog::ERRORS - }; - - native::debug_Log( message.text.c_str(), severityTranslationTable[ message.severity ], message.source.c_str() ); - } -} // base -} // yake - Modified: trunk/yake/src/base/yakeLog.cpp =================================================================== --- trunk/yake/src/base/yakeLog.cpp 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/src/base/yakeLog.cpp 2006-12-19 20:17:53 UTC (rev 1562) @@ -24,64 +24,96 @@ source code distribution. ------------------------------------------------------------------------------------ */ -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ #include <yake/base/yakePCH.h> #include <yake/base/yakeLog.h> -#include <yake/base/yakeDebugLogAppender.h> -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace base -{ +namespace yake { +namespace logging { + void toStdErr(const severity_t sev, const char* procId, threadid_t threadId, const char* msg) + { + std::ostringstream ss; + ss << "[" << (procId ? procId : "") << "]"; -Log::Log() -{ -#ifdef YAKE_DEBUG_BUILD - mOnLog.connect( &DebugLogAppender::onLog ); -#endif -} + ss << "[thread:"; + ss << std::hex << threadId; + ss << "] "; -Log::~Log() -{ -} + ss << "["; + ss << toString(Severity(sev)); + if (sev >= S_LAST) + ss << "(" << severity_t(sev) << ")"; + ss << "]"; + ss << "\t" << msg << "\n"; -void Log::onLog( const OnLog::slot_type& rSlot ) -{ - mOnLog.connect( rSlot ); -} + std::cerr << ss.str(); + } -void Log::log( const String& rWhat, - Severity severity, - const String& rSource, - const String& rAdditionalInfo ) -{ - mOnLog( Message( rWhat, severity, rSource, rAdditionalInfo ) ); -} + const char* toString(const Severity sev) + { + static char* severity_names[S_LAST+1] = + { + "emergency", + "alert", + "critical", + "error", + "warning", + "notice", + "information", + "debug", + "custom" + }; + return (sev <= S_DEBUG) ? severity_names[sev] : severity_names[S_LAST]; + } + logger::scoped_lock::scoped_lock() : lck_(instance_.mtx_) + { + } + logger logger::instance_; + logger& logger::instance() + { + return instance_; + } + void logger::enableSeverity(const severity_t sev, const bool on) + { + scoped_lock lock; + instance().enabledSeverities_[ sev ] = on; + } + int logger::addTarget(const LogFn fn) + { + scoped_lock lock; + instance().targets_.push_back( fn ); + return 1; + } + void logger::log(const severity_t sev, const char *tid, const char *msg) + { + instance().doLog(sev, tid, msg); + } + void logger::doLog(const severity_t sev, const char *tid, const char *msg) + { + scoped_lock lock; -void log_information( const String& what, const String& source, const String& where ) -{ - Log::instance().log( what, Log::INFORMATIONS, source, where ); -} + EnableMap::const_iterator itEnabled = instance_.enabledSeverities_.find( sev ); + if (itEnabled != instance_.enabledSeverities_.end() && !itEnabled->second) + return; -void log_warning( const String& what, const String& source, const String& where ) -{ - Log::instance().log( what, Log::WARNINGS, source, where ); -} + TargetFnList::const_iterator itEnd = targets_.end(); + for (TargetFnList::const_iterator it = targets_.begin(); it != itEnd; ++it) + { + const threadid_t threadId = native::getCurrentThreadId(); + (**it)(sev,instance().procId_.c_str(),threadId,msg); + } + } + void logger::setProcessId(const String& pId) + { + scoped_lock lock; + instance().procId_ = pId; + } + logger::logger() + { + scoped_lock lock; + for (severity_t i=0; i<S_LAST; ++i) + enableSeverity( i, true ); + addTarget(&toStdErr); + } -void log_error( const String& what, const String& source, const String& where ) -{ - Log::instance().log( what, Log::ERRORS, source, where ); -} - -void log( const String& what ) -{ - Log::instance().log( what ); -} - -} // base +} // logging } // yake Modified: trunk/yake/yake/base/native/yakeNative.h =================================================================== --- trunk/yake/yake/base/native/yakeNative.h 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/yake/base/native/yakeNative.h 2006-12-19 20:17:53 UTC (rev 1562) @@ -34,6 +34,7 @@ //============================================================================ namespace yake { + typedef uint32 threadid_t; namespace native { // Library Interface. @@ -72,6 +73,8 @@ // Application Information Interface. YAKE_BASE_API const char* getApplicationDir(); + YAKE_BASE_API threadid_t getCurrentThreadId(); + } // native } // yake Modified: trunk/yake/yake/base/prerequisites/yakePrerequisitesVC71Warnings.h =================================================================== --- trunk/yake/yake/base/prerequisites/yakePrerequisitesVC71Warnings.h 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/yake/base/prerequisites/yakePrerequisitesVC71Warnings.h 2006-12-19 20:17:53 UTC (rev 1562) @@ -44,6 +44,9 @@ // A base class or structure must be declared with the __declspec(dllexport) keyword for a function in a derived class to be exported #pragma warning( disable : 4251 ) +// C4275: non dll-interface class 'X' used as base for dll-interface 'Y' +#pragma warning(disable: 4275) + // Turn off 'warning C4355: 'this' : used in base member initializer list' #pragma warning( disable : 4355 ) Modified: trunk/yake/yake/base/prerequisites/yakePrerequisitesVC8Warnings.h =================================================================== --- trunk/yake/yake/base/prerequisites/yakePrerequisitesVC8Warnings.h 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/yake/base/prerequisites/yakePrerequisitesVC8Warnings.h 2006-12-19 20:17:53 UTC (rev 1562) @@ -44,6 +44,9 @@ // A base class or structure must be declared with the __declspec(dllexport) keyword for a function in a derived class to be exported #pragma warning( disable : 4251 ) +// C4275: non dll-interface class 'X' used as base for dll-interface 'Y' +#pragma warning(disable: 4275) + // Turn off 'warning C4355: 'this' : used in base member initializer list' #pragma warning( disable : 4355 ) Deleted: trunk/yake/yake/base/yakeDebugLogAppender.h =================================================================== --- trunk/yake/yake/base/yakeDebugLogAppender.h 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/yake/base/yakeDebugLogAppender.h 2006-12-19 20:17:53 UTC (rev 1562) @@ -1,60 +0,0 @@ -/* - ------------------------------------------------------------------------------------ - This file is part of YAKE - Copyright 2004 The YAKE Team - For the latest information visit http://www.yake.org - ------------------------------------------------------------------------------------ - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 Temple - Place - Suite 330, Boston, MA 02111-1307, USA, or go to - http://www.gnu.org/copyleft/lesser.txt. - ------------------------------------------------------------------------------------ - If you are interested in another license model contact the Yake Team via - E-Mail: te...@ya.... - For more information see the LICENSE file in the root directory of the - source code distribution. - ------------------------------------------------------------------------------------ -*/ -#ifndef YAKE_BASE_DEBUGLOGTARGET_H -#define YAKE_BASE_DEBUGLOGTARGET_H - -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// Standard headers -#ifndef YAKE_BASE_PREREQUISITES_H -# include "yake/base/yakePrerequisites.h" -#endif -// Yake -#include <yake/base/yakeString.h> -#include <yake/base/yakeLog.h> - -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace base -{ - -class YAKE_BASE_API DebugLogAppender -{ -// Methods -public: - static void onLog( const Log::Message& ); -}; - -} // base -} // yake - -#endif // YAKE_BASE_DEBUGLOGTARGET_H - Modified: trunk/yake/yake/base/yakeLog.h =================================================================== --- trunk/yake/yake/base/yakeLog.h 2006-12-19 00:31:15 UTC (rev 1561) +++ trunk/yake/yake/base/yakeLog.h 2006-12-19 20:17:53 UTC (rev 1562) @@ -24,126 +24,152 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#ifndef YAKE_BASE_LOG_H -#define YAKE_BASE_LOG_H +#ifndef YAKE_LOGGING_LOG_H +#define YAKE_LOGGING_LOG_H -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ -// Standard headers #ifndef YAKE_BASE_PREREQUISITES_H # include "yake/base/yakePrerequisites.h" #endif -// Yake +#include <yake/base/yakeNoncopyable.h> #include <yake/base/yakeString.h> #include <yake/base/templates/yakeSingleton.h> -#include <yake/base/templates/yakeSignals.h> -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace base -{ +#include <yake/base/native/yakeNative.h> +#include <boost/thread/mutex.hpp> -class YAKE_BASE_API Log -{ -// Types -public: - enum Severity { INFORMATIONS, WARNINGS, ERRORS }; - - /** - * Class representing log message. - */ - struct Message +namespace yake { +namespace logging { + + // syslog inspired + enum Severity { - /// Log message text. - String text; - - /// Message severity. - Severity severity; - - /// Message source, like "kernel" or "module X". - String source; - - /// Any additional info, like "file foo.cpp, line 666". - String additionalInfo; - - Message( - const String& msgText, - Severity msgSeverity, - const String& msgSrc, - const String& msgInfo ): text( msgText ), - severity( msgSeverity ), - source( msgSrc ), - additionalInfo( msgInfo ) - { - } + S_EMERGENCY = 0, + S_ALERT, + S_CRITICAL, + S_ERROR, + S_WARNING, + S_NOTICE, + S_INFORMATION, + S_DEBUG, + S_LAST // Do not use directly. }; - - /// Log signal type. - typedef Signal3< void (const Message&) > OnLog; + typedef uint32 severity_t; -// Class -public: - Log(); - virtual ~Log(); + //helper: + YAKE_BASE_API const char* toString(const Severity sev); -// Methods -public: - /// Subscribe to log messages. - void onLog( const OnLog::slot_type& rSlot ); - - /// Log message. - void log( const String& rWhat, - Severity severity = INFORMATIONS, - const String& rSource = "yake", - const String& rAdditionalInfo = "" ); -//deprecated method: for rich typesafe formatting use boost::format library -//void logPrintf(char *fmt, ...); // todo: remove this <= Er.. no! + /** severity, processId, threadId, message */ + typedef void(*LogFn)(const severity_t, const char*, threadid_t, const char*); + struct YAKE_BASE_API logger : public boost::noncopyable + { + //YAKE_BUILD_PHOENIX_SINGLETON(logger) //public + private: //Make it private if PHOENIX is not used! + logger(); + static logger& instance(); + static logger instance_; + public: + static void log(const severity_t, const char* tid, const char* msg); + static void setProcessId(const String&); + static int addTarget(const LogFn); + static void enableSeverity(const severity_t, const bool); + private: + void doLog(const severity_t, const char* tid, const char* msg); + private: + String procId_; + typedef std::vector<LogFn> TargetFnList; + TargetFnList targets_; + typedef std::map<severity_t,bool> EnableMap; + EnableMap enabledSeverities_; + boost::mutex mtx_; + struct scoped_lock; + friend struct scoped_lock; + struct scoped_lock : public boost::noncopyable + { + scoped_lock(); + private: + boost::mutex::scoped_lock lck_; + }; + }; -// Data -private: - /// Log signal itself. - OnLog mOnLog; + //////////////// +#if defined(LOG_WITH_TYPE) +# define LOG_TYPE(X) typeid(X).name() << "(" << X << ")" +#else +# define LOG_TYPE(X) X +#endif - YAKE_BUILD_PHOENIX_SINGLETON(Log) -}; + template<typename T1> + inline void log(const severity_t sev, const T1& rhs) + { + std::stringstream ss; + ss << LOG_TYPE(rhs); + logger::log(sev, "[threadid]", ss.str().c_str()); + } + template<typename T1, typename T2> + inline void log(const severity_t sev, const T1& rhs1, const T2& rhs2) + { + std::stringstream ss; + ss << LOG_TYPE(rhs1); + ss << LOG_TYPE(rhs2); + logger::log(sev, "[threadid]", ss.str().c_str()); + } + template<typename T1, typename T2, typename T3> + inline void log(const severity_t sev, const T1& rhs1, const T2& rhs2, const T3& rhs3) + { + std::stringstream ss; + ss << LOG_TYPE(rhs1); + ss << LOG_TYPE(rhs2); + ss << LOG_TYPE(rhs3); + logger::log(sev, "[threadid]", ss.str().c_str()); + } -void YAKE_BASE_API log_information( const String& what, const String& source, const String& where ); -void YAKE_BASE_API log_warning( const String& what, const String& source, const String& where ); -void YAKE_BASE_API log_error( const String& what, const String& source, const String& where ); + // short cuts + inline void setProcessId(const String& procId) + { + logger::setProcessId(procId); + } + inline void enableSeverity(const severity_t sev, const bool on) + { + logger::enableSeverity(sev,on); + } + inline void addTarget(const LogFn fn) + { + logger::addTarget(fn); + } -// the simplest form of logging. Adds nothing to "what". -// Useful in scripts where you just want to log something without "where" -void YAKE_BASE_API log( const String& what ); - -// todo: printf sucks <= no it doesn't! <= IT DOES, use boost::format for -// typesafe string formatting - -// some preprocessor magic for __LINE__ stringification -// Unfortunately it doesn't produce correct results on VC7.1. -#define STRINGIFY(x) #x -#if YAKE_PLATFORM == PLATFORM_WIN32 - inline String TOSTRING2FN(int i) + // helper stream operators + inline std::ostream& operator << (std::ostream& out, const std::exception& rhs) { - std::stringstream ss; - ss << i; - return String( ss.str().c_str() ); + out << "std::exception('" << rhs.what() << "')"; + return out; } -# define TOSTRING(x) +::yake::base::TOSTRING2FN(x) -#else -# define TOSTRING(x) STRINGIFY (x) -#endif -#define YAKE_LOG_INFORMATION( what ) yake::base::log_information( what, "yake", "File: "__FILE__"@"TOSTRING(__LINE__) ); -#define YAKE_LOG_WARNING( what ) yake::base::log_warning( what, "yake", "File: "__FILE__"@"TOSTRING(__LINE__) ); -#define YAKE_LOG_ERROR( what ) yake::base::log_error( what, "yake", "File: "__FILE__"@"TOSTRING(__LINE__) ); -#define YAKE_LOG( what ) yake::base::log_information( what, "yake", "File: "__FILE__"@"TOSTRING(__LINE__) ); + ///////////////// + // Compatibility + // @todo remove in 0.7.x -} // base -} // yake + // some preprocessor magic for __LINE__ stringification + // Unfortunately it doesn't produce correct results on VC7.1. + #define STRINGIFY(x) #x + #if YAKE_PLATFORM == PLATFORM_WIN32 + inline String TOSTRING2FN(int i) + { + std::stringstream ss; + ss << i; + return String( ss.str().c_str() ); + } + # define TOSTRING(x) +::yake::logging::TOSTRING2FN(x) + #else + # define TOSTRING(x) STRINGIFY (x) + #endif -#endif // YAKE_BASE_LOG_H + #define YAKE_LOG_INFORMATION( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + #define YAKE_LOG_WARNING( what ) yake::logging::log( yake::logging::S_WARNING, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + #define YAKE_LOG_ERROR( what ) yake::logging::log( yake::logging::S_ERROR, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + #define YAKE_LOG( what ) yake::logging::log::log_information( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); +} // namespace logging +} // namespace yake + +#endif // YAKE_LOGGING_LOG_H + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-19 21:09:39
|
Revision: 1565 http://svn.sourceforge.net/yake/?rev=1565&view=rev Author: psyclonist Date: 2006-12-19 13:09:38 -0800 (Tue, 19 Dec 2006) Log Message: ----------- added sample "RafMinimal" to premake script, added missing includes, various interface improvements Modified Paths: -------------- trunk/yake/samples/raf/minimal/yakeDemo.cpp trunk/yake/samples/raf/minimal/yakePCH.cpp trunk/yake/samples/raf/minimal/yakePCH.h trunk/yake/scripts/premake/samples.lua trunk/yake/src/raf/yakeApplication.cpp trunk/yake/yake/base/yakeString.h trunk/yake/yake/ent/prerequisites.h trunk/yake/yake/input/yakeInputEventGenerator.h trunk/yake/yake/raf/yakeApplication.h Modified: trunk/yake/samples/raf/minimal/yakeDemo.cpp =================================================================== --- trunk/yake/samples/raf/minimal/yakeDemo.cpp 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/samples/raf/minimal/yakeDemo.cpp 2006-12-19 21:09:38 UTC (rev 1565) @@ -1,6 +1,6 @@ -#include <yapp/samples/raf/minimal/yakePCH.h> +#include <samples/raf/minimal/yakePCH.h> #include <yake/audio/yakeAudio.h> -#include <yapp/raf/yakeRaf.h> +#include <yake/raf/yakeRaf.h> using namespace yake; @@ -8,7 +8,7 @@ struct TheConfiguration : public raf::ApplicationConfiguration { virtual StringVector getLibraries() - { return MakeStringVector() << "scriptingLua"; } + { return MakeStringVector() << YAKE_LIB("scriptingLua"); } virtual StringVector getScriptingSystems() { return MakeStringVector() << "lua"; } Modified: trunk/yake/samples/raf/minimal/yakePCH.cpp =================================================================== --- trunk/yake/samples/raf/minimal/yakePCH.cpp 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/samples/raf/minimal/yakePCH.cpp 2006-12-19 21:09:38 UTC (rev 1565) @@ -1,2 +1,2 @@ -#include <yapp/samples/raf/minimal/yakePCH.h> +#include <samples/raf/minimal/yakePCH.h> Modified: trunk/yake/samples/raf/minimal/yakePCH.h =================================================================== --- trunk/yake/samples/raf/minimal/yakePCH.h 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/samples/raf/minimal/yakePCH.h 2006-12-19 21:09:38 UTC (rev 1565) @@ -6,4 +6,3 @@ // Yake #include <yake/base/yake.h> #include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/scripts/premake/samples.lua 2006-12-19 21:09:38 UTC (rev 1565) @@ -42,3 +42,8 @@ useComponent("scripting") useComponent("ent") useComponent("entLua") + +-------------------------------------- +makeSample("sampleRafMinimal","samples/raf/minimal") +useComponent("base") +useComponent("raf") Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/src/raf/yakeApplication.cpp 2006-12-19 21:09:38 UTC (rev 1565) @@ -98,11 +98,15 @@ } catch (yake::Exception& e) { - YAKE_LOG_ERROR("RAF catched a Yake exception!\nException Message: " + e.getMessage()); + YAKE_LOG_ERROR("RAF caught a Yake exception!\nException Message: " + e.getMessage()); } + catch (std::exception& e) + { + YAKE_LOG_ERROR(String("RAF caught a std::exception!\nException Message: ") + e.what()); + } catch (...) { - YAKE_LOG_ERROR("RAF catched an unhandled exception!"); + YAKE_LOG_ERROR("RAF caught an unhandled exception!"); } return false; } Modified: trunk/yake/yake/base/yakeString.h =================================================================== --- trunk/yake/yake/base/yakeString.h 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/yake/base/yakeString.h 2006-12-19 21:09:38 UTC (rev 1565) @@ -97,6 +97,11 @@ struct YAKE_BASE_API MakeStringVector { + MakeStringVector & operator<<(const String& str) + { + m_strings.push_back(str); + return *this; + } MakeStringVector & operator<<(const char * str) { if (str) Modified: trunk/yake/yake/ent/prerequisites.h =================================================================== --- trunk/yake/yake/ent/prerequisites.h 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/yake/ent/prerequisites.h 2006-12-19 21:09:38 UTC (rev 1565) @@ -31,6 +31,7 @@ #include "yake/statemachine/fsm_core.h" #include "yake/base/yakeTaggedListenerManager.h" #include "yake/base/templates/yakeVector.h" +#include <yake/base/templates/yakeSignals.h> #include "yake/object/yakeObjects.h" #if defined(YAKE_ENT_EXPORTS) Modified: trunk/yake/yake/input/yakeInputEventGenerator.h =================================================================== --- trunk/yake/yake/input/yakeInputEventGenerator.h 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/yake/input/yakeInputEventGenerator.h 2006-12-19 21:09:38 UTC (rev 1565) @@ -30,6 +30,7 @@ #ifndef YAKE_INPUT_PREREQUISITES_H #include <yake/input/yakePrerequisites.h> #endif +#include <yake/base/templates/yakeSignals.h> namespace yake { namespace input { Modified: trunk/yake/yake/raf/yakeApplication.h =================================================================== --- trunk/yake/yake/raf/yakeApplication.h 2006-12-19 20:27:35 UTC (rev 1564) +++ trunk/yake/yake/raf/yakeApplication.h 2006-12-19 21:09:38 UTC (rev 1565) @@ -27,6 +27,15 @@ #ifndef YAKE_RAF_APPLICATION_H #define YAKE_RAF_APPLICATION_H +// Define YAKE_LIB() to be used by Configuration objects. +#if defined(YAKE_DEBUG) +# define YAKE_LIB_SUFFIX "_d" +#else +# define YAKE_LIB_SUFFIX "" +#endif +#define YAKE_LIB(NAME) String(String("yake_")+NAME+YAKE_LIB_SUFFIX) + + namespace yake { namespace audio { class IAudioSystem; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-19 21:29:34
|
Revision: 1566 http://svn.sourceforge.net/yake/?rev=1566&view=rev Author: psyclonist Date: 2006-12-19 13:29:33 -0800 (Tue, 19 Dec 2006) Log Message: ----------- added another sample to premake script Modified Paths: -------------- trunk/yake/samples/raf/demo1/yakeDemo.cpp trunk/yake/samples/raf/demo1/yakePCH.cpp trunk/yake/samples/raf/demo1/yakePCH.h trunk/yake/scripts/premake/samples.lua Modified: trunk/yake/samples/raf/demo1/yakeDemo.cpp =================================================================== --- trunk/yake/samples/raf/demo1/yakeDemo.cpp 2006-12-19 21:09:38 UTC (rev 1565) +++ trunk/yake/samples/raf/demo1/yakeDemo.cpp 2006-12-19 21:29:33 UTC (rev 1566) @@ -1,7 +1,7 @@ -#include <yapp/samples/raf/demo1/yakePCH.h> +#include <samples/raf/demo1/yakePCH.h> #include <yake/audio/yakeAudio.h> #include <yake/input/yakeInput.h> -#include <yapp/raf/yakeRaf.h> +#include <yake/raf/yakeRaf.h> using namespace yake; @@ -9,7 +9,7 @@ struct TheConfiguration : public raf::ApplicationConfiguration { virtual StringVector getLibraries() - { return MakeStringVector() << "scriptingLua" << "graphicsOgre" << "inputOgre"; } + { return MakeStringVector() << YAKE_LIB("scriptingLua") << YAKE_LIB("graphicsOgre") << YAKE_LIB("inputOgre"); } virtual StringVector getInputSystems() { return MakeStringVector() << "ogre"; } Modified: trunk/yake/samples/raf/demo1/yakePCH.cpp =================================================================== --- trunk/yake/samples/raf/demo1/yakePCH.cpp 2006-12-19 21:09:38 UTC (rev 1565) +++ trunk/yake/samples/raf/demo1/yakePCH.cpp 2006-12-19 21:29:33 UTC (rev 1566) @@ -1 +1 @@ -#include <yapp/samples/raf/demo1/yakePCH.h> +#include <samples/raf/demo1/yakePCH.h> Modified: trunk/yake/samples/raf/demo1/yakePCH.h =================================================================== --- trunk/yake/samples/raf/demo1/yakePCH.h 2006-12-19 21:09:38 UTC (rev 1565) +++ trunk/yake/samples/raf/demo1/yakePCH.h 2006-12-19 21:29:33 UTC (rev 1566) @@ -6,4 +6,3 @@ // Yake #include <yake/base/yake.h> #include <yake/scripting/yakeScriptingSystem.h> -#include <yapp/base/yapp.h> Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2006-12-19 21:09:38 UTC (rev 1565) +++ trunk/yake/scripts/premake/samples.lua 2006-12-19 21:29:33 UTC (rev 1566) @@ -47,3 +47,8 @@ makeSample("sampleRafMinimal","samples/raf/minimal") useComponent("base") useComponent("raf") + +-------------------------------------- +makeSample("sampleRafDemo1","samples/raf/demo1") +useComponent("base") +useComponent("raf") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2006-12-20 21:50:33
|
Revision: 1567 http://svn.sourceforge.net/yake/?rev=1567&view=rev Author: psyclonist Date: 2006-12-20 13:50:25 -0800 (Wed, 20 Dec 2006) Log Message: ----------- fixed includes, updated logging demo, demo binaries are now built into samples/bin/[debug|release|release_sym], fixed debug output printing (now restores console settings on win32) Modified Paths: -------------- trunk/yake/samples/sampleLog/demo.cpp trunk/yake/scripts/premake/copy_bin_to_samples.cmd trunk/yake/scripts/premake/tools.lua trunk/yake/src/base/native/win32/yakeDebug.cpp trunk/yake/src/base/yakeLog.cpp trunk/yake/yake/base/native/yakeNative.h trunk/yake/yake/base/yakeLog.h Added Paths: ----------- trunk/yake/yake/base/native/yakeThreads.h Modified: trunk/yake/samples/sampleLog/demo.cpp =================================================================== --- trunk/yake/samples/sampleLog/demo.cpp 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/samples/sampleLog/demo.cpp 2006-12-20 21:50:25 UTC (rev 1567) @@ -10,6 +10,7 @@ YAKE_LOG_INFORMATION("aloha"); YAKE_LOG_WARNING("aloha"); yake::logging::log( yake::logging::S_ERROR, "Batman, help! ", 42 ); + yake::logging::log( 99, "custom severity" ); } catch (yake::Exception& ex) { Modified: trunk/yake/scripts/premake/copy_bin_to_samples.cmd =================================================================== --- trunk/yake/scripts/premake/copy_bin_to_samples.cmd 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/scripts/premake/copy_bin_to_samples.cmd 2006-12-20 21:50:25 UTC (rev 1567) @@ -1,4 +1,3 @@ @echo off -xcopy /y ..\..\common\bin\*.dll ..\..\samples\bin\ xcopy /y ..\..\common\bin\*_d.dll ..\..\samples\bin\debug\ pause Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/scripts/premake/tools.lua 2006-12-20 21:50:25 UTC (rev 1567) @@ -260,19 +260,19 @@ package.config.ReleaseLib = nil debug = package.config.Debug - debug.target = name.."_d"..(EXEFILE_SUFFIX) + debug.target = rootdir.."samples/bin/debug/"..name.."_d"..(EXEFILE_SUFFIX) debug.defines = {"_DEBUG"} debug.buildflags = {} releaseWithSym = package.config.ReleaseWithSymbols - releaseWithSym.target = name.."_sym"..(EXEFILE_SUFFIX) + releaseWithSym.target = rootdir.."samples/bin/release_sym/"..name.."_sym"..(EXEFILE_SUFFIX) releaseWithSym.defines = {} releaseWithSym.buildflags = { "optimize-speed" } release = package.config.Release - release.target = name..(EXEFILE_SUFFIX) + release.target = rootdir.."samples/bin/release/"..name..(EXEFILE_SUFFIX) release.defines = {} release.buildflags = { "no-symbols", Modified: trunk/yake/src/base/native/win32/yakeDebug.cpp =================================================================== --- trunk/yake/src/base/native/win32/yakeDebug.cpp 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/src/base/native/win32/yakeDebug.cpp 2006-12-20 21:50:25 UTC (rev 1567) @@ -153,21 +153,33 @@ static bool consoleApp_; } logConsole_g; -void debug_Log( const char * what, DebugLog::Severity eSeverity, const char * source ) +void debug_Log( const std::string& what, logging::severity_t sev ) { - static char szBuffer[ 1024 ]; + if (what.empty()) + return; + // save settings + HANDLE outHandle = GetStdHandle( STD_ERROR_HANDLE ); + CONSOLE_SCREEN_BUFFER_INFO csbiInfo; + ::GetConsoleScreenBufferInfo( outHandle, &csbiInfo ); - WORD wColor = ( WORD )( eSeverity == DebugLog::INFORMATIONS ? FOREGROUND_GREEN : - ( eSeverity == DebugLog::WARNINGS ? FOREGROUND_GREEN | FOREGROUND_RED : FOREGROUND_RED ) ); - wColor |= FOREGROUND_INTENSITY; - - if( *source ) - sprintf( szBuffer, "%s: %s", source, what ); + // print + WORD wAttributes = FOREGROUND_INTENSITY; + if (sev <= logging::S_ERROR) + wAttributes |= FOREGROUND_RED; // red + else if (sev <= logging::S_WARNING) + wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow + else if (sev < logging::S_LAST) + wAttributes |= FOREGROUND_GREEN; // green else - sprintf( szBuffer, "%s", what ); + wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow + ::SetConsoleTextAttribute( outHandle, wAttributes ); + DWORD dwWritten = 0; - logConsole_g.Print( szBuffer, wColor ); - logConsole_g.Print( "\n", FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED ); + ::BOOL bSuccess = WriteConsoleA( outHandle, what.c_str(), ( DWORD )what.length(), &dwWritten, 0 ); + assert( bSuccess ); + + // restore settings + ::SetConsoleTextAttribute( outHandle, csbiInfo.wAttributes ); } void debug_Print( const char * string ) Modified: trunk/yake/src/base/yakeLog.cpp =================================================================== --- trunk/yake/src/base/yakeLog.cpp 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/src/base/yakeLog.cpp 2006-12-20 21:50:25 UTC (rev 1567) @@ -26,6 +26,8 @@ */ #include <yake/base/yakePCH.h> #include <yake/base/yakeLog.h> +#include <yake/base/native/yakeNative.h> +#include <boost/lexical_cast.hpp> namespace yake { namespace logging { @@ -41,11 +43,15 @@ ss << "["; ss << toString(Severity(sev)); if (sev >= S_LAST) - ss << "(" << severity_t(sev) << ")"; + { + ss << "("; + ss << boost::lexical_cast<std::string>(sev); + ss << ")"; + } ss << "]"; ss << "\t" << msg << "\n"; - std::cerr << ss.str(); + native::debug_Log( ss.str(), sev ); } const char* toString(const Severity sev) @@ -95,10 +101,10 @@ if (itEnabled != instance_.enabledSeverities_.end() && !itEnabled->second) return; + const threadid_t threadId = native::getCurrentThreadId(); TargetFnList::const_iterator itEnd = targets_.end(); for (TargetFnList::const_iterator it = targets_.begin(); it != itEnd; ++it) { - const threadid_t threadId = native::getCurrentThreadId(); (**it)(sev,instance().procId_.c_str(),threadId,msg); } } Modified: trunk/yake/yake/base/native/yakeNative.h =================================================================== --- trunk/yake/yake/base/native/yakeNative.h 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/yake/base/native/yakeNative.h 2006-12-20 21:50:25 UTC (rev 1567) @@ -30,11 +30,12 @@ //============================================================================ #include <yake/base/yakePrerequisites.h> #include <yake/base/yakeProcessor.h> +#include <yake/base/native/yakeThreads.h> +#include <yake/base/yakeLog.h> //============================================================================ namespace yake { - typedef uint32 threadid_t; namespace native { // Library Interface. @@ -44,17 +45,8 @@ YAKE_BASE_API void library_Free(LibraryHandle); // Debugging Interface. - struct DebugLog - { - enum Severity - { - INFORMATIONS, - WARNINGS, - ERRORS - }; - }; YAKE_BASE_API bool debug_AssertFailed( const char* pszMessage, const char* pszCondition, const char* pszFile, int nLine, bool& rbIgnoreAlways ); - YAKE_BASE_API void debug_Log( const char* what, DebugLog::Severity, const char* source ); + YAKE_BASE_API void debug_Log( const std::string& what, logging::severity_t ); YAKE_BASE_API void debug_Print( const char* string ); // Critical Section Interface. @@ -73,8 +65,6 @@ // Application Information Interface. YAKE_BASE_API const char* getApplicationDir(); - YAKE_BASE_API threadid_t getCurrentThreadId(); - } // native } // yake Added: trunk/yake/yake/base/native/yakeThreads.h =================================================================== --- trunk/yake/yake/base/native/yakeThreads.h (rev 0) +++ trunk/yake/yake/base/native/yakeThreads.h 2006-12-20 21:50:25 UTC (rev 1567) @@ -0,0 +1,44 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright \xA9 2004 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 59 Temple + Place - Suite 330, Boston, MA 02111-1307, USA, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_BASE_NATIVE_THREADS_H +#define YAKE_BASE_NATIVE_THREADS_H + +//============================================================================ +#include <yake/base/yakePrerequisites.h> + +//============================================================================ +namespace yake { + typedef uint32 threadid_t; +namespace native { + + YAKE_BASE_API threadid_t getCurrentThreadId(); + +} // native +} // yake + +#endif // YAKE_BASE_NATIVE_THREADS_H + Modified: trunk/yake/yake/base/yakeLog.h =================================================================== --- trunk/yake/yake/base/yakeLog.h 2006-12-19 21:29:33 UTC (rev 1566) +++ trunk/yake/yake/base/yakeLog.h 2006-12-20 21:50:25 UTC (rev 1567) @@ -34,7 +34,7 @@ #include <yake/base/yakeString.h> #include <yake/base/templates/yakeSingleton.h> -#include <yake/base/native/yakeNative.h> +#include <yake/base/native/yakeThreads.h> #include <boost/thread/mutex.hpp> namespace yake { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-03 21:31:07
|
Revision: 1570 http://svn.sourceforge.net/yake/?rev=1570&view=rev Author: psyclonist Date: 2007-01-03 13:31:06 -0800 (Wed, 03 Jan 2007) Log Message: ----------- various linux compatiblity fixes Modified Paths: -------------- trunk/yake/buildspec.xml trunk/yake/src/net/detail/netCommon.cpp trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp trunk/yake/src/plugins/physicsODE/OdeActor.cpp trunk/yake/src/raf/yakeApplication.cpp trunk/yake/yake/base/templates/yakeVector.h trunk/yake/yake/base/yakeLog.h trunk/yake/yake/msg/listener_mgr.h trunk/yake/yake/netsvc/netServiceHost.h trunk/yake/yake/object/ObjectManager.inl Modified: trunk/yake/buildspec.xml =================================================================== --- trunk/yake/buildspec.xml 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/buildspec.xml 2007-01-03 21:31:06 UTC (rev 1570) @@ -8,7 +8,6 @@ <include>dependencies</include> <include>.</include> - <include>dependencies/ttl</include> <include>dependencies/OGRE</include> <include>dependencies/PLSM</include> <include>dependencies/ode/include</include> @@ -103,14 +102,14 @@ > <libadd>yakeBase</libadd> </BuildSharedLibrary> - +<!--@todo yakeNet <BuildSharedLibrary name="yakeNet" src="src/yake/net" > <libadd>yakeBase</libadd> </BuildSharedLibrary> - +--> <BuildSharedLibrary name="yakeLoader" src="src/yake/loader" @@ -192,7 +191,7 @@ <libadd>openalpp</libadd> <libadd>yakeAudio</libadd> </BuildSharedLibrary> ---> + <BuildSharedLibrary name="yakegraphicsOgre" src="src/yake/plugins/graphicsOgre" @@ -208,7 +207,7 @@ <libadd>yakeInput</libadd> <libadd>OgreMain</libadd> </BuildSharedLibrary> - +--> <BuildSharedLibrary name="yakephysicsODE" src="src/yake/plugins/physicsODE" @@ -216,7 +215,7 @@ <libadd>yakePhysics</libadd> <libadd>ode</libadd> </BuildSharedLibrary> - +<!-- <BuildSharedLibrary name="yakescriptingLua" src="src/yake/plugins/scriptingLua" @@ -225,7 +224,7 @@ <libadd>luabind</libadd> <libadd>lua</libadd> </BuildSharedLibrary> - +--> <!-- TODO Rename this thing? --> <BuildSharedLibrary name="yakescriptingBindingsLua" @@ -236,6 +235,7 @@ <libadd>lua</libadd> </BuildSharedLibrary> + <!--@todo reenable. it just took so long to compile/link ... <BuildSharedLibrary name="yakegraphicsLuaBindings" src="src/yake/plugins/graphicsLuaBindings" @@ -244,6 +244,7 @@ <libadd>luabind</libadd> <libadd>lua</libadd> </BuildSharedLibrary> + --> <BuildSharedLibrary name="yakebaseLuaBindings" @@ -254,38 +255,26 @@ <libadd>lua</libadd> </BuildSharedLibrary> -<!-- - ********************************************* - * YAPP * - ********************************************* ---> <BuildSharedLibrary - name="yappEvents" - src="src/yapp/base/event" - /> - - <BuildSharedLibrary name="yappBase" src="src/yapp/base" > <libadd>yakeBase</libadd> - <libadd>yappEvents</libadd> </BuildSharedLibrary> -<!-- <BuildSharedLibrary - name="yappLoader" - src="src/yapp/loader" + name="yakeLoader" + src="src/yake/loader" > <libadd>yappBase</libadd> </BuildSharedLibrary> <BuildSharedLibrary - name="yappModel" - src="src/yapp/model" + name="yakeModel" + src="src/yake/model" > - <libadd>yappBase</libadd> - <libadd>yappLoader</libadd> + <libadd>yakeBase</libadd> + <libadd>yakeLoader</libadd> </BuildSharedLibrary> --> @@ -296,14 +285,6 @@ <libadd>yappBase</libadd> </BuildSharedLibrary> - <!--<BuildSharedLibrary - name="yappEnt" - src="src/yapp/ent" - > - <libadd>yappBase</libadd> - <libadd>yappMsg</libadd> - </BuildSharedLibrary> - --> <BuildSharedLibrary name="yappVehicle" src="src/yapp/vehicle" @@ -317,11 +298,12 @@ src="src/yapp/raf" > <libadd>yappBase</libadd> + <!-- <libadd>yakeCEGUIOgreAdapter</libadd> <libadd>CEGUIOgreRenderer</libadd> + --> </BuildSharedLibrary> - - +<!-- <BuildSharedLibrary name="yakeCEGUIOgreAdapter" src="src/yapp/plugins/ceguiOgreRendererAdapter" @@ -329,7 +311,7 @@ <libadd>CEGUIBase</libadd> <libadd>OgreMain</libadd> </BuildSharedLibrary> - +--> <!--<BuildSharedLibrary name="yappEntLua" src="src/yapp/plugins/entLua" @@ -344,16 +326,15 @@ <libadd>luabind</libadd> </BuildSharedLibrary> --> - +<!-- <BuildSharedLibrary name="yappTerrainPhysicsManager" src="src/yapp/plugins/terrainPhysMgr" > <libadd>PagingLandscape</libadd> </BuildSharedLibrary> - +--> <!-- SAMPLES --> - <List name="common_libs"> <item>yakeBase</item> <item>yakeAudio</item> @@ -371,13 +352,14 @@ <libadd>common_libs</libadd> </BuildProgram> +<!-- <BuildProgram name="GraphicsDemo" src="src/yake/samples/graphics/demo" > <libadd>common_libs</libadd> </BuildProgram> - +--> <!-- <BuildProgram name="DotSceneGraphicsDemo" Modified: trunk/yake/src/net/detail/netCommon.cpp =================================================================== --- trunk/yake/src/net/detail/netCommon.cpp 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/src/net/detail/netCommon.cpp 2007-01-03 21:31:06 UTC (rev 1570) @@ -4,28 +4,33 @@ #include <yake/base/native/yakeNative.h> #include <boost/lexical_cast.hpp> -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows XP or later. -#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif +#if YAKE_PLATFORM == PLATFORM_WIN32 -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. -#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif + // Modify the following defines if you have to target a platform prior to the ones specified below. + // Refer to MSDN for the latest info on corresponding values for different platforms. + #ifndef WINVER // Allow use of features specific to Windows XP or later. + #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. + #endif -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -#endif + #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. + #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. + #endif -#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. -#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. + #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. + #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. + #endif + + #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. + #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. + #endif + + #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + // Windows Header Files: + #include <windows.h> +#elif YAKE_PLATFORM == PLATFORM_LINUX + #include <unistd.h> #endif -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: -#include <windows.h> - namespace yake { namespace net { @@ -64,7 +69,13 @@ namespace native { void sleep(const uint32 ms) { +#if YAKE_PLATFORM == PLATFORM_WIN32 ::Sleep(ms); +#elif YAKE_PLATFORM == PLATFORM_LINUX + ::usleep(ms); +#else + #error("No nativ sleep() configured!") +#endif } } // namespace native Modified: trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp =================================================================== --- trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp 2007-01-03 21:31:06 UTC (rev 1570) @@ -225,7 +225,7 @@ // timeouts { const double currT = m_timer.getTime(); - const double deltaT = max(currT - m_timeOfLastUpdate, 0.0001); + const double deltaT = std::max(currT - m_timeOfLastUpdate, 0.0001); NET_ASSERT( deltaT > 0. )(deltaT); PeerToClientMap::iterator itEnd = m_clients.end(); PeerToClientMap::iterator it = m_clients.begin(); Modified: trunk/yake/src/plugins/physicsODE/OdeActor.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeActor.cpp 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/src/plugins/physicsODE/OdeActor.cpp 2007-01-03 21:31:06 UTC (rev 1570) @@ -274,7 +274,7 @@ //----------------------------------------------------- void OdeActor::destroyShape( IShape* pShape ) { - OdeGeom* pGeom = checked_cast<OdeGeom*>( pShape ); + OdeGeom* pGeom = checked_cast<OdeGeom*,IShape>( pShape ); ShapeList::iterator victim = std::find( mShapes.begin(), mShapes.end(), pGeom ); YAKE_ASSERT( victim != mShapes.end()).error("This shape is'nt in the list!"); Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/src/raf/yakeApplication.cpp 2007-01-03 21:31:06 UTC (rev 1570) @@ -39,7 +39,6 @@ //# pragma comment(lib,"CEGUIBase.lib") #endif #endif -#include <OgreNoMemoryMacros.h> namespace yake { namespace raf { Modified: trunk/yake/yake/base/templates/yakeVector.h =================================================================== --- trunk/yake/yake/base/templates/yakeVector.h 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/yake/base/templates/yakeVector.h 2007-01-03 21:31:06 UTC (rev 1570) @@ -309,8 +309,10 @@ //out << "<" << typeid(_Value).name() << ">"; out << "[" << int(rhs.size()) << "]"; out << "("; - typedef Vector<_Value,_Alloc> ctr_type; - for (ctr_type::const_iterator it = rhs.begin(); it != rhs.end(); ++it) + typedef Vector<_Value,_Alloc> ctr_t; + typedef typename ctr_t::const_iterator iter_t; + iter_t itEnd = rhs.end(); + for (iter_t it = rhs.begin(); it != itEnd; ++it) { if (it != rhs.begin()) out << ", "; Modified: trunk/yake/yake/base/yakeLog.h =================================================================== --- trunk/yake/yake/base/yakeLog.h 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/yake/base/yakeLog.h 2007-01-03 21:31:06 UTC (rev 1570) @@ -163,10 +163,10 @@ # define TOSTRING(x) STRINGIFY (x) #endif - #define YAKE_LOG_INFORMATION( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG_WARNING( what ) yake::logging::log( yake::logging::S_WARNING, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG_ERROR( what ) yake::logging::log( yake::logging::S_ERROR, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + #define YAKE_LOG_INFORMATION( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); + #define YAKE_LOG_WARNING( what ) yake::logging::log( yake::logging::S_WARNING, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); + #define YAKE_LOG_ERROR( what ) yake::logging::log( yake::logging::S_ERROR, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); + #define YAKE_LOG( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); } // namespace logging } // namespace yake Modified: trunk/yake/yake/msg/listener_mgr.h =================================================================== --- trunk/yake/yake/msg/listener_mgr.h 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/yake/msg/listener_mgr.h 2007-01-03 21:31:06 UTC (rev 1570) @@ -202,7 +202,7 @@ } // source // process - for(listener_list::iterator itListener = listenerCache.begin(); itListener != listenerCache.end(); ++itListener) + for(typename listener_list::iterator itListener = listenerCache.begin(); itListener != listenerCache.end(); ++itListener) { (*itListener)->execute(*msg); } Modified: trunk/yake/yake/netsvc/netServiceHost.h =================================================================== --- trunk/yake/yake/netsvc/netServiceHost.h 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/yake/netsvc/netServiceHost.h 2007-01-03 21:31:06 UTC (rev 1570) @@ -3,7 +3,8 @@ #include <boost/thread/mutex.hpp> #include <yake/netsvc/netPrerequisites.h> -#include <yake/netsvc/netService.h> +#include <yake/netsvc/netService.h> +#include <yake/base/templates/yakeSignals.h> #pragma warning(push) #pragma warning(disable: 4275) // C4275: non dll-interface class 'X' used as base for dll-interface 'Y' Modified: trunk/yake/yake/object/ObjectManager.inl =================================================================== --- trunk/yake/yake/object/ObjectManager.inl 2007-01-03 21:29:28 UTC (rev 1569) +++ trunk/yake/yake/object/ObjectManager.inl 2007-01-03 21:31:06 UTC (rev 1570) @@ -156,7 +156,7 @@ // check for existing alias assert( !util::map_contains(strIdAliases_,aliasName) ); - StringToClassIdMap::const_iterator itFindAlias = strIdAliases_.find( aliasName ); + typename StringToClassIdMap::const_iterator itFindAlias = strIdAliases_.find( aliasName ); if (itFindAlias != strIdAliases_.end()) { // Alias is already registered but with the same ClassId. => Return success. @@ -206,7 +206,7 @@ template<typename obj_type, typename objectid_type> obj_type* ObjectManager<obj_type,objectid_type>::getObject(const ObjectId id) const { - IdObjMap::const_iterator it = objs_.find( id ); + typename IdObjMap::const_iterator it = objs_.find( id ); return ( it == objs_.end() ? 0 : it->second ); } template<typename obj_type, typename objectid_type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-03 22:34:14
|
Revision: 1572 http://svn.sourceforge.net/yake/?rev=1572&view=rev Author: psyclonist Date: 2007-01-03 14:34:14 -0800 (Wed, 03 Jan 2007) Log Message: ----------- linux related changes Modified Paths: -------------- trunk/yake/scripts/linux/build.sh trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp trunk/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp trunk/yake/src/plugins/audioOpenAL/yakePCH.cpp trunk/yake/yake/object/ObjectId.inl trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h trunk/yake/yake/plugins/audioOpenAL/yakePCH.h trunk/yake/yake/raf/yakePrerequisites.h Modified: trunk/yake/scripts/linux/build.sh =================================================================== --- trunk/yake/scripts/linux/build.sh 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/scripts/linux/build.sh 2007-01-03 22:34:14 UTC (rev 1572) @@ -1,4 +1,6 @@ #!/bin/bash -pushd ..\premake +#cd .. +#cd ../premake export SOLUTION_TARGET_DIR=linux -premake --file yake.lua --target gnu --os linux -cc gcc +./premake --file yake.lua --target gnu --os linux -cc gcc +#cd ../linux Modified: trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp =================================================================== --- trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp 2007-01-03 22:34:14 UTC (rev 1572) @@ -141,4 +141,4 @@ } } -} \ No newline at end of file +} Modified: trunk/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp =================================================================== --- trunk/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp 2007-01-03 22:34:14 UTC (rev 1572) @@ -118,4 +118,4 @@ } } -} \ No newline at end of file +} Modified: trunk/yake/src/plugins/audioOpenAL/yakePCH.cpp =================================================================== --- trunk/yake/src/plugins/audioOpenAL/yakePCH.cpp 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/src/plugins/audioOpenAL/yakePCH.cpp 2007-01-03 22:34:14 UTC (rev 1572) @@ -24,4 +24,4 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#include <yake/plugins/audioOpenAL/yakePCH.h> \ No newline at end of file +#include <yake/plugins/audioOpenAL/yakePCH.h> Modified: trunk/yake/yake/object/ObjectId.inl =================================================================== --- trunk/yake/yake/object/ObjectId.inl 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/yake/object/ObjectId.inl 2007-01-03 22:34:14 UTC (rev 1572) @@ -107,7 +107,7 @@ return (id_ >= rhs.id_); } template<typename objectid_traits> -ObjectId<objectid_traits>::operator CombinedType() const +ObjectId<objectid_traits>::operator typename ObjectId<objectid_traits>::CombinedType() const { return id_; } Modified: trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h =================================================================== --- trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-01-03 22:34:14 UTC (rev 1572) @@ -164,4 +164,4 @@ } } -#endif \ No newline at end of file +#endif Modified: trunk/yake/yake/plugins/audioOpenAL/yakePCH.h =================================================================== --- trunk/yake/yake/plugins/audioOpenAL/yakePCH.h 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/yake/plugins/audioOpenAL/yakePCH.h 2007-01-03 22:34:14 UTC (rev 1572) @@ -31,4 +31,4 @@ #include <yake/audio/yakeAudio.h> #include <openalpp/alpp.h> -#endif \ No newline at end of file +#endif Modified: trunk/yake/yake/raf/yakePrerequisites.h =================================================================== --- trunk/yake/yake/raf/yakePrerequisites.h 2007-01-03 22:27:26 UTC (rev 1571) +++ trunk/yake/yake/raf/yakePrerequisites.h 2007-01-03 22:34:14 UTC (rev 1572) @@ -41,7 +41,11 @@ #endif // configuration -#define YAKE_RAF_USES_CEGUI 1 +#if YAKE_PLATFORM == PLATFORM_WIN32 //@todo fixme make it work on linux +# define YAKE_RAF_USES_CEGUI 1 +#else +# define YAKE_RAF_USES_CEGUI 0 +#endif namespace yake { } // namespace yake This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-15 18:10:20
|
Revision: 1587 http://svn.sourceforge.net/yake/?rev=1587&view=rev Author: psyclonist Date: 2007-01-15 10:06:35 -0800 (Mon, 15 Jan 2007) Log Message: ----------- added IBody::translateMass(), provided implementation for "old force API" (#0000010), Modified Paths: -------------- trunk/yake/src/plugins/physicsODE/OdeBody.cpp trunk/yake/yake/physics/yakePhysicsBody.h trunk/yake/yake/physics/yakePhysicsPrerequisites.h trunk/yake/yake/plugins/physicsODE/OdeBody.h Modified: trunk/yake/src/plugins/physicsODE/OdeBody.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeBody.cpp 2007-01-10 19:48:12 UTC (rev 1586) +++ trunk/yake/src/plugins/physicsODE/OdeBody.cpp 2007-01-15 18:06:35 UTC (rev 1587) @@ -307,6 +307,14 @@ } //----------------------------------------------------- + void OdeBody::translateMass( const Vector3& offset ) + { + YAKE_ASSERT( mOdeBody ).debug("need a valid body object"); + dMassTranslate( &mMass, offset.x, offset.y, offset.z ); + mOdeBody->setMass( &mMass ); + } + + //----------------------------------------------------- dBody* OdeBody::_getOdeBody() const { return mOdeBody; @@ -384,6 +392,40 @@ ++it; } } +#if defined(YAKE_PHYSICS_OLD_FORCE_API) + void OdeBody::addForce( const math::Vector3& rForce ) + { + this->addForce( Force(rForce, RF_GLOBAL) ); + } + void OdeBody::addForceAtPos( const math::Vector3& rForce, const math::Vector3& rPos ) + { + this->addForce( Force(rForce, RF_GLOBAL, rPos, RF_GLOBAL) ); + } + void OdeBody::addForceAtLocalPos( const math::Vector3& rForce, const math::Vector3& rPos ) + { + this->addForce( Force(rForce, RF_GLOBAL, rPos, RF_LOCAL) ); + } + void OdeBody::addLocalForce( const math::Vector3& rForce ) + { + this->addForce( Force(rForce, RF_LOCAL) ); + } + void OdeBody::addLocalForceAtLocalPos( const math::Vector3& rForce, const math::Vector3& rPos ) + { + this->addForce( Force(rForce, RF_LOCAL, rPos, RF_LOCAL) ); + } + void OdeBody::addLocalForceAtPos( const math::Vector3& rForce, const math::Vector3& rPos ) + { + this->addForce( Force(rForce, RF_LOCAL, rPos,RF_GLOBAL ) ); + } + void OdeBody::addTorque( const math::Vector3& rTorque ) + { + this->addTorque( Torque( rTorque, RF_GLOBAL ) ); + } + void OdeBody::addLocalTorque( const math::Vector3& rTorque ) + { + this->addTorque( Torque( rTorque, RF_LOCAL ) ); + } +#endif // YAKE_PHYSICS_OLD_FORCE_API } // physics } // yake Modified: trunk/yake/yake/physics/yakePhysicsBody.h =================================================================== --- trunk/yake/yake/physics/yakePhysicsBody.h 2007-01-10 19:48:12 UTC (rev 1586) +++ trunk/yake/yake/physics/yakePhysicsBody.h 2007-01-15 18:06:35 UTC (rev 1587) @@ -215,6 +215,10 @@ */ virtual real getMass() const = 0; + /** Translates the body's mass by the given offset. + */ + virtual void translateMass( const Vector3& offset ) = 0; + /* Get inertia tensor of the body. * */ Modified: trunk/yake/yake/physics/yakePhysicsPrerequisites.h =================================================================== --- trunk/yake/yake/physics/yakePhysicsPrerequisites.h 2007-01-10 19:48:12 UTC (rev 1586) +++ trunk/yake/yake/physics/yakePhysicsPrerequisites.h 2007-01-15 18:06:35 UTC (rev 1587) @@ -31,6 +31,13 @@ # include <yake/base/yakePrerequisites.h> #endif +// C O N F I G U R A T I O N + +//@todo move somewhere else? +//#define YAKE_PHYSICS_OLD_FORCE_API + +// -- + #if defined( YAKE_PHYSICS_EXPORTS ) # define YAKE_PHYSICS_API DLLEXPORT #else Modified: trunk/yake/yake/plugins/physicsODE/OdeBody.h =================================================================== --- trunk/yake/yake/plugins/physicsODE/OdeBody.h 2007-01-10 19:48:12 UTC (rev 1586) +++ trunk/yake/yake/plugins/physicsODE/OdeBody.h 2007-01-15 18:06:35 UTC (rev 1587) @@ -48,6 +48,7 @@ virtual real getMass() const; virtual void setMass( const MassDesc& rDesc ); virtual void addMass( const MassDesc& rDesc ); + virtual void translateMass( const Vector3& offset ); virtual math::Matrix3 getInertiaTensor() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-15 18:25:22
|
Revision: 1588 http://svn.sourceforge.net/yake/?rev=1588&view=rev Author: psyclonist Date: 2007-01-15 10:25:20 -0800 (Mon, 15 Jan 2007) Log Message: ----------- added audio::ISource::getState() similarly to what brainless suggested in #0000015 Modified Paths: -------------- trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp trunk/yake/yake/audio/yakeAudioSystem.h trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h Modified: trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp =================================================================== --- trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp 2007-01-15 18:06:35 UTC (rev 1587) +++ trunk/yake/src/plugins/audioOpenAL/yakeAudioSourceOpenAL.cpp 2007-01-15 18:25:20 UTC (rev 1588) @@ -140,5 +140,20 @@ mSource->pause(); } + SourceOpenAL::State SourceOpenAL::getState() const + { + YAKE_ASSERT( mSource.valid() ); + switch (mSource->getState()) + { + case openalpp::Playing: + return ISource::Playing; + case openalpp::Paused: + return ISource::Paused; + case openalpp::Stopped: + case openalpp::Initial: + default: + return ISource::Stopped; + } + } } } Modified: trunk/yake/yake/audio/yakeAudioSystem.h =================================================================== --- trunk/yake/yake/audio/yakeAudioSystem.h 2007-01-15 18:06:35 UTC (rev 1587) +++ trunk/yake/yake/audio/yakeAudioSystem.h 2007-01-15 18:25:20 UTC (rev 1588) @@ -84,6 +84,13 @@ virtual void stop() = 0; virtual void pause() = 0; + enum State { + Playing = 0, + Paused, + Stopped, + }; + virtual State getState() const = 0; + virtual Vector3 getDerivedPosition() const { return this->getPosition(); } virtual Quaternion getDerivedOrientation() const Modified: trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h =================================================================== --- trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-01-15 18:06:35 UTC (rev 1587) +++ trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-01-15 18:25:20 UTC (rev 1588) @@ -98,6 +98,8 @@ virtual void stop(); virtual void pause(); + virtual State getState() const; + virtual void setOrientation( const Quaternion & orientation ); virtual Quaternion getOrientation() const; virtual void setPosition( const Vector3 & position ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:20:25
|
Revision: 1598 http://svn.sourceforge.net/yake/?rev=1598&view=rev Author: psyclonist Date: 2007-01-22 13:17:32 -0800 (Mon, 22 Jan 2007) Log Message: ----------- updated demo list, added samples to premake script, updated build scripts, fixed ExampleApplication framework Modified Paths: -------------- trunk/yake/samples/README.TXT trunk/yake/scripts/premake/samples.lua trunk/yake/scripts/premake/tools.lua trunk/yake/scripts/premake/yake.lua trunk/yake/yake/samples/common/yakeExampleApplication.h Modified: trunk/yake/samples/README.TXT =================================================================== --- trunk/yake/samples/README.TXT 2007-01-22 21:14:00 UTC (rev 1597) +++ trunk/yake/samples/README.TXT 2007-01-22 21:17:32 UTC (rev 1598) @@ -1,6 +1,17 @@ Overview over the sampels +---- supported: +sampleLog - basic logging +net/packet - network packet connections +net/inprocess - client/server: replication objects, communication service, ... +gui/console - Graphical scripting console +raf/minimal +raf/demo1 +ent/sampleEntFsm + +---- in flux: (i.e. in process of being added to the main build scripts) + debug scripted_entity custom_entity Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2007-01-22 21:14:00 UTC (rev 1597) +++ trunk/yake/scripts/premake/samples.lua 2007-01-22 21:17:32 UTC (rev 1598) @@ -18,16 +18,6 @@ dofile("deps.lua") -function useComponent(name) - local STATIC_LINKING_STR = "" - if (SAMPLES_USE_STATIC_LINKING) then - STATIC_LINKING_STR = "_s" - end - addDependency(LIBFILE_PREFIX..name..STATIC_LINKING_STR..DEBUG_DLL_SUFFIX,"Debug") - addDependency(LIBFILE_PREFIX..name..STATIC_LINKING_STR,"Release") - addDependency(LIBFILE_PREFIX..name.."_sym","ReleaseWithSymbols") -- dynamic linking only -end - -------------------------------------- -- create samples/demos -------------------------------------- @@ -52,3 +42,37 @@ makeSample("sampleRafDemo1","samples/raf/demo1") useComponent("base") useComponent("raf") + +-------------------------------------- +makeSample("sampleGuiConsole","samples/gui/console") +useComponent("base") +useComponent("input") +useComponent("scripting") +useComponent("scriptingLua") +useComponent("graphics") +useComponent("audio") +useComponent("physics") +useDep("cegui") +useDep("lua") +useDep("luabind") + +-------------------------------------- +makeSample("sampleNetPacket","samples/net/packet") +addDefine("YAKE_MODEL_LUA_EXPORTS") +useComponent("base") +useComponent("net") + +-------------------------------------- +makeSample("sampleNetInprocess","samples/net/inprocess") +useComponent("base") +useComponent("scripting") +useComponent("net") +useComponent("netsvc") +useComponent("netrepsvc") +useComponent("model") +useComponent("modelLua") +useComponent("ent") +useComponent("entLua") +addIncludePath("dependencies/boost") +addMatching("samples/net/roclient/roclient*") +addMatching("samples/net/roserver/roserver*") Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2007-01-22 21:14:00 UTC (rev 1597) +++ trunk/yake/scripts/premake/tools.lua 2007-01-22 21:17:32 UTC (rev 1598) @@ -164,13 +164,14 @@ end if not cfg then tinsert(deps[name].libdir,path) - elseif project.configs[cfg] then - tinsert(deps[name].configs[cfg].libdir,path) + else + if deps[name].configs[cfg] ~= nil then + tinsert(deps[name].configs[cfg].libdir,path) + end end end function defDepLibrary(name,lib,cfg) if not lib then - print("defDepLibrary() failed to specify lib for dep '" .. name .. "'!") return end if not cfg then @@ -192,15 +193,15 @@ end -- paths/libs for specific targets - for k,v in project.configs do - for tmp,path in deps[name].configs[v].incdir do - addIncludePath(path,v) + for k,cfg in project.configs do + for tmp,path in deps[name].configs[cfg].incdir do + addIncludePath(path,cfg) end - for tmp,path in deps[name].configs[v].libdir do - addLibraryPath(path,v) + for tmp,path in deps[name].configs[cfg].libdir do + addLibraryPath(path,cfg) end - for tmp,lib in deps[name].configs[v].libs do - addDependency(lib,v) + for tmp,lib in deps[name].configs[cfg].libs do + addDependency(lib,cfg) end end end @@ -290,3 +291,14 @@ addMatching(path.."/*.h") addMatching(path.."/*.inl") end + +-- Mostly used in samples.lua and custom.lua +function useComponent(name) + local STATIC_LINKING_STR = "" + if (SAMPLES_USE_STATIC_LINKING) then + STATIC_LINKING_STR = "_s" + end + addDependency(LIBFILE_PREFIX..name..STATIC_LINKING_STR..DEBUG_DLL_SUFFIX,"Debug") + addDependency(LIBFILE_PREFIX..name..STATIC_LINKING_STR,"Release") + addDependency(LIBFILE_PREFIX..name.."_sym","ReleaseWithSymbols") -- dynamic linking only +end Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2007-01-22 21:14:00 UTC (rev 1597) +++ trunk/yake/scripts/premake/yake.lua 2007-01-22 21:17:32 UTC (rev 1598) @@ -89,6 +89,11 @@ addDependency("data") -------------------------------------- +makeComponent("ent","YAKE_ENT_EXPORTS") +addDependency("base") +addDependency("model") + +-------------------------------------- makeComponent("net","YAKE_NET_EXPORTS") addDependency("base") @@ -103,9 +108,11 @@ addDependency("net") -------------------------------------- -makeComponent("ent","YAKE_ENT_EXPORTS") +makeComponent("netrepsvc","YAKE_NETREPSVC_EXPORTS") addDependency("base") -addDependency("model") +addDependency("ent") +addDependency("net") +addDependency("netsvc") -------------------------------------- makeComponent("vehicle","YAKE_VEHICLE_EXPORTS") Modified: trunk/yake/yake/samples/common/yakeExampleApplication.h =================================================================== --- trunk/yake/yake/samples/common/yakeExampleApplication.h 2007-01-22 21:14:00 UTC (rev 1597) +++ trunk/yake/yake/samples/common/yakeExampleApplication.h 2007-01-22 21:17:32 UTC (rev 1598) @@ -122,7 +122,16 @@ // scripting if ( mLoadScriptingSystem ) { - SharedPtr<base::Library> pLib = loadLib("scriptingLua" ); + +#ifdef YAKE_DEBUG +# define YAKE_DYNLIB_POSTFIX "_d" +#else +# define YAKE_DYNLIB_POSTFIX +#endif +#define YAKE_DYNLIB_NAME(X) \ + yake::String("yake_" X YAKE_DYNLIB_POSTFIX).c_str() + + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("scriptingLua")); YAKE_ASSERT( pLib ).debug("Cannot load scripting system"); mScriptingSystem = create_default< scripting::IScriptingSystem >(); @@ -132,7 +141,7 @@ // scripting bindings if ( mLoadScriptingBindings ) { - SharedPtr<base::Library> pLib = loadLib("scriptingBindingsLua" ); + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("scriptingBindingsLua")); YAKE_ASSERT( pLib ).debug("Cannot load scripting bindings plugin."); mScriptingBindings = create_default< scripting::IBinder >(); @@ -142,7 +151,7 @@ // graphics if (mLoadGraphicsSystem) { - SharedPtr<base::Library> pLib = loadLib("graphicsOgre" ); + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("graphicsOgre" )); YAKE_ASSERT( pLib ).debug("Cannot load graphics plugin."); mGraphicsSystem = create_default< graphics::IGraphicsSystem >(); @@ -155,7 +164,7 @@ // physics if (mLoadPhysicsSystem) { - SharedPtr<base::Library> pLib = loadLib("physicsODE" ); + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("physicsODE" )); YAKE_ASSERT( pLib ).debug("Cannot load graphics plugin."); mPhysicsSystem = create_default< physics::IPhysicsSystem >(); @@ -165,7 +174,7 @@ // input if (mLoadInputSystem) { - SharedPtr<base::Library> pLib = loadLib("inputOgre" ); + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("inputOgre" )); YAKE_ASSERT( pLib ).debug("Cannot load input plugin."); mInputSystem = create_default< input::IInputSystem >(); @@ -177,7 +186,7 @@ // audio if (mLoadAudioSystem) { - SharedPtr<base::Library> pLib = loadLib( "audioOpenAL" ); + SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("audioOpenAL" )); YAKE_ASSERT( pLib ).debug("Cannot load audio plugin."); mAudioSystem = create_default< audio::IAudioSystem >(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:20:26
|
Revision: 1597 http://svn.sourceforge.net/yake/?rev=1597&view=rev Author: psyclonist Date: 2007-01-22 13:14:00 -0800 (Mon, 22 Jan 2007) Log Message: ----------- fixed gui scripting console demo Modified Paths: -------------- trunk/yake/samples/gui/console/yakeConsoleDemo.cpp trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIInputArea.h trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h Modified: trunk/yake/samples/gui/console/yakeConsoleDemo.cpp =================================================================== --- trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-01-22 21:11:30 UTC (rev 1596) +++ trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-01-22 21:14:00 UTC (rev 1597) @@ -25,19 +25,18 @@ ------------------------------------------------------------------------------------ */ -#include <CEGUI/CEGUI.h> -#include <CEGUI/CEGUIImageset.h> -#include <CEGUI/CEGUISystem.h> -#include <CEGUI/CEGUILogger.h> -#include <CEGUI/CEGUISchemeManager.h> -#include <CEGUI/CEGUIWindowManager.h> -#include <CEGUI/CEGUIWindow.h> -#include <CEGUI/elements/CEGUICombobox.h> -#include <CEGUI/elements/CEGUIListbox.h> -#include <CEGUI/elements/CEGUIListboxTextItem.h> -#include <CEGUI/elements/CEGUIPushButton.h> -#include <CEGUI/elements/CEGUIScrollbar.h> -#include <CEGUI/elements/CEGUIStaticImage.h> +#include <CEGUI.h> +#include <CEGUIImageset.h> +#include <CEGUISystem.h> +#include <CEGUILogger.h> +#include <CEGUISchemeManager.h> +#include <CEGUIWindowManager.h> +#include <CEGUIWindow.h> +#include <elements/CEGUICombobox.h> +#include <elements/CEGUIListbox.h> +#include <elements/CEGUIListboxTextItem.h> +#include <elements/CEGUIPushButton.h> +#include <elements/CEGUIScrollbar.h> // Yake #include <yake/base/yake.h> @@ -50,16 +49,16 @@ #include <yake/samples/common/yakeExampleApplication.h> #include <yake/data/yakeData.h> -#include <yapp/common/yakeCEGUIRendererAdapter.h> -#include <yapp/common/yakeCEGUIHelpers.h> +#include <yake/common/yakeCEGUIRendererAdapter.h> +#include <yake/common/yakeCEGUIHelpers.h> #include <yake/model/model.h> // console -#include <yapp/gui_addons/console/yakeGenericConsole.h> -#include <yapp/gui_addons/console/yakeDefaultHistory.h> -#include <yapp/gui_addons/console/yakeConsoleLuaProcessor.h> -#include <yapp/gui_addons/console/cegui/yakeCEGUIInputArea.h> -#include <yapp/gui_addons/console/cegui/yakeCEGUIOutputArea.h> +#include <yake/gui_addons/console/yakeGenericConsole.h> +#include <yake/gui_addons/console/yakeDefaultHistory.h> +#include <yake/gui_addons/console/yakeConsoleLuaProcessor.h> +#include <yake/gui_addons/console/cegui/yakeCEGUIInputArea.h> +#include <yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h> // boost #include <boost/lexical_cast.hpp> @@ -121,12 +120,12 @@ }; /// Viewport/Camera pairs - Vector< std::pair<IViewport*,ICamera*> > mVPs; + Vector< std::pair<IViewport*,ICamera*> > mVPs; /// Graphical world SharedPtr< IWorld > mGWorld; /// CEGUI renderer adapter handle - ceguiadapter::RendererAdapterPlugin* mGuiRendererAdapter; + ceguiadapter::RendererAdapterPlugin* mGuiRendererAdapter; /// Editbox representing console input area CEGUI::Editbox* mEditBox; @@ -158,7 +157,7 @@ yake::base::Library* pDynLib = new yake::base::Library( file ); YAKE_ASSERT( pDynLib ).debug( "Out of memory" ); - YAKE_LOG( "Loading plugin " + file ); + YAKE_LOG("demo","Loading plugin " + file ); yake::base::YakeDynLibStartPluginFn pfnStartPlugin = (yake::base::YakeDynLibStartPluginFn)pDynLib->getSymbol( "dynlibStartPlugin" ); YAKE_ASSERT( pfnStartPlugin ).debug( "Cannot find export in dynamic library" ); @@ -186,7 +185,7 @@ */ void onKeyDown( const yake::input::KeyboardEvent& rEvent ) { - YAKE_LOG( "KEY: " + boost::lexical_cast<String>( rEvent.keyCode ) ); + YAKE_LOG("demo", "KEY: " + boost::lexical_cast<String>( rEvent.keyCode ) ); if ( rEvent.keyCode == input::KC_ESCAPE ) requestShutdown(); @@ -228,7 +227,7 @@ */ void onKeyUp( const yake::input::KeyboardEvent& rEvent ) { - YAKE_LOG( "KEY released: " + boost::lexical_cast<String>( rEvent.keyCode ) ); + YAKE_LOG("demo", "KEY released: " + boost::lexical_cast<String>( rEvent.keyCode ) ); CEGUI::System::getSingleton().injectKeyUp( rEvent.keyCode ); } @@ -239,7 +238,7 @@ */ void onMBDown( uint8 btn ) { - YAKE_LOG( "MB: " + boost::lexical_cast<String>( static_cast<int>( btn ) ) ); + YAKE_LOG("demo", "MB: " + boost::lexical_cast<String>( static_cast<int>( btn ) ) ); CEGUI::System::getSingleton().injectMouseButtonDown( convertYakeButtonToCegui( btn ) ); } @@ -249,7 +248,7 @@ */ void onMBUp( uint8 btn ) { - YAKE_LOG( "MB: " + boost::lexical_cast<String>( static_cast<int>( btn ) ) ); + YAKE_LOG("demo", "MB: " + boost::lexical_cast<String>( static_cast<int>( btn ) ) ); CEGUI::System::getSingleton().injectMouseButtonUp( convertYakeButtonToCegui( btn ) ); } @@ -331,10 +330,10 @@ module( pL->getLuaState() ) [ class_<TheApp>( "app" ) - .scope - [ - def( "addConsoleMessage", &TheApp::addConsoleMessage ) - ] + .scope + [ + def( "addConsoleMessage", &TheApp::addConsoleMessage ) + ] ]; } catch (luabind::error& e) @@ -342,11 +341,13 @@ YAKE_EXCEPT(String("LUABIND Exception:\n") + e.what()); } - YAKE_LOG( "Executing console init script... " ); + YAKE_LOG("demo", "Executing console init script... " ); // executing console initialisation script - pL->execute( "dofile( '../../media/gui.addons.scripts/console_redirect.lua' );" ); + //pL->execute( "dofile( '../../../media/gui.addons.scripts/console_redirect.lua' );" ); + SharedPtr<scripting::IScript> script( getScriptingSystem().createScriptFromFile("../../../common/media/gui.addons.scripts/console_redirect.lua")); + pL->execute( script.get() ); } /** @@ -356,44 +357,50 @@ void initGui() { //mGuiRendererAdapter = loadPlugin( "CEGUIOgreAdapter" ); - mGuiRendererAdapter = loadPlugin( "ceguiOgreRendererAdapter" ); + mGuiRendererAdapter = loadPlugin( YAKE_DYNLIB_NAME("ceguiOgreRendererAdapter") ); YAKE_ASSERT( mGuiRendererAdapter ); - YAKE_LOG( "Starting adapter version " + mGuiRendererAdapter->getName() ); - YAKE_LOG( "Initialising CEGUI..." ); + YAKE_LOG("demo", "Starting adapter version " + mGuiRendererAdapter->getName() ); + YAKE_LOG("demo", "Initialising CEGUI..." ); - CEGUI::System* ceguiSys = new CEGUI::System( mGuiRendererAdapter->getRenderer() ); - ceguiSys = 0; // we don't use sys pointer but want to avoid unused variable warning + try + { + CEGUI::System* ceguiSys = new CEGUI::System( mGuiRendererAdapter->getRenderer() ); + ceguiSys = 0; // we don't use sys pointer but want to avoid unused variable warning - using namespace CEGUI; + using namespace CEGUI; - YAKE_LOG( "Setting CEGUI logging level..." ); + YAKE_LOG("demo", "Setting CEGUI logging level..." ); - Logger::getSingleton().setLoggingLevel( Informative ); + Logger::getSingleton().setLoggingLevel( Informative ); - try - { - YAKE_LOG( "Loading scheme..." ); - // load scheme and set up defaults - SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLook.scheme"); - System::getSingleton().setDefaultMouseCursor((utf8*)"TaharezLook", (utf8*)"MouseArrow"); - CEGUI::MouseCursor::getSingleton().setImage(CEGUI::System::getSingleton().getDefaultMouseCursor()); - System::getSingleton().setDefaultFont((utf8*)"Tahoma-12"); + YAKE_LOG("demo", "Loading scheme..." ); - WindowManager& wmgr = WindowManager::getSingleton(); + SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme"); + System::getSingleton().setDefaultMouseCursor("Vanilla-Images","MouseArrow"); + FontManager::getSingleton().createFont("Iconified-12.font"); + WindowManager& winMgr = WindowManager::getSingleton(); - Window* sheet = wmgr.loadWindowLayout( "console.layout" ); - System::getSingleton().setGUISheet(sheet); + Window* background = winMgr.createWindow("Vanilla/StaticImage"); + background->setArea(URect(cegui_reldim(0), cegui_reldim(0), cegui_reldim(1), cegui_reldim(1))); + background->setProperty("FrameEnabled", "false"); + background->setProperty("BackgroundEnabled", "false"); + background->setProperty("Image", "set:BackgroundImage image:full_image"); + System::getSingleton().setGUISheet(background); - CEGUI::Window* pEditBoxWnd = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"/Console/Wnd/Edit"); + background->addChildWindow(winMgr.loadWindowLayout("VanillaConsole.layout")); + + background->activate(); + + mEditBox = static_cast<CEGUI::Editbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/Edit")); - mListBox = static_cast<CEGUI::Listbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/List")); + mListBox = static_cast<CEGUI::Listbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/History")); } // catch to prevent exit (errors will be logged). catch( CEGUI::Exception& e) { - YAKE_LOG( yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); + YAKE_LOG_ERROR( "demo", yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); } setupConsole(); @@ -493,7 +500,8 @@ } catch ( const yake::Exception& rException ) { - YAKE_LOG( rException.what() ); + YAKE_LOG_ERROR( "demo", rException.what() ); + std::cin.get(); } return 0; Modified: trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIInputArea.h =================================================================== --- trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIInputArea.h 2007-01-22 21:11:30 UTC (rev 1596) +++ trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIInputArea.h 2007-01-22 21:14:00 UTC (rev 1597) @@ -27,9 +27,9 @@ #ifndef YAKE_CEGUI_INPUT_AREA_H #define YAKE_CEGUI_INPUT_AREA_H -#include <CEGUI/CEGUI.h> -#include <CEGUI/CEGUISystem.h> -#include <CEGUI/CEGUIWindow.h> +#include <CEGUI.h> +#include <CEGUISystem.h> +#include <CEGUIWindow.h> namespace yake Modified: trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h =================================================================== --- trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h 2007-01-22 21:11:30 UTC (rev 1596) +++ trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h 2007-01-22 21:14:00 UTC (rev 1597) @@ -27,10 +27,10 @@ #ifndef YAKE_CEGUI_OUTPUT_AREA_H #define YAKE_CEGUI_OUTPUT_AREA_H -#include <CEGUI/CEGUI.h> -#include <CEGUI/CEGUIWindow.h> -#include <CEGUI/elements/CEGUIListbox.h> -#include <CEGUI/elements/CEGUIListboxTextItem.h> +#include <CEGUI.h> +#include <CEGUIWindow.h> +#include <elements/CEGUIListbox.h> +#include <elements/CEGUIListboxTextItem.h> namespace yake { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:21:46
|
Revision: 1600 http://svn.sourceforge.net/yake/?rev=1600&view=rev Author: psyclonist Date: 2007-01-22 13:21:46 -0800 (Mon, 22 Jan 2007) Log Message: ----------- modified logging API Modified Paths: -------------- trunk/yake/samples/raf/demo1/yakeDemo.cpp trunk/yake/samples/sampleLog/demo.cpp trunk/yake/src/base/yakeLog.cpp trunk/yake/src/loader/yakeDotScene.cpp trunk/yake/src/loader/yakeXODEParser.cpp trunk/yake/src/model/yakeComponentCreatorManager.cpp trunk/yake/src/model/yakeDotLinkLoader.cpp trunk/yake/src/model/yakeDotModelParser.cpp trunk/yake/src/model/yakeGraphical.cpp trunk/yake/src/model/yakeGraphicalDotSceneLoader.cpp trunk/yake/src/model/yakeModelManager.cpp trunk/yake/src/model/yakePhysical.cpp trunk/yake/src/model/yakeXODEListener.cpp trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp trunk/yake/src/plugins/graphicsOgre/graphicsOgreNode.cpp trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp trunk/yake/src/raf/yakeApplication.cpp trunk/yake/src/raf/yakeApplicationState.cpp trunk/yake/src/raf/yakeRtApplicationState.cpp trunk/yake/src/vehicle/yakeNativeOde.cpp trunk/yake/yake/base/yakeLog.h Modified: trunk/yake/samples/raf/demo1/yakeDemo.cpp =================================================================== --- trunk/yake/samples/raf/demo1/yakeDemo.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/samples/raf/demo1/yakeDemo.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -32,7 +32,7 @@ protected: virtual void onCreateScene() { - YAKE_LOG_INFORMATION("Creating scene"); + YAKE_LOG_INFORMATION("demo","Creating scene"); // create movable ninja graphics::ISceneNode* pSN = getGraphicalWorld()->createSceneNode("root"); pSN->attachEntity( getGraphicalWorld()->createEntity("ninja.mesh") ); Modified: trunk/yake/samples/sampleLog/demo.cpp =================================================================== --- trunk/yake/samples/sampleLog/demo.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/samples/sampleLog/demo.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -7,10 +7,10 @@ try { yake::logging::setProcessId("demo"); - YAKE_LOG_INFORMATION("aloha"); - YAKE_LOG_WARNING("aloha"); - yake::logging::log( yake::logging::S_ERROR, "Batman, help! ", 42 ); - yake::logging::log( 99, "custom severity" ); + YAKE_LOG_INFORMATION("demo","aloha"); + YAKE_LOG_WARNING("demo","aloha"); + yake::logging::log( yake::logging::S_ERROR, "demo", "Batman, help! ", 42 ); + yake::logging::log( 99, "demo", "custom severity" ); } catch (yake::Exception& ex) { Modified: trunk/yake/src/base/yakeLog.cpp =================================================================== --- trunk/yake/src/base/yakeLog.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/base/yakeLog.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -31,12 +31,14 @@ namespace yake { namespace logging { - void toStdErr(const severity_t sev, const char* procId, threadid_t threadId, const char* msg) + void toStdErr(const severity_t sev, const char* logId, const char* procId, threadid_t threadId, const char* msg) { std::ostringstream ss; ss << "[" << (procId ? procId : "") << "]"; - ss << "[thread:"; + ss << "[" << (logId ? logId : "") << "]"; + + ss << "["; ss << std::hex << threadId; ss << "] "; @@ -49,8 +51,9 @@ ss << ")"; } ss << "]"; - ss << "\t" << msg << "\n"; + ss << " " << msg << "\n"; + native::debug_Log( ss.str(), sev ); } @@ -83,17 +86,22 @@ scoped_lock lock; instance().enabledSeverities_[ sev ] = on; } + void logger::enableLog(const char* logId, const bool on) + { + scoped_lock lock; + instance().enabledLogs_[ std::string(logId ? logId : "") ] = on; + } int logger::addTarget(const LogFn fn) { scoped_lock lock; instance().targets_.push_back( fn ); return 1; } - void logger::log(const severity_t sev, const char *tid, const char *msg) + void logger::log(const severity_t sev, const char *logId, const char *msg) { - instance().doLog(sev, tid, msg); + instance().doLog(sev, logId, msg); } - void logger::doLog(const severity_t sev, const char *tid, const char *msg) + void logger::doLog(const severity_t sev, const char *logId, const char *msg) { scoped_lock lock; @@ -101,11 +109,15 @@ if (itEnabled != instance_.enabledSeverities_.end() && !itEnabled->second) return; + EnableLogIdMap::const_iterator itLogEnabled = instance_.enabledLogs_.find( logId ); + if (itLogEnabled != instance_.enabledLogs_.end() && !itLogEnabled->second) + return; + const threadid_t threadId = native::getCurrentThreadId(); TargetFnList::const_iterator itEnd = targets_.end(); for (TargetFnList::const_iterator it = targets_.begin(); it != itEnd; ++it) { - (**it)(sev,instance().procId_.c_str(),threadId,msg); + (**it)(sev,logId,instance().procId_.c_str(),threadId,msg); } } void logger::setProcessId(const String& pId) @@ -116,6 +128,7 @@ logger::logger() { scoped_lock lock; + enableLog(0,true); for (severity_t i=0; i<S_LAST; ++i) enableSeverity( i, true ); addTarget(&toStdErr); Modified: trunk/yake/src/loader/yakeDotScene.cpp =================================================================== --- trunk/yake/src/loader/yakeDotScene.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/loader/yakeDotScene.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -45,7 +45,7 @@ //------------------------------------------------------ bool DotSceneParser::load( const SharedPtr<dom::INode>& docNode ) { - YAKE_LOG( "DotSceneParser::load()" ); + YAKE_LOG("dotscene", "DotSceneParser::load()" ); YAKE_ASSERT( docNode.get() ); @@ -54,7 +54,7 @@ mDocNode = docNode; - YAKE_LOG( "DotSceneParser: parsing scene..." ); + YAKE_LOG("dotscene", "DotSceneParser: parsing scene..." ); readScene( mDocNode ); @@ -65,12 +65,12 @@ void DotSceneParser::readScene( const SharedPtr<dom::INode>& pNode ) { //const String name = pNode->getAttributeValueAs<String>( "name" ); - //YAKE_LOG( "DotSceneParser: readScene() [" + name + "]" ); + //YAKE_LOG("dotscene", "DotSceneParser: readScene() [" + name + "]" ); YAKE_ASSERT( pNode ); SharedPtr<dom::INode> pNodes = pNode->getNodeByName("nodes"); - YAKE_LOG( "DotSceneParser: scene: found nodes = " + String( pNodes.get() ? "yes" : "no" ) ); + YAKE_LOG("dotscene", "DotSceneParser: scene: found nodes = " + String( pNodes.get() ? "yes" : "no" ) ); if ( pNodes.get() ) readNodes( pNodes, _T("") ); @@ -79,7 +79,7 @@ //------------------------------------------------------ void DotSceneParser::readNodes( const SharedPtr<dom::INode>& pNodes, const String& path ) { - YAKE_LOG( "DotSceneParser: readNodes()" ); + YAKE_LOG("dotscene", "DotSceneParser: readNodes()" ); YAKE_ASSERT( pNodes ); const dom::NodeList& nodes = pNodes->getNodes(); @@ -98,7 +98,7 @@ { String nodeName = pNode->getAttributeValueAs<String>( "name" ); - YAKE_LOG( "DotSceneParser: readNode() [name=" + nodeName + "]" ); + YAKE_LOG("dotscene", "DotSceneParser: readNode() [name=" + nodeName + "]" ); YAKE_ASSERT( pNode ); if ( nodeName.empty() ) @@ -190,7 +190,7 @@ desc.parentNodeName = parentNodeName; desc.path = appendToPath(path, name); - YAKE_LOG( "DotSceneParser: readEntity() [name = " + name + "]" ); + YAKE_LOG("dotscene", "DotSceneParser: readEntity() [name = " + name + "]" ); desc.meshFile = pNode->getAttributeValueAs<String>( "meshFile" ); @@ -263,7 +263,7 @@ String g = pNode->getAttributeValueAs<String>("g"); String b = pNode->getAttributeValueAs<String>("b"); - //YAKE_LOG( "DotSceneParser: readColour: r=" + r + ", g=" + g + ", b=" + b ); + //YAKE_LOG("dotscene", "DotSceneParser: readColour: r=" + r + ", g=" + g + ", b=" + b ); colour.r = StringUtil::parseReal( r ); colour.g = StringUtil::parseReal( g ); @@ -302,7 +302,7 @@ desc.parentNodeName = parentNodeName; desc.path = appendToPath(path, name); - YAKE_LOG( "DotSceneParser: readLight() [name=" + name + "]" ); + YAKE_LOG("dotscene", "DotSceneParser: readLight() [name=" + name + "]" ); YAKE_ASSERT( pNode ); String lightType = pNode->getAttributeValueAs<String>( "type" ); @@ -321,7 +321,7 @@ { String childNodeName = (*it)->getName(); - //YAKE_LOG( "DotSceneParser: node child: " + StringUtil::toLowerCase( childNodeName ) ); + //YAKE_LOG("dotscene", "DotSceneParser: node child: " + StringUtil::toLowerCase( childNodeName ) ); const SharedPtr<dom::INode>& pChild = *it; @@ -336,7 +336,7 @@ else if ( childNodeName == "lightAttenuation" ) readLightAttenuation( pChild, desc ); else - YAKE_LOG_ERROR(String("DotSceneParser: Unhandled node child '") + childNodeName + _T("'")); + YAKE_LOG_ERROR("dotscene","DotSceneParser: Unhandled node child '" << childNodeName << "'"); } // Light description ready. Fire! @@ -366,7 +366,7 @@ desc.parentNodeName = parentNodeName; desc.path = appendToPath(path, name); - YAKE_LOG( "DotSceneParser: readCamera() [name=" + name + "]" ); + YAKE_LOG("dotscene", "DotSceneParser: readCamera() [name=" + name + "]" ); YAKE_ASSERT( pNode ); String projectionType = pNode->getAttributeValueAs<String>( "projectionType" ); @@ -389,7 +389,7 @@ { String childNodeName = (*it)->getName(); - //YAKE_LOG( "DotSceneParser: node child: " + StringUtil::toLowerCase( childNodeName ) ); + //YAKE_LOG("dotscene", "DotSceneParser: node child: " + StringUtil::toLowerCase( childNodeName ) ); const SharedPtr<dom::INode>& pChild = *it; @@ -400,7 +400,7 @@ else if ( childNodeName == "trackTarget" ) desc.trackTargetName = pChild->getAttributeValueAs<String>( "nodeName" ); else - YAKE_LOG_ERROR(String("DotSceneParser: Unhandled node child '") + childNodeName + _T("'")); + YAKE_LOG_ERROR("dotscene","DotSceneParser: Unhandled node child '" << childNodeName << "'"); } // Camera description ready. Fire! Modified: trunk/yake/src/loader/yakeXODEParser.cpp =================================================================== --- trunk/yake/src/loader/yakeXODEParser.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/loader/yakeXODEParser.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -40,15 +40,15 @@ //------------------------------------------------------ bool XODEParser::load( const NodeSharedPtr docNode ) { - YAKE_LOG( "XODE: load()" ); + YAKE_LOG("xode", "XODE: load()" ); YAKE_ASSERT( docNode.get() ); mDocNode = docNode; - YAKE_LOG( "*******************" ); - YAKE_LOG( "* Parsing xode... *" ); - YAKE_LOG( "*******************" ); + YAKE_LOG("xode", "*******************" ); + YAKE_LOG("xode", "* Parsing xode... *" ); + YAKE_LOG("xode", "*******************" ); readXODE( mDocNode ); @@ -61,13 +61,13 @@ YAKE_ASSERT( pNode ); const String name = pNode->getAttributeValueAs<String>( "name" ); - YAKE_LOG( "XODE: parsing " + name ); + YAKE_LOG("xode", "XODE: parsing " + name ); // Assuming single world in .xode NodeSharedPtr pWorldNode = pNode->getNodeByName( "world" ); YAKE_ASSERT( pWorldNode ); - YAKE_LOG( "XODE: finding world ... " + String( pWorldNode.get() ? "Yes!" : "No :(" ) ); + YAKE_LOG("xode", "XODE: finding world ... " + String( pWorldNode.get() ? "Yes!" : "No :(" ) ); readWorld( pWorldNode ); @@ -82,7 +82,7 @@ NodeSharedPtr pSpaceNode = pWorldNode->getNodeByName( "space" ); YAKE_ASSERT( pSpaceNode ); - YAKE_LOG( "XODE: finding space... " + String( pSpaceNode.get() ? "Yes!" : "No :(" ) ); + YAKE_LOG("xode", "XODE: finding space... " + String( pSpaceNode.get() ? "Yes!" : "No :(" ) ); readSpace( pSpaceNode, "world" ); } @@ -97,7 +97,7 @@ //------------------------------------------------------ void XODEParser::readSpace( const NodeSharedPtr pSpaceNode, const String& parent ) { - YAKE_LOG( "XODE: reading space ..." ); + YAKE_LOG("xode", "XODE: reading space ..." ); const dom::NodeList& nodes = pSpaceNode->getNodes(); for (dom::NodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) @@ -116,7 +116,7 @@ else if ( nodeName == "bodygroup" ) { //TODO bodygroup reading here - YAKE_LOG( "XODE: Bodygroup is not yet implemented in parser" ); + YAKE_LOG("xode", "XODE: Bodygroup is not yet implemented in parser" ); } else if ( nodeName == "joint" ) { @@ -263,7 +263,7 @@ if ( !strQuantity.empty() ) { quantity = StringUtil::parseReal( strQuantity ); - YAKE_LOG( "XODE: reading mass_struct with density = " + strQuantity + " " ); + YAKE_LOG("xode", "XODE: reading mass_struct with density = " + strQuantity + " " ); } else { @@ -271,7 +271,7 @@ if ( !strQuantity.empty() ) { quantity = StringUtil::parseReal( strQuantity ); - YAKE_LOG( "XODE: reading mass_sstruct with total mass = " + strQuantity + " " ); + YAKE_LOG("xode", "XODE: reading mass_sstruct with total mass = " + strQuantity + " " ); qt = IBody::QT_MASS; } } @@ -330,7 +330,7 @@ if ( !strDensity.empty() ) { density = StringUtil::parseReal( strDensity ); - YAKE_LOG( "XODE: reading mass_shape with density = " + strDensity + " " ); + YAKE_LOG("xode", "XODE: reading mass_shape with density = " + strDensity + " " ); } const dom::NodeList& nodes = pMShapeNode->getNodes(); @@ -338,7 +338,7 @@ { String nodeName = StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG( "XODE: reading mass_shape that is " + nodeName + " " ); + YAKE_LOG("xode", "XODE: reading mass_shape that is " + nodeName + " " ); IBody::MassDesc* physicsMassDesc = NULL; @@ -398,7 +398,7 @@ { real total = StringUtil::parseReal( pMAdjustNode->getAttributeValueAs<String>( "total" ) ); - YAKE_LOG_INFORMATION( "XODE: read mass adjust - " + pMAdjustNode->getAttributeValueAs<String>( "total" ) ); + YAKE_LOG_INFORMATION("xode","XODE: read mass adjust - " << pMAdjustNode->getAttributeValueAs<String>( "total" ) ); MassDesc desc; desc.parentName_ = parent; @@ -467,7 +467,7 @@ void XODEParser::readBody( const NodeSharedPtr pBodyNode, const String& parent ) { const String name = pBodyNode->getAttributeValueAs<String>( "name" ); - YAKE_LOG( "XODE: reading body " + name ); + YAKE_LOG("xode", "XODE: reading body " + name ); // Setting up body description... BodyDesc desc; @@ -484,7 +484,7 @@ Transform bodyTransform; if ( iTrans != nodes.end() ) { - YAKE_LOG( "XODE: body " + name + " has transform " ); + YAKE_LOG("xode", "XODE: body " + name + " has transform " ); readTransform( *iTrans, bodyTransform ); @@ -502,7 +502,7 @@ { String nodeName = StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG( "XODE: body " + name + " has node #" + nodeName ); + YAKE_LOG("xode", "XODE: body " + name + " has node #" + nodeName ); if ( nodeName == "geom" ) { @@ -531,7 +531,7 @@ */ void XODEParser::readMaterialExt( const NodeSharedPtr pNode, const String& parent ) { - YAKE_LOG( "XODE: entered readMaterialExt..." ); + YAKE_LOG("xode", "XODE: entered readMaterialExt..." ); const dom::NodeList& nodes = pNode->getNodes(); @@ -545,18 +545,18 @@ if ( iExt == nodes.end() ) { - YAKE_LOG( "XODE: didn't find extension... " ); + YAKE_LOG("xode", "XODE: didn't find extension... " ); return; } - YAKE_LOG( "XODE: found extension... processing... :) " ); + YAKE_LOG("xode", "XODE: found extension... processing... :) " ); if ( (*iExt)->getAttributeValueAs<String>( "name" ) != "material" ) { - YAKE_LOG( "XODE: extension is not material" ); + YAKE_LOG("xode", "XODE: extension is not material" ); } - YAKE_LOG( "XODE: the extension IS material! Parsing..." ); + YAKE_LOG("xode", "XODE: the extension IS material! Parsing..." ); const dom::NodeList& extNodes = (*iExt)->getNodes(); //HACK assuming first node is "params" @@ -569,9 +569,9 @@ String strRestitution = pParamsNode->getAttributeValueAs<String>( "bouncecoeff" ); String strSoftness = pParamsNode->getAttributeValueAs<String>( "soften" ); - YAKE_LOG( "XODE: read friction = " + strFriction ); - YAKE_LOG( "XODE: read restitution = " + strRestitution ); - YAKE_LOG( "XODE: read softness = " + strSoftness ); + YAKE_LOG("xode", "XODE: read friction = " + strFriction ); + YAKE_LOG("xode", "XODE: read restitution = " + strRestitution ); + YAKE_LOG("xode", "XODE: read softness = " + strSoftness ); desc.mFriction = StringUtil::parseReal( strFriction ); desc.mRestitution = StringUtil::parseReal( strRestitution ); @@ -598,7 +598,7 @@ const Transform& rParentTransform, bool absoluteTransform ) { const String name = pGeomNode->getAttributeValueAs<String>( "name" ); - YAKE_LOG( "XODE: reading geom " + name ); + YAKE_LOG("xode", "XODE: reading geom " + name ); const dom::NodeList& nodes = pGeomNode->getNodes(); @@ -611,7 +611,7 @@ if ( iTrans != nodes.end() ) { - YAKE_LOG( "XODE: readGeom() [" + name + "] : geom has transform " ); + YAKE_LOG("xode", "XODE: readGeom() [" + name + "] : geom has transform " ); readTransform( *iTrans, geomTransform ); } @@ -620,13 +620,13 @@ if ( absoluteTransform ) geomTransform = geomTransform.getDerivedTransform( rParentTransform ); - YAKE_LOG( "XODE: scanning other geom properties..." ); + YAKE_LOG("xode", "XODE: scanning other geom properties..." ); for (dom::NodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { String nodeName = StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG( "XODE: geom [" + name + "] has node #" + nodeName ); + YAKE_LOG("xode", "XODE: geom [" + name + "] has node #" + nodeName ); IShape::Desc* shapeDesc = NULL; @@ -649,7 +649,7 @@ String strSizeY; strSizeY << sizeY; String strSizeZ; strSizeZ << sizeZ; - YAKE_LOG( "XODE: box with sizes: " + strSizeX + ", " + strSizeY + ", " + strSizeZ ); + YAKE_LOG("xode", "XODE: box with sizes: " + strSizeX + ", " + strSizeY + ", " + strSizeZ ); shapeDesc = new IShape::BoxDesc( math::Vector3( sizeX, sizeY, sizeZ ), "", geomTransform.position_, geomTransform.rotation_ ); @@ -789,7 +789,7 @@ } } - YAKE_LOG( "XODE: Leaving readGeom()" ); + YAKE_LOG("xode", "XODE: Leaving readGeom()" ); } //------------------------------------------------------ @@ -853,7 +853,7 @@ { String nodeName = StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG( "XODE: reading " + nodeName + " trimesh now..." ); + YAKE_LOG("xode", "XODE: reading " + nodeName + " trimesh now..." ); if ( nodeName == "vertices" ) { @@ -927,7 +927,7 @@ desc.name_ = name; - YAKE_LOG( "XODE: reading joint '" + name + "' ..." ); + YAKE_LOG("xode", "XODE: reading joint '" + name + "' ..." ); // Looking for link1 NodeHunter link1Hunter( "link1" ); @@ -956,9 +956,9 @@ desc.body2_ = body2Name; - YAKE_LOG( "XODE: the joint connects two actors:" ); - YAKE_LOG( "XODE: 1:" + body1Name ); - YAKE_LOG( "XODE: 2:" + body2Name ); + YAKE_LOG("xode", "XODE: the joint connects two actors:" ); + YAKE_LOG("xode", "XODE: 1:" + body1Name ); + YAKE_LOG("xode", "XODE: 2:" + body2Name ); // Looking for transform NodeHunter hunter( "transform" ); @@ -968,7 +968,7 @@ Transform jointTransform; if ( iTrans != nodes.end() ) { - YAKE_LOG( "XODE: joint has transform " ); + YAKE_LOG("xode", "XODE: joint has transform " ); readTransform( *iTrans, jointTransform ); } @@ -984,7 +984,7 @@ IJoint::DescBase* jointDesc = NULL; - YAKE_LOG( "XODE: reading " + nodeName + " now..." ); + YAKE_LOG("xode", "XODE: reading " + nodeName + " now..." ); if ( nodeName == "ball" ) { @@ -1028,7 +1028,7 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readBall( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "XODE: reading ball joint description..." ); + YAKE_LOG("xode", "XODE: reading ball joint description..." ); const dom::NodeList& nodes = pJointNode->getNodes(); @@ -1047,7 +1047,7 @@ IJoint::DescBase* desc = new IJoint::DescBall( NULL, NULL, anchor ); - YAKE_LOG( "XODE: Finished processing ball joint description." ); + YAKE_LOG("xode", "XODE: Finished processing ball joint description." ); return desc; } @@ -1055,11 +1055,11 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readFixed( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "Reading fixed joint description..." ); + YAKE_LOG("xode", "Reading fixed joint description..." ); IJoint::DescBase* desc = new IJoint::DescFixed( NULL, NULL ); - YAKE_LOG( "Finished processing fixed joint description." ); + YAKE_LOG("xode", "Finished processing fixed joint description." ); return desc; } @@ -1067,7 +1067,7 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readHinge( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "Reading hinge joint description..." ); + YAKE_LOG("xode", "Reading hinge joint description..." ); const dom::NodeList& nodes = pJointNode->getNodes(); @@ -1093,7 +1093,7 @@ IJoint::DescBase* desc = new IJoint::DescHinge( NULL, NULL, axis, anchor ); - YAKE_LOG( "Finished processing hinge joint description." ); + YAKE_LOG("xode", "Finished processing hinge joint description." ); return desc; } @@ -1101,7 +1101,7 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readHinge2( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "Reading hinge2 joint description..." ); + YAKE_LOG("xode", "Reading hinge2 joint description..." ); const dom::NodeList& nodes = pJointNode->getNodes(); @@ -1134,7 +1134,7 @@ IJoint::DescBase* desc = new IJoint::DescHinge2( NULL, NULL, axis0, axis1, anchor ); - YAKE_LOG( "XODE: finished processing hinge2 joint description." ); + YAKE_LOG("xode", "XODE: finished processing hinge2 joint description." ); return desc; } @@ -1142,7 +1142,7 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readSlider( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "XODE: reading slider joint description..." ); + YAKE_LOG("xode", "XODE: reading slider joint description..." ); const dom::NodeList& nodes = pJointNode->getNodes(); @@ -1159,7 +1159,7 @@ IJoint::DescBase* desc = new IJoint::DescSlider( NULL, NULL, axis ); - YAKE_LOG( "XODE: finished processing slider joint description." ); + YAKE_LOG("xode", "XODE: finished processing slider joint description." ); return desc; } @@ -1167,7 +1167,7 @@ //------------------------------------------------------ IJoint::DescBase* XODEParser::readUniversal( const NodeSharedPtr pJointNode, const Transform& rJointTransform ) { - YAKE_LOG( "XODE: reading universal joint description..." ); + YAKE_LOG("xode", "XODE: reading universal joint description..." ); const dom::NodeList& nodes = pJointNode->getNodes(); @@ -1200,7 +1200,7 @@ IJoint::DescBase* desc = new IJoint::DescUniversal( NULL, NULL, axis0, axis1, anchor ); - YAKE_LOG( "XODE: finished processing universal joint description." ); + YAKE_LOG("xode", "XODE: finished processing universal joint description." ); return desc; } @@ -1210,7 +1210,7 @@ math::Vector3& rAnchor, const Transform& rJointTransform ) { - YAKE_LOG( "XODE: reading anchor..." ); + YAKE_LOG("xode", "XODE: reading anchor..." ); rAnchor.x = StringUtil::parseReal( pAnchorNode->getAttributeValueAs<String>( "x" ) ); rAnchor.y = StringUtil::parseReal( pAnchorNode->getAttributeValueAs<String>( "y" ) ); @@ -1224,7 +1224,7 @@ math::Vector3& rAxis, const Transform& rJointTransform ) { - YAKE_LOG( "XODE: reading axis..." ); + YAKE_LOG("xode", "XODE: reading axis..." ); rAxis.x = StringUtil::parseReal( pAxisNode->getAttributeValueAs<String>( "x" ) ); rAxis.y = StringUtil::parseReal( pAxisNode->getAttributeValueAs<String>( "y" ) ); Modified: trunk/yake/src/model/yakeComponentCreatorManager.cpp =================================================================== --- trunk/yake/src/model/yakeComponentCreatorManager.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeComponentCreatorManager.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -56,7 +56,7 @@ } catch (...) { - YAKE_LOG_ERROR("Unregistered ComponentCreator type!"); + YAKE_LOG_ERROR("model","Unregistered ComponentCreator type!"); } YAKE_ASSERT( creator.get() )(type)(params).debug("Failed to create component creator! Probably it has not been registered/loaded."); if (!creator.get()) Modified: trunk/yake/src/model/yakeDotLinkLoader.cpp =================================================================== --- trunk/yake/src/model/yakeDotLinkLoader.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeDotLinkLoader.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -86,18 +86,18 @@ String sourceMovableType = StringUtil::toLowerCase(rNode.getAttributeValueAs<String>("elementtype")); String sourceMovableName = (rNode.getAttributeValueAs<String>("element")); - YAKE_LOG( "Searching model '" + rModel.getName() + "' for movable: " ); - YAKE_LOG( " type: " + sourceType ); - YAKE_LOG( " submodel: " + sourceModelName ); - YAKE_LOG( " movable type: " + sourceMovableType ); - YAKE_LOG( " movable name: " + sourceMovableName ); + YAKE_LOG( "model", "Searching model '" + rModel.getName() + "' for movable: " ); + YAKE_LOG( "model", " type: " + sourceType ); + YAKE_LOG( "model", " submodel: " + sourceModelName ); + YAKE_LOG( "model", " movable type: " + sourceMovableType ); + YAKE_LOG( "model", " movable name: " + sourceMovableName ); // retrieve source movable Movable* pMovable = 0; if ( sourceType == "graphical" ) { YAKE_ASSERT( sourceMovableType == "graphics.scenenode" ); - YAKE_LOG( "Searching for graphical named '" + sourceModelName + "'" ); + YAKE_LOG( "model", "Searching for graphical named '" + sourceModelName + "'" ); Graphical* pG = dynamic_cast<Graphical*>(rModel.getComponentByTag( sourceModelName )); YAKE_ASSERT( pG )( sourceModelName ); @@ -106,7 +106,7 @@ } else if ( sourceType == "physical" ) { - YAKE_LOG( "Searching for physical named '" + sourceModelName + "'" ); + YAKE_LOG( "model", "Searching for physical named '" + sourceModelName + "'" ); Physical* pP = dynamic_cast<Physical*>(rModel.getComponentByTag( sourceModelName )); YAKE_ASSERT( pP )( sourceModelName ); @@ -163,7 +163,7 @@ Movable* from = getMovableFromModel(*mpModel,*pSourceNode); Movable* to = getMovableFromModel(*mpModel,*pTargetNode); - YAKE_LOG( "Found source and target. Adding controller to model..." ); + YAKE_LOG( "model", "Found source and target. Adding controller to model..." ); ModelMovableLink* link = mpModel->createLink( from, to, linkType ); YAKE_ASSERT( link ); Modified: trunk/yake/src/model/yakeDotModelParser.cpp =================================================================== --- trunk/yake/src/model/yakeDotModelParser.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeDotModelParser.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -40,15 +40,15 @@ //------------------------------------------------------ bool DotModelParser::load( const NodeSharedPtr docNode ) { - YAKE_LOG( "dotModel: load()" ); + YAKE_LOG("model", "dotModel: load()" ); YAKE_ASSERT( docNode.get() ); mDocNode = docNode; - YAKE_LOG( "***********************" ); - YAKE_LOG( "* Parsing dotModel... *" ); - YAKE_LOG( "***********************" ); + YAKE_LOG("model", "***********************" ); + YAKE_LOG("model", "* Parsing dotModel... *" ); + YAKE_LOG("model", "***********************" ); readDotModel( mDocNode ); @@ -81,7 +81,7 @@ { ModelDesc desc; desc.name_ = yake::StringUtil::toLowerCase( pModelNode->getAttributeValueAs<String>("name") ); - YAKE_LOG("xode: model '" << desc.name_ << "' found!"); + YAKE_LOG("model", "xode: model '" << desc.name_ << "' found!"); this->sigModel_( desc ); @@ -89,13 +89,13 @@ for (dom::NodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { const String name = yake::StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG("xode: item '" << name << "' found!"); + YAKE_LOG("model", "xode: item '" << name << "' found!"); if (name == "component") { this->readModelComponent( *it, desc ); } else - YAKE_LOG_WARNING("xode: unhandled item '" << name << "'!"); + YAKE_LOG_WARNING("model", "xode: unhandled item '" << name << "'!"); } this->sigModelFinished_( desc ); @@ -112,7 +112,7 @@ for (dom::NodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { const String name = yake::StringUtil::toLowerCase( (*it)->getName() ); - YAKE_LOG("xode: item '" << name << "' found!"); + YAKE_LOG("model", "xode: item '" << name << "' found!"); if (name == "parameter") { String name; @@ -121,7 +121,7 @@ desc.params[name] = value; } else - YAKE_LOG_WARNING("xode: unhandled item '" << name << "'!"); + YAKE_LOG_WARNING("model", "xode: unhandled item '" << name << "'!"); } desc.params["name"] = desc.name; Modified: trunk/yake/src/model/yakeGraphical.cpp =================================================================== --- trunk/yake/src/model/yakeGraphical.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeGraphical.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -82,17 +82,17 @@ */ void Graphical::addSceneNode(graphics::ISceneNode* node, const String& xpath, const bool owned) { - YAKE_LOG(String("Graphical::addSceneNode(") + xpath + _T(")")); + YAKE_LOG_INFORMATION("model",String("Graphical::addSceneNode(") + xpath + _T(")")); this->_add(node,nodes_,xpath,owned); } void Graphical::addEntity(graphics::IEntity* ent, const String& xpath, const bool owned) { - YAKE_LOG(String("Graphical::addEntity(") + xpath + _T(")")); + YAKE_LOG_INFORMATION("model",String("Graphical::addEntity(") + xpath + _T(")")); this->_add(ent,entities_,xpath,owned); } void Graphical::addLight(graphics::ILight* light, const String& xpath, const bool owned) { - YAKE_LOG(String("Graphical::addLight(") + xpath + _T(")")); + YAKE_LOG_INFORMATION("model",String("Graphical::addLight(") + xpath + _T(")")); this->_add(light,lights_,xpath,owned); } graphics::ISceneNode* Graphical::getSceneNode(const String& xpath) const Modified: trunk/yake/src/model/yakeGraphicalDotSceneLoader.cpp =================================================================== --- trunk/yake/src/model/yakeGraphicalDotSceneLoader.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeGraphicalDotSceneLoader.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -37,7 +37,7 @@ { const String fullName = mNamePrefix + desc.path; const String fullParentNodeName = mNamePrefix + desc.parentNodeName; - YAKE_LOG( "Processing scene node " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); + YAKE_LOG("model", "Processing scene node " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); // create scene node graphics::ISceneNode* pSN = mGWorld->createSceneNode( fullName ); @@ -68,19 +68,19 @@ { if ( trackRecord->second == desc.name ) { - YAKE_LOG( "Setting track target for camera " + trackRecord->first + " ..." ); + YAKE_LOG("model", "Setting track target for camera " + trackRecord->first + " ..." ); CameraInfo info = mCameras[ trackRecord->first ]; - YAKE_LOG( "Camera info found. Acquiring camera..." ); + YAKE_LOG("model", "Camera info found. Acquiring camera..." ); graphics::ICamera* tracker = info.camera; - YAKE_LOG( "Got camera. Setting orientation..." ); + YAKE_LOG("model", "Got camera. Setting orientation..." ); tracker->lookAt( pSN->getPosition( graphics::ISceneNode::TS_WORLD ) ); - YAKE_LOG( "Orientation was set up..." ); + YAKE_LOG("model", "Orientation was set up..." ); // cleaning up mTrackersTargets.erase( trackRecord ); @@ -94,7 +94,7 @@ { const String fullName = mNamePrefix + desc.name; const String fullParentNodeName = mNamePrefix + desc.parentNodeName; - YAKE_LOG( "Processing entity " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); + YAKE_LOG("model", "Processing entity " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); // create entity graphics::IEntity* pEntity = mGWorld->createEntity( desc.meshFile ); @@ -128,7 +128,7 @@ //----------------------------------------------------- void DotSceneListener::processCamera( const CameraDesc& desc ) { - YAKE_LOG( "Processing camera " + desc.name + " with parent node " + desc.parentNodeName ); + YAKE_LOG("model", "Processing camera " + desc.name + " with parent node " + desc.parentNodeName ); graphics::ICamera* pCamera = mGWorld->createCamera(); @@ -154,7 +154,7 @@ if ( desc.trackTargetName != "" ) { - YAKE_LOG( "Saving tracking record for camera " + desc.name + " ... " ); + YAKE_LOG("model", "Saving tracking record for camera " + desc.name + " ... " ); mTrackersTargets.insert( TrackerMap::value_type( desc.name, desc.trackTargetName ) ); } @@ -172,7 +172,7 @@ { const String fullName = mNamePrefix + desc.name; const String fullParentNodeName = mNamePrefix + desc.parentNodeName; - YAKE_LOG( "Processing light " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); + YAKE_LOG("model", "Processing light " + desc.name + " (" + fullName + ") with parent node " + desc.parentNodeName + " (" + fullParentNodeName + ")" ); // create light graphics::ILight* pLight = mGWorld->createLight(); @@ -198,11 +198,11 @@ if ( desc.castsShadows ) { - YAKE_LOG( " light casts shadows" ); + YAKE_LOG("model", " light casts shadows" ); } else { - YAKE_LOG( " light doesn't cast shadows" ); + YAKE_LOG("model", " light doesn't cast shadows" ); } pLight->setDiffuseColour( desc.diffuseColor ); Modified: trunk/yake/src/model/yakeModelManager.cpp =================================================================== --- trunk/yake/src/model/yakeModelManager.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeModelManager.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -92,7 +92,7 @@ */ ModelPtr ModelManager::createModel(const String& modelName, const ModelComponentDescList& compDescList) { - YAKE_LOG_INFORMATION( "MODEL: Creating model with name: " + modelName ); + YAKE_LOG_INFORMATION("model","Creating model with name: " + modelName ); // Validate name YAKE_ASSERT( !modelName.empty() ); @@ -122,7 +122,7 @@ const String name = (itParam == params.end()) ? _T("") : itParam->second; // Create component. - YAKE_LOG_INFORMATION( "MODEL: Creating component with name: " + name ); + YAKE_LOG_INFORMATION("model"," Creating component with name: " + name ); #ifdef YAKE_DEBUG if (!name.empty()) { Modified: trunk/yake/src/model/yakePhysical.cpp =================================================================== --- trunk/yake/src/model/yakePhysical.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakePhysical.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -54,22 +54,22 @@ } void Physical::addActor(physics::IActor* actor, const String& xpath) { - YAKE_LOG(String("Physical::addActor(") + xpath + _T(")")); + YAKE_LOG("model",String("Physical::addActor(") + xpath + _T(")")); this->_add<physics::IActor>(actor,actors_,xpath); } void Physical::addJoint(physics::IJoint* joint, const String& xpath) { - YAKE_LOG(String("Physical::addJoint(") + xpath + _T(")")); + YAKE_LOG("model",String("Physical::addJoint(") + xpath + _T(")")); this->_add<physics::IJoint>(joint,joints_,xpath); } void Physical::addBody(physics::IBody* body, const String& xpath) { - YAKE_LOG(String("Physical::addBody(") + xpath + _T(")")); + YAKE_LOG("model",String("Physical::addBody(") + xpath + _T(")")); this->_add<physics::IBody>(body,bodies_,xpath); } void Physical::addAffector(physics::IBodyAffector* affector, const String& xpath) { - YAKE_LOG(String("Physical::addAffector(") + xpath + _T(")")); + YAKE_LOG("model",String("Physical::addAffector(") + xpath + _T(")")); this->_add<physics::IBodyAffector>(affector,affectors_,xpath); } physics::IActor* Physical::getActor(const yake::String& xpath) const Modified: trunk/yake/src/model/yakeXODEListener.cpp =================================================================== --- trunk/yake/src/model/yakeXODEListener.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/model/yakeXODEListener.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -35,7 +35,7 @@ //----------------------------------------------------- void XODEListener::processBody( const parser_t::BodyDesc& desc ) { - YAKE_LOG( "XODE listener: processing body description..." ); + YAKE_LOG("model.xodelistener", "XODE listener: processing body description..." ); // create actor physics::IActorPtr pDynActor = physicalWorld_->createActor( physics::ACTOR_DYNAMIC ); @@ -59,13 +59,13 @@ // filling owner model owner_.addActor( pDynActor, desc.name_ ); - YAKE_LOG( "XODE listener: Success." ); + YAKE_LOG("model.xodelistener", "XODE listener: Success." ); } //----------------------------------------------------- void XODEListener::processGeom( const parser_t::GeomDesc& desc ) { - YAKE_LOG( "XODE listener: processing geom description..." ); + YAKE_LOG("model.xodelistener", "XODE listener: processing geom description..." ); physics::IActorPtr parentActor = NULL; @@ -79,7 +79,7 @@ } else { - YAKE_LOG( "XODE listener: geom parent not found... creating static actor. " ); + YAKE_LOG("model.xodelistener", "XODE listener: geom parent not found... creating static actor. " ); // create static actor parentActor = physicalWorld_->createActor( physics::ACTOR_STATIC ); @@ -101,13 +101,13 @@ // add to collection geoms_[ desc.name_ ] = info; - YAKE_LOG( "XODE listener: Success." ); + YAKE_LOG("model.xodelistener", "XODE listener: Success." ); } //----------------------------------------------------- void XODEListener::processMaterial( const parser_t::MaterialDesc& desc ) { - YAKE_LOG( "XODE listener: processing material description..." ); + YAKE_LOG("model.xodelistener", "XODE listener: processing material description..." ); physics::IMaterial* material = physicalWorld_->createMaterial( desc.material_, desc.name_ ); @@ -116,7 +116,7 @@ if ( shape != geoms_.end() ) { - YAKE_LOG( "XODE listener: shape found! Applying material..." ); + YAKE_LOG("model.xodelistener", "XODE listener: shape found! Applying material..." ); // apply material to shape shape->second.shape_->setMaterial( material ); @@ -129,13 +129,13 @@ // add to collection materials_[ desc.name_ ] = info; - YAKE_LOG( "XODE listener: Success." ); + YAKE_LOG("model.xodelistener", "XODE listener: Success." ); } //----------------------------------------------------- void XODEListener::processMass( const parser_t::MassDesc& desc ) { - YAKE_LOG( "XODE listener: processing mass description..." ); + YAKE_LOG("model.xodelistener", "XODE listener: processing mass description..." ); // search for parent in actors ActorMap::iterator actor = actors_.find( desc.parentName_ ); @@ -145,32 +145,32 @@ // parent actor found! physics::IBody& body = actor->second.actor_->getBody(); - YAKE_LOG( "XODE listener: owner body found. Adding mass..." ); + YAKE_LOG("model.xodelistener", "XODE listener: owner body found. Adding mass..." ); body.addMass( *desc.mass_ ); // TODO process mass... add to collection etc. } - YAKE_LOG( "XODE listener: Success." ); + YAKE_LOG("model.xodelistener", "XODE listener: Success." ); } //----------------------------------------------------- void XODEListener::processJoint( const parser_t::JointDesc& desc ) { - YAKE_LOG( "XODE listener: processing joint description..." ); + YAKE_LOG("model.xodelistener", "XODE listener: processing joint description..." ); // storing joint description for further processing... jointDescriptions_.push_back( desc ); - YAKE_LOG( "XODE listener: Success." ); + YAKE_LOG("model.xodelistener", "XODE listener: Success." ); } //----------------------------------------------------- void XODEListener::postprocess() { // create joints here - YAKE_LOG( "XODE listener: postprocessing..." ); + YAKE_LOG("model.xodelistener", "XODE listener: postprocessing..." ); // TODO only implemented creation of joint connecting dynamic objects @@ -181,15 +181,15 @@ // search for connected actors - YAKE_LOG( "XODE listener: processing " + desc.name_ + " ... " ); - YAKE_LOG( "XODE listener: searching for actors [0]: " + desc.body1_ + ", [1]: " + desc.body2_ ); + YAKE_LOG("model.xodelistener", "XODE listener: processing " + desc.name_ + " ... " ); + YAKE_LOG("model.xodelistener", "XODE listener: searching for actors [0]: " + desc.body1_ + ", [1]: " + desc.body2_ ); ActorMap::iterator actor0 = actors_.find( desc.body1_ ); ActorMap::iterator actor1 = actors_.find( desc.body2_ ); if ( actor0 == actors_.end() || actor1 == actors_.end() ) { - YAKE_LOG( "XODE listener: Failed to find actors... :( " ); + YAKE_LOG("model.xodelistener", "XODE listener: Failed to find actors... :( " ); continue; } @@ -206,7 +206,7 @@ joints_[ desc.name_ ] = info; } - YAKE_LOG( "XODE listener: finished postprocessing." ); + YAKE_LOG("model.xodelistener", "XODE listener: finished postprocessing." ); } } //model Modified: trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -231,7 +231,7 @@ Ogre::SceneNode::ObjectIterator itObj = pSN->getAttachedObjectIterator(); while (itObj.hasMoreElements()) { - YAKE_LOG_WARNING( "gfx rootnode.obj '" + itObj.getNext()->getName() + "'" ); + YAKE_LOG_WARNING( "graphicsOgre", "gfx rootnode.obj '" + itObj.getNext()->getName() + "'" ); } } if (pSN->numChildren() > 0) @@ -239,7 +239,7 @@ Ogre::SceneNode::ChildNodeIterator itN = pSN->getChildIterator(); while (itN.hasMoreElements()) { - YAKE_LOG_WARNING( "gfx rootnode.node '" + itN.getNext()->getName() + "'" ); + YAKE_LOG_WARNING( "graphicsOgre", "gfx rootnode.node '" + itN.getNext()->getName() + "'" ); } } @@ -270,7 +270,7 @@ } catch (Ogre::Exception& e) { - YAKE_LOG( "[yake.graphics.ogre] OGRE EXCEPTION\n" + e.getFullDescription() + "\n"); + YAKE_LOG( "graphicsOgre", "OGRE EXCEPTION\n" + e.getFullDescription() + "\n"); mReady = false; } } @@ -366,9 +366,9 @@ } catch (Ogre::Exception& e) { - String rMsg = "[yake.graphics.ogre] OGRE EXCEPTION\n" + e.getFullDescription() + "\n"; + String rMsg = "OGRE EXCEPTION\n" + e.getFullDescription() + "\n"; - YAKE_LOG( rMsg ); + YAKE_LOG( "graphicsOgre", rMsg ); YAKE_EXCEPT( rMsg ); Modified: trunk/yake/src/plugins/graphicsOgre/graphicsOgreNode.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/graphicsOgreNode.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/plugins/graphicsOgre/graphicsOgreNode.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -291,7 +291,7 @@ if (e.getNumber() == Ogre::Exception::ERR_ITEM_NOT_FOUND) mSceneNode->attachObject( pCam->getCamera_() ); else - YAKE_LOG(String("Ogre Exception: ") + e.getFullDescription()); + YAKE_LOG("graphicsOgre", String("Ogre Exception: ") + e.getFullDescription()); } mCameras.push_back( pCamera ); } @@ -338,7 +338,7 @@ if (e.getNumber() == Ogre::Exception::ERR_ITEM_NOT_FOUND) mSceneNode->attachObject( pE->getEntity_() ); else - YAKE_LOG(String("Ogre Exception: ") + e.getFullDescription()); + YAKE_LOG("graphicsOgre", String("Ogre Exception: ") + e.getFullDescription()); } mEntities.push_back( pEntity ); } Modified: trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -117,7 +117,7 @@ YAKE_SAFE_DELETE( mRootNode ); while (mWrapped.size() > 0) { - YAKE_LOG_INFORMATION(String("graphicsOgre: trying to destroy wrapped object...")); + YAKE_LOG_INFORMATION("graphicsOgre", String("graphicsOgre: trying to destroy wrapped object...")); //delete *mWrapped.begin(); delete mWrapped.begin()->second; mWrapped.erase( mWrapped.begin() ); Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/raf/yakeApplication.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -97,15 +97,15 @@ } catch (yake::Exception& e) { - YAKE_LOG_ERROR("RAF caught a Yake exception!\nException Message: " + e.getMessage()); + YAKE_LOG_ERROR("raf","RAF caught a Yake exception!\nException Message: " + e.getMessage()); } catch (std::exception& e) { - YAKE_LOG_ERROR(String("RAF caught a std::exception!\nException Message: ") + e.what()); + YAKE_LOG_ERROR("raf",String("RAF caught a std::exception!\nException Message: ") + e.what()); } catch (...) { - YAKE_LOG_ERROR("RAF caught an unhandled exception!"); + YAKE_LOG_ERROR("raf","RAF caught an unhandled exception!"); } return false; } @@ -181,7 +181,7 @@ yake::base::Library* pDynLib = new yake::base::Library( file ); //@FIXME. MEMORY LEAK. YAKE_ASSERT( pDynLib ).debug( "Out of memory" ); - YAKE_LOG( "Loading plugin " + file ); + YAKE_LOG("raf", "Loading plugin " + file ); yake::base::YakeDynLibStartPluginFn pfnStartPlugin = (yake::base::YakeDynLibStartPluginFn)pDynLib->getSymbol( "dynlibStartPlugin" ); YAKE_ASSERT( pfnStartPlugin ).debug( "Cannot find export in dynamic library" ); @@ -201,17 +201,17 @@ //---- Stating CEGUI - YAKE_LOG( "Initialising CEGUI..." ); + YAKE_LOG("raf", "Initialising CEGUI..." ); CEGUI::System* ceguiSys = new CEGUI::System( mCeguiRendererAdapter->getRenderer() ); using namespace CEGUI; - YAKE_LOG( "Setting CEGUI logging level..." ); + YAKE_LOG( "raf", "Setting CEGUI logging level..." ); Logger::getSingleton().setLoggingLevel( Informative ); try { - YAKE_LOG( "Loading scheme..." ); + YAKE_LOG( "raf", "Loading scheme..." ); // load scheme and set up defaults SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLook.scheme"); System::getSingleton().setDefaultMouseCursor((utf8*)"TaharezLook", (utf8*)"MouseArrow"); @@ -230,7 +230,7 @@ // catch to prevent exit (errors will be logged). catch( CEGUI::Exception& e) { - YAKE_LOG( yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); + YAKE_LOG( "raf", yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); YAKE_EXCEPT(yake::String( "Caught CEGUI Exception:\n") + e.getMessage().c_str() ); } } Modified: trunk/yake/src/raf/yakeApplicationState.cpp =================================================================== --- trunk/yake/src/raf/yakeApplicationState.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/raf/yakeApplicationState.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -58,15 +58,15 @@ } void MainState::onEnter() { - YAKE_LOG_INFORMATION("MainState::onEnter()"); + YAKE_LOG_INFORMATION("raf","MainState::onEnter()"); } void MainState::onExit() { - YAKE_LOG_INFORMATION("MainState::onExit()"); + YAKE_LOG_INFORMATION("raf","MainState::onExit()"); } void MainState::onStep() { - YAKE_LOG_INFORMATION("MainState::onStep()"); + YAKE_LOG_INFORMATION("raf","MainState::onStep()"); } //----------------------------------------------------- Modified: trunk/yake/src/raf/yakeRtApplicationState.cpp =================================================================== --- trunk/yake/src/raf/yakeRtApplicationState.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/raf/yakeRtApplicationState.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -55,7 +55,7 @@ YAKE_ASSERT( pVP ); if (!pVP) { - YAKE_LOG_WARNING("Could not create the default viewport!"); + YAKE_LOG_WARNING("raf","Could not create the default viewport!"); return 0; } // default is a fullscreen viewport @@ -142,7 +142,7 @@ YAKE_ASSERT( mDefaultCamera ); if (!mDefaultCamera) { - YAKE_LOG_WARNING("No default camera available."); + YAKE_LOG_WARNING("raf","No default camera available."); } else { @@ -152,7 +152,7 @@ YAKE_ASSERT( pVP ); if (!pVP) { - YAKE_LOG_WARNING("Could not get/create default viewport!"); + YAKE_LOG_WARNING("raf","Could not get/create default viewport!"); } else if (!onGetDefaultViewport()) { Modified: trunk/yake/src/vehicle/yakeNativeOde.cpp =================================================================== --- trunk/yake/src/vehicle/yakeNativeOde.cpp 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/src/vehicle/yakeNativeOde.cpp 2007-01-22 21:21:46 UTC (rev 1600) @@ -106,7 +106,7 @@ } void GenericVehicleSystem::_onVehicleTpl(vehicle::DotVehicleParser& parser, const String& tplId) { - YAKE_LOG("GenericVehicleSystem: loaded vehicle template'" + tplId + "'."); + YAKE_LOG("vehicle","GenericVehicleSystem: loaded vehicle template'" + tplId + "'."); mVehicleTemplates[ tplId ] = SharedPtr<vehicle::VehicleTemplate>( parser.detachCurrentVehicleTpl() ); YAKE_ASSERT( mVehicleTemplates[ tplId ] ); } @@ -269,10 +269,10 @@ } void GenericVehicle::_create(const VehicleTemplate& tpl, physics::IWorld& PWorld, model::Physical& physModel ) { - YAKE_LOG( "Creating vehicle from template..." ); + YAKE_LOG("vehicle", "Creating vehicle from template..." ); if ( tpl.mChassis.mPhysicsBody != "" ) // i.e. chassis is defined as reference to physical body { - YAKE_LOG( "External physical body found. Searching provided model for it..." ); + YAKE_LOG("vehicle", "External physical body found. Searching provided model for it..." ); // searching for actor in provided model physics::IActorPtr actor = physModel.getActor( tpl.mChassis.mPhysicsBody ); @@ -280,13 +280,13 @@ YAKE_ASSERT( actor != NULL ).error( "Actor '" + tpl.mChassis.mPhysicsBody + "' was not found in physical model! Are you sure you provided the right model???" ); - YAKE_LOG( "Found. OK." ); + YAKE_LOG("vehicle", "Found. OK." ); // initial position is determined by body position mpChassis = actor; } else // chassis is defined in .vehicle itself { - YAKE_LOG( "External physical body not found. Looking for body definition in .vehicle file." ); + YAKE_LOG("vehicle", "External physical body not found. Looking for body definition in .vehicle file." ); // chassis mpChassis = PWorld.createActor( physics::ACTOR_DYNAMIC ); Modified: trunk/yake/yake/base/yakeLog.h =================================================================== --- trunk/yake/yake/base/yakeLog.h 2007-01-22 21:19:05 UTC (rev 1599) +++ trunk/yake/yake/base/yakeLog.h 2007-01-22 21:21:46 UTC (rev 1600) @@ -59,7 +59,7 @@ YAKE_BASE_API const char* toString(const Severity sev); /** severity, processId, threadId, message */ - typedef void(*LogFn)(const severity_t, const char*, threadid_t, const char*); + typedef void(*LogFn)(const severity_t, const char*, const char*, threadid_t, const char*); struct YAKE_BASE_API logger : public boost::noncopyable { //YAKE_BUILD_PHOENIX_SINGLETON(logger) //public @@ -68,18 +68,23 @@ static logger& instance(); static logger instance_; public: - static void log(const severity_t, const char* tid, const char* msg); + //static void log(const severity_t, const char* env, const char* src, const char* msg); + static void log(const severity_t, const char* logId, const char* msg); static void setProcessId(const String&); static int addTarget(const LogFn); static void enableSeverity(const severity_t, const bool); + static void enableLog(const char* logId, const bool); private: - void doLog(const severity_t, const char* tid, const char* msg); + //void doLog(const severity_t, const char* env, const char* msg); + void doLog(const severity_t, const char* logId, const char* msg); private: String procId_; typedef std::vector<LogFn> TargetFnList; TargetFnList targets_; typedef std::map<severity_t,bool> EnableMap; EnableMap enabledSeverities_; + typedef std::map<std::string,bool> EnableLogIdMap; + EnableLogIdMap enabledLogs_; boost::mutex mtx_; struct scoped_lock; friend struct scoped_lock; @@ -99,28 +104,28 @@ #endif template<typename T1> - inline void log(const severity_t sev, const T1& rhs) + inline void log(const severity_t sev, const char* logId, const T1& rhs) { std::stringstream ss; ss << LOG_TYPE(rhs); - logger::log(sev, "[threadid]", ss.str().c_str()); + logger::log(sev, logId, ss.str().c_str()); } template<typename T1, typename T2> - inline void log(const severity_t sev, const T1& rhs1, const T2& rhs2) + inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2) { std::stringstream ss; ss << LOG_TYPE(rhs1); ss << LOG_TYPE(rhs2); - logger::log(sev, "[threadid]", ss.str().c_str()); + logger::log(sev, logId, ss.str().c_str()); } template<typename T1, typename T2, typename T3> - inline void log(const severity_t sev, const T1& rhs1, const T2& rhs2, const T3& rhs3) + inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2, const T3& rhs3) { std::stringstream ss; ss << LOG_TYPE(rhs1); ss << LOG_TYPE(rhs2); ss << LOG_TYPE(rhs3); - logger::log(sev, "[threadid]", ss.str().c_str()); + logger::log(sev, logId, ss.str().c_str()); } // short cuts @@ -132,6 +137,10 @@ { logger::enableSeverity(sev,on); } + inline void enableLog(const char* logId, const bool on) + { + logger::enableLog(logId,on); + } inline void addTarget(const LogFn fn) { logger::addTarget(fn); @@ -169,10 +178,16 @@ #define YAKE_LOG_ERROR( what ) yake::logging::log( yake::logging::S_ERROR, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); #define YAKE_LOG( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: \"__FILE__\"@\"TOSTRING(__LINE__)+\"] ", what ); #else - #define YAKE_LOG_INFORMATION( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG_WARNING( what ) yake::logging::log( yake::logging::S_WARNING, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG_ERROR( what ) yake::logging::log( yake::logging::S_ERROR, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); - #define YAKE_LOG( what ) yake::logging::log( yake::logging::S_INFORMATION, "[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + //#define YAKE_LOG_INFORMATION( what ) yake::logging::log( yake::logging::S_INFORMATION, std:"[File: "__FILE__"@"TOSTRING(__LINE__)+"] ", what ); + #define YAKE_LOG_X_BASE( LOGID, LOGLVL, WHAT ) \ + { \ + std::stringstream ss; ss << WHAT; \ + yake::logging::log( LOGLVL, LOGID, ss.str() ); \ + } + #define YAKE_LOG_INFORMATION( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT ) + #define YAKE_LOG_WARNING( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_WARNING, WHAT ) + #define YAKE_LOG_ERROR( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_ERROR, WHAT ) + #define YAKE_LOG( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT ); #endif } // namespace logging } // namespace yake This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:23:34
|
Revision: 1601 http://svn.sourceforge.net/yake/?rev=1601&view=rev Author: psyclonist Date: 2007-01-22 13:23:31 -0800 (Mon, 22 Jan 2007) Log Message: ----------- modified logging API, physicsOde: avoid collision detection between static objects Modified Paths: -------------- trunk/yake/src/plugins/physicsODE/OdeActor.cpp trunk/yake/src/plugins/physicsODE/OdeAvatar.cpp trunk/yake/src/plugins/physicsODE/OdeShapes.cpp trunk/yake/src/plugins/physicsODE/OdeWorld.cpp trunk/yake/yake/plugins/physicsODE/OdeActor.h Modified: trunk/yake/src/plugins/physicsODE/OdeActor.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeActor.cpp 2007-01-22 21:21:46 UTC (rev 1600) +++ trunk/yake/src/plugins/physicsODE/OdeActor.cpp 2007-01-22 21:23:31 UTC (rev 1601) @@ -39,13 +39,14 @@ //----------------------------------------------------- //----------------------------------------------------- - OdeActor::OdeActor( OdeWorld* pWorld, bool bDynamic ) : + OdeActor::OdeActor( OdeWorld* pWorld, const ActorType type ) : mOdeWorld(pWorld), mBody(0), actorSpace(0), - actorSpaceID(0) + actorSpaceID(0), + type_(type) { - if (bDynamic) + if (type_ == ACTOR_DYNAMIC) { mBody = new OdeBody( mOdeWorld, *this ); YAKE_ASSERT( mBody ).error( "Failed to create body!" ); @@ -105,7 +106,7 @@ //----------------------------------------------------- OdeGeom* OdeActor::createShapeFromDesc( const IShape::Desc& rShapeDesc ) { - YAKE_LOG_INFORMATION( String( "OdeActor | creating geom. Position " ) << rShapeDesc.position ); + YAKE_LOG_INFORMATION("physicsOde", String( "OdeActor | creating geom. Position " ) << rShapeDesc.position ); const IShape::Desc* pShapeDesc = &( rShapeDesc ); IMaterial* pMaterial = this->getCreator()->getMaterial( pShapeDesc->material ); @@ -242,7 +243,7 @@ setupOdeSpace(); YAKE_ASSERT( actorSpaceID && actorSpace ); - YAKE_LOG( "Adding geom to the actor space"); + YAKE_LOG( "physicsOde", "Adding geom to the actor space"); if( geom->_getOdeSpaceID() == actorSpaceID) // geom already in the actor space return; @@ -256,7 +257,7 @@ // and insert it to the actor space dSpaceAdd( actorSpaceID, geom->_getOdeGeomID()); - YAKE_LOG( String("Objects in Actor ODE Space = ")<< dSpaceGetNumGeoms( actorSpaceID)); + YAKE_LOG( "physicsOde", String("Objects in Actor ODE Space = ")<< dSpaceGetNumGeoms( actorSpaceID)); } //----------------------------------------------------- Modified: trunk/yake/src/plugins/physicsODE/OdeAvatar.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeAvatar.cpp 2007-01-22 21:21:46 UTC (rev 1600) +++ trunk/yake/src/plugins/physicsODE/OdeAvatar.cpp 2007-01-22 21:23:31 UTC (rev 1601) @@ -204,8 +204,8 @@ localTargetVel = (localTargetVel - localCurrLinVel); localTargetVel.y = 0.; if (mJumping) - localTargetVel *= 0.2; // player is less able to control direction during jump - so scale influence - if (localTargetVel.length() > 0.001) + localTargetVel *= real(0.2); // player is less able to control direction during jump - so scale influence + if (localTargetVel.length() > real(0.001)) { Vector3 forceInLocalPlane = mActor->getBody().getMass() * (localTargetVel); forceInLocalPlane = mOrientation * forceInLocalPlane; Modified: trunk/yake/src/plugins/physicsODE/OdeShapes.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeShapes.cpp 2007-01-22 21:21:46 UTC (rev 1600) +++ trunk/yake/src/plugins/physicsODE/OdeShapes.cpp 2007-01-22 21:23:31 UTC (rev 1601) @@ -211,7 +211,7 @@ // enabling collisions with spheres and boxes dGeomTriMeshEnableTC( mOdeGeomID, dSphereClass, 1 ); dGeomTriMeshEnableTC( mOdeGeomID, dBoxClass, 1 ); - YAKE_LOG_INFORMATION("physicsOde: enabled sphere+box collisions for trimesh"); + YAKE_LOG_INFORMATION("physicsOde","enabled sphere+box collisions for trimesh"); _setData( this ); } Modified: trunk/yake/src/plugins/physicsODE/OdeWorld.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeWorld.cpp 2007-01-22 21:21:46 UTC (rev 1600) +++ trunk/yake/src/plugins/physicsODE/OdeWorld.cpp 2007-01-22 21:23:31 UTC (rev 1601) @@ -316,7 +316,7 @@ //----------------------------------------------------- IActorPtr OdeWorld::createActor( const IActor::Desc& rActorDesc ) { - OdeActor* pActor = new OdeActor( this, (rActorDesc.type == ACTOR_DYNAMIC) ); + OdeActor* pActor = new OdeActor( this, rActorDesc.type ); YAKE_ASSERT( pActor ); typedef Deque< SharedPtr<IShape::Desc> > ActorShapesCollection; @@ -451,7 +451,7 @@ mMeshDataMap.insert( MeshDataMap::value_type( mNextMeshId, data ) ); - YAKE_LOG(String("TriangleMeshes in the scene - ")<<mMeshDataMap.size()); + YAKE_LOG("physicsOde", String("TriangleMeshes in the scene - ")<<mMeshDataMap.size()); return mNextMeshId++; } @@ -490,7 +490,7 @@ //----------------------------------------------------- void OdeWorld::_OdeNearCallback ( void* data, dGeomID o1, dGeomID o2 ) { - //YAKE_LOG("OdeWorld::->NearCallBack()"); + //YAKE_LOG("physicsOde", "OdeWorld::->NearCallBack()"); // make sure we traverse through all spaces and sub-spaces if ( dGeomIsSpace (o1) || dGeomIsSpace (o2) ) { @@ -533,12 +533,24 @@ { OdeActor* pA = static_cast<OdeGeom*>( data1 )->getOwner(); OdeActor* pB = static_cast<OdeGeom*>( data2 )->getOwner(); - if ( pA && pB ) + + if (!pA || !pB) + return; + + // collision between two static objects: do nothing + if ((pA->getType() == ACTOR_STATIC) && (pA->getType() == ACTOR_STATIC)) { - // collide - pA->_collide( pB, o1, o2, odeContactGroup ); return; } + else // at least one object is 'dynamic' or 'moving' + { + if ( pA && pB ) + { + // collide + pA->_collide( pB, o1, o2, odeContactGroup ); + return; + } + } } } Modified: trunk/yake/yake/plugins/physicsODE/OdeActor.h =================================================================== --- trunk/yake/yake/plugins/physicsODE/OdeActor.h 2007-01-22 21:21:46 UTC (rev 1600) +++ trunk/yake/yake/plugins/physicsODE/OdeActor.h 2007-01-22 21:23:31 UTC (rev 1601) @@ -39,7 +39,7 @@ class YAKE_PHYSICSODE_API OdeActor : public IActor { public: - OdeActor( OdeWorld* pOdeWorld, bool bDynamic ); + OdeActor( OdeWorld* pOdeWorld, const ActorType type ); virtual ~OdeActor(); IBody& getBody() const; @@ -76,6 +76,9 @@ void _collide( OdeActor* pOther, dGeomID geomA, dGeomID geomB, dJointGroup* pContactJointGroup ); bool isSpaceEmpty(); + + ActorType getType() const + { return type_; } protected: IBody::MassDesc* createMassDescFromShapeDesc( const IShape::Desc& rShapeDesc, real massOrDensity, IBody::quantityType qType ); @@ -119,6 +122,8 @@ dSpaceID actorSpaceID; dSpace * actorSpace; + + ActorType type_; }; } // physics This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:33:27
|
Revision: 1606 http://svn.sourceforge.net/yake/?rev=1606&view=rev Author: psyclonist Date: 2007-01-22 13:33:25 -0800 (Mon, 22 Jan 2007) Log Message: ----------- added another sample to premake build script, provided global macro for building dynamic link library names Modified Paths: -------------- trunk/yake/scripts/premake/samples.lua trunk/yake/yake/base/yakePrerequisites.h Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2007-01-22 21:32:50 UTC (rev 1605) +++ trunk/yake/scripts/premake/samples.lua 2007-01-22 21:33:25 UTC (rev 1606) @@ -34,6 +34,12 @@ useComponent("entLua") -------------------------------------- +makeSample("samplePhysics1","samples/physics/demo") +useComponent("base") +useComponent("physics") +useComponent("graphics") + +-------------------------------------- makeSample("sampleRafMinimal","samples/raf/minimal") useComponent("base") useComponent("raf") Modified: trunk/yake/yake/base/yakePrerequisites.h =================================================================== --- trunk/yake/yake/base/yakePrerequisites.h 2007-01-22 21:32:50 UTC (rev 1605) +++ trunk/yake/yake/base/yakePrerequisites.h 2007-01-22 21:33:25 UTC (rev 1606) @@ -149,4 +149,13 @@ #define YAKE_FOR_EACH(ITER_TYPE,ITER_NAME,CTR) \ for (ITER_TYPE ITER_NAME = CTR.begin(); ITER_NAME != CTR.end(); ++ITER_NAME) + +#ifdef YAKE_DEBUG +# define YAKE_DYNLIB_POSTFIX "_d" +#else +# define YAKE_DYNLIB_POSTFIX +#endif +#define YAKE_DYNLIB_NAME(X) \ + yake::String("yake_" X YAKE_DYNLIB_POSTFIX).c_str() + #endif // YAKE_BASE_PREREQUISITES_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:34:15
|
Revision: 1607 http://svn.sourceforge.net/yake/?rev=1607&view=rev Author: psyclonist Date: 2007-01-22 13:34:15 -0800 (Mon, 22 Jan 2007) Log Message: ----------- added beginObjects() and endObjects() for iterating over contained objects Modified Paths: -------------- trunk/yake/src/ent/object_mgr.cpp trunk/yake/yake/ent/object_mgr.h Modified: trunk/yake/src/ent/object_mgr.cpp =================================================================== --- trunk/yake/src/ent/object_mgr.cpp 2007-01-22 21:33:25 UTC (rev 1606) +++ trunk/yake/src/ent/object_mgr.cpp 2007-01-22 21:34:15 UTC (rev 1607) @@ -148,6 +148,14 @@ { return objMgr_.getObject( objId ); } + ObjectManager::const_object_iterator ObjectManager::beginObjects() const + { + return objs_.begin(); + } + ObjectManager::const_object_iterator ObjectManager::endObjects() const + { + return objs_.end(); + } } } Modified: trunk/yake/yake/ent/object_mgr.h =================================================================== --- trunk/yake/yake/ent/object_mgr.h 2007-01-22 21:33:25 UTC (rev 1606) +++ trunk/yake/yake/ent/object_mgr.h 2007-01-22 21:34:15 UTC (rev 1607) @@ -160,6 +160,11 @@ bool registerClassAlias(const String& aliasName, const ClassId targetClsId); bool registerClassAlias(const ClassId aliasClsId, const ClassId targetClsId); void setClassIdGenerationRange(const ClassId min, const ClassId max); + + typedef std::deque<Object*> object_ptr_list; + typedef object_ptr_list::const_iterator const_object_iterator; + const_object_iterator beginObjects() const; + const_object_iterator endObjects() const; private: // typedef ListenerManager<ObjectManagerListener> listener_mgr_type; @@ -169,7 +174,6 @@ private: void setupObjectPostCreate(Object*); - typedef std::deque<Object*> object_ptr_list; object_ptr_list objs_; typedef object::ObjectManager<Object> obj_mgr_type; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:37:24
|
Revision: 1608 http://svn.sourceforge.net/yake/?rev=1608&view=rev Author: psyclonist Date: 2007-01-22 13:37:23 -0800 (Mon, 22 Jan 2007) Log Message: ----------- various tidy ups in the networking system, moved replication services out of the prototype into 'netrepsvc', modified logging API, added IServerPacketConnection::sendToAllExcept() Modified Paths: -------------- trunk/yake/samples/net/inprocess/common.h trunk/yake/samples/net/roclient/ROClient.cpp trunk/yake/samples/net/roclient/ROClient.h trunk/yake/samples/net/roserver/ROServer.cpp trunk/yake/samples/net/roserver/ROServer.h trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp trunk/yake/src/net/detail/netEventConnection.cpp trunk/yake/src/netsvc/detail/netPeerRttCalculator.cpp trunk/yake/src/netsvc/service/netClientCommService.cpp trunk/yake/src/netsvc/service/netClientTimeService.cpp trunk/yake/src/netsvc/service/netServerCommService.cpp trunk/yake/src/netsvc/service/netServerTimeService.cpp trunk/yake/yake/net/detail/netEnetServerPacketConnection.h trunk/yake/yake/net/detail/netInternal.h trunk/yake/yake/net/netPacket.h trunk/yake/yake/netsvc/netPrerequisites.h trunk/yake/yake/samples/common/yakeExampleApplication.h trunk/yake/yake/samples/net/common/commonEvents.h Modified: trunk/yake/samples/net/inprocess/common.h =================================================================== --- trunk/yake/samples/net/inprocess/common.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/samples/net/inprocess/common.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -7,4 +7,5 @@ #include <yake/net/net.h> #include <yake/samples/net/common/common.h> +#define COUTLN(X) YAKE_LOG_INFORMATION("app",X) #endif Modified: trunk/yake/samples/net/roclient/ROClient.cpp =================================================================== --- trunk/yake/samples/net/roclient/ROClient.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/samples/net/roclient/ROClient.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -1,21 +1,18 @@ #include <samples/net/inprocess/common.h> +#include <yake/netrepsvc/netEvents.h> #include <samples/net/roclient/ROClient.h> namespace yake { namespace ro { client::client(const net::Address& serverAddr) : - timedOut_(false), stage_(CS_JOINING), objMgr_(0), serverAddr_(serverAddr), packetConnStarted_(false) + timedOut_(false), stage_(CS_JOINING), serverAddr_(serverAddr), packetConnStarted_(false) { } client::~client() { stop(); } - void client::setObjectManager(ent::ObjectManager* objMgr) - { - objMgr_ = objMgr; - } bool client::onStart() { try { @@ -68,10 +65,6 @@ c2sEvtJoinReq::create, c2sEvtJoinReq::destroy ); evtConn_->registerEvent( s2cEvtJoinReqReply::ID, net::NetEvent::DIR_ANY, s2cEvtJoinReqReply::create, s2cEvtJoinReqReply::destroy ); - evtConn_->registerEvent( s2cEvtClassTable::ID, net::NetEvent::DIR_ANY, - s2cEvtClassTable::create, s2cEvtClassTable::destroy ); - evtConn_->registerEvent( s2cEvtCreateObject::ID, net::NetEvent::DIR_ANY, - s2cEvtCreateObject::create, s2cEvtCreateObject::destroy ); evtConn_->setProcessEventCallback( boost::bind(&client::onProcessEvent,this,_1,_2,_3) ); evtConn_->setPacketConnection( conn_.get(), net::NetEvent::DIR_ANY ); @@ -149,70 +142,6 @@ void client::running_onProcessEvent(const net::PeerId, const net::NetEvent& evt, const net::ChannelId) { COUTLN("client (running) received event (" << (int)evt.id() << ")."); - if (evt.id() == s2cEvtClassTable::ID) - { - COUTLN("client: starting sim " << int(evt.id())); - const s2cEvtClassTable& reply = static_cast<const s2cEvtClassTable&>( evt ); - COUTLN(" " << int(reply.globalClassIds_.size()) << " class(es)"); - for (std::map<std::string,ent::ClassId>::const_iterator it = reply.globalClassIds_.begin(); - it != reply.globalClassIds_.end(); ++it) - { - const std::string& clsName = it->first; - const ent::ClassId globalClsId = it->second; - COUTLN(" ['" << clsName << "'] = " << int(globalClsId)); - if (!objMgr_) - { - COUTLN(" -> no object manager"); - } - else - { - ent::ObjectManager::ClassIdLookupResult ret = objMgr_->getClassId( clsName ); - if (ret.first) - { - const ent::ClassId localClsId = ret.second; - if (localClsId != it->second) - { - if (objMgr_->registerClassAlias( globalClsId, localClsId )) - { - COUTLN(" -> successfully registered alias"); - } - else - { - COUTLN(" -> failed to register alias"); - } - } - else - { - COUTLN(" -> no need to register an alias (global id = local id; and names match)"); - } - } - else - { - COUTLN(" -> class with this name not registered locally!"); - } - } - } - } - else if (evt.id() == s2cEvtCreateObject::ID) - { - COUTLN("client: creating object"); - const s2cEvtCreateObject& reply = static_cast<const s2cEvtCreateObject&>( evt ); - COUTLN(" object class='" << int(reply.objId_.classId()) << "' serNo='" << int(reply.objId_.serialNo()) << "'"); - if (objMgr_) - { - ent::Object* o = objMgr_->makeObject( reply.objId_ ); - if (o) - { - COUTLN(" successfully created! (class='" << o->isA()->name() << "')"); - objMgr_->destroyObject( o ); - } - else - COUTLN(" failed to create!"); - } - } - //else if (evt.id() == s2cUpdateObject::ID) - { - } } void client::init_onProcessEvent(const net::PeerId, const net::NetEvent& evt, const net::ChannelId) { Modified: trunk/yake/samples/net/roclient/ROClient.h =================================================================== --- trunk/yake/samples/net/roclient/ROClient.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/samples/net/roclient/ROClient.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -18,8 +18,6 @@ virtual net::NetEventConnectionPtr getEventConnection() const { return evtConn_; } - void setObjectManager(yake::ent::ObjectManager*); - void waitForStart(); void step(); private: @@ -40,8 +38,6 @@ }; stage_t stage_; - yake::ent::ObjectManager* objMgr_; - typedef net::INetEventConnection::EvtProcessEventFn ProcessEventFn; ProcessEventFn currEvtProcessFn_; private: Modified: trunk/yake/samples/net/roserver/ROServer.cpp =================================================================== --- trunk/yake/samples/net/roserver/ROServer.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/samples/net/roserver/ROServer.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -91,18 +91,10 @@ { return sigClientDisconnected_.connect(slot); } - const s2cEvtClassTable& server::getClassTableMessage() const - { - return evtClassTbl_; - } void server::onClientSimStarted(iclient&c) { sigClientSimulationStarted_(c.getPeerId()); } - void server::setClassTableMessage(const s2cEvtClassTable& msg) - { - msg.copyTo( evtClassTbl_ ); - } bool server::onStart() { if (conn_) @@ -166,9 +158,9 @@ evtConn_->registerEvent( c2sEvtJoinReq::ID, net::NetEvent::DIR_ANY, c2sEvtJoinReq::create, c2sEvtJoinReq::destroy ); evtConn_->registerEvent( s2cEvtJoinReqReply::ID, net::NetEvent::DIR_ANY, s2cEvtJoinReqReply::create, s2cEvtJoinReqReply::destroy ); - evtConn_->registerEvent( s2cEvtClassTable::ID, net::NetEvent::DIR_ANY, s2cEvtClassTable::create, s2cEvtClassTable::destroy ); + evtConn_->registerEvent( net::s2cEvtClassTable::ID, net::NetEvent::DIR_ANY, net::s2cEvtClassTable::create, net::s2cEvtClassTable::destroy ); evtConn_->registerEvent( c2sEvtSimOk::ID, net::NetEvent::DIR_ANY, c2sEvtSimOk::create, c2sEvtSimOk::destroy ); - evtConn_->registerEvent( s2cEvtCreateObject::ID, net::NetEvent::DIR_ANY, s2cEvtCreateObject::create, s2cEvtCreateObject::destroy ); + evtConn_->registerEvent( net::s2cEvtCreateObject::ID, net::NetEvent::DIR_ANY, net::s2cEvtCreateObject::create, net::s2cEvtCreateObject::destroy ); evtConn_->setProcessEventCallback( boost::bind(&server::onProcessEvent,this,_1,_2,_3) ); evtConn_->setPacketConnection( conn_.get(), net::NetEvent::DIR_ANY ); @@ -250,10 +242,6 @@ evtConn->sendEvent( this->id, joinReply, net::SendOptions().channel(CHANNELID_CONTROL) ); #endif - // replicate class table - evtConn->sendEvent( this->id, this->svr.getClassTableMessage(), - net::SendOptions().channel(CHANNELID_CONTROL).ordered().reliable() ); - // use different event callback for the CS_RUNNING stage: COUTLN("server: => CLIENT: RUNNING"); processEventFn_ = boost::bind(&client::running_onProcessEvent,this,_1,_2); Modified: trunk/yake/samples/net/roserver/ROServer.h =================================================================== --- trunk/yake/samples/net/roserver/ROServer.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/samples/net/roserver/ROServer.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -2,6 +2,7 @@ #define RO_SERVER_H #include <yake/netsvc/netSvc.h> +#include <yake/netrepsvc/netEvents.h> #include <yake/samples/net/common/common.h> #include <yake/samples/net/common/commonEvents.h> #include <yake/samples/net/common/roCommon.h> @@ -46,10 +47,6 @@ //void queueEvent(const net::PeerId, net::NetEvent*, const net::ChannelId); //void queueEventBroadcast(net::NetEvent*, const net::ChannelId); - //typedef boost::function<void(s2cEvtClassTable&)> InitEvtClassTableFn; - //void setInitClassTableMessageFn(const InitEvtClassTableFn&); - void setClassTableMessage(const s2cEvtClassTable&); - typedef SignalX<void(const net::PeerId)> PeerIdSignal; typedef PeerIdSignal ClientSimulationStartedSignal; typedef PeerIdSignal ClientDisconnectedSignal; @@ -57,7 +54,7 @@ yake::SignalConnection subscribeToClientDisconnected(const ClientDisconnectedSignal::slot_type&); //private: - const s2cEvtClassTable& getClassTableMessage() const; + const net::s2cEvtClassTable& getClassTableMessage() const; private: server(const server&); server& operator=(const server&); @@ -99,7 +96,6 @@ //mutable boost::mutex outEvtQMtx_; //InitEvtClassTableFn initEvtClassTableFn_; - s2cEvtClassTable evtClassTbl_; ClientSimulationStartedSignal sigClientSimulationStarted_; ClientDisconnectedSignal sigClientDisconnected_; }; Modified: trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp =================================================================== --- trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/net/detail/netEnetServerPacketConnection.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -398,21 +398,53 @@ } void EnetServerPacketConnection::sendOutgoingPacketQ() { + //@todo Only send if the target client is CS_CONNECTED + for (OutgoingPacketQ::const_iterator it = m_outgoingPacketQ.begin(); it != m_outgoingPacketQ.end(); ++it) //YAKE_FOR_EACH(OutgoingPacketQ::const_iterator,it,m_outgoingPacketQ) { const SendOptions& opt = it->opt_; const PacketPtr& pckt = it->pckt_; YAKE_ASSERT( pckt.get() ); - if (it->target_ == PEERID_BROADCAST) + if (it->sendToAllExcept_) + { + // to all clients except peerId + IdToClientMap::const_iterator itIdEnd = m_id2client.end(); + for (IdToClientMap::const_iterator itId = m_id2client.begin(); itId!=itIdEnd; ++itId) + { + if (itId->first == it->target_) + continue; + this->sendTo( itId->first, pckt->payload().data(), pckt->payload().size(), + opt.getReliability(), opt.getOrdering(), opt.getChannel() ); + } + } + else if (it->target_ == PEERID_BROADCAST) + { + // to all clients this->sendBroadcast( pckt->payload().data(), pckt->payload().size(), opt.getReliability(), opt.getOrdering(), opt.getChannel() ); + } else + { + // to a single client this->sendTo( it->target_, pckt->payload().data(), pckt->payload().size(), opt.getReliability(), opt.getOrdering(), opt.getChannel() ); + } } m_outgoingPacketQ.clear(); } + void EnetServerPacketConnection::sendToAllExcept(const PeerId peerId, const PacketPtr& pckt, const SendOptions& opt ) + { + YAKE_ASSERT( pckt ); + if (!pckt) + return; + OutgoingPacket pcktEntry; + pcktEntry.opt_ = opt; + pcktEntry.pckt_ = pckt; + pcktEntry.target_ = opt.getPeerId(); + pcktEntry.sendToAllExcept_ = true; + m_outgoingPacketQ.push_back( pcktEntry ); + } void EnetServerPacketConnection::send( const PacketPtr& pckt, const SendOptions& opt ) { YAKE_ASSERT( pckt ); Modified: trunk/yake/src/net/detail/netEventConnection.cpp =================================================================== --- trunk/yake/src/net/detail/netEventConnection.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/net/detail/netEventConnection.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -34,7 +34,7 @@ EventConnection::~EventConnection() { stop(); -#ifdef _DEBUG +#ifdef YAKE_DEBUG std::cout << "\nnet::EventConnection statistics:\n"; std::cout << " total errors : " << stats_.totalErrors() << "\n"; std::cout << " total events processed : " << stats_.numEventsProcessed << "\n"; @@ -121,9 +121,18 @@ NET_ASSERT( !fnDestroy.empty() ); if (fnDestroy.empty()) return; - NET_ASSERT( !map_contains(eventIds_,id) ); + // NB It is OK to register a single id multiple times + //NET_ASSERT( !map_contains(eventIds_,id) ); +#ifdef YAKE_DEBUG if (map_contains(eventIds_,id)) + { + YAKE_LOG_WARNING("net","event id registered multiple times on event connection"); return; + } +#endif + + if (map_contains(eventIds_,id)) + return; IdEntry entry; entry.dir = dir; entry.fnCreate = fnCreate; Modified: trunk/yake/src/netsvc/detail/netPeerRttCalculator.cpp =================================================================== --- trunk/yake/src/netsvc/detail/netPeerRttCalculator.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/netsvc/detail/netPeerRttCalculator.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -57,7 +57,7 @@ is_time_sent(origTime)); if (itPing == sentPings_.end()) { - COUTLN("(cannot find ping for time " << origTime << ")"); + YAKE_LOG_INFORMATION("rtt","(cannot find ping for time " << origTime << ")"); return false; } @@ -68,10 +68,10 @@ PingInfo& pingInfo = receivedPings_.back(); pingInfo.timeRecvd_ = currTimeMs; pingInfo.rtt_ = (double(pingInfo.timeRecvd_) - double(pingInfo.timeSent_)); - COUTLN(pingInfo.rtt_); + YAKE_LOG_INFORMATION("rtt",pingInfo.rtt_); if (pingInfo.rtt_ < 0.) { - COUTLN("(ignoring rtt < 0; rtt=" << pingInfo.rtt_ << ")\n"); + YAKE_LOG_INFORMATION("rtt","(ignoring rtt < 0; rtt=" << pingInfo.rtt_ << ")\n"); receivedPings_.pop_back(); return false; } Modified: trunk/yake/src/netsvc/service/netClientCommService.cpp =================================================================== --- trunk/yake/src/netsvc/service/netClientCommService.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/netsvc/service/netClientCommService.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -12,7 +12,7 @@ } void ClientCommService::onStart(IServiceHost& host) { - COUTLN("client: starting comm service"); + YAKE_LOG_INFORMATION("client-comm", "client: starting comm service"); evtConn_ = host.getEventConnection(); evtConn_->registerEvent( s2cEvtCommMsg::ID, NetEvent::DIR_ANY, s2cEvtCommMsg::create, s2cEvtCommMsg::destroy ); host.subscribeToNetEvent( s2cEvtCommMsg::ID, commChannelId_, @@ -22,7 +22,7 @@ } void ClientCommService::onStop(IServiceHost&) { - COUTLN("client: stopping comm service"); + YAKE_LOG_INFORMATION("client-comm", "client: stopping comm service"); } void ClientCommService::joinChannel(const String& cId) { @@ -38,7 +38,7 @@ void ClientCommService::onProcessMsg(const PeerId pId, const NetEvent& evt, const ChannelId) { const s2cEvtCommMsg& msg = static_cast<const s2cEvtCommMsg&>(evt); - COUTLN("client-comm: received message: cid=" << msg.cId_ << " from=" << msg.from_ << " to=" << msg.to_ << " text=" << msg.msg_); + YAKE_LOG_INFORMATION("client-comm", "client-comm: received message: cid=" << msg.cId_ << " from=" << msg.from_ << " to=" << msg.to_ << " text=" << msg.msg_); activeChannels_[ msg.cId_ ].outstandingMessages_.push_back(MsgEntry(msg.from_,msg.msg_)); } Modified: trunk/yake/src/netsvc/service/netClientTimeService.cpp =================================================================== --- trunk/yake/src/netsvc/service/netClientTimeService.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/netsvc/service/netClientTimeService.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -12,7 +12,7 @@ } void ClientTimeService::onStart(IServiceHost& host) { - COUTLN("starting time service"); + YAKE_LOG_INFORMATION("client-time", "starting time service"); evtConn_ = host.getEventConnection(); evtConn_->registerEvent( s2cEvtPing::ID, NetEvent::DIR_ANY, s2cEvtPing::create, s2cEvtPing::destroy ); @@ -25,11 +25,11 @@ boost::bind(&ClientTimeService::onPong,this,_1,_2,_3)); firstTime_ = true; - COUTLN("time service is up"); + YAKE_LOG_INFORMATION("client-time", "time service is up"); } void ClientTimeService::onStop(IServiceHost&) { - COUTLN("stopping time service"); + YAKE_LOG_INFORMATION("client-time", "stopping time service"); timer_.stop(); firstTime_ = false; @@ -37,7 +37,7 @@ } void ClientTimeService::onPing(const PeerId pId, const NetEvent& evt, const ChannelId cId) { - COUTLN("client-time: received PING with cId='" << int(cId) << "'"); + YAKE_LOG_INFORMATION("client-time", "client-time: received PING with cId='" << int(cId) << "'"); const s2cEvtPing& ping = static_cast<const s2cEvtPing&>(evt); @@ -51,7 +51,7 @@ { //clockDelta_ = 0.; clockDelta_ = 0.001 * double(ping.serverTime_) - currTime; - COUTLN("initial clock delta = " << clockDelta_); + YAKE_LOG_INFORMATION("client-time", "initial clock delta = " << clockDelta_); firstTime_ = false; } currTime += clockDelta_; @@ -67,7 +67,7 @@ } void ClientTimeService::onPong(const PeerId pId, const NetEvent& evt, const ChannelId cId) { - COUTLN("client-time: received PONG with cId='" << int(cId) << "'"); + YAKE_LOG_INFORMATION("client-time", "client-time: received PONG with cId='" << int(cId) << "'"); const s2cEvtPong& msg = static_cast<const s2cEvtPong&>(evt); @@ -79,20 +79,20 @@ // recalc RTT rttCalc_.processPong( currTimeMs, msg.clientTime_ ); - COUTLN("client-time: RTT=" << rttCalc_.getMeanRtt() << " over " << int(rttCalc_.sizeReceivedPings()) << " samples"); + YAKE_LOG_INFORMATION("client-time", "client-time: RTT=" << rttCalc_.getMeanRtt() << " over " << int(rttCalc_.sizeReceivedPings()) << " samples"); // adjust clock if (rttCalc_.getMeanRtt() > 0.) { - //COUTLN("current clock=" << (timerVal+clockDelta_) << " clockdelta=" << clockDelta_); + //YAKE_LOG_INFORMATION("client-time", "current clock=" << (timerVal+clockDelta_) << " clockdelta=" << clockDelta_); const double halfLatency = 0.001 * .5 * rttCalc_.getMeanRtt(); const double serverTime = 0.001 * double(msg.serverTime2_); // in sec const double deltaToServer = serverTime - currTime + halfLatency; clockDelta_ += deltaToServer; // @todo use a factor? (e.g. 0.6) - COUTLN("server t1=" << msg.serverTime_ << " t2=" << msg.serverTime2_); - //COUTLN("client sent=" << msg.clientTime_ << " curr(ms)=" << currTimeMs); - COUTLN("current clock=" << (timerVal+clockDelta_) << " clockdelta=" << clockDelta_); - COUTLN("deltaToServer=" << deltaToServer); + YAKE_LOG_INFORMATION("client-time", "server t1=" << msg.serverTime_ << " t2=" << msg.serverTime2_); + //YAKE_LOG_INFORMATION("client-time", "client sent=" << msg.clientTime_ << " curr(ms)=" << currTimeMs); + YAKE_LOG_INFORMATION("client-time", "current clock=" << (timerVal+clockDelta_) << " clockdelta=" << clockDelta_); + YAKE_LOG_INFORMATION("client-time", "deltaToServer=" << deltaToServer); } } double ClientTimeService::getClientTime() const Modified: trunk/yake/src/netsvc/service/netServerCommService.cpp =================================================================== --- trunk/yake/src/netsvc/service/netServerCommService.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/netsvc/service/netServerCommService.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -13,7 +13,7 @@ } void ServerCommService::onStart(IServiceHost& host) { - COUTLN("starting comm service"); + YAKE_LOG_INFORMATION("server-comm", "starting comm service"); evtConn_ = host.getEventConnection(); evtConn_->registerEvent( s2cEvtCommMsg::ID, NetEvent::DIR_ANY, s2cEvtCommMsg::create, s2cEvtCommMsg::destroy ); @@ -27,7 +27,7 @@ } void ServerCommService::onStop(IServiceHost&) { - COUTLN("stopping comm service"); + YAKE_LOG_INFORMATION("server-comm", "stopping comm service"); } void ServerCommService::onClientConnected(const PeerId pId) { @@ -36,7 +36,7 @@ } void ServerCommService::onClientDisconnected(const PeerId pId) { - COUTLN("server-comm: user '" << pId << "' disconnected."); + YAKE_LOG_INFORMATION("server-comm", "server-comm: user '" << pId << "' disconnected."); // remove user from all channels YAKE_FOR_EACH(ChannelList::iterator,itChannel,channels_) @@ -49,7 +49,7 @@ if (channels_.find( name ) != channels_.end()) YAKE_EXCEPT("channel with this name already exists"); channels_[ name ].description_ = description; - COUTLN("server-comm: channel '" << name << "' created."); + YAKE_LOG_INFORMATION("server-comm", "server-comm: channel '" << name << "' created."); } void ServerCommService::destroyChannel(const String& name) { @@ -67,7 +67,7 @@ void ServerCommService::onProcessJoinRequest(const PeerId pId, const NetEvent& evt, const ChannelId) { const c2sEvtCommJoinChannel& msg = static_cast<const c2sEvtCommJoinChannel&>(evt); - COUTLN("server-comm: user " << int(pId) << " likes to join '" << msg.cId_ << "'"); + YAKE_LOG_INFORMATION("server-comm", "server-comm: user " << int(pId) << " likes to join '" << msg.cId_ << "'"); ChannelList::iterator itC = channels_.find( msg.cId_ ); if (itC == channels_.end()) @@ -91,7 +91,7 @@ void ServerCommService::onProcessMsg(const PeerId pId, const NetEvent& evt, const ChannelId) { const s2cEvtCommMsg& msg = static_cast<const s2cEvtCommMsg&>(evt); - COUTLN("server-comm: received: pId=" << int(pId) + YAKE_LOG_INFORMATION("server-comm", "server-comm: received: pId=" << int(pId) << " cId=" << msg.cId_ << " from=" << msg.from_ << " to=" << msg.to_ << " text=" << msg.msg_); // special command channel: Modified: trunk/yake/src/netsvc/service/netServerTimeService.cpp =================================================================== --- trunk/yake/src/netsvc/service/netServerTimeService.cpp 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/src/netsvc/service/netServerTimeService.cpp 2007-01-22 21:37:23 UTC (rev 1608) @@ -12,7 +12,7 @@ } void ServerTimeService::onStart(IServiceHost& host) { - COUTLN("starting time service"); + YAKE_LOG_INFORMATION("server-time", "starting time service"); evtConn_ = host.getEventConnection(); evtConn_->registerEvent( s2cEvtPing::ID, NetEvent::DIR_ANY, s2cEvtPing::create, s2cEvtPing::destroy ); @@ -26,7 +26,7 @@ } void ServerTimeService::onStop(IServiceHost&) { - COUTLN("stopping time service"); + YAKE_LOG_INFORMATION("server-time", "stopping time service"); timer_.stop(); timer_.reset(); } @@ -40,7 +40,7 @@ } void ServerTimeService::onClientDisconnected(const PeerId pId) { - COUTLN("server-time: user '" << pId << "' disconnected."); + YAKE_LOG_INFORMATION("server-time", "server-time: user '" << pId << "' disconnected."); users_.erase( pId ); } @@ -69,10 +69,10 @@ if (timeSinceSent > 950) { //@todo force recalc of RTT - COUTLN("server-time: client timed out?"); + YAKE_LOG_INFORMATION("server-time", "server-time: client timed out?"); //itUser->second.processPong( timeMs, // itPing->timeSent_ - itUser->second.meanRtt_ * 2 ); - //COUTLN("server-time: new RTT = " << itUser->second.meanRtt_); + //YAKE_LOG_INFORMATION("server-time", "server-time: new RTT = " << itUser->second.meanRtt_); } } // clear list and add new ping info @@ -90,7 +90,7 @@ { //@todo handle bad cast! const c2sEvtPong& msg = static_cast<const c2sEvtPong&>(evt); - COUTLN("server-time: user " << int(pId) << " pong'd with '" << msg.serverTime_ << "'"); + YAKE_LOG_INFORMATION("server-time", "server-time: user " << int(pId) << " pong'd with '" << msg.serverTime_ << "'"); const uint32 timeMs = uint32(1000. * timer_.getTime()); @@ -113,10 +113,10 @@ // if (!peerInfo.processPong(timeMs,msg.serverTime_)) { - COUTLN("server-time: could not handle PONG.\n"); + YAKE_LOG_INFORMATION("server-time", "server-time: could not handle PONG.\n"); return; } - COUTLN("server-time: client '" << pId << "' RTT=" << peerInfo.getMeanRtt() + YAKE_LOG_INFORMATION("server-time", "server-time: client '" << pId << "' RTT=" << peerInfo.getMeanRtt() << " over " << int(peerInfo.sizeReceivedPings()) << " samples"); for(detail::PeerRttCalculator::const_pinginfo_iterator pi = peerInfo.beginReceivedPings(); pi != peerInfo.endReceivedPings(); ++pi) Modified: trunk/yake/yake/net/detail/netEnetServerPacketConnection.h =================================================================== --- trunk/yake/yake/net/detail/netEnetServerPacketConnection.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/net/detail/netEnetServerPacketConnection.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -33,6 +33,7 @@ virtual void send(const PacketPtr&, const SendOptions& opt = SendOptions()); virtual void send(const PeerId, const PacketPtr&, const SendOptions& opt = SendOptions()); + virtual void sendToAllExcept(const PeerId, const PacketPtr&, const SendOptions& opt = SendOptions()); virtual void addStartedCallback(const OnStartedFn&); virtual void addClientConnectedCallback(const OnClientConnectedFn&); @@ -163,6 +164,9 @@ PeerId target_; PacketPtr pckt_; SendOptions opt_; + bool sendToAllExcept_; + OutgoingPacket() : sendToAllExcept_(false) + {} }; typedef std::deque<OutgoingPacket> OutgoingPacketQ; OutgoingPacketQ m_outgoingPacketQ; Modified: trunk/yake/yake/net/detail/netInternal.h =================================================================== --- trunk/yake/yake/net/detail/netInternal.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/net/detail/netInternal.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -13,19 +13,9 @@ #include <boost/thread/mutex.hpp> #include <boost/bind.hpp> -#define NET_ERROR( X ) \ - { \ - std::stringstream s; \ - s << "net_error: " << X << "\n"; \ - std::cerr << s.str().c_str(); \ - } +#define NET_ERROR( X ) YAKE_LOG_ERROR("net",X) -#define NET_LOG( X ) \ - { \ - std::stringstream s; \ - s << "net: " << X << "\n"; \ - std::cout << s.str().c_str(); \ - } +#define NET_LOG( X ) YAKE_LOG_INFORMATION("net",X) #define NET_THROW(MSG) \ throw Exception(MSG,__FILE__,__LINE__) Modified: trunk/yake/yake/net/netPacket.h =================================================================== --- trunk/yake/yake/net/netPacket.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/net/netPacket.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -124,6 +124,10 @@ virtual void addClientConnectedCallback(const OnClientConnectedFn&) = 0; /** Set callback to be called when a client disconnected. */ virtual void addClientDisconnectedCallback(const OnClientDisconnectedFn&) = 0; + + /** Sends a packet to all connected clients except the specified one. + */ + virtual void sendToAllExcept(const PeerId, const PacketPtr&, const SendOptions& opt = SendOptions()) = 0; }; /** A packet connection interface specific to packet clients. Modified: trunk/yake/yake/netsvc/netPrerequisites.h =================================================================== --- trunk/yake/yake/netsvc/netPrerequisites.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/netsvc/netPrerequisites.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -36,14 +36,6 @@ CLASS() : ::yake::net::NetEvent(ID) \ {} -/** @todo replace with real logging */ -#define COUTLN(X) \ -{ \ - std::stringstream ss; \ - ss << X; \ - yake::logging::log( yake::logging::S_INFORMATION, ss.str() ); \ -} - /** @todo move the streaming operators */ namespace yake { namespace net { Modified: trunk/yake/yake/samples/common/yakeExampleApplication.h =================================================================== --- trunk/yake/yake/samples/common/yakeExampleApplication.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/samples/common/yakeExampleApplication.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -122,15 +122,6 @@ // scripting if ( mLoadScriptingSystem ) { - -#ifdef YAKE_DEBUG -# define YAKE_DYNLIB_POSTFIX "_d" -#else -# define YAKE_DYNLIB_POSTFIX -#endif -#define YAKE_DYNLIB_NAME(X) \ - yake::String("yake_" X YAKE_DYNLIB_POSTFIX).c_str() - SharedPtr<base::Library> pLib = loadLib(YAKE_DYNLIB_NAME("scriptingLua")); YAKE_ASSERT( pLib ).debug("Cannot load scripting system"); Modified: trunk/yake/yake/samples/net/common/commonEvents.h =================================================================== --- trunk/yake/yake/samples/net/common/commonEvents.h 2007-01-22 21:34:15 UTC (rev 1607) +++ trunk/yake/yake/samples/net/common/commonEvents.h 2007-01-22 21:37:23 UTC (rev 1608) @@ -108,48 +108,21 @@ virtual bool pack(yake::net::obitstream& out) const { out.write( accepted ); - std::string msg("i wanna join!"); - out << msg; + //std::string msg("i wanna join!"); + //out << msg; return true; } virtual bool unpack(yake::net::ibitstream& in) { in.read( accepted ); - std::string msg; - in >> msg; - COUTLN("MSG: " << msg.c_str()); + //std::string msg; + //in >> msg; + //COUTLN("MSG: " << msg.c_str()); return true; } bool accepted; }; -struct s2cEvtClassTable : public yake::net::NetEvent -{ - DECLARE_EVENT( s2cEvtClassTable, 10 ); - virtual bool pack(yake::net::obitstream& out) const - { - std::map<int,int> c; - c[1] = 2; - c[3] = 46; - out << c; - out << globalClassIds_; - return true; - } - virtual bool unpack(yake::net::ibitstream& in) - { - std::map<int,int> c; - in >> c; - in >> globalClassIds_; - return true; - } - //uint8 numClassIdBits_; - std::map<std::string,yake::ent::ClassId> globalClassIds_; - void copyTo(s2cEvtClassTable& other) const - { - if (&other != this) - other.globalClassIds_ = this->globalClassIds_; - } -}; struct c2sEvtSimOk : public yake::net::NetEvent { DECLARE_EVENT( c2sEvtSimOk, 11 ); @@ -162,22 +135,4 @@ return true; } }; -struct s2cEvtCreateObject : public yake::net::NetEvent -{ - DECLARE_EVENT( s2cEvtCreateObject, 20 ); - virtual bool pack(yake::net::obitstream& out) const - { - out << objId_.classId() << objId_.serialNo(); - return true; - } - virtual bool unpack(yake::net::ibitstream& in) - { - yake::ent::ObjectId::ClassId clsId; - yake::ent::ObjectId::SerialNo serNo; - in >> clsId >> serNo; - objId_ = yake::ent::ObjectId(clsId,serNo); - return true; - } - yake::ent::ObjectId objId_; -}; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-01-22 21:38:28
|
Revision: 1610 http://svn.sourceforge.net/yake/?rev=1610&view=rev Author: psyclonist Date: 2007-01-22 13:38:27 -0800 (Mon, 22 Jan 2007) Log Message: ----------- moved replication services out of the prototype into 'netrepsvc', Added Paths: ----------- trunk/yake/src/netrepsvc/ trunk/yake/src/netrepsvc/detail/ trunk/yake/src/netrepsvc/netClientRepService.cpp trunk/yake/src/netrepsvc/netRepSvc.cpp trunk/yake/src/netrepsvc/netServerRepService.cpp trunk/yake/yake/netrepsvc/ trunk/yake/yake/netrepsvc/detail/ trunk/yake/yake/netrepsvc/netClientReplicationService.h trunk/yake/yake/netrepsvc/netEvents.h trunk/yake/yake/netrepsvc/netPrerequisites.h trunk/yake/yake/netrepsvc/netRepSvc.h trunk/yake/yake/netrepsvc/netServerReplicationService.h Added: trunk/yake/src/netrepsvc/netClientRepService.cpp =================================================================== --- trunk/yake/src/netrepsvc/netClientRepService.cpp (rev 0) +++ trunk/yake/src/netrepsvc/netClientRepService.cpp 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,102 @@ +#include <yake/netrepsvc/netPrerequisites.h> +#include <yake/netrepsvc/netClientReplicationService.h> + +namespace yake { +namespace net { + + ClientReplicationService::ClientReplicationService(const ChannelId cid) : + sendOptions_( net::SendOptions().channel(cid).ordered().reliable() ), evtClassTblReceived_(false) + {} + ClientReplicationService::~ClientReplicationService() + { + eventConn_.reset(); + } + void ClientReplicationService::onStart(net::IServiceHost& host) + { + YAKE_LOG_INFORMATION("client-rep","starting replication client..."); + eventConn_ = host.getEventConnection(); + + eventConn_->registerEvent( s2cEvtClassTable::ID, NetEvent::DIR_ANY, s2cEvtClassTable::create, s2cEvtClassTable::destroy ); + eventConn_->registerEvent( s2cEvtCreateObject::ID, NetEvent::DIR_ANY, s2cEvtCreateObject::create, s2cEvtCreateObject::destroy ); + eventConn_->registerEvent( s2cEvtDestroyObject::ID, NetEvent::DIR_ANY, s2cEvtDestroyObject::create, s2cEvtDestroyObject::destroy ); + + host.subscribeToNetEvent( s2cEvtClassTable::ID, sendOptions_.getChannel(), + boost::bind(&ClientReplicationService::onRecvClassTable,this,_1,_2,_3)); + host.subscribeToNetEvent( s2cEvtCreateObject::ID, sendOptions_.getChannel(), + boost::bind(&ClientReplicationService::onRecvPublishObject,this,_1,_2,_3)); + host.subscribeToNetEvent( s2cEvtDestroyObject::ID, sendOptions_.getChannel(), + boost::bind(&ClientReplicationService::onRecvUnpublishObject,this,_1,_2,_3)); + + evtClassTblReceived_ = false; + } + void ClientReplicationService::onStop(net::IServiceHost&) + { + //@todo unbind + eventConn_.reset(); + + evtClassTblReceived_ = false; + } + void ClientReplicationService::onRecvClassTable(const PeerId, const NetEvent& evt, const ChannelId) + { + YAKE_LOG_INFORMATION("client-rep","received class table"); + try { + const s2cEvtClassTable& evtClsTbl = dynamic_cast<const s2cEvtClassTable&>(evt); + evtClsTbl.copyTo( evtClassTbl_ ); + evtClassTblReceived_ = true; + } + catch (std::bad_cast&) + { + YAKE_LOG_ERROR("client-rep","invalid event type"); + } + } + void ClientReplicationService::onRecvPublishObject(const PeerId, const NetEvent& evt, const ChannelId) + { + YAKE_LOG_INFORMATION("client-rep","onRecvPublishObject"); + const s2cEvtCreateObject& evtCreate = static_cast<const s2cEvtCreateObject&>(evt); + qForPublish_.insert( evtCreate.objId_ ); + } + void ClientReplicationService::onRecvUnpublishObject(const PeerId, const NetEvent& evt, const ChannelId) + { + YAKE_LOG_INFORMATION("client-rep","onRecvUnpublishObject"); + const s2cEvtCreateObject& evtCreate = static_cast<const s2cEvtCreateObject&>(evt); + qForUnpublish_.insert( evtCreate.objId_ ); + } + void ClientReplicationService::update() + { + if (evtClassTblReceived_) + { + evtClassTblReceived_ = false; + sigClassTblReceived_( evtClassTbl_ ); + } + YAKE_FOR_EACH(ObjectEntryList::const_iterator,it,qForPublish_) + { + if (objs_.find( *it ) != objs_.end()) // already published? + continue; + objs_.insert( *it ); + sigPublish_( *it ); + } + qForPublish_.clear(); + YAKE_FOR_EACH(ObjectEntryList::const_iterator,it,qForUnpublish_) + { + if (objs_.find( *it ) == objs_.end()) + continue; + sigUnpublish_( *it ); + objs_.erase( *it ); + } + qForUnpublish_.clear(); + } + SignalConnection ClientReplicationService::connectToUpdateClassTable(const ClassTableSignal::slot_type& slot) + { + return sigClassTblReceived_.connect(slot); + } + SignalConnection ClientReplicationService::connectToObjectPublished(const ObjectIdSignal::slot_type& slot) + { + return sigPublish_.connect(slot); + } + SignalConnection ClientReplicationService::connectToObjectUnpublished(const ObjectIdSignal::slot_type& slot) + { + return sigUnpublish_.connect(slot); + } + +} // namespace net +} // namespace yake Added: trunk/yake/src/netrepsvc/netRepSvc.cpp =================================================================== --- trunk/yake/src/netrepsvc/netRepSvc.cpp (rev 0) +++ trunk/yake/src/netrepsvc/netRepSvc.cpp 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,10 @@ +#include <yake/netrepsvc/netPrerequisites.h> +#include <yake/netrepsvc/netEvents.h> +//#include <yake/netrepsvc/netClientReplicationService.h> +//#include <yake/netrepsvc/netServerReplicationService.h> + +namespace yake { +namespace net { + +} // namespace net +} // namespace yake Added: trunk/yake/src/netrepsvc/netServerRepService.cpp =================================================================== --- trunk/yake/src/netrepsvc/netServerRepService.cpp (rev 0) +++ trunk/yake/src/netrepsvc/netServerRepService.cpp 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,124 @@ +#include <yake/netrepsvc/netPrerequisites.h> +#include <yake/netrepsvc/netServerReplicationService.h> + +namespace yake { +namespace net { + + ServerReplicationService::ServerReplicationService(const ChannelId cId) : + cId_(cId), sendOptions_(SendOptions().channel(cId).ordered().reliable()) + { + } + ServerReplicationService::~ServerReplicationService() + { + YAKE_ASSERT( !eventConn_.get() ); + } + void ServerReplicationService::onStart(net::IServiceHost& host) + { + YAKE_LOG_INFORMATION("netrepsvc","starting replication service"); + eventConn_ = host.getEventConnection(); + } + void ServerReplicationService::onStop(net::IServiceHost&) + { + YAKE_LOG_INFORMATION("netrepsvc","stopping replication service"); + this->unpublishAll(); + eventConn_.reset(); + } + void ServerReplicationService::unpublishAll() + { + YAKE_LOG_WARNING("netrepsvc","unpublishAll() not implemented"); + } + void ServerReplicationService::setClassTableData(const s2cEvtClassTable& evt) + { + evt.copyTo( evtClassTbl_ ); + } + void ServerReplicationService::startReplicationToClient(const PeerId pid) + { + if (clients_.find(pid) != clients_.end()) + { + YAKE_LOG_WARNING("netrepsvc","replication to this client already started"); + return; + } + + // replicate class table + clients_.insert( pid ); + eventConn_->sendEvent( pid, evtClassTbl_, sendOptions_ ); + + //@todo replicate global objects + /* + ent::ObjectManager::const_object_iterator itEnd = objMgr_->endObjects(); + for (ent::ObjectManager::const_object_iterator it = objMgr_->beginObjects(); it != itEnd; ++it) + */ + } + void ServerReplicationService::publish(const ent::ObjectId& oid) + { + YAKE_FOR_EACH(PeerIdList::const_iterator,itId,clients_) + { + this->publish( *itId, oid ); + } + } + void ServerReplicationService::publish(PeerId pid, const ent::ObjectId& oid) + { + // test whether object is already q'd for replication + PublishedObjectsMap::iterator it = clientObjects_.find(pid); + if (it != clientObjects_.end()) + { + ObjectEntryList::iterator itObj = it->second.find(oid); + if (itObj != it->second.end()) + { + YAKE_LOG_WARNING("netrepsvc","object with this id already queued for replication this client"); + return; //already replicated + } + } + // add to q + qForPublish_[pid].insert(oid); + } + void ServerReplicationService::unpublish(const ent::ObjectId& oid) + { + YAKE_FOR_EACH(PeerIdList::const_iterator,itId,clients_) + { + this->unpublish( *itId, oid ); + } + } + void ServerReplicationService::unpublish(PeerId pid, const ent::ObjectId& oid) + { + // if q'd for publish then remove from q + qForPublish_[pid].erase(oid); + + // if alrady published add to 'unpublish' q + ObjectEntryList& clientObjs = clientObjects_[pid]; + if (clientObjs.find(oid) != clientObjs.end()) + clientObjs.insert(oid); + } + void ServerReplicationService::update() + { + // send 'create object' messages + YAKE_FOR_EACH(PublishedObjectsMap::const_iterator,it,qForPublish_) + { + const PeerId pid = it->first; + const ObjectEntryList& objs = it->second; + s2cEvtCreateObject createObjEvt; + YAKE_FOR_EACH(ObjectEntryList::const_iterator,itObj,objs) + { + createObjEvt.objId_ = *itObj; + eventConn_->sendEvent( pid, createObjEvt, sendOptions_ ); + } + } + qForPublish_.clear(); + + // send 'destroy object' messages + YAKE_FOR_EACH(PublishedObjectsMap::const_iterator,it,qForUnpublish_) + { + const PeerId pid = it->first; + const ObjectEntryList& objs = it->second; + s2cEvtDestroyObject destroyObjEvt; + YAKE_FOR_EACH(ObjectEntryList::const_iterator,itObj,objs) + { + destroyObjEvt.objId_ = *itObj; + eventConn_->sendEvent( pid, destroyObjEvt, sendOptions_ ); + } + } + qForUnpublish_.clear(); + } + +} // namespace net +} // namespace yake Added: trunk/yake/yake/netrepsvc/netClientReplicationService.h =================================================================== --- trunk/yake/yake/netrepsvc/netClientReplicationService.h (rev 0) +++ trunk/yake/yake/netrepsvc/netClientReplicationService.h 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,90 @@ +#ifndef YAKE_NETREPSVC_CLIENTREPLICATIONSERVICE_H +#define YAKE_NETREPSVC_CLIENTREPLICATIONSERVICE_H + +#include <yake/netrepsvc/netPrerequisites.h> +//#include <yake/base/templates/yakeSignals.h> +#include <yake/netrepsvc/netEvents.h> + +#pragma warning(push) +#pragma warning(disable: 4275) // C4275: non dll-interface class 'X' used as base for dll-interface 'Y' + +namespace yake { +namespace net { + + /** The ClientReplicationService manages remotely created objects on the client side. + It gets notified by the remote server when class tables are updated, when global + objects are created or destroyed. + Furthermore it provides callbacks for applications so that they can react on these events. + @note Only the object ids and basic binary information is used by this service. No actual + C++ object classes are created or used for the replicated objects. It expects other + managing objects to handle this. For this it provides various callbacks. + @note update() needs to be called regularly so that the server can handle queued requests. + @note Like most net::IServices the ClientReplicationService needs to be attached to + an IHost and started before it can do its work. + */ + struct NETREPSVC_API ClientReplicationService : public net::IService//, yake::ListenerManager<ClientReplicationListener> + { + /** Creates the ClientReplicationService and let's it use the given channel id. + @note The given channel needs to be identical to the one used on the server. + */ + ClientReplicationService(const ChannelId); + + /** Destroys the service object. + */ + virtual ~ClientReplicationService(); + + /** Called when the service is to be started. */ + virtual void onStart(net::IServiceHost&); + /** Called when the service is to be shut down. */ + virtual void onStop(net::IServiceHost&); + + /** Call this regularly to let the service do it's work. */ + void update(); + + typedef SignalX<void(const s2cEvtClassTable&)> ClassTableSignal; + + /** Subscribe to signal that is fired whenever the 'global' class table + is sent/updated by the server. + @note The signal can only triggered from within a call to update(). + */ + SignalConnection connectToUpdateClassTable(const ClassTableSignal::slot_type&); + + typedef SignalX<void(const ent::ObjectId&)> ObjectIdSignal; + + /** Subscribe to a signal that is fired whenever a global object has been + created by the remote server. + @note The signal can only triggered from within a call to update(). + */ + SignalConnection connectToObjectPublished(const ObjectIdSignal::slot_type&); + + /** Subscribe to a signal that is fired whenever a global object has been + destroyed by the remote server. + @note The signal can only triggered from within a call to update(). + */ + SignalConnection connectToObjectUnpublished(const ObjectIdSignal::slot_type&); + private: + void onRecvClassTable(const PeerId, const NetEvent&, const ChannelId); + void onRecvPublishObject(const PeerId, const NetEvent&, const ChannelId); + void onRecvUnpublishObject(const PeerId, const NetEvent&, const ChannelId); + private: + net::NetEventConnectionPtr eventConn_; + + typedef std::set<ent::ObjectId> ObjectEntryList; + ObjectEntryList qForPublish_; + ObjectEntryList qForUnpublish_; + ObjectEntryList objs_; + ObjectIdSignal sigPublish_; + ObjectIdSignal sigUnpublish_; + + s2cEvtClassTable evtClassTbl_; + bool evtClassTblReceived_; + ClassTableSignal sigClassTblReceived_; + const SendOptions sendOptions_; + }; + +} // namespace net +} // namespace yake + +#pragma warning(pop) + +#endif Added: trunk/yake/yake/netrepsvc/netEvents.h =================================================================== --- trunk/yake/yake/netrepsvc/netEvents.h (rev 0) +++ trunk/yake/yake/netrepsvc/netEvents.h 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,81 @@ +#ifndef YAKE_NETREPSVC_EVENTS_H +#define YAKE_NETREPSVC_EVENTS_H + +#include <yake/netrepsvc/netPrerequisites.h> + +#pragma warning(push) +#pragma warning(disable: 4275) // C4275: non dll-interface class 'X' used as base for dll-interface 'Y' + +namespace yake { +namespace net { + + struct NETREPSVC_API s2cEvtClassTable : public yake::net::NetEvent + { + DECLARE_EVENT( s2cEvtClassTable, 10 ); + virtual bool pack(yake::net::obitstream& out) const + { + std::map<int,int> c; + c[1] = 2; + c[3] = 46; + out << c; + out << globalClassIds_; + return true; + } + virtual bool unpack(yake::net::ibitstream& in) + { + std::map<int,int> c; + in >> c; + in >> globalClassIds_; + return true; + } + //uint8 numClassIdBits_; + std::map<std::string,yake::ent::ClassId> globalClassIds_; + void copyTo(s2cEvtClassTable& other) const + { + if (&other != this) + other.globalClassIds_ = this->globalClassIds_; + } + }; + struct NETREPSVC_API s2cEvtCreateObject : public yake::net::NetEvent + { + DECLARE_EVENT( s2cEvtCreateObject, 20 ); + virtual bool pack(yake::net::obitstream& out) const + { + out << objId_.classId() << objId_.serialNo(); + return true; + } + virtual bool unpack(yake::net::ibitstream& in) + { + yake::ent::ObjectId::ClassId clsId; + yake::ent::ObjectId::SerialNo serNo; + in >> clsId >> serNo; + objId_ = yake::ent::ObjectId(clsId,serNo); + return true; + } + yake::ent::ObjectId objId_; + }; + struct s2cEvtDestroyObject : public yake::net::NetEvent + { + DECLARE_EVENT( s2cEvtDestroyObject, 21 ); + virtual bool pack(yake::net::obitstream& out) const + { + out << objId_.classId() << objId_.serialNo(); + return true; + } + virtual bool unpack(yake::net::ibitstream& in) + { + yake::ent::ObjectId::ClassId clsId; + yake::ent::ObjectId::SerialNo serNo; + in >> clsId >> serNo; + objId_ = yake::ent::ObjectId(clsId,serNo); + return true; + } + yake::ent::ObjectId objId_; + }; + +} // namespace net +} // namespace yake + +#pragma warning(pop) + +#endif Added: trunk/yake/yake/netrepsvc/netPrerequisites.h =================================================================== --- trunk/yake/yake/netrepsvc/netPrerequisites.h (rev 0) +++ trunk/yake/yake/netrepsvc/netPrerequisites.h 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,31 @@ +#ifndef YAKE_NETREPSVC_PREREQUISITES_H +#define YAKE_NETREPSVC_PREREQUISITES_H + +#include <yake/base/yakePrerequisites.h> +#include <yake/base/yakeString.h> +#include <yake/net/net.h> +#include <yake/netsvc/netsvc.h> +#include <yake/ent/ent.h> + +#if YAKE_PLATFORM == PLATFORM_WIN32 && defined(_USRDLL) +# define YAKE_NETREPSVC_DLL +#endif + +#ifdef YAKE_NETREPSVC_EXPORTS +# ifdef YAKE_NETREPSVC_DLL +# pragma message("dllexport") +# define NETREPSVC_API DLLEXPORT +# else +# pragma message("lib") +# define NETREPSVC_API +# endif +#else +# ifdef YAKE_NETREPSVC_DLL +# define NETREPSVC_API DLLIMPORT +# else +# define NETREPSVC_API +# endif +#endif + +#endif + Added: trunk/yake/yake/netrepsvc/netRepSvc.h =================================================================== --- trunk/yake/yake/netrepsvc/netRepSvc.h (rev 0) +++ trunk/yake/yake/netrepsvc/netRepSvc.h 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,15 @@ +#ifndef YAKE_NETREPSVC_H +#define YAKE_NETREPSVC_H + +#include <yake/netrepsvc/netPrerequisites.h> +#include <yake/netrepsvc/netClientReplicationService.h> +#include <yake/netrepsvc/netServerReplicationService.h> + +namespace yake { +namespace net { + + +} // namespace net +} // namespace yake + +#endif Added: trunk/yake/yake/netrepsvc/netServerReplicationService.h =================================================================== --- trunk/yake/yake/netrepsvc/netServerReplicationService.h (rev 0) +++ trunk/yake/yake/netrepsvc/netServerReplicationService.h 2007-01-22 21:38:27 UTC (rev 1610) @@ -0,0 +1,103 @@ +#ifndef YAKE_NETREPSVC_SERVERREPLICATIONSERVICE_H +#define YAKE_NETREPSVC_SERVERREPLICATIONSERVICE_H + +#include <yake/netrepsvc/netPrerequisites.h> +//#include <yake/base/templates/yakeSignals.h> +#include <yake/netrepsvc/netEvents.h> + +#pragma warning(push) +#pragma warning(disable: 4275) // C4275: non dll-interface class 'X' used as base for dll-interface 'Y' + +namespace yake { +namespace net { + + /** The ServerReplicationService manages replicated objects (by id). + + */ + struct NETREPSVC_API ServerReplicationService : public net::IService + { + /** + @note The channel ids on the clients have to be identical to the + givenb channel id. + */ + ServerReplicationService(const ChannelId); + virtual ~ServerReplicationService(); + + /** Called by an IHost when the service is started. */ + virtual void onStart(net::IServiceHost&); + + /** Called by an IHost when the service is stopped. */ + virtual void onStop(net::IServiceHost&); + + /** Sets the class table that is to be replicated to the clients. + The class table maps names to class ids. Object ids contain the + class id and make replication and identification on remote clients + possible. + @note At the moment, the class table has to be set prior to the start + of the service OR prior to the first replication attempt. + It may NOT change after that! + */ + void setClassTableData(const s2cEvtClassTable&); + + // sends immediately! + void startReplicationToClient(const PeerId); + + // Q'd actions + /** Queues an object for replication to all clients. + @note This is action is queued and then executed from within a call to update(). + Therefore it is possible to undo this action by calling unpublish() + prior to update(). + */ + void publish(const ent::ObjectId&); + /** Queues an object for replication to a specific client. + @note This is action is queued and then executed from within a call to update(). + Therefore it is possible to undo this action by calling unpublish() + prior to update(). + */ + void publish(PeerId, const ent::ObjectId&); + /** Queues an object for destruction on all clients it was replicated to. + @note This is action is queued and then executed from within a call to update(). + Therefore it is possible to undo this action by calling publish() + prior to update(). + */ + void unpublish(const ent::ObjectId&); + /** Queues an object for destruction on a specific client it was replicated to. + @note This is action is queued and then executed from within a call to update(). + Therefore it is possible to undo this action by calling publish() + prior to update(). + */ + void unpublish(PeerId, const ent::ObjectId&); + + void unpublishAll(); + + /** This is to be regularly called so that this service can do its magic. + */ + void update(); + private: + net::NetEventConnectionPtr eventConn_; + + typedef std::set<PeerId> PeerIdList; + PeerIdList clients_; + + /*struct ObjectEntry + { + ent::ObjectId objId_; + }; + */ + typedef std::set<ent::ObjectId> ObjectEntryList; + typedef std::map<PeerId,ObjectEntryList> PublishedObjectsMap; + PublishedObjectsMap clientObjects_; + PublishedObjectsMap qForPublish_; + PublishedObjectsMap qForUnpublish_; + + s2cEvtClassTable evtClassTbl_; + ChannelId cId_; + const SendOptions sendOptions_; + }; + +} // namespace net +} // namespace yake + +#pragma warning(pop) + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-02-07 23:26:41
|
Revision: 1612 http://svn.sourceforge.net/yake/?rev=1612&view=rev Author: psyclonist Date: 2007-02-07 15:26:34 -0800 (Wed, 07 Feb 2007) Log Message: ----------- fixed logging in demo applications, move demos, interface cleanups, added samples to premake scripts, use of YAKE_DYNLIB_NAME(), safe initialisation Modified Paths: -------------- trunk/yake/samples/ent/sampleEntFsm/demo.cpp trunk/yake/samples/gui/console/yakeConsoleDemo.cpp trunk/yake/samples/net/roserver/ROServer.cpp trunk/yake/samples/net/roserver/ROServer.h trunk/yake/scripts/premake/samples.lua trunk/yake/src/raf/yakeApplication.cpp trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h trunk/yake/yake/netsvc/netSvc.h trunk/yake/yake/netsvc/service/netTimeServiceMessages.h Added Paths: ----------- trunk/yake/samples/cmdrmayhem/ trunk/yake/samples/cmdrmayhem/yakeDemo.cpp trunk/yake/samples/cmdrmayhem/yakePCH.cpp trunk/yake/samples/cmdrmayhem/yakePCH.h Copied: trunk/yake/samples/cmdrmayhem/yakeDemo.cpp (from rev 1603, trunk/yake/samples/misc/cmdrmayhem/yakeDemo.cpp) =================================================================== --- trunk/yake/samples/cmdrmayhem/yakeDemo.cpp (rev 0) +++ trunk/yake/samples/cmdrmayhem/yakeDemo.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -0,0 +1,713 @@ +#include <samples/cmdrmayhem/yakePCH.h> +#include <yake/audio/yakeAudio.h> +#include <yake/raf/yakeRaf.h> +#include <yake/model/model.h> +#include <yake/input/yakeInput.h> +#include <yake/common/yakeCameraControllers.h> +#ifdef DEMO_USES_CEGUI +#include <CEGUISystem.h> +#include <CEGUISchemeManager.h> +#include <CEGUIWindowManager.h> +#include <CEGUIWindow.h> +#include <CEGUIExceptions.h> +#include <CEGUIString.h> +#endif + +#define DEMO_USES_SPHERE + +using namespace yake; + +const input::ActionId ACTIONID_ZOOM_INOUT( input::ACTIONID_USER + 1, "zoom_inout" ); +const input::ActionId ACTIONID_MOUSE_MOVE( input::ACTIONID_USER + 2, "mouse_move" ); +const input::ActionId ACTIONID_NEXT_CAMERA( input::ACTIONID_USER + 3, "next_camera" ); + +struct CoordSys : public Movable +{ +private: + CoordSys(const CoordSys&); + CoordSys& operator=(const CoordSys&); +public: + CoordSys(graphics::IWorld& w) + { + sn_.reset( w.createSceneNode() ); + for (size_t i=0; i<3; ++i) + { + graphics::ISceneNode* sn = sn_->createChildNode(); + //graphics::IEntity* ent = w.createEntity("pyramid_1x1x1.mesh"); + graphics::IEntity* ent = w.createEntity("box_1x1x1.mesh"); + sn->attachEntity( ent ); + Quaternion q; + if (i==0) // x + { + q.FromAngleAxis( 0.5*3.14, Vector3::kUnitY ); + ent->setMaterial( "pyramid_red" ); + } + else if (i==1) // y + { + q.FromAngleAxis( -0.5*3.14, Vector3::kUnitX ); + ent->setMaterial( "pyramid_green" ); + } + else // z + { + q.FromAngleAxis( 0, Vector3::kUnitY ); + ent->setMaterial( "pyramid_blue" ); + } + sn->setOrientation( q ); + sn->setScale(Vector3(1,1,5)); + } + } + ~CoordSys() + { + sn_.reset(); + } + virtual void setPosition( const Vector3& rPosition ) + { + sn_->setPosition( rPosition ); + } + virtual void setOrientation( const Quaternion& rOrientation ) + { + std::cout << "cs.x=" << rOrientation * Vector3::kUnitX << " "; + std::cout << "cs.y=" << rOrientation * Vector3::kUnitY << " "; + std::cout << "cs.z=" << rOrientation * Vector3::kUnitZ << "\n"; + sn_->setOrientation( rOrientation ); + } + virtual Vector3 getPosition() const + { + return sn_->getPosition(); + } + virtual Quaternion getOrientation() const + { + return sn_->getOrientation(); + } + virtual Vector3 getDerivedPosition() const + { + return sn_->getDerivedPosition(); + } + virtual Quaternion getDerivedOrientation() const + { + return sn_->getDerivedOrientation(); + } +private: + SharedPtr<graphics::ISceneNode> sn_; +}; + +/** Configuration of the application */ +struct TheConfiguration : public raf::ApplicationConfiguration +{ + virtual StringVector getLibraries() + { return MakeStringVector() << YAKE_DYNLIB_NAME("graphicsOgre") << YAKE_DYNLIB_NAME("inputOgre") << YAKE_DYNLIB_NAME("physicsODE"); } + + //virtual StringVector getScriptingSystems() + //{ return MakeStringVector() << "lua"; } + + virtual StringVector getGraphicsSystems() + { return MakeStringVector() << "ogre3d"; } + + virtual StringVector getInputSystems() + { return MakeStringVector() << "ogre"; } + + virtual StringVector getPhysicsSystems() + { return MakeStringVector() << "ode"; } + + virtual bool loadCEGUI() +#ifdef DEMO_USES_CEGUI + { return true; } +#else + { return false; } +#endif +}; + + +class CharacterController +{ +}; + + +struct Env +{ + SharedPtr<model::Model> model_; +}; +void loadEnvironment(Env& env, graphics::IWorld* pGWorld, physics::IWorld* pPWorld, const String& dotSceneFn, const String& dotXodeFn, const String& dotLinkFn) +{ + YAKE_ASSERT( pGWorld ); + YAKE_ASSERT( pPWorld ); + + YAKE_ASSERT( 0 ); +} + +// struct AvatarPhysicsComponent : public ModelComponent +// struct HumanAvatarController : public ModelComponent +// struct AvatarGraphicsComponent : public ModelComponent + +struct ControllableCharacter +{ +public: + ControllableCharacter(model::CentralControllerBase&, graphics::IWorld&, physics::IWorld&); + ~ControllableCharacter(); + void bindInput(input::ActionMap&, input::KeyboardDevice*, input::MouseDevice*); + void unbindInput(); + void update(const real dt); + void setDirection(const Vector3&); + Point3 getPosition() const; + void setPosition(const Point3&); + Quaternion getOrientation() const; +private: + ControllableCharacter(const ControllableCharacter&); + ControllableCharacter& operator=(const ControllableCharacter&); +private: + void addInputSignalConnection(const SignalConnection&); + void addInputConditionConnection(const input::ConditionConnection&); +private: + void onForward() + { mActiveActions.insert( input::ACTIONID_FORWARD ); } + void onReverse() + { mActiveActions.insert( input::ACTIONID_REVERSE ); } + void onUp() + { mActiveActions.insert( input::ACTIONID_UP ); } + void onLeft() + { mActiveActions.insert( input::ACTIONID_LEFT ); } + void onRight() + { mActiveActions.insert( input::ACTIONID_RIGHT ); } + void onCrouch() + { mActiveActions.insert( input::ACTIONID_DOWN ); } + void onRotateLeft() + { mActiveActions.insert( input::ACTIONID_ROTATE_LEFT ); } + void onRotateRight() + { mActiveActions.insert( input::ACTIONID_ROTATE_RIGHT ); } +private: + physics::IAvatarPtr mPlayerRep; + model::Model* mPlayerModel; + + typedef std::deque<SignalConnection> SignalConnectionList; + SignalConnectionList mInputSignalConnections; + + typedef std::deque<input::ConditionConnection> ConditionConnectionList; + ConditionConnectionList mInputConditionConnections; + + typedef std::set<input::ActionId> ActionIdList; + ActionIdList mActiveActions; + Vector3 mMouseMovement; + Quaternion mProjViewRot; + + SharedPtr<CoordSys> mCoordSys; +}; +ControllableCharacter::ControllableCharacter( + model::CentralControllerBase& centralCtrlr, + yake::graphics::IWorld & gworld, + yake::physics::IWorld & pworld) +{ + mPlayerRep = pworld.createAvatar( + physics::IAvatar::Desc( + Vector3(0.5,2,0), // dimensions + Vector3(0,real(0.1),0) // initial position (relative to stable position) + ) + ); + YAKE_ASSERT( mPlayerRep ); + { + mPlayerModel = new model::Model(); + model::Graphical* pG = new model::Graphical(); + mPlayerModel->addComponent( pG ); + graphics::ISceneNode* pSN = gworld.createSceneNode(); + pG->addSceneNode( pSN, "playerSN" ); + graphics::IEntity* pE = gworld.createEntity("sphere_d1.mesh"); + pSN->attachEntity( pE ); + pSN->setScale( 0.5 * Vector3::kUnitScale ); + + model::ModelMovableDirectLink* pLink = new model::ModelMovableDirectLink(); + mPlayerModel->addLink( pLink ); + pLink->setSource( mPlayerRep ); + pLink->subscribeToPositionChanged( pSN ); + pLink->subscribeToOrientationChanged( pSN ); + centralCtrlr.subscribeToGraphicsUpdate( Bind2(&model::ModelMovableDirectLink::update,pLink) ); + } + mCoordSys.reset( new CoordSys(gworld) ); +} +ControllableCharacter::~ControllableCharacter() +{ + unbindInput(); + if (mPlayerRep) + { + mPlayerRep->getCreator().destroyAvatar( mPlayerRep ); + mPlayerRep = 0; + } + YAKE_SAFE_DELETE( mPlayerModel ); +} +void ControllableCharacter::setPosition(const Point3& pos) +{ + YAKE_ASSERT( mPlayerRep ); + mPlayerRep->setPosition( pos ); +} +void ControllableCharacter::bindInput(input::ActionMap& actionMap, + input::KeyboardDevice* keyboard, + input::MouseDevice* mouse) +{ + YAKE_ASSERT( keyboard ); + YAKE_ASSERT( mouse ); + + using namespace input; + + // load key<->action bindings + ActionMap::loadFromFile( actionMap, "../../media/samples/character/demo.actionmap.txt", keyboard, + boost::bind(&ControllableCharacter::addInputConditionConnection,this,_1) ); + + // bind functions/callbacks to input actions + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_LEFT, boost::bind(&ControllableCharacter::onLeft,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_RIGHT, boost::bind(&ControllableCharacter::onRight,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_ROTATE_LEFT, boost::bind(&ControllableCharacter::onRotateLeft,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_ROTATE_RIGHT, boost::bind(&ControllableCharacter::onRotateRight,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_FORWARD, boost::bind(&ControllableCharacter::onForward,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_REVERSE, boost::bind(&ControllableCharacter::onReverse,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_UP, boost::bind(&ControllableCharacter::onUp,this) ) ); + this->addInputSignalConnection( + actionMap.subscribeToActionIdV( ACTIONID_DOWN, boost::bind(&ControllableCharacter::onCrouch,this) ) ); +} +void ControllableCharacter::unbindInput() +{ + for( SignalConnectionList::iterator it = mInputSignalConnections.begin(); it != mInputSignalConnections.end(); ++it ) + it->disconnect(); + mInputSignalConnections.clear(); + + for( ConditionConnectionList::iterator it = mInputConditionConnections.begin(); it != mInputConditionConnections.end(); ++it ) + it->disconnect(); + mInputConditionConnections.clear(); +} +void ControllableCharacter::addInputSignalConnection(const SignalConnection& conn) +{ + mInputSignalConnections.push_back( conn ); +} +void ControllableCharacter::addInputConditionConnection(const input::ConditionConnection& conn) +{ + mInputConditionConnections.push_back( conn ); +} +void ControllableCharacter::setDirection(const Vector3& dir) +{ + const Vector3 normalisedDir = dir.normalisedCopy(); + mProjViewRot.FromAxes( normalisedDir.crossProduct( Vector3::kUnitY ), Vector3::kUnitY, -normalisedDir ); +} +void ControllableCharacter::update(const real dt) +{ + // + const real maxAng = 3.14; + real ang = 0.; + Vector3 playerTargetVel; + ConstDequeIterator< ActionIdList > itAction( mActiveActions ); + while (itAction.hasMoreElements()) + { + const input::ActionId activeId = itAction.getNext(); + if (activeId == input::ACTIONID_FORWARD) + playerTargetVel += Vector3(0,0,+1); + else if (activeId == input::ACTIONID_REVERSE) + playerTargetVel += Vector3(0,0,-1); + else if (activeId == input::ACTIONID_LEFT) + playerTargetVel += Vector3(+1,0,0); //x=1 is left vector! + else if (activeId == input::ACTIONID_RIGHT) + playerTargetVel += Vector3(-1,0,0); + else if (activeId == input::ACTIONID_UP) + mPlayerRep->jump(); + else if (activeId == input::ACTIONID_ROTATE_LEFT) + ang += maxAng; + else if (activeId == input::ACTIONID_ROTATE_RIGHT) + ang -= maxAng; + else if (activeId == input::ACTIONID_DOWN) + { + mPlayerRep->duck( !mPlayerRep->isDucking() ); + } + } + if (playerTargetVel.length() > 0.001) + { + playerTargetVel.normalise(); + mPlayerRep->move( playerTargetVel ); // velocity relative to player's orientation + } + else + mPlayerRep->move( Vector3::kZero ); + + // newUp = gravity_source to position +#ifdef DEMO_USES_SPHERE + const Vector3 newGravityVector = (Vector3::kZero/*source of gravity*/ - mPlayerRep->getPosition()).normalisedCopy(); + mPlayerRep->setGravityDirection( newGravityVector ); +#else + mPlayerRep->setGravityDirection( Vector3(0,1,0) ); +#endif + if (fabs(ang) > 0.001) + { + Quaternion rot( ang * dt, mPlayerRep->getOrientation() * Vector3::kUnitY ); + rot = rot * mPlayerRep->getOrientation(); + mPlayerRep->setOrientation( rot ); + } + + // prepare for next step + mActiveActions.clear(); + mMouseMovement = Vector3::kZero; + + // + mCoordSys->setPosition( mPlayerRep->getPosition() ); + mCoordSys->setOrientation( mPlayerRep->getOrientation() ); +} +Vector3 ControllableCharacter::getPosition() const +{ + YAKE_ASSERT( mPlayerRep ); + return mPlayerRep->getPosition(); +} +Quaternion ControllableCharacter::getOrientation() const +{ + YAKE_ASSERT( mPlayerRep ); + return mPlayerRep->getOrientation(); +} + +/** Main application state */ +class TheMainState : public raf::RtMainState +{ +public: + TheMainState(raf::Application& owner) : + raf::RtMainState(owner), + mGround(0), + mEnv(0) + { + enableInstantQuitByKey( input::KC_ESCAPE ); + } + ~TheMainState() + { + } +private: + //@todo cleanup code! + void setupGUI() + { +#ifdef DEMO_USES_CEGUI + using namespace CEGUI; + try { + WindowManager& wmgr = WindowManager::getSingleton(); + Window* sheet = wmgr.loadWindowLayout( "cmdr_main.layout" ); + System::getSingleton().setGUISheet(sheet); + } + catch (CEGUI::Exception& ex) + { + YAKE_EXCEPT(yake::String("CEGUI Exception:\n") + ex.getMessage().c_str() ); + } +#endif + } +protected: + virtual void onCreateScene() + { + YAKE_LOG_INFORMATION("demo","Creating scene"); + + //getPhysicalWorld()->setGlobalGravity(Vector3(0,real(-9.8),0)); + + // create a light + graphics::ILight* pLight = getGraphicalWorld()->createLight(); + pLight->setType( graphics::ILight::LT_DIRECTIONAL ); + pLight->setDirection( Vector3(0,-1,1) ); + getGraphicalWorld()->createSceneNode("lightnode0")->attachLight( pLight ); + + getGraphicalWorld()->setShadowsEnabled( true ); + + // position camera and look at the ninja + getDefaultCamera()->setNearClipDistance( 1 ); + getDefaultCamera()->setFixedYawAxis(Vector3::kUnitY); + getDefaultCamera()->setPosition(Vector3(7,4,-7)); + + // create ground + mGround = new model::Model(); + { + const real groundHeight = 50; + // visual +#ifndef DEMO_USES_SPHERE + graphics::ISceneNode* pGroundSN = getGraphicalWorld()->createSceneNode(); + graphics::IEntity* pGroundE = getGraphicalWorld()->createEntity("plane_1x1.mesh"); + pGroundE->setMaterial("box"); + pGroundE->setCastsShadow( false ); + pGroundSN->attachEntity( pGroundE ); + pGroundSN->setScale( Vector3(100,1,100) ); + pGroundSN->setPosition( Vector3(0,-groundHeight,0) ); + + model::Graphical* pG = new model::Graphical(); + pG->addSceneNode( pGroundSN, "ground", true ); + mGround->addComponent( pG, "p" ); +#endif + + // physical + physics::IActorPtr pGroundPlane = getPhysicalWorld()->createActor( physics::ACTOR_STATIC ); +#ifdef DEMO_USES_SPHERE + pGroundPlane->createShape( physics::IShape::SphereDesc( real(groundHeight) ) ); +#else + pGroundPlane->createShape( physics::IShape::PlaneDesc( Vector3(0,-1,0), groundHeight ) ); +#endif + + model::Physical* pP = new model::Physical(); + pP->addActor( pGroundPlane, "groundPlane" ); + mGround->addComponent( pP, "g" ); + } + // +#ifdef DEMO_USES_SPHERE + getGraphicalWorld()->load("osm","C:/Programme/Autodesk/3dsMax8/OSM/geo1.osm"); +#endif + + // sky box + getGraphicalWorld()->setSkyBox("Examples/SpaceSkyBox"); + + // graphics / physics environment + mEnv = new Env(); + //const String dirMediaRoot = "../../media/samples/dotLink/DynTest/"; + //const String sceneBaseName = "DotScene1"; + //loadEnvironment( *mEnv, getGraphicalWorld(), getPhysicalWorld(), + // dirMediaRoot+sceneBaseName+".scene", dirMediaRoot+sceneBaseName+".xode", dirMediaRoot+sceneBaseName+".link" ); + + // create player/avatar + mPlayer.reset( new ControllableCharacter(*this,*getGraphicalWorld(),*getPhysicalWorld()) ); + //mPlayer->setPosition( Point3(0,-52,0) ); // 2 meters above the 50 m radius sphere + mPlayer->setPosition( Point3(-25.967,44.376,0.9326) ); + + // camera controllers + { // top-down camera controller + TopDownCameraController* ctrlr = new TopDownCameraController(); + ctrlr->setCamera( getDefaultCamera() ); + ctrlr->setOffset( Vector3(40,0,0) ); + ctrlr->setTargetOffset( Vector3(40,0,0) ); + mCamControllers.push_back( CameraControllerPtr(ctrlr) ); + } + { // 3rd person camera controller + ThirdPersonCameraController* ctrlr = new ThirdPersonCameraController(); + ctrlr->setCamera( getDefaultCamera() ); + + ctrlr->setOffsetFromTarget( Vector3(0,1.5,2) ); + ctrlr->setCurrentOffsetFromTarget( ctrlr->getOffsetFromTarget() ); + + // slightly downwards + ctrlr->setOffsetOrientation( Quaternion( -0.5, Vector3::kUnitX ) ); + ctrlr->setCurrentOffsetOrientation( ctrlr->getOffsetOrientation() ); + + mCamControllers.push_back( CameraControllerPtr(ctrlr) ); + } + mCurrentCamController = 0; + + } + virtual void onDestroyScene() + { + mCamControllers.clear(); + mPlayer.reset(); + YAKE_SAFE_DELETE( mGround ); + YAKE_SAFE_DELETE( mEnv ); + } + virtual void onEnter() + { + RtMainState::onEnter(); + using namespace input; + + // controls + if (mPlayer) + mPlayer->bindInput( mActionMap, getApp().getKeyboard(), getApp().getMouse() ); + + YAKE_ASSERT( !mCamControllers.empty() ); + + // + mActionMap.reg( ACTIONID_NEXT_CAMERA, new KeyboardActionCondition( getApp().getKeyboard(), input::KC_1, input::KAM_RELEASED ) ); + mActionMap.subscribeToActionIdV( ACTIONID_NEXT_CAMERA, BindX(&TheMainState::onNextCamera,this) ); + + // top-down controller + // @todo unsubscribe; move out into top down controller's bindInput() + mActionMap.reg( ACTIONID_ZOOM_INOUT, new MouseMoveActionCondition( getApp().getMouse(), input::MMA_WHEEL, input::MMD_BOTH ) ); + mActionMap.subscribeToActionIdR( ACTIONID_ZOOM_INOUT, Bind1(&TheMainState::onMouseWheel,this) ); + + mActionMap.reg( ACTIONID_MOUSE_MOVE, new MouseMoveActionCondition( getApp().getMouse(), input::MMA_X_AND_Y, input::MMD_BOTH ) ); + mActionMap.subscribeToActionIdR( ACTIONID_MOUSE_MOVE, Bind1(&TheMainState::onMouseMoveXY,this) ); + + // for cursor +#ifdef DEMO_USES_CEGUI + getApp().enableMouseInputForCEGUI(true); + getApp().enableKeyboardInputForCEGUI(true); +#endif + setupGUI(); + + mActionMap.start(); + } + virtual void onExit() + { + mActionMap.stop(); + + if (mPlayer) + mPlayer->unbindInput(); + +#ifdef DEMO_USES_CEGUI + getApp().enableKeyboardInputForCEGUI(false); + getApp().enableMouseInputForCEGUI(false); +#endif + RtMainState::onExit(); + } + virtual void onFrame(const real timeElapsed) + { + // + mActionMap.update(); + + // + if (mPlayer) + { + /* + Vector3 projViewDir = mTopDownCtrlr.getOffset(); + projViewDir.y = 0.; + if (projViewDir.length() <= 0.01) + projViewDir = Vector3::kUnitZ; + projViewDir.normalise(); + mPlayer->setDirection( projViewDir ); + */ + mPlayer->update( timeElapsed ); + } + + CameraControllerPtr currCamCtrlr = mCamControllers.at(mCurrentCamController); + YAKE_ASSERT( currCamCtrlr.get() ); + + //@todo hide properly + if (TopDownCameraController* topdownCtrlr = dynamic_cast<TopDownCameraController*>(currCamCtrlr.get())) + { // top-down controller + const real dist = timeElapsed * real(4.); + Vector3 offset; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_I)) + offset += dist * Vector3::kUnitZ; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_K)) + offset += - dist * Vector3::kUnitZ; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_J)) + offset += dist * Vector3::kUnitX; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_L)) + offset += - dist * Vector3::kUnitX; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_R)) + offset += dist * Vector3::kUnitY; + if (this->getApp().getKeyboard()->isKeyDown(input::KC_F)) + offset += - dist * Vector3::kUnitY; + topdownCtrlr->setOffset( topdownCtrlr->getOffset() + offset ); + topdownCtrlr->setTargetOffset( topdownCtrlr->getTargetOffset() + offset ); + + topdownCtrlr->setTarget( mPlayer->getPosition() ); + + // Rotate camera around camera's 'up' axis + // when user presses RMB and moves the mouse. + if (this->getApp().getMouse()->isButtonDown( input::MB_RIGHT )) + { + // @todo adjust rotation over several frames for smoother rotation. + const real angle = mMouseMovement.x * real(100.) * timeElapsed; + Matrix3 rot; + rot.FromAxisAngle( Vector3::kUnitY, angle ); + + // NB rotate both 'target offset' and 'current offset' so that + // relative to each other they stay the same. + + Vector3 offset = rot * topdownCtrlr->getTargetOffset(); + topdownCtrlr->setTargetOffset( offset ); + + offset = rot * topdownCtrlr->getOffset(); + topdownCtrlr->setOffset( offset ); + } + } + else if (ThirdPersonCameraController* ctrlr = dynamic_cast<ThirdPersonCameraController*>(currCamCtrlr.get())) + { + ctrlr->setTargetPosition( mPlayer->getPosition() ); + ctrlr->setTargetOrientation( mPlayer->getOrientation() ); + } + + // + currCamCtrlr->update( timeElapsed ); + + // prepare for next step + mActiveActions.clear(); + mMouseMovement = Vector3::kZero; + + //std::cout << this->mPlayerRep->getPosition() << "\n"; + + if (this->getApp().getKeyboard()->isKeyDown(input::KC_ADD)) + { + real physicsTimeFactor = this->getPhysicsTimeFactor(); + physicsTimeFactor += real(0.1) * timeElapsed; + this->setPhysicsTimeFactor( physicsTimeFactor ); + std::cout << "factor = " << this->getPhysicsTimeFactor() << "\n"; + } + if (this->getApp().getKeyboard()->isKeyDown(input::KC_SUBTRACT)) + { + real physicsTimeFactor = this->getPhysicsTimeFactor(); + physicsTimeFactor -= real(0.1) * timeElapsed; + if (physicsTimeFactor < 0.) physicsTimeFactor = 0.; + this->setPhysicsTimeFactor( physicsTimeFactor ); + std::cout << "factor = " << this->getPhysicsTimeFactor() << "\n"; + } + } +private: + void onNextCamera() + { + ++mCurrentCamController; + if (mCurrentCamController >= mCamControllers.size()) + mCurrentCamController = 0; + } + void onMouseMoveXY(const input::ActionMap::ActionResult& ar) + { + mMouseMovement = ar.signal * 10.; + std::swap( mMouseMovement.y, mMouseMovement.z ); + mMouseMovement.y = 0.; + } + void onMouseWheel(const input::ActionMap::ActionResult& ar) + { + /** @todo move out into CameraControllerBase::init() ... + if (fabs(ar.signal.z) < std::numeric_limits<real>::epsilon()) + return; + + const real fac = real(1.0 - 0.1 * ar.signal.z); // either 0.9 or 1.1 + + // scale the target offset + Vector3 targetOffset = mTopDownCtrlr.getTargetOffset() * fac; + + // keep a minimum length + if (targetOffset.length() < 5.) // min length + targetOffset = targetOffset.normalisedCopy() * 5.; + + // apply + mTopDownCtrlr.setTargetOffset( targetOffset ); + */ + } +private: + model::Model* mGround; + input::ActionMap mActionMap; + + typedef std::set<input::ActionId> ActionIdList; + ActionIdList mActiveActions; + + Env* mEnv; + + typedef SharedPtr<CameraControllerBase> CameraControllerPtr; + typedef std::deque<CameraControllerPtr> CameraControllerList; + CameraControllerList mCamControllers; + int mCurrentCamController; + + Vector3 mMouseMovement; + + SharedPtr<ControllableCharacter> mPlayer; +}; + +/** The mighty application itself! */ +class TheApp : public raf::ExampleApplication<TheConfiguration> +{ +public: + TheApp() {} +protected: + virtual raf::MainState* createMainState() + { + return new TheMainState(*this); + } +}; + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +int main( int argc, char** argv ) +{ + // @todo fixme: Workaround on windows because of different timers on different cores... + ::SetProcessAffinityMask( ::GetCurrentProcess(), 0x01 ); + ::SetThreadAffinityMask( ::GetCurrentThread(), 0x01 ); + + // Use default executor for convenience. + // It's always possible to manually execute TheApp::initialise() etc. + TheApp theApp; + return (raf::runApplication( theApp )) ? 0 : 1; +} + Copied: trunk/yake/samples/cmdrmayhem/yakePCH.cpp (from rev 1603, trunk/yake/samples/misc/cmdrmayhem/yakePCH.cpp) =================================================================== --- trunk/yake/samples/cmdrmayhem/yakePCH.cpp (rev 0) +++ trunk/yake/samples/cmdrmayhem/yakePCH.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -0,0 +1 @@ +//#include <samples/cmdrmayhem/yakePCH.h> Copied: trunk/yake/samples/cmdrmayhem/yakePCH.h (from rev 1603, trunk/yake/samples/misc/cmdrmayhem/yakePCH.h) =================================================================== --- trunk/yake/samples/cmdrmayhem/yakePCH.h (rev 0) +++ trunk/yake/samples/cmdrmayhem/yakePCH.h 2007-02-07 23:26:34 UTC (rev 1612) @@ -0,0 +1,10 @@ +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// STL +#include <iostream> +// Yake +#include <yake/base/yake.h> +#include <yake/scripting/yakeScriptingSystem.h> +#include <yake/yappbase/yapp.h> +#include <yake/ent/ent.h> Modified: trunk/yake/samples/ent/sampleEntFsm/demo.cpp =================================================================== --- trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -20,7 +20,7 @@ {} virtual void onObjectCreated(ent::Object* obj) { - YAKE_LOG( "exappOML::onObjectCreated: class is '" + obj->isA()->name() + "'" ); + YAKE_LOG( "exappOML", "onObjectCreated: class is '" + obj->isA()->name() + "'" ); scripting::IVM* vm = scriptingSys_.createVM(); YAKE_ASSERT( vm ); Modified: trunk/yake/samples/gui/console/yakeConsoleDemo.cpp =================================================================== --- trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -144,7 +144,9 @@ false /*script bindings*/, false /*audio*/), mGuiRendererAdapter( NULL ), - mConsole( ConsoleHolder::instance().getConsole() ) + mConsole( ConsoleHolder::instance().getConsole() ), + mEditBox( 0 ), + mListBox( 0 ) {} /** @@ -311,8 +313,10 @@ */ void setupConsole() { - mConsole.setInputWidget( mEditBox ); - mConsole.setOutputWidget( mListBox ); + if (mEditBox) + mConsole.setInputWidget( mEditBox ); + if (mListBox) + mConsole.setOutputWidget( mListBox ); yake::scripting::IVM* pVM = getScriptingSystem().createVM(); YAKE_ASSERT( pVM ); @@ -376,12 +380,12 @@ YAKE_LOG("demo", "Loading scheme..." ); - SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme"); - System::getSingleton().setDefaultMouseCursor("Vanilla-Images","MouseArrow"); + SchemeManager::getSingleton().loadScheme("yake1skin.scheme"); + System::getSingleton().setDefaultMouseCursor("yake1-images","MouseArrow"); FontManager::getSingleton().createFont("Iconified-12.font"); WindowManager& winMgr = WindowManager::getSingleton(); - Window* background = winMgr.createWindow("Vanilla/StaticImage"); + Window* background = winMgr.createWindow("yake1/StaticImage"); background->setArea(URect(cegui_reldim(0), cegui_reldim(0), cegui_reldim(1), cegui_reldim(1))); background->setProperty("FrameEnabled", "false"); background->setProperty("BackgroundEnabled", "false"); @@ -392,15 +396,16 @@ background->activate(); - +#if 0 mEditBox = static_cast<CEGUI::Editbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/Edit")); mListBox = static_cast<CEGUI::Listbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/History")); +#endif } // catch to prevent exit (errors will be logged). catch( CEGUI::Exception& e) { - YAKE_LOG_ERROR( "demo", yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); + YAKE_EXCEPT( yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); } setupConsole(); Modified: trunk/yake/samples/net/roserver/ROServer.cpp =================================================================== --- trunk/yake/samples/net/roserver/ROServer.cpp 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/samples/net/roserver/ROServer.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -1,5 +1,6 @@ #include <samples/net/inprocess/common.h> #include <samples/net/roserver/ROServer.h> +#include <boost/lexical_cast.hpp> namespace yake { namespace ro { @@ -83,17 +84,17 @@ outEvtQ_.push_back( EventQEntry(id,evt,cId) ); } */ - SignalConnection server::subscribeToClientSimulationStarted(const ClientSimulationStartedSignal::slot_type& slot) + SignalConnection server::subscribeToClientAccepted(const ClientAcceptedSignal::slot_type& slot) { - return sigClientSimulationStarted_.connect(slot); + return sigClientAccepted_.connect(slot); } SignalConnection server::subscribeToClientDisconnected(const ClientDisconnectedSignal::slot_type& slot) { return sigClientDisconnected_.connect(slot); } - void server::onClientSimStarted(iclient&c) + void server::onClientAccepted(iclient&c) { - sigClientSimulationStarted_(c.getPeerId()); + sigClientAccepted_(c.getPeerId()); } bool server::onStart() { @@ -102,6 +103,9 @@ const size_t maxClients = 32; + const String strServer = bindInterface_.ip() + ":" + boost::lexical_cast<String>(bindInterface_.port()); + YAKE_LOG_INFORMATION("serv-host","starting server at '" << strServer << "' with max. " << maxClients << " clients..."); + conn_.reset( net::createServerPacketConnection() ); YAKE_ASSERT( conn_ ); @@ -109,7 +113,6 @@ conn_->addPacketReceivedCallback( boost::bind(&server::onReceivePacket,this,_1,_2,_3) ); conn_->addClientDisconnectedCallback( boost::bind(&server::onClientDisconnected,this,_1) ); - COUTLN("starting server at '" << bindInterface_.ip() << ":" << bindInterface_.port() << "' with max. " << maxClients << " clients..."); conn_->start( bindInterface_, maxClients ); // wait until net object is up @@ -119,6 +122,7 @@ net::update(); net::native::sleep(0); } + YAKE_LOG_INFORMATION("serv-host","server is up at '" << strServer << "'"); return true; } void server::onStop() @@ -248,7 +252,7 @@ this->stage = CS_RUNNING; // replicate objects - this->svr.onClientSimStarted( *this ); + this->svr.onClientAccepted( *this ); } } void client::running_onProcessEvent(const net::NetEvent& evt, const net::ChannelId channel) Modified: trunk/yake/samples/net/roserver/ROServer.h =================================================================== --- trunk/yake/samples/net/roserver/ROServer.h 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/samples/net/roserver/ROServer.h 2007-02-07 23:26:34 UTC (rev 1612) @@ -48,9 +48,9 @@ //void queueEventBroadcast(net::NetEvent*, const net::ChannelId); typedef SignalX<void(const net::PeerId)> PeerIdSignal; - typedef PeerIdSignal ClientSimulationStartedSignal; + typedef PeerIdSignal ClientAcceptedSignal; typedef PeerIdSignal ClientDisconnectedSignal; - yake::SignalConnection subscribeToClientSimulationStarted(const ClientSimulationStartedSignal::slot_type&); + yake::SignalConnection subscribeToClientAccepted(const ClientAcceptedSignal::slot_type&); yake::SignalConnection subscribeToClientDisconnected(const ClientDisconnectedSignal::slot_type&); //private: @@ -68,7 +68,7 @@ void onProcessEvent(const net::PeerId, const net::NetEvent&, const net::ChannelId); void onClientDisconnected(const net::PeerId); private: // internal callback - void onClientSimStarted(iclient&); + void onClientAccepted(iclient&); private: net::Address bindInterface_; @@ -96,7 +96,7 @@ //mutable boost::mutex outEvtQMtx_; //InitEvtClassTableFn initEvtClassTableFn_; - ClientSimulationStartedSignal sigClientSimulationStarted_; + ClientAcceptedSignal sigClientAccepted_; ClientDisconnectedSignal sigClientDisconnected_; }; Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/scripts/premake/samples.lua 2007-02-07 23:26:34 UTC (rev 1612) @@ -40,6 +40,27 @@ useComponent("graphics") -------------------------------------- +makeSample("sampleVehicle","samples/vehicle") +useComponent("base") +useComponent("physics") +useComponent("graphics") +useComponent("input") +useComponent("model") +useComponent("ent") +useComponent("raf") +useComponent("vehicle") + +-------------------------------------- +makeSample("sampleCmdrMayhem","samples/cmdrmayhem") +useComponent("base") +useComponent("physics") +useComponent("graphics") +useComponent("input") +useComponent("model") +useComponent("raf") +useDep("cegui") + +-------------------------------------- makeSample("sampleRafMinimal","samples/raf/minimal") useComponent("base") useComponent("raf") Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/src/raf/yakeApplication.cpp 2007-02-07 23:26:34 UTC (rev 1612) @@ -177,7 +177,7 @@ void Application::initCEGUI() { //const String file = "CEGUIOgreAdapter"; - const String file = "CEGUIOgreRendererAdapter"; + const String file = YAKE_DYNLIB_NAME("CEGUIOgreRendererAdapter"); yake::base::Library* pDynLib = new yake::base::Library( file ); //@FIXME. MEMORY LEAK. YAKE_ASSERT( pDynLib ).debug( "Out of memory" ); Modified: trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h =================================================================== --- trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/yake/gui_addons/console/cegui/yakeCEGUIOutputArea.h 2007-02-07 23:26:34 UTC (rev 1612) @@ -75,6 +75,9 @@ */ void addMessage( const MessageType& msg ) { + if (!outputBox_) + return; + CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem( (CEGUI::utf8*)msg.text_.c_str() ); outputBox_->addItem( item ); @@ -90,6 +93,9 @@ */ void scrollUp( std::size_t lines ) { + if (!outputBox_) + return; + if ( visibleItemIndex_ == 0 ) return; @@ -110,6 +116,9 @@ */ void scrollDown( std::size_t lines ) { + if (!outputBox_) + return; + if ( visibleItemIndex_ == 0 ) lines *= 2; @@ -127,10 +136,15 @@ */ void clearScroll() { + if (!outputBox_) + return; visibleItemIndex_ = outputBox_->getItemCount(); outputBox_->ensureItemIsVisible( visibleItemIndex_ ); } + CEGUIOutputArea() : outputBox_(0), visibleItemIndex_(0) + { + } private: /// CEGUI widget representing output area CEGUI::Listbox* outputBox_; Modified: trunk/yake/yake/netsvc/netSvc.h =================================================================== --- trunk/yake/yake/netsvc/netSvc.h 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/yake/netsvc/netSvc.h 2007-02-07 23:26:34 UTC (rev 1612) @@ -5,11 +5,4 @@ #include <yake/netsvc/netService.h> #include <yake/netsvc/netServiceHost.h> -namespace yake { -namespace net { - - -} // namespace net -} // namespace yake - #endif Modified: trunk/yake/yake/netsvc/service/netTimeServiceMessages.h =================================================================== --- trunk/yake/yake/netsvc/service/netTimeServiceMessages.h 2007-01-22 21:41:10 UTC (rev 1611) +++ trunk/yake/yake/netsvc/service/netTimeServiceMessages.h 2007-02-07 23:26:34 UTC (rev 1612) @@ -3,13 +3,13 @@ #include <yake/netsvc/netPrerequisites.h> +#if YAKE_COMPILER == COMPILER_MSVC #pragma warning(push) #pragma warning(disable: 4275) // C4275: non dll-interface class 'X' used as base for dll-interface 'Y' +#endif namespace yake { namespace net { -//namespace svc { -//namespace comm { struct s2cEvtPing : public yake::net::NetEvent { @@ -69,11 +69,11 @@ yake::uint32 clientTime_; }; -//} // namespace comm -//} // namespace svc } // namespace net } // namespace yake +#if YAKE_COMPILER == COMPILER_MSVC #pragma warning(pop) +#endif #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |