yake-svn Mailing List for Yake Engine (Page 4)
Status: Beta
Brought to you by:
psyclonist
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(51) |
Oct
(2) |
Nov
(18) |
Dec
(66) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(44) |
Feb
(13) |
Mar
(73) |
Apr
(61) |
May
|
Jun
(4) |
Jul
(19) |
Aug
(50) |
Sep
(47) |
Oct
(7) |
Nov
(7) |
Dec
(14) |
2008 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
(4) |
May
(5) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(4) |
2009 |
Jan
|
Feb
(22) |
Mar
(12) |
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
(4) |
Aug
|
Sep
|
Oct
(17) |
Nov
(3) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(12) |
Apr
(11) |
May
|
Jun
(5) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <psy...@us...> - 2009-02-23 15:35:05
|
Revision: 1962 http://yake.svn.sourceforge.net/yake/?rev=1962&view=rev Author: psyclonist Date: 2009-02-23 15:35:00 +0000 (Mon, 23 Feb 2009) Log Message: ----------- build: If ENABLE_LUA_GRAPHICS_OGRE==true then "bindings.lua" needs to link to "graphicsOgre" (and implicitely Ogre). [http://www.yake.org/forum/index.php/topic,1402.0.html] Modified Paths: -------------- trunk/yake/scripts/premake/yake.lua Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2009-02-17 23:08:16 UTC (rev 1961) +++ trunk/yake/scripts/premake/yake.lua 2009-02-23 15:35:00 UTC (rev 1962) @@ -303,6 +303,9 @@ if ENABLE_LUA_GRAPHICS then addDependency("graphics") end + if ENABLE_LUA_GRAPHICS_OGRE then + addDependency("graphicsOgre") + end if ENABLE_LUA_PHYSICS then addDependency("physics") end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:16:04
|
Revision: 1960 http://yake.svn.sourceforge.net/yake/?rev=1960&view=rev Author: psyclonist Date: 2009-02-17 22:45:49 +0000 (Tue, 17 Feb 2009) Log Message: ----------- scripts/premake/tools.lua: fixed use of comment Modified Paths: -------------- trunk/yake/scripts/premake/tools.lua Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2009-02-17 22:24:08 UTC (rev 1959) +++ trunk/yake/scripts/premake/tools.lua 2009-02-17 22:45:49 UTC (rev 1960) @@ -198,7 +198,7 @@ if (cb_gcc) then addDefine("_REENTRANT") end - else // Linux: + else -- Linux: addDefine("_REENTRANT") end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:46
|
Revision: 1956 http://yake.svn.sourceforge.net/yake/?rev=1956&view=rev Author: psyclonist Date: 2009-02-17 22:19:39 +0000 (Tue, 17 Feb 2009) Log Message: ----------- * bindings.lua/ent: added property 'model' to class 'Entity' * bindings.lua: modifications for compatibility with Luabind 0.8 (which is now a requirement!) Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/ent.lua.cpp trunk/yake/yake/bindings.lua/bindings.lua.ent.registry.h trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.h Modified: trunk/yake/src/bindings.lua/detail/ent.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/ent.lua.cpp 2009-02-17 22:18:09 UTC (rev 1955) +++ trunk/yake/src/bindings.lua/detail/ent.lua.cpp 2009-02-17 22:19:39 UTC (rev 1956) @@ -489,6 +489,7 @@ class_<Entity,Object>( "Entity" ) //.def( constructor<>() ) + .property( "model", &Entity::getModel, &Entity::setModel ) .def( "setModel", &Entity::setModel ) .def( "getModel", &Entity::getModel ) @@ -753,8 +754,8 @@ // cast fails. if (is_derived_from( objCls, root )) { - void* p1 = 0; //@todo find out what's this for. - void* p = objCls->convert_to( LUABIND_TYPEID(Object), obj, p1 ); + luabind::detail::conversion_storage storage; + void* p = objCls->convert_to( LUABIND_TYPEID(Object), obj, storage ); Object* ent = reinterpret_cast<Object*>(p); if (ent) // <- I don't know of any case where this fails but to be safe... { Modified: trunk/yake/yake/bindings.lua/bindings.lua.ent.registry.h =================================================================== --- trunk/yake/yake/bindings.lua/bindings.lua.ent.registry.h 2009-02-17 22:18:09 UTC (rev 1955) +++ trunk/yake/yake/bindings.lua/bindings.lua.ent.registry.h 2009-02-17 22:19:39 UTC (rev 1956) @@ -68,16 +68,14 @@ luabind::detail::class_rep* crep = orep->crep(); YAKE_ASSERT(crep); - void* p1 = 0; //@todo find out what's this for. - #if 0 - void* p = crep->convert_to( LUABIND_TYPEID(T), orep, p1 ); - T* derived = reinterpret_cast<T*>(p); - #else - void* p = crep->convert_to( LUABIND_TYPEID(ent::Object), orep, p1 ); + + // cast to ent::Object* + luabind::detail::conversion_storage storage; + void* p = crep->convert_to( LUABIND_TYPEID(ent::Object), orep, storage ); ent::Object* obj = reinterpret_cast<ent::Object*>(p); - T* derived = dynamic_cast<T*>(obj); - #endif + // now cast to T* + T* derived = dynamic_cast<T*>(obj); YAKE_ASSERT(derived); if (!derived) { Modified: trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.h =================================================================== --- trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.h 2009-02-17 22:18:09 UTC (rev 1955) +++ trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.h 2009-02-17 22:19:39 UTC (rev 1956) @@ -117,6 +117,10 @@ } #endif + // Actually, this function doesn't just register the type T for conversion from/to C++ and Lua + // when used with boost::any. + // This function also registers several other related converters and creators, e.g. + // the property related converters and creators. template<class T> inline void register_any_converter() { @@ -157,4 +161,57 @@ } } + +// As of Luabind 0.8 a specilization of default_converter<boost::any> is required +// for the C++-to-Lua conversion to work. +#include <luabind/detail/policy.hpp> +namespace luabind { + +template <> +struct default_converter<boost::any> + : native_converter_base<boost::any> +{ + static int compute_score(lua_State* L, int index) + { + return default_converter<int>::compute_score(L, index); + } + + /* Isn't called by Luabind.... why? Instead, the regular convert_cpp_to_lua() etc. gets called. + // Lua -> C++ + boost::any from(lua_State* L, int index) + { + boost::any out; + object o(from_stack(L,index)); + switch (luabind::type(o)) + { + case LUA_TBOOLEAN: + return boost::any( object_cast<bool>(o) ); + case LUA_TNUMBER: + return boost::any( object_cast<int>(o) ); //@todo what about double? float? + case LUA_TSTRING: + return boost::any( object_cast<std::string>(o) ); //@todo fixme + //case LUA_TFUNCTION: + // return boost::any( o ); + case LUA_TUSERDATA: + { + } + return out; + default: + break; + } + throw std::runtime_error("encountered unsupported type in default_converter<boost::any>::from()"); + } + */ + + // C++ -> Lua + // As of Luabind 0.8 this seems to get called instead of convert_cpp_to_lua() directly. + void to(lua_State* L, boost::any const& x) + { + ::luabind::converters::convert_cpp_to_lua(L,x); + } +}; + +} // namespace luabind + + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:45
|
Revision: 1957 http://yake.svn.sourceforge.net/yake/?rev=1957&view=rev Author: psyclonist Date: 2009-02-17 22:20:10 +0000 (Tue, 17 Feb 2009) Log Message: ----------- * scripts/sia_importer.lua: preliminary support for materials (-> Ogre .material output) Modified Paths: -------------- trunk/yake/common/media/scripts/sia_importer.lua Modified: trunk/yake/common/media/scripts/sia_importer.lua =================================================================== --- trunk/yake/common/media/scripts/sia_importer.lua 2009-02-17 22:19:39 UTC (rev 1956) +++ trunk/yake/common/media/scripts/sia_importer.lua 2009-02-17 22:20:10 UTC (rev 1957) @@ -27,35 +27,100 @@ local sia_reader = { current = nil, - data = {} + data = {}, + tags = {} } -function sia_reader:file(line) - if line == "-Shape" then +sia_reader.tags["Shape"] = sia_reader.shape +sia_reader.tags["endShape"] = function() end +sia_reader.tags["Mat"] = function() end +sia_reader.tags["endMat"] = function() end + +function sia_reader:file(line,shapeFinalizer,materialFinalizer) + if line:find("-Shape") == 1 then + print("SIA","-Shape") self.current = self.shape + self:current(line,shapeFinalizer,materialFinalizer) + elseif line:find("-Mat") == 1 then + print("SIA","-Mat") + self.current = self.material + self:current(line,shapeFinalizer,materialFinalizer) end end -function sia_reader:finishShape(finalizer) +function sia_reader:material(line,_,materialFinalizer) + if line:find("-Mat") == 1 then + self.data.materials = self.data.materials or {} + self.data.materials.current = {} + elseif line:find("-endMat") == 1 then + local mat = self.data.materials.current + assert( mat, "no material to finialize" ) + assert( mat.name, "material: requires name" ) + mat.diffuse = mat.diffuse or yake.Color(1,1,1) + mat.specular = mat.specular or yake.Color(1,1,1) + mat.emissive = mat.emissive or yake.Color(1,1,1) + mat.shininess = mat.shininess or 0 + + assert( materialFinalizer ) + if materialFinalizer then + materialFinalizer(mat,fn) + end + + table.insert(self.data.materials,mat) + self.data.materials.current = {} + --@todo FINISH + self.current = self.file + elseif line:find("-dif") == 1 then + local r,g,b,_ = line:match("%-dif%s+(.-)%s+(.-)%s+(.-)%s+(.-)") + r,g,b = tonumber(r),tonumber(g),tonumber(b) + assert(r and g and b) + self.data.materials.current.diffuse = yake.Color(r,g,b) + elseif line:find("-spec") == 1 then + local r,g,b,_ = line:match("%-spec%s+(.-)%s+(.-)%s+(.-)%s+(.-)") + r,g,b = tonumber(r),tonumber(g),tonumber(b) + assert(r and g and b) + self.data.materials.current.specular = yake.Color(r,g,b) + elseif line:find("-emis") == 1 then + local r,g,b,_ = line:match("%-emis%s+(.-)%s+(.-)%s+(.-)%s+(.-)") + r,g,b = tonumber(r),tonumber(g),tonumber(b) + assert(r and g and b) + self.data.materials.current.emissive = yake.Color(r,g,b) + elseif line:find("-shin") == 1 then + local shininess = line:match("%-shin%s+(.-)") + assert(shininess) + elseif line:find("-tex") == 1 then + local tex = line:match("%-tex%s+%\"(.-)%\"") + assert(tex) + print("material","tex",tex) + self.data.materials.current.tex0 = tex + elseif line:find("-name") == 1 then + local name = line:match("%-name%s+%\"(.-)%\"") + assert(name) + print("material","name",name) + self.data.materials.current.name = name + end +end +function sia_reader:finishShape(shapeFinalizer) assert( self.data.name, "shape: no name set - cannot finish") print("SIA - finalizing shape '"..tostring(self.data.name).."'") - assert( finalizer and type(finalizer) == "function" ) - finalizer(self.data) + --assert( (shapeFinalizer~=nil) and (type(v) == "function"), type(shapeFinalizer) ) + shapeFinalizer(self.data) -- prepare for next shape: - --self.current = nil self.current = self.file - self.data = { name = nil, vertices = {}, indices = {}, numVerts = 0, numIndices = 0 } end -function sia_reader:shape(line,finalizer) +function sia_reader:shape(line,shapeFinalizer) if line:find("-endShape") == 1 then - self:finishShape(finalizer) + self:finishShape(shapeFinalizer) return end if not self.data.name then - self.data.name = line:match("-snam%s+%\"(.-)%\"") + self.data.name = line:match("%-snam%s+%\"(.-)%\"") if self.data.name then print("found",self.data.name) end + elseif line:find("-setmat") == 1 then + self.data.matidx = tonumber(line:match("%-%w+%s+([%d]+)")) + print("matidx",self.data.matidx,line) elseif line:find("-vert") == 1 then local x,y,z = line:match("%-vert%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)") assert( x and y and z ) @@ -63,7 +128,8 @@ self.data.numVerts = self.data.numVerts + 1 elseif line:find("-face") == 1 then local num,a,_,_,_,b,_,_,_,c = line:match("%-face%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)") - assert( tonumber(num) == 3, "face: only tris are supported") + num = tonumber(num) + assert( num == 3, "face: only tris are supported") assert( a and b and c, "face: not all ordinates available") assert( tonumber(a) < #self.data.vertices, a ) assert( tonumber(b) < #self.data.vertices, b ) @@ -75,12 +141,12 @@ self.data.numIndices = self.data.numIndices + 3 end end -sia_reader.current = sia_reader.file -sia_reader.data = { name = nil, vertices = {}, indices = {}, numVerts = 0, numIndices = 0 } -- official "api": -function sia_reader.import(filename,finalizer) +function sia_reader.import(filename,shapeFinalizer,materialFinalizer) + sia_reader.data = { name = nil, vertices = {}, indices = {}, numVerts = 0, numIndices = 0, materials = {} } + sia_reader.current = sia_reader.file for line in io.lines(filename) do - sia_reader:current(line,finalizer) + sia_reader:current(line,shapeFinalizer,materialFinalizer) if not sia_reader.current then break end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:45
|
Revision: 1955 http://yake.svn.sourceforge.net/yake/?rev=1955&view=rev Author: psyclonist Date: 2009-02-17 22:18:09 +0000 (Tue, 17 Feb 2009) Log Message: ----------- * bindings.lua/input: added bindings for MouseActionConditions (movement, buttons). * bindings.lua/input: added support for creating custom ActionIds from Lua. Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/input.lua.cpp Modified: trunk/yake/src/bindings.lua/detail/input.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/input.lua.cpp 2009-02-17 22:16:35 UTC (rev 1954) +++ trunk/yake/src/bindings.lua/detail/input.lua.cpp 2009-02-17 22:18:09 UTC (rev 1955) @@ -123,6 +123,8 @@ [ namespace_("input") [ + /* @todo FIXME This doesn't really seem to work well. + So as a workaround for now we use the direct registration: see below. class_<NullType>("MouseButton") .enum_("MouseButton") [ @@ -130,7 +132,22 @@ value("MBT_RIGHT",MBT_RIGHT), value("MBT_MIDDLE",MBT_MIDDLE) ] + .enum_("MouseMoveAxis") + [ + value("MMA_X",MMA_X), + value("MMA_Y",MMA_Y), + value("MMA_X_AND_Y",MMA_X_AND_Y), + value("MMA_WHEEL",MMA_WHEEL), + value("MMA_ALL",MMA_ALL) + ] + .enum_("MouseMoveDirection") + [ + value("MMD_POSITIVE",MMD_POSITIVE), + value("MMD_NEGATIVE",MMD_NEGATIVE), + value("MMD_BOTH",MMD_BOTH) + ] , + */ class_<InputDevice>("InputDevice") .property("type", &InputDevice::getType) , @@ -144,6 +161,9 @@ .def("activateDevice", &IInputSystem::activateDevice) , class_<ActionId>("ActionId") + .def(constructor<ActionId::IdType,String>()) + .def(constructor<ActionId const&>()) + .def(const_self == other<ActionId>()) .property("id", &ActionId::id) .property("name", &ActionId::getName) .scope @@ -157,12 +177,12 @@ , class_<ActionCondition,SharedPtr<ActionCondition> >("ActionCondition") , - class_<MouseActionCondition,ActionCondition>("MouseActionCondition") - //.def(constructor<MouseDevice*>()) - , - class_<MouseButtonActionCondition,MouseActionCondition>("MouseButtonActionCondition") + class_<MouseButtonActionCondition,ActionCondition,SharedPtr<ActionCondition> >("MouseButtonActionCondition") .def(constructor<MouseDevice*,MouseButton,MouseButtonActionMode>()) , + class_<MouseMoveActionCondition,ActionCondition,SharedPtr<ActionCondition> >("MouseMoveActionCondition") + .def(constructor<MouseDevice*,MouseMoveAxis,MouseMoveDirection,bool>()) + , class_<KeyboardActionCondition,ActionCondition,SharedPtr<ActionCondition> >("KeyboardActionCondition") .def(constructor<KeyboardDevice*,KeyCode,KeyboardActionMode>()) .def("setKey", &KeyboardActionCondition::setKey) @@ -186,6 +206,20 @@ .def("save", &ActionMap::saveToFile) ] ]; + luabind::globals(L)["yake"]["input"]["MBT_LEFT"] = MBT_LEFT; + luabind::globals(L)["yake"]["input"]["MBT_RIGHT"] = MBT_RIGHT; + luabind::globals(L)["yake"]["input"]["MBT_MIDDLE"] = MBT_MIDDLE; + + luabind::globals(L)["yake"]["input"]["MMA_X"] = MMA_X; + luabind::globals(L)["yake"]["input"]["MMA_Y"] = MMA_Y; + luabind::globals(L)["yake"]["input"]["MMA_X_AND_Y"] = MMA_X_AND_Y; + luabind::globals(L)["yake"]["input"]["MMA_WHEEL"] = MMA_WHEEL; + luabind::globals(L)["yake"]["input"]["MMA_ALL"] = MMA_ALL; + + luabind::globals(L)["yake"]["input"]["MMD_POSITIVE"] = MMD_POSITIVE; + luabind::globals(L)["yake"]["input"]["MMD_NEGATIVE"] = MMD_NEGATIVE; + luabind::globals(L)["yake"]["input"]["MMD_BOTH"] = MMD_BOTH; + luabind::globals(L)["yake"]["input"]["KAM_CONTINUOUS"] = KAM_CONTINUOUS; luabind::globals(L)["yake"]["input"]["KAM_PRESSED"] = KAM_PRESSED; luabind::globals(L)["yake"]["input"]["KAM_RELEASED"] = KAM_RELEASED; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:44
|
Revision: 1951 http://yake.svn.sourceforge.net/yake/?rev=1951&view=rev Author: psyclonist Date: 2009-02-17 22:13:27 +0000 (Tue, 17 Feb 2009) Log Message: ----------- bindings.lua: Color properties r,g,b,a are now bound correctly Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/base.lua.cpp Modified: trunk/yake/src/bindings.lua/detail/base.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/base.lua.cpp 2009-02-06 16:24:19 UTC (rev 1950) +++ trunk/yake/src/bindings.lua/detail/base.lua.cpp 2009-02-17 22:13:27 UTC (rev 1951) @@ -122,7 +122,6 @@ // using namespace luabind; #define YAKE_MATH_MODULE L, "yake" - module( YAKE_MATH_MODULE ) [ class_<Color>("Color") @@ -130,11 +129,10 @@ .def( constructor<real,real,real>() ) .def( constructor<real,real,real,real>() ) .def( constructor< const Color& >() ) - //FIXME some strange members in anonymous union::struct - /* .def_readwrite( "r", &Color::r ) - .def_readwrite( "g", &Color::g ) - .def_readwrite( "b", &Color::b ) - .def_readwrite( "a", &Color::a )*/ + .def_readwrite( "r", &Color::r ) + .def_readwrite( "g", &Color::g ) + .def_readwrite( "b", &Color::b ) + .def_readwrite( "a", &Color::a ) ]; //TODO Bind the whole math::Math class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:43
|
Revision: 1954 http://yake.svn.sourceforge.net/yake/?rev=1954&view=rev Author: psyclonist Date: 2009-02-17 22:16:35 +0000 (Tue, 17 Feb 2009) Log Message: ----------- bindings.lua/graphics: added bindings for programmatically defined meshes (i.e. ISubmeshAccess, IMeshGeometryAccess, IWorld:createManualMesh) Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/graphics.lua.cpp Modified: trunk/yake/src/bindings.lua/detail/graphics.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/graphics.lua.cpp 2009-02-17 22:14:37 UTC (rev 1953) +++ trunk/yake/src/bindings.lua/detail/graphics.lua.cpp 2009-02-17 22:16:35 UTC (rev 1954) @@ -25,8 +25,9 @@ ------------------------------------------------------------------------------------ */ #include <yake/config.h> -#undef YAKE_ENABLE_LUA_GRAPHICS_OGRE -#define YAKE_ENABLE_LUA_GRAPHICS_OGRE 0 + +//#undef YAKE_ENABLE_LUA_GRAPHICS_OGRE +//#define YAKE_ENABLE_LUA_GRAPHICS_OGRE 0 #if YAKE_ENABLE_LUA_GRAPHICS == 1 #include <yake/bindings.lua/prerequisites.h> // Don't forget to include this for proper dllexport! @@ -43,15 +44,17 @@ #include <yake/base/templates/yakeSmartAssert.h> #include <yake/base/yake.h> #include <yake/graphics/yakeGraphics.h> +#include <yake/graphics/yakeGeometryAccess.h> #if YAKE_ENABLE_LUA_GRAPHICS_OGRE == 1 #include <yake/plugins/graphicsOgre/yakeGraphicsSystem.h> #include <yake/plugins/graphicsOgre/graphicsOgreNode.h> #include <yake/plugins/graphicsOgre/graphicsOgreEntity.h> -#include <../../../dependencies/ogrenew/include/OgreNode.h> -#include <../../../dependencies/ogrenew/include/OgreSceneNode.h> -#include <../../../dependencies/ogrenew/include/OgreEntity.h> -#include <../../../dependencies/ogrenew/include/OgreSubEntity.h> -#include <../../../dependencies/ogrenew/include/OgreSceneManager.h> +#include <../../../dependencies/ogre/include/OgreNode.h> +#include <../../../dependencies/ogre/include/OgreSceneNode.h> +#include <../../../dependencies/ogre/include/OgreEntity.h> +#include <../../../dependencies/ogre/include/OgreSubEntity.h> +#include <../../../dependencies/ogre/include/OgreSceneManager.h> +#include <../../../dependencies/ogre/include/OgreMaterialManager.h> #endif #include <yake/bindings.lua/detail/private.h> @@ -60,6 +63,7 @@ #include <luabind/iterator_policy.hpp> #include <luabind/operator.hpp> #include <luabind/adopt_policy.hpp> +#include <luabind/tag_function.hpp> namespace yake { namespace graphics { @@ -102,6 +106,13 @@ { return (n ? n->createChildNode() : 0); } +#if YAKE_ENABLE_LUA_GRAPHICS_OGRE == 1 + void IWorld_parseMaterialScript(const String& filename) + { + Ogre::DataStreamPtr ptr(new Ogre::FileStreamDataStream(new std::ifstream(filename.c_str(),std::ios::binary))); + Ogre::MaterialManager::getSingleton().parseScript(ptr,"Default"); + } +#endif void bind( lua_State* L ) { @@ -198,6 +209,25 @@ class_<IViewport>("Viewport") //@todo , + class_<ISubmeshAccess>("SubmeshAccess") + //.def("open", (bool(ISubmeshAccess::*)(uint32,uint32,uint8))&ISubmeshAccess::open) + .def("open", tag_function<bool(ISubmeshAccess*,uint32,uint32)>(boost::bind(&ISubmeshAccess::open,_1,_2,_3,uint8(0)))) + .def("close", &ISubmeshAccess::close) + .def("setMaterial", &ISubmeshAccess::setMaterial) + + //.def("lockPositions", &ISubmeshAccess::lockPositions) + .def("lockPositions", tag_function<bool(ISubmeshAccess*,uint32,uint32)>(boost::bind(&ISubmeshAccess::lockPositions,_1,_2,_3,false))) + .def("unlockPositions", &ISubmeshAccess::unlockPositions) + .def("setPosition", &ISubmeshAccess::setPosition) + + .def("lockIndices", &ISubmeshAccess::lockIndices) + .def("unlockIndices", &ISubmeshAccess::unlockIndices) + .def("setIndex", &ISubmeshAccess::setIndex) + , + class_<IMeshGeometryAccess>("MeshGeometryAccess") + .def("createSubmesh", &IMeshGeometryAccess::createSubmesh) + .def("getSubmesh", &IMeshGeometryAccess::getSubmesh) + , //@todo ISkeleton etc pp // class_<IWorld>("World") @@ -214,6 +244,12 @@ .def("setShadowsEnabled", &IWorld::setShadowsEnabled) .def("setAmbientLight", &IWorld::setAmbientLight) .def("pickEntity", &IWorld::pickEntity) + .def("createManualMesh", &IWorld::createProceduralMesh, adopt(result)) + + // Ogre specific: +#if YAKE_ENABLE_LUA_GRAPHICS_OGRE == 1 + .def("parseMaterialScript", &IWorld_parseMaterialScript) +#endif ] ]; #if YAKE_ENABLE_LUA_GRAPHICS_OGRE == 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:43
|
Revision: 1952 http://yake.svn.sourceforge.net/yake/?rev=1952&view=rev Author: psyclonist Date: 2009-02-17 22:14:13 +0000 (Tue, 17 Feb 2009) Log Message: ----------- bindings.lua: raf.Application now provides 'mouse' property to access the application's default mouse device Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/raf.lua.cpp Modified: trunk/yake/src/bindings.lua/detail/raf.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/raf.lua.cpp 2009-02-17 22:13:27 UTC (rev 1951) +++ trunk/yake/src/bindings.lua/detail/raf.lua.cpp 2009-02-17 22:14:13 UTC (rev 1952) @@ -64,6 +64,10 @@ { return app ? app->getKeyboard() : 0; } + input::MouseDevice* getAppMouse(raf::Application* app) + { + return app ? app->getMouse() : 0; + } graphics::IGraphicsSystem* getAppDefaultGraphics(raf::Application* app) { return app ? app->getGraphicsSystem() : 0; @@ -93,6 +97,7 @@ [ class_<raf::Application>("Application") .property("keyboard", &getAppKeyboard) + .property("mouse", &getAppMouse) .property("graphics", &getAppDefaultGraphics) .property("physics", &getAppDefaultPhysics) .property("audio", &getAppDefaultAudio) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:43
|
Revision: 1958 http://yake.svn.sourceforge.net/yake/?rev=1958&view=rev Author: psyclonist Date: 2009-02-17 22:20:41 +0000 (Tue, 17 Feb 2009) Log Message: ----------- scripts/bind_resource_loaders.lua: added error message to assert() Modified Paths: -------------- trunk/yake/common/media/scripts/bind_resource_loaders.lua Modified: trunk/yake/common/media/scripts/bind_resource_loaders.lua =================================================================== --- trunk/yake/common/media/scripts/bind_resource_loaders.lua 2009-02-17 22:20:10 UTC (rev 1957) +++ trunk/yake/common/media/scripts/bind_resource_loaders.lua 2009-02-17 22:20:41 UTC (rev 1958) @@ -14,7 +14,7 @@ assert( succ.valid, "could not locate file " .. tostring(path) ) if succ.valid then local f = yake.old_loadfile(succ.location) - assert( f ) + assert( f, "loadfile failed for '"..succ.location.."'" ) return f() -- execute! end return nil This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:34
|
Revision: 1959 http://yake.svn.sourceforge.net/yake/?rev=1959&view=rev Author: psyclonist Date: 2009-02-17 22:24:08 +0000 (Tue, 17 Feb 2009) Log Message: ----------- * scripts/raf2.lua: added mouse look using custom actions * scripts/raf2.lua: added camera movement using left/right/up/down or w/a/s/d * scripts/raf2.lua: implemented new Lua based graphics scene description as alternative to dotScene (.scene) which is both, easily human-readable/editable and machine-writable/readable. Modified Paths: -------------- trunk/yake/common/media/scripts/raf2.lua Modified: trunk/yake/common/media/scripts/raf2.lua =================================================================== --- trunk/yake/common/media/scripts/raf2.lua 2009-02-17 22:20:41 UTC (rev 1958) +++ trunk/yake/common/media/scripts/raf2.lua 2009-02-17 22:24:08 UTC (rev 1959) @@ -5,7 +5,7 @@ -- * res (including yake.dofile) -- * graphics, physics, ent, raf, model and more -- * demo specific bindings (sim.* and app.*) --- +-- local gworld = sim.gworld local defaultCam = sim.activeCamera @@ -15,39 +15,147 @@ local io = require 'io' + -------------------------------------- +--@TODO currently uses global 'gworld'... +local graphics = {} +function graphics.node(args) + local out = gworld:createSceneNode(args.name or "") + out.__type = "graphics.node" + if args.scale then + out.scale = args.scale + end + if args.position then + out.position = args.position + end + + for _,n in pairs(args) do + if n and n.__type and (n.__type == "graphics.entity" or n.__type == "graphics.light") then + out:attach(n) + end + end + + return out +end +function graphics.entity(args) + assert( args.mesh, "graphics.entity: no mesh specified") + local out = gworld:createEntity(args.mesh) + out.__type = "graphics.entity" + if args.material then out:setMaterial(args.material) end + return out +end +function graphics.light(args) + assert( args.type, "graphics.light: no type specified") + + local light = gworld:createLight() -- create light + light.__type = "graphics.light" + + light.type = args.type or yake.graphics.Light.LT_DIRECTIONAL -- configure light + light:setDiffuseColour(args.diffuse or yake.Color(1,1,1,1)) + if args.direction then + light.direction = args.direction + end +end + +--@TODO currently uses global 'objMgr'... +local ent = { + create = function(args) + local args = args or {} + local cls = args.class or "Entity" + local e = objMgr:makeObject(cls) + assert( e ~= nil, "ent.create: failed to create instance of class: "..tostring(cls) ) + return e + end +} +local component = {} +function component.model(args) + local m = yake.Model() + if args and type(args) == "table" then + for _,child in pairs(args) do + if child.__type and (child.__type == "ent.graphical" or child.__type == "ent.physical") then + if child.name then + m:add(child,child.name) + else + m:add(child) + end + end + end + end + + return m +end +function component.graphics(args) + print("component.graphics") + print("","name",args.name or "[]") + local out = yake.Graphical() + out.__type = "ent.graphical" + out.name = args.name or nil + + if args and type(args) == "table" then + for _,child in pairs(args) do + if child and child.__type and child.__type == "graphics.node" then + out:addSceneNode(child) + end + end + end + return out +end +-- convenience wrappers: +component.prefab = {} +-- component.prefab.mesh: Creates a simple model with one 'graphics' component, +-- containing exactly one scene node with one entity (=mesh instance) attached. +-- required arguments: mesh (string) +-- optional arguments: position (Point3) +function component.prefab.mesh(args) + local args = args or {} + assert( args.mesh, "component.builtin.mesh: 'mesh' required") + return component.model{ + component.graphics{ + graphics.node{ + position = args.position or yake.Point3(0,0,0), + graphics.entity{ mesh = args.mesh } + } + } + } +end +-------------------------------------- + + +-------------------------------------- -- demo methods which make creating various objects simpler -------------------------------------- function makeProximityTrigger(radius) - local trigger = objMgr:makeObject("VolumeTrigger") + local radius = radius or 2 + + -- create instance + local trigger = ent.create{class="VolumeTrigger"} assert( trigger ) - trigger.volumes:add( yake.Sphere(radius or 2) ) + + -- add 1 volume + trigger.volumes:add( yake.Sphere(radius) ) - -- create DEBUG geometry - local m = yake.Model() - trigger.model = m - local g = yake.Graphical() - m:add(g) - local sn = gworld:createSceneNode() - local e = gworld:createEntity("sphere_d1.mesh") - e:setMaterial("trigger_off") + -- set DEBUG model (otherwise it's invisible) + local sn = graphics.node{ name="trigger_root", scale = yake.Vector3.UnitScale * radius * 2 } + local e = graphics.entity{ mesh="sphere_d1.mesh", material="trigger_off" } + sn:attach(e) + trigger.model = component.model{ component.graphics{ name="g", sn } } + trigger.sphereEnt = e - sn.scale = yake.Vector3.UnitScale * radius * 2 + --trigger.sphereEnt = trigger.model:getComponentByTag("g") --:getSceneNode("trigger_root") + local g = trigger.model:getComponentByTag("g") - sn:attach(e) - g:addSceneNode(sn) --ent:setPositionSource(sn) + -- return trigger end function createBall() - local ent = objMgr:makeObject("Ball") + local ent = ent.create{class="Ball"} print("BALL at position ",ent.position) --< This actually accesses a static (!) property of a derived (!) class! return ent end - -------------------------------------- -- Configure graphics -------------------------------------- @@ -58,15 +166,20 @@ -- create directional light -local light = gworld:createLight() -- create light +local theScene = { + -- create root node + graphics.node { + name = "root", -local lightnode = gworld:createSceneNode() -- attach light to node -lightnode:attach(light) + -- attach 1 light to root node + graphics.light { + type = yake.graphics.Light.LT_DIRECTIONAL, + diffuse = yake.Color(1,1,1,1), + direction = yake.Vector3(0,-1,1) + } + } +} -light.type = yake.graphics.Light.LT_DIRECTIONAL -- configure light -light:setDiffuseColour(yake.Color(1,1,1,1)) -light.direction = yake.Vector3(0,-1,1) - -- configure active (=default) camera local cam = sim.activeCamera @@ -104,13 +217,6 @@ -- Configure input -------------------------------------- ---class 'DemoApp' ---function DemoApp:__init() --- self.actionMap = app.actionMap ---end ---local app = DemoApp() --- - local activeKeys = {} -- Store the keys that are active in current frame. -- We demonstrate two ways to bind Lua callbacks to a keyboard action. @@ -141,6 +247,21 @@ activeKeys["right"] = true end) +------ Use mouse movement for rotating the camera: +actionMap:reg("rotate_left", input.MouseMoveActionCondition(app.mouse, input.MMA_X, input.MMD_NEGATIVE, true)) +actionMap:reg("rotate_right", input.MouseMoveActionCondition(app.mouse, input.MMA_X, input.MMD_POSITIVE, true)) +actionMap:connectToAction("rotate_left",function() activeKeys["rotate_left"] = true end) +actionMap:connectToAction("rotate_right",function() activeKeys["rotate_right"] = true end) + +-- Let's define two custom action ids for "rotate_up" and "rotate_down". +-- (Yake does not provide these two out-of-the-box.) +input.ACTIONID_ROTATE_UP = input.ActionId(input.ACTIONID_USER.id + 1, "rotate_up") +input.ACTIONID_ROTATE_UP = input.ActionId(input.ACTIONID_USER.id + 2, "rotate_down") +actionMap:reg("rotate_up", input.MouseMoveActionCondition(app.mouse, input.MMA_Y, input.MMD_NEGATIVE, true)) +actionMap:reg("rotate_down", input.MouseMoveActionCondition(app.mouse, input.MMA_Y, input.MMD_POSITIVE, true)) +actionMap:connectToAction("rotate_up",function() activeKeys["rotate_up"] = true end) +actionMap:connectToAction("rotate_down",function() activeKeys["rotate_down"] = true end) + ------- Let's define a few helper functions to make things easier: function createKeyAction(action, key, keymode) @@ -152,15 +273,16 @@ ------- Bind the rest of the keys to actions: +createKeyAction("left", input.KC_A, input.KAM_CONTINUOUS) +createKeyAction("right", input.KC_D, input.KAM_CONTINUOUS) + createKeyAction("forward", input.KC_UP, input.KAM_CONTINUOUS) -bindAction("forward", function() - activeKeys["forward"] = true - end) +createKeyAction("forward", input.KC_W, input.KAM_CONTINUOUS) +bindAction("forward", function() activeKeys["forward"] = true end) createKeyAction("reverse", input.KC_DOWN, input.KAM_CONTINUOUS) -bindAction("reverse", function() - activeKeys["reverse"] = true - end) +createKeyAction("reverse", input.KC_S, input.KAM_CONTINUOUS) +bindAction("reverse", function() activeKeys["reverse"] = true end) ----------------- F r a m e H a n d l e r --------------- ball.currAngle = 0. @@ -181,10 +303,17 @@ cam:translate( -1 * yake.Vector3.UnitZ * distance ) elseif k == "reverse" then cam:translate( 1 * yake.Vector3.UnitZ * distance ) + elseif k == "rotate_left" then + cam:yaw( 200. * timeElapsed ) + elseif k == "rotate_right" then + cam:yaw( -200. * timeElapsed ) + elseif k == "rotate_up" then + cam:pitch( 200. * timeElapsed ) + elseif k == "rotate_down" then + cam:pitch( -200. * timeElapsed ) end end -- prepare for next frame: activeKeys = {} end - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:12:34
|
Revision: 1953 http://yake.svn.sourceforge.net/yake/?rev=1953&view=rev Author: psyclonist Date: 2009-02-17 22:14:37 +0000 (Tue, 17 Feb 2009) Log Message: ----------- reformatting Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/model.lua.cpp Modified: trunk/yake/src/bindings.lua/detail/model.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/model.lua.cpp 2009-02-17 22:14:13 UTC (rev 1952) +++ trunk/yake/src/bindings.lua/detail/model.lua.cpp 2009-02-17 22:14:37 UTC (rev 1953) @@ -110,13 +110,12 @@ .def_readwrite("type", &ModelComponent::Desc::type) .def_readwrite("params", &ModelComponent::Desc::params, return_stl_iterator) , - class_<ModelComponent>( "ModelComponent" ) + + class_<ModelComponent>( "ModelComponent" ) //.def( constructor<>() ) - ]; + , - module( YAKE_MODEL_MODULE ) - [ - class_<Graphical,ModelComponent>( "Graphical" ) + class_<Graphical,ModelComponent>( "Graphical" ) .def( constructor<>() ) //.def( "addSceneNode", &Graphical_addSceneNode, adopt(_2) ) //.def( "addSceneNode", &Graphical_addSceneNodeWithPath, adopt(_2) ) @@ -128,10 +127,8 @@ .def( "getEntity", &Graphical::getEntity ) .def( "getLight", &Graphical::getLight ) .def( "translate", &Graphical::translate ) - ]; + , - module( YAKE_MODEL_MODULE ) - [ class_<Physical,ModelComponent>( "Physical" ) .def( constructor<>() ) .def( "addActor", &Physical::addActor ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-17 23:08:19
|
Revision: 1961 http://yake.svn.sourceforge.net/yake/?rev=1961&view=rev Author: psyclonist Date: 2009-02-17 23:08:16 +0000 (Tue, 17 Feb 2009) Log Message: ----------- * build scripts: made sure that scriptingLua and physicsODE can be disabled. Modified Paths: -------------- trunk/yake/scripts/premake/config.lua trunk/yake/scripts/premake/plugins.lua Modified: trunk/yake/scripts/premake/config.lua =================================================================== --- trunk/yake/scripts/premake/config.lua 2009-02-17 22:45:49 UTC (rev 1960) +++ trunk/yake/scripts/premake/config.lua 2009-02-17 23:08:16 UTC (rev 1961) @@ -29,7 +29,6 @@ -------------------------------------- -- NB only some of these options have effect ---PLUGIN_SCRIPTING_LUA = true PLUGIN_AUDIO_OPENAL = true PLUGIN_AUDIO_FMOD = true @@ -38,8 +37,10 @@ PLUGIN_INPUT_OGRE_OIS = true -- enable for OGRE 1.4+ PLUGIN_INPUT_OGRE = false -- enable for OGRE 1.2 and 1.3 -PLUGIN_PHYSICS_NX = false -PLUGIN_PHYSICS_ODE = true +PLUGIN_SCRIPTING_LUA = true + +PLUGIN_PHYSICS_NX = false -- deprecated +PLUGIN_PHYSICS_ODE = true -- actively maintained PLUGIN_PHYSICS_ODE_REAL = "dDOUBLE" -- dDOUBLE uses 'double', dSINGLE uses 'float' -- IMPORTANT: If modified also update deps.lua to link with the correct library! @@ -99,3 +100,8 @@ SAMPLES_RAF = true --OK SAMPLES_NET = true --OK SAMPLES_TASK = true --OK + +-- Sanity checks +if LUA_BINDINGS then + assert( PLUGIN_SCRIPTING_LUA==true, "If LUA_BINDINGS is activated, then PLUGIN_SCRIPTING_LUA needs to be activated, too!" ) +end Modified: trunk/yake/scripts/premake/plugins.lua =================================================================== --- trunk/yake/scripts/premake/plugins.lua 2009-02-17 22:45:49 UTC (rev 1960) +++ trunk/yake/scripts/premake/plugins.lua 2009-02-17 23:08:16 UTC (rev 1961) @@ -53,26 +53,30 @@ end -------------------------------------- -makeComponentPlugin("scriptingLua","YAKE_SCRIPTINGLUA_EXPORTS") -addDependency("base") -addDependency("res") -addDependency("scripting") +if PLUGIN_SCRIPTING_LUA then + makeComponentPlugin("scriptingLua","YAKE_SCRIPTINGLUA_EXPORTS") + addDependency("base") + addDependency("res") + addDependency("scripting") -if (windows) then - useDep("lua") - useDep("luabind") -else - --addPkgConfigLib(package,"lua5.1.so.0") - table.insert(package.linkoptions,"/usr/lib/liblua5.1.so.0") + if (windows) then + useDep("lua") + useDep("luabind") + else + --addPkgConfigLib(package,"lua5.1.so.0") + table.insert(package.linkoptions,"/usr/lib/liblua5.1.so.0") + end end -------------------------------------- -makeComponentPlugin("physicsODE","YAKEPHYSICSODE_EXPORTS") -addDefine(PLUGIN_PHYSICS_ODE_REAL) -addDependency("base") -addDependency("physics") +if PLUGIN_PHYSICS_ODE then + makeComponentPlugin("physicsODE","YAKEPHYSICSODE_EXPORTS") + addDefine(PLUGIN_PHYSICS_ODE_REAL) + addDependency("base") + addDependency("physics") -useDep("ode") + useDep("ode") +end -------------------------------------- if (PLUGIN_INPUT_OGRE or PLUGIN_INPUT_OGRE_OIS) and PLUGIN_GRAPHICS_OGRE then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 16:24:22
|
Revision: 1950 http://yake.svn.sourceforge.net/yake/?rev=1950&view=rev Author: psyclonist Date: 2009-02-06 16:24:19 +0000 (Fri, 06 Feb 2009) Log Message: ----------- build: set NOMINMAX macro in Windows Modified Paths: -------------- trunk/yake/scripts/premake/tools.lua Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2009-02-06 01:57:47 UTC (rev 1949) +++ trunk/yake/scripts/premake/tools.lua 2009-02-06 16:24:19 UTC (rev 1950) @@ -190,14 +190,15 @@ if (windows) then addDefine("WIN32") addDefine("_WINDOWS") - if (not linux and not cb_gcc) then --MSVC: + addDefine("NOMINMAX") -- avoid min and max macros as they collide with std::min() and std::max() + if not cb_gcc then --MSVC: addDefine("_CRT_SECURE_NO_DEPRECATE") addDefine("_CRT_NOFORCE_MANIFEST") -- No manifests for DLLs. Let the executable decide. end if (cb_gcc) then addDefine("_REENTRANT") end - else + else // Linux: addDefine("_REENTRANT") end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:55:44
|
Revision: 1947 http://yake.svn.sourceforge.net/yake/?rev=1947&view=rev Author: psyclonist Date: 2009-02-06 01:40:58 +0000 (Fri, 06 Feb 2009) Log Message: ----------- bindings.lua: registered any converted for 'real' Modified Paths: -------------- trunk/yake/src/bindings.lua/bindings.lua.cpp Modified: trunk/yake/src/bindings.lua/bindings.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/bindings.lua.cpp 2009-02-06 01:40:14 UTC (rev 1946) +++ trunk/yake/src/bindings.lua/bindings.lua.cpp 2009-02-06 01:40:58 UTC (rev 1947) @@ -52,6 +52,7 @@ { register_any_converter<int>(); register_any_converter<float>(); + register_any_converter<real>(); register_any_converter<double>(); register_any_converter<bool>(); register_any_converter<String>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:55:35
|
Revision: 1945 http://yake.svn.sourceforge.net/yake/?rev=1945&view=rev Author: psyclonist Date: 2009-02-06 01:39:52 +0000 (Fri, 06 Feb 2009) Log Message: ----------- graphics: ISubmeshAccess::lockPositions() now uses Point3 instead of Vector3, for consistency. Modified Paths: -------------- trunk/yake/src/plugins/graphicsOgre/graphicsOgreGeometryAccess.cpp trunk/yake/yake/graphics/yakeGeometryAccess.h trunk/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h Modified: trunk/yake/src/plugins/graphicsOgre/graphicsOgreGeometryAccess.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/graphicsOgreGeometryAccess.cpp 2009-02-06 01:38:31 UTC (rev 1944) +++ trunk/yake/src/plugins/graphicsOgre/graphicsOgreGeometryAccess.cpp 2009-02-06 01:39:52 UTC (rev 1945) @@ -257,6 +257,7 @@ unlockTexCoords( i ); unlockColours(); + mSubmesh->parent->_setBoundingSphereRadius( mBox.getSize().length() * 1.5 ); mSubmesh->parent->_setBounds( mBox ); return true; @@ -314,7 +315,7 @@ } //----------------------------------------------------- - bool OgreSubmeshAccess::setPosition( uint32 index, const math::Vector3 & position ) + bool OgreSubmeshAccess::setPosition( uint32 index, const math::Point3 & position ) { YAKE_ASSERT( mpLockedPositions != 0 ).warning("should be locked!"); YAKE_ASSERT( mhwvbPositions.isNull() == false ).warning("need a hwvb!"); Modified: trunk/yake/yake/graphics/yakeGeometryAccess.h =================================================================== --- trunk/yake/yake/graphics/yakeGeometryAccess.h 2009-02-06 01:38:31 UTC (rev 1944) +++ trunk/yake/yake/graphics/yakeGeometryAccess.h 2009-02-06 01:39:52 UTC (rev 1945) @@ -94,7 +94,7 @@ virtual bool lockPositions( uint32 start, uint32 count, bool bRead = false ) = 0; virtual bool unlockPositions() = 0; - virtual bool setPosition( uint32 index, const math::Vector3 & position ) = 0; + virtual bool setPosition( uint32 index, const math::Point3 & position ) = 0; virtual bool lockNormals( uint32 start, uint32 count, bool bRead = false ) = 0; virtual bool unlockNormals() = 0; Modified: trunk/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h =================================================================== --- trunk/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h 2009-02-06 01:38:31 UTC (rev 1944) +++ trunk/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h 2009-02-06 01:39:52 UTC (rev 1945) @@ -85,7 +85,7 @@ virtual bool lockPositions( uint32 start, uint32 count, bool bRead = false ); virtual bool unlockPositions(); - virtual bool setPosition( uint32 index, const math::Vector3 & position ); + virtual bool setPosition( uint32 index, const math::Point3 & position ); virtual bool lockNormals( uint32 start, uint32 count, bool bRead = false ); virtual bool unlockNormals(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:55:26
|
Revision: 1944 http://yake.svn.sourceforge.net/yake/?rev=1944&view=rev Author: psyclonist Date: 2009-02-06 01:38:31 +0000 (Fri, 06 Feb 2009) Log Message: ----------- entity scripts: refactored condition Modified Paths: -------------- trunk/yake/common/media/scripts/o_trigger2.lua Modified: trunk/yake/common/media/scripts/o_trigger2.lua =================================================================== --- trunk/yake/common/media/scripts/o_trigger2.lua 2009-02-06 00:29:13 UTC (rev 1943) +++ trunk/yake/common/media/scripts/o_trigger2.lua 2009-02-06 01:38:31 UTC (rev 1944) @@ -18,7 +18,8 @@ for id,ent in pairs(objs) do --TODO: if .. and ent.isA()->isKindOf("Entity") local pos = ent.position -- pos will be 'nil' if property 'position' does not exist. - if ent and id ~= this.id and pos ~= nil then -- ignore self, and non-positioned objects + --print("testing",this.id,"against",id) + if ent and pos and id ~= this.id then -- ignore self, and non-positioned objects local intersects = this.volumes:intersectsWith( pos ) if intersects then numIntersects = numIntersects + 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:55:20
|
Revision: 1946 http://yake.svn.sourceforge.net/yake/?rev=1946&view=rev Author: psyclonist Date: 2009-02-06 01:40:14 +0000 (Fri, 06 Feb 2009) Log Message: ----------- graphicsOgre: removed Ogre 1.1.x "Dagon" compatibility code Modified Paths: -------------- trunk/yake/src/plugins/graphicsOgre/graphicsOgreParticleSystem.cpp Modified: trunk/yake/src/plugins/graphicsOgre/graphicsOgreParticleSystem.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/graphicsOgreParticleSystem.cpp 2009-02-06 01:39:52 UTC (rev 1945) +++ trunk/yake/src/plugins/graphicsOgre/graphicsOgreParticleSystem.cpp 2009-02-06 01:40:14 UTC (rev 1946) @@ -32,34 +32,17 @@ namespace graphics { //------------------------------------------------------ -// for Ogre 1.1.0 "Dagon" compatibility -#if OGRE_VERSION_MINOR >= 1 OgreParticleSystem::OgreParticleSystem( Ogre::SceneManager& rSMgr, const String& rPSTempl ) : mSceneMgr( rSMgr ), mParticleSys( NULL ) { mParticleSys = mSceneMgr.createParticleSystem( uniqueName::create( "ps_" ), rPSTempl ); - YAKE_ASSERT( mParticleSys ).debug( "Failed to create particle system!" ); } -#else - OgreParticleSystem::OgreParticleSystem( Ogre::ParticleSystemManager& rPSMgr, const String& rPSTempl ) : - mParticleSysMgr( rPSMgr ), mParticleSys( NULL ) - { - mParticleSys = mParticleSysMgr.createSystem( uniqueName::create( "ps_" ), rPSTempl ); - - YAKE_ASSERT( mParticleSys ).debug( "Failed to create particle system!" ); - } -#endif //------------------------------------------------------ OgreParticleSystem::~OgreParticleSystem() { YAKE_ASSERT( mParticleSys ); -// for Ogre 1.1.0 "Dagon" compatibility -#if OGRE_VERSION_MINOR >= 1 mSceneMgr.destroyParticleSystem( mParticleSys ); -#else - mParticleSysMgr.destroySystem( mParticleSys->getName() ); -#endif } //------------------------------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:03:07
|
Revision: 1948 http://yake.svn.sourceforge.net/yake/?rev=1948&view=rev Author: psyclonist Date: 2009-02-06 01:42:17 +0000 (Fri, 06 Feb 2009) Log Message: ----------- audio/demo1: now uses audioFMOD by default Modified Paths: -------------- trunk/yake/samples/audio/demo1/demo.cpp Modified: trunk/yake/samples/audio/demo1/demo.cpp =================================================================== --- trunk/yake/samples/audio/demo1/demo.cpp 2009-02-06 01:40:58 UTC (rev 1947) +++ trunk/yake/samples/audio/demo1/demo.cpp 2009-02-06 01:42:17 UTC (rev 1948) @@ -1,5 +1,8 @@ #include <yake/audio/yakeAudio.h> #include <yake/base/yakeLibrary.h> +#include <yake/base/yakeLog.h> +#include <yake/base/yakeStderrLog.h> +#include <yake/base/yakeFileLog.h> #if YAKE_PLATFORM == PLATFORM_WIN32 #define WIN32_LEAN_AND_MEAN @@ -8,11 +11,22 @@ int main(int argc,char* argv[]) { try { + // configure logging (console, log file, etc) + using namespace yake; + typedef SharedPtr<logging::log_listener> log_listener_ptr; + + log_listener_ptr toStdErr( new logging::stderr_listener() ); + logging::addListener( toStdErr.get() ); + + log_listener_ptr toFile( new logging::file_listener("sampleAudio1.log") ); + logging::addListener( toFile.get() ); + + // std::cout << "starting...\n"; // loading & starting plugin using namespace yake; - SharedPtr<base::Library> pLib( new base::Library( YAKE_LIB("audioOpenAL") ) ); + SharedPtr<base::Library> pLib( new base::Library( YAKE_LIB("audioFMOD") ) ); SharedPtr<audio::IAudioSystem> pAudio = templates::create_default<audio::IAudioSystem>(); // create world @@ -31,7 +45,7 @@ //sound1->setLoopMode( audio::ISoundData::SLM_LOOP_OFF ); //std::cin.get(); //audio::SoundDataPtr song = world->createSoundDataFromFile("../../../common/media/audio/stop.ogg",true); - audio::SoundDataPtr song = world->createSoundDataFromFile("../../../common/media/audio/test1.ogg",true); + audio::SoundDataPtr song = world->createSoundDataFromFile("../../../common/media/audio/test1.mp3",true); //std::cin.get(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 02:03:04
|
Revision: 1949 http://yake.svn.sourceforge.net/yake/?rev=1949&view=rev Author: psyclonist Date: 2009-02-06 01:57:47 +0000 (Fri, 06 Feb 2009) Log Message: ----------- media/scripts: added .sia mesh importer (for native Silo 2 text file format) Added Paths: ----------- trunk/yake/common/media/scripts/sia_importer.lua Added: trunk/yake/common/media/scripts/sia_importer.lua =================================================================== --- trunk/yake/common/media/scripts/sia_importer.lua (rev 0) +++ trunk/yake/common/media/scripts/sia_importer.lua 2009-02-06 01:57:47 UTC (rev 1949) @@ -0,0 +1,90 @@ +--[[ + sia_importer implements a parser for the native Silo 2 .sia file format. + Silo 2's native file formats are .sib (binary format) and .sia (text format). + + When using the importer in combination with sia_finishShapeAsGraphicsMesh() + then the imported shapes will be available as graphics meshes, e.g. in Ogre 3D. + (The meshes will be available under the original Silo 2 mesh names (-snam)). + + USAGE + sia_reader = dofile("sia_importer.lua") + sia_reader.import(filename, sia_finishShapeAsGraphicsMesh) + + TODO + * Make this a regular Lua module + * Complete -Shape import + * -axis 0 0.5 0 1 0 0 0 1 0 0 0 1 + (translation x (0), y (0.5) and z (0), direction x (1,0,0), y (0,1,0) and z (0,0,1) + * -mirp 0 0 0 1 0 0 + ? (position (x,y,z) and normal (nx,ny,nz) for plane definition ?) + * -setmat 0 + * -shad 0 + * -shadw 1 + * Import materials + * Import UVs + +--]] + +local sia_reader = { + current = nil, + data = {} +} +function sia_reader:file(line) + if line == "-Shape" then + self.current = self.shape + end +end +function sia_reader:finishShape(finalizer) + assert( self.data.name, "shape: no name set - cannot finish") + print("SIA - finalizing shape '"..tostring(self.data.name).."'") + + assert( finalizer and type(finalizer) == "function" ) + finalizer(self.data) + + -- prepare for next shape: + --self.current = nil + self.current = self.file + self.data = { name = nil, vertices = {}, indices = {}, numVerts = 0, numIndices = 0 } +end +function sia_reader:shape(line,finalizer) + if line:find("-endShape") == 1 then + self:finishShape(finalizer) + return + end + if not self.data.name then + self.data.name = line:match("-snam%s+%\"(.-)%\"") + if self.data.name then + print("found",self.data.name) + end + elseif line:find("-vert") == 1 then + local x,y,z = line:match("%-vert%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)") + assert( x and y and z ) + table.insert(self.data.vertices,yake.Point3(tonumber(x),tonumber(y),tonumber(z))) + self.data.numVerts = self.data.numVerts + 1 + elseif line:find("-face") == 1 then + local num,a,_,_,_,b,_,_,_,c = line:match("%-face%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+([^%s]+)") + assert( tonumber(num) == 3, "face: only tris are supported") + assert( a and b and c, "face: not all ordinates available") + assert( tonumber(a) < #self.data.vertices, a ) + assert( tonumber(b) < #self.data.vertices, b ) + assert( tonumber(c) < #self.data.vertices, c ) + --print(num,a,b,c) + table.insert(self.data.indices,tonumber(a)) + table.insert(self.data.indices,tonumber(b)) + table.insert(self.data.indices,tonumber(c)) + self.data.numIndices = self.data.numIndices + 3 + end +end +sia_reader.current = sia_reader.file +sia_reader.data = { name = nil, vertices = {}, indices = {}, numVerts = 0, numIndices = 0 } +-- official "api": +function sia_reader.import(filename,finalizer) + for line in io.lines(filename) do + sia_reader:current(line,finalizer) + if not sia_reader.current then + break + end + end +end + +return sia_reader This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-02-06 00:29:18
|
Revision: 1943 http://yake.svn.sourceforge.net/yake/?rev=1943&view=rev Author: psyclonist Date: 2009-02-06 00:29:13 +0000 (Fri, 06 Feb 2009) Log Message: ----------- * scriptingLua: chunk names can now be set for script objects. file names are used when possible. * scriptingLua: fixed executing loaded chunks. It could result in truncated chunks to be executed. * res: data streams can now return an optional id (for example, filename). * res: fixed serious issue in FileDataStream which could result in truncated data during read operations. Modified Paths: -------------- trunk/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp trunk/yake/src/res/datastream.cpp trunk/yake/yake/plugins/scriptingLua/ScriptingSystemLua.h trunk/yake/yake/res/datastream.h Modified: trunk/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp =================================================================== --- trunk/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp 2008-12-03 19:28:27 UTC (rev 1942) +++ trunk/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp 2009-02-06 00:29:13 UTC (rev 1943) @@ -142,7 +142,7 @@ lua_pushcclosure(mLuaState, &pcall_handler, 0); - if (luaL_loadbuffer(mLuaState,str_code,std::strlen(str_code),"chunk_name")) + if (luaL_loadbuffer(mLuaState,str_code,code.size(),pLuaScript->getChunkName().c_str())) //if (luaL_loadbuffer(mLuaState,(const char*)&code[0],code.size(),"buffer")) //if (luaL_loadstring(mLuaState,(const char*)&code[0])) //if (luaL_loadfile(mLuaState, rFileName.c_str())) @@ -227,11 +227,22 @@ } //------------------------------------------------------ + LuaScript::LuaScript(const String& chunkName) : mChunkName(chunkName) + { + } + + //------------------------------------------------------ LuaScript::~LuaScript() { } //------------------------------------------------------ + const String& LuaScript::getChunkName() const + { + return mChunkName; + } + + //------------------------------------------------------ bool LuaScript::isLoaded() { return !mCode.empty(); @@ -280,7 +291,7 @@ } res::ResourcePtr LuaScriptManager::createAndInitResource(res::DataStreamBase& data) { - boost::shared_ptr<LuaScript> script( new LuaScript() ); + boost::shared_ptr<LuaScript> script( new LuaScript(data.getStreamId()) ); uint8* code = script->resizeData( data.size() ); YAKE_ASSERT( code != 0 ).debug("stream empty? no data to fill the code buffer with."); if (!code) Modified: trunk/yake/src/res/datastream.cpp =================================================================== --- trunk/yake/src/res/datastream.cpp 2008-12-03 19:28:27 UTC (rev 1942) +++ trunk/yake/src/res/datastream.cpp 2009-02-06 00:29:13 UTC (rev 1943) @@ -36,13 +36,13 @@ DataStreamBase::~DataStreamBase() {} - FileDataStream::FileDataStream(const std::string & fn) : in_(0), size_(0) + FileDataStream::FileDataStream(const std::string & fn) : in_(0), size_(0), id_(fn) { //std::ifstream test(fn.c_str()); //YAKE_ASSERT( test.is_open() ); //test.close(); - in_ = fopen(fn.c_str(),"r"); + in_ = fopen(fn.c_str(),"rb"); YAKE_ASSERT( in_ ); int succ = fseek(in_, 0, SEEK_END); @@ -51,8 +51,9 @@ size_ = ftell(in_); std::cout << "file '" << fn << "' has length " << size_ << " byte(s) (ftell)\n"; - succ = fseek(in_, 0, SEEK_SET); - YAKE_ASSERT( succ == 0 ).debug("failed to seek to begin"); + //succ = fseek(in_, 0, SEEK_SET); + ::rewind(in_); + //YAKE_ASSERT( succ == 0 ).debug("failed to seek to begin"); } FileDataStream::~FileDataStream() { @@ -64,11 +65,14 @@ YAKE_ASSERT( !feof(in_) ); if (feof(in_)) return 0; + YAKE_ASSERT( size > 0 )(size); - size_t succ = fread(out,size,1,in_); - if ((succ != 1) && !feof(in_)) + size_t succ = fread(out,1,size,in_); + if (succ != size) { - YAKE_ASSERT( succ == 1 )(succ)(size).debug("read not successful"); + const int err = ferror(in_); + const int is_eof = feof(in_); + YAKE_ASSERT( succ == size )(succ)(size)(err)(is_eof).debug("read not successful"); return 0; } @@ -88,6 +92,10 @@ fclose(in_); in_ = 0; } + std::string FileDataStream::getStreamId() const + { + return id_; + } } // namespace res } // namespace yake Modified: trunk/yake/yake/plugins/scriptingLua/ScriptingSystemLua.h =================================================================== --- trunk/yake/yake/plugins/scriptingLua/ScriptingSystemLua.h 2008-12-03 19:28:27 UTC (rev 1942) +++ trunk/yake/yake/plugins/scriptingLua/ScriptingSystemLua.h 2009-02-06 00:29:13 UTC (rev 1943) @@ -156,6 +156,7 @@ { public: LuaScript(); + LuaScript(const String& chunkName); virtual ~LuaScript(); typedef std::vector<uint8> CodeBuffer; @@ -166,8 +167,10 @@ const CodeBuffer& getData() const; uint8* resizeData(const size_t length); + const String& getChunkName() const; private: CodeBuffer mCode; + String mChunkName; }; //---------------------------------------------------- Modified: trunk/yake/yake/res/datastream.h =================================================================== --- trunk/yake/yake/res/datastream.h 2008-12-03 19:28:27 UTC (rev 1942) +++ trunk/yake/yake/res/datastream.h 2009-02-06 00:29:13 UTC (rev 1943) @@ -46,6 +46,8 @@ //virtual void skip(const size_t) = 0; virtual size_t size() const = 0; virtual void close() = 0; + + virtual std::string getStreamId() const = 0; }; typedef boost::shared_ptr<DataStreamBase> DataStreamPtr; @@ -60,9 +62,13 @@ virtual bool eof() const; virtual size_t size() const; virtual void close(); + + virtual std::string getStreamId() const; private: FILE* in_; size_t size_; //@todo fails if file is modified during read! + + std::string id_; }; } // namespace res This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-12-03 19:28:31
|
Revision: 1942 http://yake.svn.sourceforge.net/yake/?rev=1942&view=rev Author: psyclonist Date: 2008-12-03 19:28:27 +0000 (Wed, 03 Dec 2008) Log Message: ----------- build: introduced PLUGIN_PHYSICS_ODE_REAL to control whether dSINGLE or dDOUBLE is defined for ODE. physicsODE: updated code to work with ODE 0.10.1 (initialization) vehicle: worked around an include problem Modified Paths: -------------- trunk/yake/scripts/premake/config.lua trunk/yake/scripts/premake/plugins.lua trunk/yake/scripts/premake/samples.lua trunk/yake/scripts/premake/yake.lua trunk/yake/src/plugins/physicsODE/OdeBody.cpp trunk/yake/src/plugins/physicsODE/PhysicsSystemODE.cpp trunk/yake/src/vehicle/yakeNativeOde.cpp trunk/yake/yake/vehicle/yakePCH.h Modified: trunk/yake/scripts/premake/config.lua =================================================================== --- trunk/yake/scripts/premake/config.lua 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/scripts/premake/config.lua 2008-12-03 19:28:27 UTC (rev 1942) @@ -38,8 +38,10 @@ PLUGIN_INPUT_OGRE_OIS = true -- enable for OGRE 1.4+ PLUGIN_INPUT_OGRE = false -- enable for OGRE 1.2 and 1.3 +PLUGIN_PHYSICS_NX = false PLUGIN_PHYSICS_ODE = true -PLUGIN_PHYSICS_NX = false +PLUGIN_PHYSICS_ODE_REAL = "dDOUBLE" -- dDOUBLE uses 'double', dSINGLE uses 'float' + -- IMPORTANT: If modified also update deps.lua to link with the correct library! -- Controls whether yake.raf is compiled with built-in support for CEGUI. -- Dependency: "cegui" Modified: trunk/yake/scripts/premake/plugins.lua =================================================================== --- trunk/yake/scripts/premake/plugins.lua 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/scripts/premake/plugins.lua 2008-12-03 19:28:27 UTC (rev 1942) @@ -68,6 +68,7 @@ -------------------------------------- makeComponentPlugin("physicsODE","YAKEPHYSICSODE_EXPORTS") +addDefine(PLUGIN_PHYSICS_ODE_REAL) addDependency("base") addDependency("physics") Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/scripts/premake/samples.lua 2008-12-03 19:28:27 UTC (rev 1942) @@ -243,7 +243,7 @@ useComponent("net") useComponent("netsvc") addIncludePath("dependencies/boost") -addMatching("samples/net/roclient/roclient*") + addMatching("samples/net/roclient/roclient*") end -------------------------------------- Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/scripts/premake/yake.lua 2008-12-03 19:28:27 UTC (rev 1942) @@ -241,6 +241,7 @@ -------------------------------------- makeComponent("vehicle","YAKE_VEHICLE_EXPORTS") package.guid = "6A263623-F10C-4ad7-9397-119EDC53A79B" +addDefine(PLUGIN_PHYSICS_ODE_REAL) addDependency("base") addDependency("data") addDependency("model") Modified: trunk/yake/src/plugins/physicsODE/OdeBody.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/OdeBody.cpp 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/src/plugins/physicsODE/OdeBody.cpp 2008-12-03 19:28:27 UTC (rev 1942) @@ -43,6 +43,22 @@ mOdeBody = new dBody( mOdeWorld->_getOdeID() ); YAKE_ASSERT( mOdeBody ).error( "Failed to create ODE body!" ); + // xform + setPosition( Point3::kZero ); + setOrientation( Quaternion::kIdentity ); + + // mass + dMassSetZero( &mMass ); + const real DENSITY = 5.0; + dMassSetSphere( &mMass, DENSITY, 1 ); +#ifdef YAKE_DEBUG + const int massOK = dMassCheck(&mMass); + YAKE_ASSERT( massOK == 1 )(massOK); +#endif + //BOOST_STATIC_ASSERT(sizeof(dReal) == sizeof(real)); + mOdeBody->setMass( mMass ); + + // mOdeBody->setAutoDisableFlag( 1 ); mOdeBody->enable(); mOdeBody->setTorque( 0, 0, 0 ); @@ -50,13 +66,7 @@ mOdeBody->setLinearVel( 0, 0, 0 ); mOdeBody->setAngularVel( 0, 0, 0 ); - dMassSetSphere( &mMass, 1, 1 ); - dMassAdjust( &mMass, dReal(0.0001) ); - mOdeBody->setMass( &mMass ); - - setPosition( Point3::kZero ); - setOrientation( Quaternion::kIdentity ); - + // register mOdeWorld->_addBody( this ); } Modified: trunk/yake/src/plugins/physicsODE/PhysicsSystemODE.cpp =================================================================== --- trunk/yake/src/plugins/physicsODE/PhysicsSystemODE.cpp 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/src/plugins/physicsODE/PhysicsSystemODE.cpp 2008-12-03 19:28:27 UTC (rev 1942) @@ -36,6 +36,8 @@ //------------------------------------------------------ PhysicsSystemODE::PhysicsSystemODE() { + if (dInitODE2(0) == 0) + YAKE_EXCEPT("could not initialize ODE (dInitODE2())"); } //------------------------------------------------------ Modified: trunk/yake/src/vehicle/yakeNativeOde.cpp =================================================================== --- trunk/yake/src/vehicle/yakeNativeOde.cpp 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/src/vehicle/yakeNativeOde.cpp 2008-12-03 19:28:27 UTC (rev 1942) @@ -24,25 +24,24 @@ source code distribution. ------------------------------------------------------------------------------------ */ -#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) +//#if defined(YAKE_VEHICLE_USE_ODE) # include <ode/ode.h> # include <ode/odecpp.h> # include <ode/objects.h> +//# pragma comment(lib, "physicsODE.lib") +//#endif // #if defined(YAKE_VEHICLE_USE_ODE) + +#include <yake/vehicle/yakePCH.h> + +#include <yake/physics/yakePhysics.h> +//#if defined(YAKE_VEHICLE_USE_ODE) # include <yake/plugins/physicsODE/OdeJoint.h> # include <yake/plugins/physicsODE/OdeBody.h> # include <yake/plugins/physicsODE/OdeWorld.h> -//# pragma comment(lib, "physicsODE.lib") -# ifdef YAKE_DEBUG -//# pragma comment(lib, "ode.lib") -# else -//# pragma comment(lib, "ode.lib") -# endif -#endif // #if defined(YAKE_VEHICLE_USE_ODE) +//#endif +#include <yake/vehicle/yakeVehicle.h> +#include <yake/vehicle/yakeNativeOde.h> +#include <yake/vehicle/yakeDotVehicle.h> namespace yake { namespace vehicle { Modified: trunk/yake/yake/vehicle/yakePCH.h =================================================================== --- trunk/yake/yake/vehicle/yakePCH.h 2008-12-03 17:47:37 UTC (rev 1941) +++ trunk/yake/yake/vehicle/yakePCH.h 2008-12-03 19:28:27 UTC (rev 1942) @@ -28,8 +28,6 @@ #define YAKE_VEHICLE_PCH_H #include <yake/base/yake.h> -#include <yake/yappbase/yapp.h> -#include <yake/yappmsg/yakeMsg.h> #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-12-03 17:47:41
|
Revision: 1941 http://yake.svn.sourceforge.net/yake/?rev=1941&view=rev Author: psyclonist Date: 2008-12-03 17:47:37 +0000 (Wed, 03 Dec 2008) Log Message: ----------- * updated deps.lua for "ODE 0.10.1" Modified Paths: -------------- trunk/yake/scripts/premake/deps.lua Modified: trunk/yake/scripts/premake/deps.lua =================================================================== --- trunk/yake/scripts/premake/deps.lua 2008-12-03 17:47:05 UTC (rev 1940) +++ trunk/yake/scripts/premake/deps.lua 2008-12-03 17:47:37 UTC (rev 1941) @@ -64,19 +64,19 @@ -------------------------------------- defDep("ode") defDepIncludePath("ode", "dependencies/ode/include") -defDepLibraryPath("ode","dependencies/ode/lib/debugdll","Debug") -defDepLibraryPath("ode","dependencies/ode/lib/debugdll","DebugLib") -defDepLibraryPath("ode","dependencies/ode/lib/releasedll","Release") -defDepLibraryPath("ode","dependencies/ode/lib/releasedll","ReleaseLib") -defDepLibraryPath("ode","dependencies/ode/lib/releasedll","ReleaseWithSymbols") -defDepLibrary("ode","ode") +defDepLibraryPath("ode", "dependencies/ode/lib") +defDepLibrary("ode","ode_double","Release") +defDepLibrary("ode","ode_double","ReleaseLib") +defDepLibrary("ode","ode_double","ReleaseWithSymbols") +defDepLibrary("ode","ode_doubled","Debug") +defDepLibrary("ode","ode_doubled","DebugLib") -------------------------------------- -- Dependency package CEGUI -------------------------------------- defDep("cegui") defDepIncludePath("cegui", "dependencies/ogrenew/include/CEGUI") -defDepLibraryPath("cegui","dependencies/ogrenew/lib") +defDepLibraryPath("cegui", "dependencies/ogrenew/lib") defDepLibrary("cegui","CEGUIBase","Release") defDepLibrary("cegui","CEGUIBase","ReleaseLib") defDepLibrary("cegui","CEGUIBase","ReleaseWithSymbols") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-12-03 17:47:09
|
Revision: 1940 http://yake.svn.sourceforge.net/yake/?rev=1940&view=rev Author: psyclonist Date: 2008-12-03 17:47:05 +0000 (Wed, 03 Dec 2008) Log Message: ----------- * updated build instructions * updated LICENSE and README Modified Paths: -------------- trunk/yake/BUILD trunk/yake/LICENSE trunk/yake/README Modified: trunk/yake/BUILD =================================================================== --- trunk/yake/BUILD 2008-12-01 22:38:16 UTC (rev 1939) +++ trunk/yake/BUILD 2008-12-03 17:47:05 UTC (rev 1940) @@ -9,7 +9,7 @@ 0. Prologue 1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS 1.1 Configuration -1.2 Building with Microsoft Visual C++ 2003/2005 (7.1/8.0) +1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0) 1.3 Building with Code::Blocks 1.4 Building with GCC 2 BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX @@ -38,12 +38,9 @@ 1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS -------------------------------------------- -Last modified: 08/12/2006 by Stephan Kaiser (psy) +Last modified: 12 Dec 2008 by Stephan Kaiser (psy) -* Install premake and put the premake.exe into /yake/scripts/premake. -* Change to /yake/scripts/premake - -1.1.0 Installation +1.1.0 Sources ---------------------------------------------------------- Download a source package or checkout the sources from the repository. @@ -70,15 +67,21 @@ yake/scripts/linux - build script generation for Linux platforms yake/scripts/msvc71 - build script generation for Windows/MSVC7.1 platform yake/scripts/msvc80 - build script generation for Windows/MSVC8.0 platform + yake/scripts/msvc90 - build script generation for Windows/MSVC9.0 platform + yake/scripts/cb_gnu_win - build script generation for Windows/CodeBlocks platform yake/common/media - common media as used by the demo applications + yake/dependencies - directory containing 3rd party libraries (ogre, ode, ...) 1.1.3 Requirements ---------------------------------------------------------- - * a recent C++ compiler (MSVC7.1/8.0+ or GCC 3.3/3.4/4.x+) + * a recent C++ compiler (MSVC7.1/8.0/9.0+ or GCC 3.3/3.4/4.x+) * a good standard template library (STL) - * boost 1.33.x or above (not all libraries are needed) + * boost 1.36.x or above (not all libraries are needed) +1.1.4 Dependencies +---------------------------------------------------------- + For specific components additional dependencies are required. These include: * ODE 0.6/0.7 for physicsODE @@ -91,24 +94,42 @@ * TinyXML * ... -1.1.4 Configuration +We provide PREBUILT DEPENDENCIES packages for certain platform/compiler +combinations. + +If there is a dependencies package for your platform/compiler then +simply extract the archive over the root source directory of Yake. + +Otherwise you will have to manually install premake, the generator +for Visual C++ projects (.vcproj/.sln), and build the dependencies +yourself. + +Installation of premake: +* Obtain premake from http://premake.sourceforge.net +* Install premake and put the premake.exe into /yake/scripts/premake. +* Change to /yake/scripts/premake +* Configure config.lua etc. to meet your requirements + +1.1.5 Configuration ---------------------------------------------------------- If you need to configure the build process you find the available options in /yake/scripts/premake/config.lua. -1.2 Building with Microsoft Visual C++ 2003/2005 (7.1/8.0) +1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0) ---------------------------------------------------------- To build the libraries: * Run build.cmd in /yake/scripts/msvc71/ or /yake/scripts/msvc80/ - in order to build solutions for MSVC 2003 or MSVC 2005. -* Solution and project files can be found in the same directory. + or /yake/scripts/msvc90/ in order to build solutions for MSVC 2003 + or MSVC 2005 or MSVC 2008. +* Solution and project files can then be found in the same directory. * Open yake.sln in MSVC and start 'Build All' * Find the libs in /yake/common/lib and the DLLs in /yake/common/bin To build the samples: * Run build_samples.cmd in /yake/scripts/msvc71/ or /yake/scripts/msvc80/ + or /yake/scripts/msvc90/. * Open yake_samples.sln and start 'Build All' * Find the executables in /yake/samples/bin @@ -159,9 +180,10 @@ * Build Yake demos: - - We suppose your in the directory: yake/scripts/linux - + + * Open a console and move to the Yake root directory + + # cd scripts/linux # ./build_samples.sh # make @@ -170,44 +192,15 @@ 2.2 Building Yake with SCons ------------------------------------------ +Last modified: 12/3/2008 by Stephan Kaiser (psy) Last modified: 30/9/2005 by Stephan Kaiser (psy) Last modified: 22/9/2004 by Nikita Buida (mj) -This instruction applies to SVN (Subversion) version of Yake. +Support for SCons build system has been DEPRECATED. -If you encounter problems and need the very latest instructions, please -visit www.yake.org and search the forums and the wiki. You will most likely -find the solution there. +If you still want to use it, please visit www.yake.org and search the forums +and the wiki. You may find the solution there. -Assuming that you are in yake root directory. - -#. Copy all files except SVN related ones to yake root dir from ./scripts/linux. -#. Set up ./dependencies dir. -Its structure should look like this: -/dependencies - | - | - /luabind - | - /OGRE - | - /tinyxml - | - /ttl - -All that dirs are in Yake dependencies package. -Note: you DON'T really need that ./dependencies dir in Linux. With latest fixes you can just -install all that libraries on your Linux system as usual. You should edit OgreString.h in -dependencies dir as it is described in Yake forums to avoid string redefinition ( -just comment out Ogre's definitions of additional operators ). - -Open a console and navigate to Yake's root directory. - - # cd scripts/linux - # ./build.sh - # make - - 3 BUILD INSTRUCTIONS FOR CUSTOM PROJECTS ---------------------------------------- @@ -216,7 +209,7 @@ Add /yake/yake to the include paths. Add /yake/common/lib to the library search paths. -If the auto-link feature is not available add the propery linker +If the auto-link feature is not available (notably, GCC) add the proper linker dependencies for each library/component you use (e.g. yake_ent_d.lib for the yake_ent_d.dll on Windows). Modified: trunk/yake/LICENSE =================================================================== --- trunk/yake/LICENSE 2008-12-01 22:38:16 UTC (rev 1939) +++ trunk/yake/LICENSE 2008-12-03 17:47:05 UTC (rev 1940) @@ -25,3 +25,13 @@ 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. + + ------------------------------------------------------------------------------------ + Dependencies: + ------------------------------------------------------------------------------------ + + Dependencies come with their own licenses. + The license texts are included in the dependency packages provided by the YAKE Team. + + The YAKE plugin "audioFMOD" uses: + FMOD Sound System, copyright \xA9 Firelight Technologies Pty, Ltd., 1994-2007. Modified: trunk/yake/README =================================================================== --- trunk/yake/README 2008-12-01 22:38:16 UTC (rev 1939) +++ trunk/yake/README 2008-12-03 17:47:05 UTC (rev 1940) @@ -1,7 +1,7 @@ YAKE - Yake is at least partly still BETA code. + Yake is at least partially BETA code. Use it in your applications AT YOUR OWN RISK. We are NOT LIABLE IN ANY WAY for ANY DAMAGES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-12-01 22:38:21
|
Revision: 1939 http://yake.svn.sourceforge.net/yake/?rev=1939&view=rev Author: psyclonist Date: 2008-12-01 22:38:16 +0000 (Mon, 01 Dec 2008) Log Message: ----------- * audio: added plugin "audioFMOD" which uses the FMOD audio API Modified Paths: -------------- trunk/yake/scripts/premake/config.lua trunk/yake/scripts/premake/deps.lua trunk/yake/scripts/premake/plugins.lua Added Paths: ----------- trunk/yake/src/plugins/audioFMOD/ trunk/yake/src/plugins/audioFMOD/audioFMOD.cpp trunk/yake/yake/plugins/audioFMOD/ trunk/yake/yake/plugins/audioFMOD/audioFMOD.h Modified: trunk/yake/scripts/premake/config.lua =================================================================== --- trunk/yake/scripts/premake/config.lua 2008-11-13 18:54:14 UTC (rev 1938) +++ trunk/yake/scripts/premake/config.lua 2008-12-01 22:38:16 UTC (rev 1939) @@ -31,6 +31,8 @@ -- NB only some of these options have effect --PLUGIN_SCRIPTING_LUA = true PLUGIN_AUDIO_OPENAL = true +PLUGIN_AUDIO_FMOD = true + PLUGIN_GRAPHICS_OGRE = true PLUGIN_INPUT_OGRE_OIS = true -- enable for OGRE 1.4+ Modified: trunk/yake/scripts/premake/deps.lua =================================================================== --- trunk/yake/scripts/premake/deps.lua 2008-11-13 18:54:14 UTC (rev 1938) +++ trunk/yake/scripts/premake/deps.lua 2008-12-01 22:38:16 UTC (rev 1939) @@ -154,3 +154,19 @@ elseif (linux) then defDepLibrary("oalpp","libopenalpp") end + +-------------------------------------- +-- Dependency package FMOD +-------------------------------------- +defDep("fmod") +defDepIncludePath("fmod", "dependencies/fmod/api/inc") +defDepLibraryPath("fmod","dependencies/fmod/api/lib") +if (windows) then + defDepLibrary("fmod","fmodex_vc","Release") + defDepLibrary("fmod","fmodex_vc","ReleaseLib") + defDepLibrary("fmod","fmodex_vc","ReleaseWithSymbols") + defDepLibrary("fmod","fmodex_vc","Debug") -- OR: fmodexL_vc to get debug logging. + defDepLibrary("fmod","fmodex_vc","DebugLib") -- OR: fmodexL_vc to get debug logging. +elseif (linux) then + defDepLibrary("fmod","libfmodex") +end Modified: trunk/yake/scripts/premake/plugins.lua =================================================================== --- trunk/yake/scripts/premake/plugins.lua 2008-11-13 18:54:14 UTC (rev 1938) +++ trunk/yake/scripts/premake/plugins.lua 2008-12-01 22:38:16 UTC (rev 1939) @@ -40,6 +40,19 @@ end -------------------------------------- +if PLUGIN_AUDIO_FMOD then + makeComponentPlugin("audioFMOD","YAKE_AUDIO_FMOD_EXPORTS") + addDependency("base") + addDependency("audio") + + if (windows) then + useDep("fmod") + else + addPkgConfigLib(package,"fmod.so") + end +end + +-------------------------------------- makeComponentPlugin("scriptingLua","YAKE_SCRIPTINGLUA_EXPORTS") addDependency("base") addDependency("res") Added: trunk/yake/src/plugins/audioFMOD/audioFMOD.cpp =================================================================== --- trunk/yake/src/plugins/audioFMOD/audioFMOD.cpp (rev 0) +++ trunk/yake/src/plugins/audioFMOD/audioFMOD.cpp 2008-12-01 22:38:16 UTC (rev 1939) @@ -0,0 +1,462 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright (c) 2004 - 2008 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/plugins/audioFMOD/audioFMOD.h" +#include "yake/base/yakeLog.h" +#include "dependencies/fmod/api/inc/fmod.hpp" +#include "dependencies/fmod/api/inc/fmod_errors.h" + +namespace yake { +namespace audio { + void ERRCHECK(FMOD_RESULT result) + { + if (result != FMOD_OK) + { + std::stringstream msg; + msg << "FMOD error: (" << result << ") %s" << FMOD_ErrorString(result); + YAKE_EXCEPT(msg.str()); + } + } + //----------------------------------------------------- + // Helpers for conversion from/to Yake/FMOD + //----------------------------------------------------- + FMOD_VECTOR toFMOD(const Vector3& v) + { + FMOD_VECTOR out; + out.x = v.x; + out.y = v.y; + out.z = v.z; + return out; + } + FMOD_VECTOR toFMOD(const Point3& v) + { + FMOD_VECTOR out; + out.x = v.x; + out.y = v.y; + out.z = v.z; + return out; + } + //----------------------------------------------------- + struct WorldFMOD : public IWorld + { + WorldFMOD(); + virtual ~WorldFMOD(); + + virtual SoundDataPtr createSoundDataFromFile( const String & filename, const bool streaming = false ); + virtual ListenerPtr createListener(); + virtual SourcePtr createSource(); + virtual void setActiveListener( ListenerPtr pListener ); + + virtual void setDopplerFactor( real factor ); + virtual void setSoundVelocity( real velocity ); + + /** Call this every 50ms or so. */ + void update() + { + system_->update(); + } + private: + FMOD::System* system_; //@todo move to AudioSystemFMOD to enable multiple words!? + ListenerPtr activeListener_; + }; + //----------------------------------------------------- + class SoundDataImpl : public ISoundData + { + public: + typedef boost::shared_ptr<SoundDataImpl> pointer; + SoundDataImpl(FMOD::Sound* sound); + virtual ~SoundDataImpl(); + + virtual void setLoopMode( const LoopMode loopMode ); + virtual LoopMode getLoopMode() const; + + FMOD::Sound* sound() + { return sound_; } + private: + FMOD::Sound* sound_; + LoopMode loopMode_; + }; + SoundDataImpl::SoundDataImpl(FMOD::Sound* sound) : sound_(sound) + { + YAKE_ASSERT(sound_); + this->setLoopMode(SLM_LOOP_OFF); + } + SoundDataImpl::~SoundDataImpl() + { + FMOD_RESULT result = sound_->release(); + ERRCHECK(result); + sound_ = 0; + } + SoundDataImpl::LoopMode SoundDataImpl::getLoopMode() const + { + return loopMode_; + } + void SoundDataImpl::setLoopMode(const LoopMode loopMode) + { + loopMode_ = loopMode; + FMOD_RESULT result; + switch (loopMode_) + { + case SLM_LOOP_BIDI: + result = sound_->setMode(FMOD_LOOP_BIDI); + break; + case SLM_LOOP_ON: + result = sound_->setMode(FMOD_LOOP_NORMAL); + break; + case SLM_LOOP_OFF: + default: + result = sound_->setMode(FMOD_LOOP_OFF); + break; + } + ERRCHECK(result); + } + //----------------------------------------------------- + class SourceImpl : public ISource + { + public: + SourceImpl(FMOD::System* system); + virtual ~SourceImpl(); + + virtual void setVelocity( const Vector3 & velocity ); + virtual Vector3 getVelocity() const; + + virtual void setSoundData( SoundDataPtr pSoundData ); + //virtual void setSoundData( const String & resourceName ); + virtual void play(); + virtual void stop(); + virtual void pause(); + + virtual State getState() const; + + virtual void setOrientation( const Quaternion & orientation ); + virtual Quaternion getOrientation() const; + virtual void setPosition( const Point3 & position ); + virtual Point3 getPosition() const; + protected: + FMOD::System* system_; + SoundDataImpl::pointer data_; + State state_; + FMOD::Channel* channel_; + + Point3 pos_; + Vector3 vel_; + Quaternion rot_; + }; + SourceImpl::SourceImpl(FMOD::System* system) : state_(Stopped), channel_(0), system_(system) + { + } + SourceImpl::~SourceImpl() + { + stop(); + } + SourceImpl::State SourceImpl::getState() const + { + return state_; + } + void SourceImpl::play() + { + YAKE_ASSERT( system_ ); + YAKE_ASSERT( data_ ); + YAKE_ASSERT( data_->sound() ); + if (state_ == Stopped) + { + //YAKE_ASSERT( !channel_ ); + FMOD_RESULT result = system_->playSound(FMOD_CHANNEL_FREE, data_->sound(), true/*paused*/, &channel_); + ERRCHECK(result); + + const FMOD_VECTOR pos = toFMOD(pos_); + const FMOD_VECTOR vel = toFMOD(vel_); + result = channel_->set3DAttributes(&pos, &vel); + ERRCHECK(result); + + result = channel_->setPaused(false); + ERRCHECK(result); + + state_ = Playing; + } + else if (state_ == Paused) + { + YAKE_ASSERT( channel_ ); + FMOD_RESULT result = channel_->setPaused(false); + ERRCHECK(result); + + state_ = Playing; + } + } + void SourceImpl::stop() + { + if (state_ == Playing) + { + YAKE_ASSERT( channel_ ); + FMOD_RESULT result = channel_->setPaused(true); + ERRCHECK(result); + } + } + void SourceImpl::pause() + { + if (state_ == Playing) + { + YAKE_ASSERT( channel_ ); + FMOD_RESULT result = channel_->setPaused(true); + ERRCHECK(result); + + state_ = Paused; + } + } + void SourceImpl::setSoundData(SoundDataPtr pSoundData ) + { + YAKE_ASSERT( dynamic_pointer_cast<SoundDataImpl>(pSoundData) ); + data_ = dynamic_pointer_cast<SoundDataImpl>(pSoundData); + YAKE_ASSERT( data_ ); + YAKE_ASSERT( data_->sound() ); + } + void SourceImpl::setVelocity( const Vector3 & velocity ) + { + vel_ = velocity; + } + Vector3 SourceImpl::getVelocity() const + { + return vel_; + } + void SourceImpl::setOrientation( const Quaternion & orientation ) + { + rot_ = orientation; + } + Quaternion SourceImpl::getOrientation() const + { + return rot_; + } + void SourceImpl::setPosition( const Point3 & position ) + { + pos_ = position; + } + Point3 SourceImpl::getPosition() const + { + return pos_; + } + //----------------------------------------------------- + class ListenerImpl : public IListener + { + public: + ListenerImpl(FMOD::System*); + virtual ~ListenerImpl(); + virtual void setVelocity( const Vector3 & velocity ); + virtual Vector3 getVelocity() const; + + virtual void setOrientation( const Quaternion & orientation ); + virtual Quaternion getOrientation() const; + virtual void setPosition( const Point3 & position ); + virtual Point3 getPosition() const; + + void setActive(const bool yes) + { + active_ = yes; + applyIfActive(); + } + private: + void applyIfActive(); + protected: + FMOD::System* system_; + bool active_; + + Point3 pos_; + Vector3 vel_; + Quaternion rot_; + }; + ListenerImpl::ListenerImpl(FMOD::System* system) : system_(system), active_(false) + { + YAKE_ASSERT( system_ ); + } + ListenerImpl::~ListenerImpl() + { + system_ = 0; + } + void ListenerImpl::setVelocity(const Vector3 & velocity ) + { + vel_ = velocity; + applyIfActive(); + } + Vector3 ListenerImpl::getVelocity() const + { + return vel_; + } + void ListenerImpl::setPosition(const Point3 & position ) + { + pos_ = position; + applyIfActive(); + } + Point3 ListenerImpl::getPosition() const + { + return pos_; + } + void ListenerImpl::setOrientation(const Quaternion & orientation ) + { + rot_ = orientation; + applyIfActive(); + } + Quaternion ListenerImpl::getOrientation() const + { + return rot_; + } + void ListenerImpl::applyIfActive() + { + const FMOD_VECTOR forward = toFMOD(rot_ * Vector3::kUnitZ); + const FMOD_VECTOR up = toFMOD(rot_ * Vector3::kUnitY); + const FMOD_VECTOR pos = toFMOD(pos_); + const FMOD_VECTOR vel = toFMOD(vel_); + FMOD_RESULT result = system_->set3DListenerAttributes(0, &pos, &vel, &forward, &up); + ERRCHECK(result); + } + //----------------------------------------------------- + YAKE_REGISTER_CONCRETE( AudioSystemFMOD ) + //----------------------------------------------------- + AudioSystemFMOD::AudioSystemFMOD() + { + } + AudioSystemFMOD::~AudioSystemFMOD() + { + } + WorldPtr AudioSystemFMOD::createWorld() + { + return WorldPtr( new WorldFMOD() ); + } + //----------------------------------------------------- + WorldFMOD::WorldFMOD() : system_(0) + { + FMOD_RESULT result = FMOD::System_Create(&system_); + ERRCHECK(result); + + // + FMOD_CAPS caps; + FMOD_SPEAKERMODE speakerMode; + result = system_->getDriverCaps(0, &caps, 0, 0, &speakerMode); + ERRCHECK(result); + + result = system_->setSpeakerMode(speakerMode); //Set the user selected speaker mode. + ERRCHECK(result); + + // 'Acceleration' slider is set to 'off'. + // Inform the user. + if (caps & FMOD_CAPS_HARDWARE_EMULATED) + { + logging::log(logging::S_WARNING,"audioFMOD","Hardware acceleration is not enabled/available! This may have a negative impact on performance/latency."); + + result = system_->setDSPBufferSize(1024, 10); + ERRCHECK(result); + } + + // + char name[256]; + result = system_->getDriverInfo(0, name, 256, 0); + ERRCHECK(result); + + // Workaruond for SigmaTel: + if (strstr(name, "SigmaTel")) /* Sigmatel sound devices crackle for some reason if the format is PCM 16bit. PCM floating point output seems to solve it. */ + { + result = system_->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0,0, FMOD_DSP_RESAMPLER_LINEAR); + ERRCHECK(result); + } + + // Init FMOD system + result = system_->init(100, FMOD_INIT_NORMAL, 0); + if (result == FMOD_ERR_OUTPUT_CREATEBUFFER) /* Ok, the speaker mode selected isn't supported by this soundcard. Switch it back to stereo... */ + { + logging::log(logging::S_WARNING,"audioFMOD","Speaker mode not supported - switching back to stereo."); + + result = system_->setSpeakerMode(FMOD_SPEAKERMODE_STEREO); + ERRCHECK(result); + + result = system_->init(100, FMOD_INIT_NORMAL, 0);/* ... and re-init. */ + ERRCHECK(result); + } + + // Set distance units etc. + const float DISTANCEFACTOR = 1.0f; // units per meter, e.g. 100 for centimeters. + result = system_->set3DSettings(1.0, DISTANCEFACTOR, 1.0f); + ERRCHECK(result); + } + + WorldFMOD::~WorldFMOD() + { + FMOD_RESULT result = system_->close(); + ERRCHECK(result); + result = system_->release(); + ERRCHECK(result); + system_ = 0; + } + + SoundDataPtr WorldFMOD::createSoundDataFromFile( const String & filename, const bool streaming /*= false*/ ) + { + FMOD::Sound* sound = 0; + FMOD_RESULT result = system_->createSound(filename.c_str(), FMOD_3D, 0, &sound); + ERRCHECK(result); + + //result = sound2->set3DMinMaxDistance(0.5f * DISTANCEFACTOR, 5000.0f * DISTANCEFACTOR); + //ERRCHECK(result); + + return SoundDataPtr(new SoundDataImpl( sound )); + } + + /* + ISoundData* WorldFMOD::createSoundData( bool b3D, + ISoundData::LoopMode loopMode, + ISoundData::ChannelMode channelMode, + ISoundData::DataMode dataMode) + { + YAKE_ASSERT( 1==0 ).error("Disabled! SoundData is not yet completely implemented! Use Source to play files!"); + //return new SoundDataOpenAL(); + return 0; + }*/ + + ListenerPtr WorldFMOD::createListener() + { + ListenerPtr listener( new ListenerImpl(system_) ); + if (!activeListener_) + this->setActiveListener(listener); + return listener; + } + + SourcePtr WorldFMOD::createSource() + { + return SourcePtr( new SourceImpl(system_) ); + } + + void WorldFMOD::setActiveListener( ListenerPtr pListener ) + { + activeListener_ = pListener; + static_cast<ListenerImpl*>(activeListener_.get())->setActive(true); + } + + void WorldFMOD::setDopplerFactor( real factor ) + { + } + + void WorldFMOD::setSoundVelocity( real velocity ) + { + } + +} +} Added: trunk/yake/yake/plugins/audioFMOD/audioFMOD.h =================================================================== --- trunk/yake/yake/plugins/audioFMOD/audioFMOD.h (rev 0) +++ trunk/yake/yake/plugins/audioFMOD/audioFMOD.h 2008-12-01 22:38:16 UTC (rev 1939) @@ -0,0 +1,51 @@ +/* +------------------------------------------------------------------------------------ +This file is part of YAKE +Copyright (c) 2004 - 2008 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/yakePrerequisites.h> +#include "yake/audio/yakeAudio.h" + +#ifdef YAKE_AUDIO_FMOD_EXPORTS +# pragma message("Exporting yake::audio::fmod") +# define YAKE_AUDIO_FMOD_API YAKE_EXPORT_API +#else +# pragma message("Importing yake::audio::fmod") +# define YAKE_AUDIO_FMOD_API YAKE_IMPORT_API +#endif + +namespace yake { +namespace audio { + class YAKE_AUDIO_FMOD_API AudioSystemFMOD : public IAudioSystem + { + public: + AudioSystemFMOD(); + virtual ~AudioSystemFMOD(); + virtual WorldPtr createWorld(); + + YAKE_DECLARE_CONCRETE( AudioSystemFMOD, "fmod" ) + }; +} // namespace audio +} // namespace yake + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-11-13 18:54:24
|
Revision: 1938 http://yake.svn.sourceforge.net/yake/?rev=1938&view=rev Author: psyclonist Date: 2008-11-13 18:54:14 +0000 (Thu, 13 Nov 2008) Log Message: ----------- * build: added project GUIDs * build: added options ENABLE_RAF_CEGUI and ENABLE_GRAPHICSOGRE_OSM_SUPPORT * build: premake 3.7 compatibility fixes * build: updated dependencies folder layout for 0.8 release * graphicsOgre|gui2: compatibility with Ogre 1.6.0 * base: compatibility with boost 1.37.0 * bindings.lua: compatibility with Luabind 0.7.1 Modified Paths: -------------- trunk/yake/samples/gui/ui1/demo.cpp trunk/yake/scripts/premake/config.lua trunk/yake/scripts/premake/deps.lua trunk/yake/scripts/premake/tools.lua trunk/yake/scripts/premake/yake.lua trunk/yake/src/base/yakeConfigFile.cpp trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp trunk/yake/src/raf/yakeApplication.cpp trunk/yake/src/res/source_manager.cpp trunk/yake/yake/base/yakeConfigFile.h trunk/yake/yake/bindings.lua/common/yake.lua.shared_ptr.h trunk/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h trunk/yake/yake/plugins/graphicsOgre/yakePCH.h trunk/yake/yake/raf/yakePrerequisites.h Added Paths: ----------- trunk/yake/common/media/gui2/styles/lua1/tools.lua Added: trunk/yake/common/media/gui2/styles/lua1/tools.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/tools.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/tools.lua 2008-11-13 18:54:14 UTC (rev 1938) @@ -0,0 +1,75 @@ + +function tbl_2_pos(p) + --assert( type(p) == "table", "wrong input type" ) + --assert( type(p[1]) == "table", "wrong input type" ) + --assert( type(p[2]) == "table", "wrong input type" ) + return pos(dim(p[1][1],p[1][2]), dim(p[2][1],p[2][2])) +end +function tbl_2_dim(d) + --assert( type(d) == "table", "wrong input type" ) + return dim(d[1],d[2]) +end + +render.rectangle = function(self,p,w,h) + -- convert parameters from tables to pos() or dim() + if type(p) == "table" then p = tbl_2_pos(p) end + if type(w) == "table" then w = tbl_2_dim(w) end + if type(h) == "table" then h = tbl_2_dim(h) end + -- + render:quad( + p, + pos(p.x+w, p.y ), + pos(p.x+w, p.y+h), + pos(p.x , p.y+h) + ) +end + +--@todo Use this: +render.define_matrix = function(self,mtx) + local out = mtx + render:finishMatrix(out) + return out +end + +render.finishMatrix = function(self,mtx) + print("finishM",mtx) + for row,h in pairs(mtx.widths) do + if type(h) == "table" then + mtx.widths[row] = tbl_2_dim(h) + print("C row",row) + end + end + for col,w in pairs(mtx.heights) do + if type(w) == "table" then + mtx.heights[col] = tbl_2_dim(w) + print("C col",col) + end + end +end + +render.matrix = function(self,m) + local currPos = pos(dim(0,0),dim(0,0)) + local currIdx = 1 -- for colour lookup + for row,h in pairs(m.widths) do + for col,w in pairs(m.heights) do + if m.colours and m.colours[currIdx] then + render:colour(m.colours[currIdx]) + end + -- + render:rectangle(currPos,w,h) + -- + currPos.x = currPos.x + w + currIdx = currIdx + 1 + end + currPos.x = dim(0,0) + currPos.y = currPos.y + h + end +end + +-- @todo +function text2dim(text) + -- "2px" -> absolute + -- "1" -> relative + -- "1,2" -> 1 rel, 2 px + -- "1.2" -> 1.2 rel +end \ No newline at end of file Modified: trunk/yake/samples/gui/ui1/demo.cpp =================================================================== --- trunk/yake/samples/gui/ui1/demo.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/samples/gui/ui1/demo.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -330,7 +330,8 @@ public: TheApp() { - getConfiguration().get().load("sampleUI1.cfg"); + if (!getConfiguration().get().load("sampleUI1.cfg")) + throw yake::Exception("Could not find configuration file: sampleUI1.cfg"); } private: virtual yake::raf::MainState* createMainState() @@ -362,11 +363,13 @@ catch ( std::exception& e ) { std::cerr << "EXCEPTION: " << e.what() << "\n"; + std::cout << "Waiting for key press...\n"; std::cin.get(); } catch ( ... ) { std::cerr << "Caught unhandled exception.\n"; + std::cout << "Waiting for key press...\n"; std::cin.get(); } Modified: trunk/yake/scripts/premake/config.lua =================================================================== --- trunk/yake/scripts/premake/config.lua 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/scripts/premake/config.lua 2008-11-13 18:54:14 UTC (rev 1938) @@ -39,8 +39,18 @@ PLUGIN_PHYSICS_ODE = true PLUGIN_PHYSICS_NX = false ---GRAPHICSOGRE_USES_OSM = true +-- Controls whether yake.raf is compiled with built-in support for CEGUI. +-- Dependency: "cegui" +ENABLE_RAF_CEGUI = false +-- Controls whether yake.graphicsOgre is compiled with built-in support for the OSM scene loader. +-- Dependency: "osm" +ENABLE_GRAPHICSOGRE_OSM_SUPPORT = false + +-------------------------------------- +-- Lua Bindings +-------------------------------------- + -- If set to true then the ENABLE_LUA_* settings are used. -- If set to false then the ENABLE_LUA_* settings are ignored. LUA_BINDINGS = true Modified: trunk/yake/scripts/premake/deps.lua =================================================================== --- trunk/yake/scripts/premake/deps.lua 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/scripts/premake/deps.lua 2008-11-13 18:54:14 UTC (rev 1938) @@ -18,15 +18,15 @@ -- Dependency package OGRE -------------------------------------- defDep("ogre") -defDepIncludePath("ogre", "dependencies/ogrenew/include") -defDepIncludePath("ogre", "dependencies/ogrenew/samples/include") -defDepLibraryPath("ogre", "dependencies/ogrenew/lib") +defDepIncludePath("ogre", "dependencies/ogre/include") +defDepIncludePath("ogre", "dependencies/ogre/samples/include") +defDepLibraryPath("ogre", "dependencies/ogre/lib") do local ext = "" local pre = "" if cb_gcc then ext = "."..DLL_EXTENSION - pre = rootdir .. "dependencies/ogrenew/lib/" --TODO < why is the lib path above not enough for C:B/MinGW? + pre = rootdir .. "dependencies/ogre/lib/" --TODO < why is the lib path above not enough for C:B/MinGW? end defDepLibrary("ogre",pre.."OgreMain"..ext,"Release") defDepLibrary("ogre",pre.."OgreMain"..ext,"ReleaseLib") @@ -44,8 +44,8 @@ -- Dependency package OIS -------------------------------------- defDep("ois") -defDepIncludePath("ois", "dependencies/ogrenew/include/OIS") -defDepLibraryPath("ois","dependencies/ogrenew/lib") +defDepIncludePath("ois", "dependencies/ogre/include/OIS") +defDepLibraryPath("ois","dependencies/ogre/lib") defDepLibrary("ois","OIS","Release") defDepLibrary("ois","OIS","ReleaseLib") defDepLibrary("ois","OIS","ReleaseWithSymbols") @@ -102,13 +102,13 @@ defDepIncludePath("lua", "dependencies/lua/src") defDepLibraryPath("lua","dependencies/lua/lib") if windows and not cb_gcc then - defDepLibrary("lua","lua","Release") - defDepLibrary("lua","lua","ReleaseWithSymbols") - defDepLibrary("lua","lua","ReleaseLib") - defDepLibrary("lua","luad","Debug") - defDepLibrary("lua","luad","DebugLib") + defDepLibrary("lua","lua5.1","Release") + defDepLibrary("lua","lua5.1","ReleaseWithSymbols") + defDepLibrary("lua","lua5.1","ReleaseLib") + defDepLibrary("lua","lua5.1d","Debug") + defDepLibrary("lua","lua5.1d","DebugLib") elseif windows and cb_gcc then - defDepLibrary("lua",rootdir.."dependencies/lua/lib/lua51.dll") + defDepLibrary("lua",rootdir.."dependencies/lua/lib/lua5.1.dll") else defDepLibrary("lua","lua") end Modified: trunk/yake/scripts/premake/tools.lua =================================================================== --- trunk/yake/scripts/premake/tools.lua 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/scripts/premake/tools.lua 2008-11-13 18:54:14 UTC (rev 1938) @@ -16,7 +16,7 @@ g_libs[package.name].links = {} g_libs[package.name].config = {} - for k,lib in package.links do + for k,lib in pairs(package.links) do table.insert( g_libs[package.name].links, lib ) end @@ -278,7 +278,7 @@ deps[name].libdir = {} deps[name].libs = {} deps[name].configs = {} - for k,v in project.configs do + for k,v in pairs(project.configs) do deps[name].configs[v] = {} deps[name].configs[v].incdir = {} deps[name].configs[v].libdir = {} @@ -322,25 +322,25 @@ end function useDep(name) -- paths/libs for all targets - for tmp,path in deps[name].incdir do + for tmp,path in pairs(deps[name].incdir) do addIncludePath(path) end - for tmp,path in deps[name].libdir do + for tmp,path in pairs(deps[name].libdir) do addLibraryPath(path) end - for tmp,lib in deps[name].libs do + for tmp,lib in pairs(deps[name].libs) do addDependency(lib) end -- paths/libs for specific targets - for k,cfg in project.configs do - for tmp,path in deps[name].configs[cfg].incdir do + for k,cfg in pairs(project.configs) do + for tmp,path in pairs(deps[name].configs[cfg].incdir) do addIncludePath(path,cfg) end - for tmp,path in deps[name].configs[cfg].libdir do + for tmp,path in pairs(deps[name].configs[cfg].libdir) do addLibraryPath(path,cfg) end - for tmp,lib in deps[name].configs[cfg].libs do + for tmp,lib in pairs(deps[name].configs[cfg].libs) do addDependency(lib,cfg) end end @@ -400,7 +400,7 @@ print(indent .. "lib="..lib .. " (level " .. tostring(level) .. ")") if g_libs[lib] then -- it's a Yake library if g_libs[lib].config[target] and g_libs[lib].config[target].links then - for a,b in g_libs[lib].config[target].links do + for a,b in pairs(g_libs[lib].config[target].links) do if not g_libs[b] and not linksdone[b] and not package.config[target].links[b] then -- only non-Yake libraries as Yake libraries are already bound. print(indent .. " dep " .. b) --addDependency(b,target) @@ -408,7 +408,7 @@ end end end - for a,b in g_libs[lib].links do + for a,b in pairs(g_libs[lib].links) do local shouldLink = not package.links[b] and not linksdone[b] --if windows then -- only non-Yake libraries as Yake libraries are already bound. Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/scripts/premake/yake.lua 2008-11-13 18:54:14 UTC (rev 1938) @@ -81,6 +81,9 @@ f:write("#define YAKE_ENABLE_LUA_RES " .. bool_to_int(ENABLE_LUA_RES) .. "\n") f:write("#define YAKE_ENABLE_LUA_UI " .. bool_to_int(ENABLE_LUA_UI) .. "\n") f:write("\n") + f:write("#define YAKE_RAF_USES_CEGUI " .. bool_to_int(ENABLE_RAF_CEGUI) .. "\n") + f:write("#define YAKE_GRAPHICSOGRE_USES_OSM " .. bool_to_int(ENABLE_GRAPHICSOGRE_OSM_SUPPORT) .. "\n") + f:write("\n") f:write("#endif\n") io.close(f) return true @@ -95,6 +98,7 @@ -------------------------------------- makePackage("base") -- we cannot use makeDLLComponent() because of native .cpp + package.guid = "84C4540D-29E6-4a82-83D4-9A6D5FA29AEA" addDefine("YAKE_BASE_EXPORTS") --package.pchheader = "yake/base/yakePCH.h" --package.pchsource = rootdir.."src/base/yakePCH.cpp" @@ -126,26 +130,32 @@ -------------------------------------- makeComponent("graphics","YAKE_GRAPHICSINTERFACE_EXPORTS") +package.guid = "2D6225E8-2B35-4b61-9259-6641A2A23D1D" addDependency("base") -------------------------------------- makeComponent("audio","YAKE_AUDIO_EXPORTS") +package.guid = "0C385E67-85C2-49ff-A2B0-0C4F817C9BEA" addDependency("base") -------------------------------------- makeComponent("input","YAKE_INPUT_EXPORTS") +package.guid = "00AAC1AE-935B-459f-8278-DAFA37597A14" addDependency("base") -------------------------------------- makeComponent("physics","YAKE_PHYSICS_EXPORTS") +package.guid = "C7B1016B-95C9-4089-A0E7-F57AEDA49938" addDependency("base") -------------------------------------- makeComponent("scripting","YAKE_SCRIPTING_EXPORTS") +package.guid = "EDD43870-469C-4eb7-BD67-D08346DBE960" addDependency("base") -------------------------------------- makeComponent("data","YAKE_DATA_EXPORTS") +package.guid = "DCF71344-0B5C-4e94-9CEA-431BD53F07D6" -- Compile TinyXML into yake::data: addMatching("dependencies/tinyxml/*.h") @@ -155,6 +165,7 @@ -------------------------------------- makeComponent("model","YAKE_MODEL_EXPORTS") +package.guid = "14D0133E-FC8D-41a2-9B03-56DD812C0738" addDependency("base") addDependency("data") addDependency("loader") @@ -163,16 +174,19 @@ -------------------------------------- makeComponent("loader","YAKE_LOADER_EXPORTS") +package.guid = "FB8ED003-E23E-42a2-A91F-FCDD8B895E27" addDependency("base") addDependency("data") -------------------------------------- makeComponent("ent","YAKE_ENT_EXPORTS") +package.guid = "4922CEAA-98D6-47d1-AD03-A13C43229F99" addDependency("base") addDependency("model") -------------------------------------- makeComponent("res","YAKE_RES_EXPORTS") +package.guid = "DC084FFA-86EE-4b1a-99AE-70E1C5BE31D7" addDependency("base") -------------------------------------- @@ -181,11 +195,13 @@ -- For Linux/GCC: Do not create project. if windows then makeComponent("net2","YAKE_NET_EXPORTS") + package.guid = "15A6BBC2-9018-454a-BF31-ECEED3A63CAE" --addDependency("base") -- for logging end -------------------------------------- makeComponent("net","YAKE_NET_EXPORTS") +package.guid = "ED6E596B-FCE3-4482-8D72-E11C5C72D28A" addDependency("base") -- Yes, we compile ENet into yake::net therefore include the sources: @@ -196,11 +212,13 @@ -------------------------------------- makeComponent("netsvc","YAKE_NETSVC_EXPORTS") +package.guid = "82303998-76E3-4d45-A477-B43DA4621E36" addDependency("base") addDependency("net") -------------------------------------- makeComponent("netrepsvc","YAKE_NETREPSVC_EXPORTS") +package.guid = "0E1F72FD-B2E2-4506-A9BC-275A7106F2F3" addDependency("base") addDependency("ent") addDependency("net") @@ -208,6 +226,7 @@ -------------------------------------- makeComponent("gui2","YAKE_GUI_EXPORTS") +package.guid = "BE7B5C3C-4D88-4b2a-9BE0-975920DF10F0" addDependency("base") addDependency("res") addDependency("scripting") @@ -221,6 +240,7 @@ -------------------------------------- makeComponent("vehicle","YAKE_VEHICLE_EXPORTS") +package.guid = "6A263623-F10C-4ad7-9397-119EDC53A79B" addDependency("base") addDependency("data") addDependency("model") @@ -232,6 +252,7 @@ -------------------------------------- makeComponent("raf","YAKE_RAF_EXPORTS") +package.guid = "B1B4C43B-1728-4f8d-962A-46B35C860DB6" addDependency("base") addDependency("res") addDependency("audio") @@ -243,7 +264,7 @@ addDependency("scripting") -- @todo FIXME should work on linux and with mingw etc, too... -if not linux and not cb_gcc then +if ENABLE_RAF_CEGUI and not linux and not cb_gcc then useDep("cegui") end @@ -253,15 +274,18 @@ -------------------------------------- makeComponent("property","YAKE_PROPERTY_EXPORTS") +package.guid = "726EAB13-8544-44b1-8713-B3EA600FE776" addDependency("base") -------------------------------------- makeComponent("task","YAKE_TASK_EXPORTS") +package.guid = "9D0F5EF6-579A-48de-8C18-5608CF35824C" addDependency("base") -------------------------------------- if LUA_BINDINGS then makeComponent("bindings.lua","YAKE_BINDINGS_LUA_EXPORTS") + package.guid = "6FF27D76-E3C9-48fd-A855-BEF5CBED5C68" addDependency("base") addDependency("scripting") addDependency("scriptingLua") Modified: trunk/yake/src/base/yakeConfigFile.cpp =================================================================== --- trunk/yake/src/base/yakeConfigFile.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/base/yakeConfigFile.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -115,6 +115,7 @@ return; //@todo boost::property_tree::read_info(in,*tree_); } +#if 0 void Configuration::readFromXML(const String& fn, const String& insertAt) { YAKE_ASSERT( insertAt.empty() ).debug("not yet supported" ); @@ -123,6 +124,7 @@ return; //@todo boost::property_tree::read_xml(in,*tree_); } +#endif void Configuration::writeToFile(const String& fn, const String& startAt) { YAKE_ASSERT( startAt.empty() ).debug("not yet supported" ); @@ -133,6 +135,7 @@ return; //@todo boost::property_tree::write_info(out,*tree_); } +#if 0 void Configuration::writeToXML(const String& fn, const String& startAt) { YAKE_ASSERT( startAt.empty() && "not yet supported" ); @@ -143,6 +146,7 @@ return; //@todo boost::property_tree::write_xml(out,*tree_); } +#endif //----------------------------------------------------- Modified: trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp =================================================================== --- trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -865,7 +865,7 @@ oSystem_->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT); oSystem_->_setTextureAddressingMode(0, uvwAddressingMode_); oSystem_->_setTextureMatrix(0, Ogre::Matrix4::IDENTITY); - oSystem_->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0); + oSystem_->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0, false); oSystem_->_setTextureBlendMode(0, colourBlend_); oSystem_->_setTextureBlendMode(0, alphaBlend_); oSystem_->_disableTextureUnitsFrom(1); Modified: trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -40,7 +40,6 @@ #pragma message("disabling OGRE's memory macros") # include <OgreNoMemoryMacros.h> #endif -#include <OgreMemoryMacros.h> #include <yake/plugins/graphicsOgre/graphicsOgreCore.h> Modified: trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp =================================================================== --- trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/plugins/graphicsOgre/yakeGraphicsWorld.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -30,7 +30,6 @@ #include <yake/plugins/graphicsOgre/yakePCH.h> #include <yake/graphics/yakeGeometryAccess.h> #include <OgreMeshManager.h> -#include <OgreNoMemoryMacros.h> #include <yake/plugins/graphicsOgre/yakeGraphicsSystem.h> #include <yake/plugins/graphicsOgre/yakeGraphicsWorld.h> #include <yake/plugins/graphicsOgre/graphicsOgreNode.h> @@ -42,8 +41,8 @@ #include <yake/plugins/graphicsOgre/graphicsOgreParticleSystem.h> #include <yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h> -#ifdef YAKE_USE_OSM -#include "OgreOSMScene.h" +#if YAKE_GRAPHICSOGRE_USES_OSM == 1 +# include "OgreOSMScene.h" #endif //============================================================================ @@ -399,7 +398,7 @@ return 0; } //----------------------------------------------------- -#ifdef YAKE_USE_OSM +#if YAKE_GRAPHICSOGRE_USES_OSM == 1 // Callback handler to post-process created objects loaded by the OSM loader. // We create our graphicsOGRE wrapper objects here. class oSceneCallback : public OSMSceneCallbacks { @@ -481,7 +480,7 @@ return false; if (file.empty()) return false; -#ifdef YAKE_USE_OSM +#if YAKE_GRAPHICSOGRE_USES_OSM == 1 if (type == "osm") { YAKE_ASSERT( msCore ); Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/raf/yakeApplication.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -576,18 +576,22 @@ } input::KeyboardDevice* Application::getKeyboard() { + YAKE_ASSERT(mKeyboard).debug("no input system available or initialized"); return mKeyboard; } input::KeyboardEventGenerator* Application::getKeyboardEventGenerator() { + YAKE_ASSERT(mKeyboardEventGenerator).debug("no input system available or initialized"); return mKeyboardEventGenerator; } input::MouseDevice* Application::getMouse() { + YAKE_ASSERT(mMouse).debug("no input system available or initialized"); return mMouse; } input::MouseEventGenerator* Application::getMouseEventGenerator() { + YAKE_ASSERT(mMouseEventGenerator).debug("no input system available or initialized"); return mMouseEventGenerator; } Modified: trunk/yake/src/res/source_manager.cpp =================================================================== --- trunk/yake/src/res/source_manager.cpp 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/src/res/source_manager.cpp 2008-11-13 18:54:14 UTC (rev 1938) @@ -76,7 +76,7 @@ return stream; } DataStreamPtr SourceManager::open(const Location& loc) - { + { YAKE_ASSERT( !sources_.empty() )(loc).debug("no sources to search in"); for (SourceMap::const_iterator it = sources_.begin(); it != sources_.end(); ++it) { Modified: trunk/yake/yake/base/yakeConfigFile.h =================================================================== --- trunk/yake/yake/base/yakeConfigFile.h 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/yake/base/yakeConfigFile.h 2008-11-13 18:54:14 UTC (rev 1938) @@ -137,7 +137,7 @@ void readFromFile(const String& fn, const String& insertAt = ""); /** Overwrites existing configuration values if conflicts appear! */ - void readFromXML(const String& fn, const String& insertAt = ""); + //@todo void readFromXML(const String& fn, const String& insertAt = ""); /** @note Ignores any set offset/prefix! */ @@ -145,7 +145,7 @@ /** @note Ignores any set offset/prefix! */ - void writeToXML(const String& fn, const String& startAt = ""); + //@todo void writeToXML(const String& fn, const String& startAt = ""); private: tree_ptr tree_; Modified: trunk/yake/yake/bindings.lua/common/yake.lua.shared_ptr.h =================================================================== --- trunk/yake/yake/bindings.lua/common/yake.lua.shared_ptr.h 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/yake/bindings.lua/common/yake.lua.shared_ptr.h 2008-11-13 18:54:14 UTC (rev 1938) @@ -40,12 +40,15 @@ //typedef boost::shared_ptr<ui::LuaStyleBatcher> LuaStyleBatcherPtr; //typedef boost::shared_ptr<const ui::LuaStyleBatcher> ConstLuaStyleBatcherPtr; + /** As of Luabind 0.7.1 this is now in luabind/class.hpp: */ + /* template<class A> boost::shared_ptr<const A>* get_const_holder(boost::shared_ptr<A>*) { return 0; } + */ } // namespace luabind #endif Modified: trunk/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h =================================================================== --- trunk/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h 2008-11-13 18:54:14 UTC (rev 1938) @@ -27,14 +27,15 @@ #ifndef YAKE_GRAPHICS_OGRE_PREREQUISITES_H #define YAKE_GRAPHICS_OGRE_PREREQUISITES_H +#include "yake/config.h" + #if defined( YAKE_GRAPHICSCONCRETEAPI_EXPORTS ) # define YAKE_GRAPHICS_CONCRETE_API YAKE_EXPORT_API #else # define YAKE_GRAPHICS_CONCRETE_API YAKE_IMPORT_API #endif -#if YAKE_PLATFORM == PLATFORM_WIN32 -# define YAKE_USE_OSM +#if YAKE_GRAPHICSOGRE_USES_OSM == 1 # pragma message("Compiling graphicsOGRE with OSM support.") #else # pragma message("Compiling graphicsOGRE without OSM support.") Modified: trunk/yake/yake/plugins/graphicsOgre/yakePCH.h =================================================================== --- trunk/yake/yake/plugins/graphicsOgre/yakePCH.h 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/yake/plugins/graphicsOgre/yakePCH.h 2008-11-13 18:54:14 UTC (rev 1938) @@ -37,7 +37,6 @@ #include <OgreConfigFile.h> #include <OgreRenderSystem.h> #include <OgreSceneManager.h> -#include <OgreNoMemoryMacros.h> #define VEC_YAKE2OGRE( YV ) Ogre::Vector3( YV.x, YV.y, YV.z ) #define VEC_OGRE2YAKE( YV ) yake::math::Vector3( YV.x, YV.y, YV.z ) Modified: trunk/yake/yake/raf/yakePrerequisites.h =================================================================== --- trunk/yake/yake/raf/yakePrerequisites.h 2008-09-25 17:09:20 UTC (rev 1937) +++ trunk/yake/yake/raf/yakePrerequisites.h 2008-11-13 18:54:14 UTC (rev 1938) @@ -35,13 +35,6 @@ # define YAKE_RAF_API YAKE_IMPORT_API #endif -// configuration -#if YAKE_PLATFORM == PLATFORM_WIN32 && YAKE_COMPILER == COMPILER_MSVC //@todo fixme make it work on linux and mingw etc -# 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. |