[Python-ogre-commit] SF.net SVN: python-ogre:[788] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2008-11-08 01:46:56
|
Revision: 788 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=788&view=rev Author: andy_miller Date: 2008-11-08 01:46:46 +0000 (Sat, 08 Nov 2008) Log Message: ----------- Further updated for Ogre 1.6 release Modified Paths: -------------- trunk/python-ogre/demos/ogre/Demo_Compositor.py trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/patch/ogre_1.6.0.patch Modified: trunk/python-ogre/demos/ogre/Demo_Compositor.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Compositor.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/demos/ogre/Demo_Compositor.py 2008-11-08 01:46:46 UTC (rev 788) @@ -1,3 +1,4 @@ +# NO_UNITTEST # This code is in the Public Domain # ----------------------------------------------------------------------------- # This source file is part of Python-Ogre Modified: trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py =================================================================== --- trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py 2008-11-08 01:46:46 UTC (rev 788) @@ -21,8 +21,8 @@ assert len(Vertices_Pos)==len(Vertices_Colour) meshMgr = ogre.MeshManager.getSingleton() - self.mesh = mesh = meshMgr.createManual(Name, ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) - self.subMesh = subMesh = mesh.createSubMesh() + self.mesh = meshMgr.createManual(Name, ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) + self.subMesh = mesh.createSubMesh() POSITION_ELEMENT = 0 NORMAL_ELEMENT = 1 @@ -40,7 +40,7 @@ #work-around to prevent destruction self.sharedVertexData = mesh.sharedVertexData - declaration = mesh.sharedVertexData.vertexDeclaration + declaration = self.mesh.sharedVertexData.vertexDeclaration offset = 0 offset += ogre.VertexElement.getTypeSize(ogre.VET_FLOAT3) declaration.addElement(0, offset, ogre.VET_FLOAT3, ogre.VES_POSITION) @@ -56,15 +56,37 @@ # # pVertex = vbuf.lock(declaration, ogre.HardwareBuffer.HBL_DISCARD) pVertex = vbuf.lock(ogre.HardwareBuffer.HBL_DISCARD) - + print pVertex + + pVert= ( ctypes.c_float * (mesh.sharedVertexData.vertexCount)).from_address ( ogre.CastInt ( pVertex ) ) #loop through the position array + index = 0 for i in range(len(Vertices_Pos)): vx, vy, vz = Vertices_Pos[i] nx, ny, nz = Vertices_Norm[i] - + pVert[i pVertex.setFloat(i, POSITION_ELEMENT, vx, vy, vz) pVertex.setFloat(i, NORMAL_ELEMENT, nx, ny, nz) + + index = 0 + for i in range ( 3 ): + off = i*4 + pVert[ index ] = 0 + off + index +=1 + pVert[ index ] = 3 + off + index +=1 + pVert[ index ] = 1 + off + index +=1 + pVert[ index ] = 0 + off + index +=1 + pVert[ index ] = 2 + off + index +=1 + pVert[ index ] = 3 + off + index +=1 + + + bind = mesh.sharedVertexData.vertexBufferBinding bind.setBinding(0,vbuf) #Set vertex buffer binding so buffer 0 is bound to positional data @@ -194,8 +216,12 @@ # colours.append(rs.convertColourValue(ogre.ColourValue(0.0,1.0,1.0))) #6 colour # colours.append(rs.convertColourValue(ogre.ColourValue(0.0,0.0,1.0))) #7 colour - ManuallyDefinedMesh("cubeMesh",vert_pos,vert_norm,faces ) #,colours) + mm = ManuallyDefinedMesh("cubeMesh",vert_pos,vert_norm,faces ) #,colours) + print mm + mm.Print() + + self.cubeEntity = sceneManager.createEntity("myCubeEntity", "cubeMesh") self.cubeEntity.setMaterialName("Test/SimpleVertexColor") self.nd=sceneManager.rootSceneNode.createChildSceneNode() Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/environment.py 2008-11-08 01:46:46 UTC (rev 788) @@ -575,32 +575,32 @@ if isWindows(): if _STABLE or not _STABLE: ## temp force to this version... - version="1.6.0RC1" + version="1.6.0" source = [ [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], - [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0RC1.zip", downloadPath], + [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0.zip", downloadPath], ] buildCmds = [ - [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0RC1.zip"),os.getcwd() ], + [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0.zip"),os.getcwd() ], [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), os.path.join(os.getcwd(), 'ogre') ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0RC2.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] ] - else: +# else: +# +# version="trunk" +# source = [ +# [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], +# [ svn, "https://svn.ogre3d.org/svnroot/ogre/trunk", os.path.join(os.getcwd(), 'ogre')] +# ] +# buildCmds = [ +# [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), +# os.path.join(os.getcwd(), 'ogre') ], +# [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], +# [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] +# ] - version="1.7" - source = [ - [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], - [ svn, "https://svn.ogre3d.org/svnroot/ogre/branches/v1-6", os.path.join(os.getcwd(), 'ogre')] - ] - buildCmds = [ - [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), - os.path.join(os.getcwd(), 'ogre') ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], - [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] - ] - # requirements to build a precompiled header on the fly if _PreCompiled: pchstop = 'python_ogre_precompiled.h' @@ -635,11 +635,11 @@ [0, "make install", os.path.join(os.getcwd(), 'ogre')], ] else: - version = "1.6.0RC1" - base = "ogre-v1-6-0RC1" + version = "1.6.0" + base = "ogre-v1-6-0" buildCmds = [ [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0RC1.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], [0, "./configure --prefix=%s --with-gui=Xt --disable-devil" % PREFIX, os.path.join(os.getcwd(), 'ogre')], Added: trunk/python-ogre/patch/ogre_1.6.0.patch =================================================================== --- trunk/python-ogre/patch/ogre_1.6.0.patch (rev 0) +++ trunk/python-ogre/patch/ogre_1.6.0.patch 2008-11-08 01:46:46 UTC (rev 788) @@ -0,0 +1,188 @@ +Index: ogre/Samples/Common/include/ExampleFrameListener.h +=================================================================== +--- ogre/Samples/Common/include/ExampleFrameListener.h (revision 8145) ++++ ogre/Samples/Common/include/ExampleFrameListener.h (working copy) +@@ -41,7 +41,7 @@ + + //Use this define to signify OIS will be used as a DLL + //(so that dll import/export macros are in effect) +-#define OIS_DYNAMIC_LIB ++//#define OIS_DYNAMIC_LIB + #include <OIS/OIS.h> + + using namespace Ogre; +Index: ogre/OgreMain/include/OgreMovableObject.h +=================================================================== +--- ogre/OgreMain/include/OgreMovableObject.h (revision 8145) ++++ ogre/OgreMain/include/OgreMovableObject.h (working copy) +@@ -482,7 +482,7 @@ + included too. + */ + virtual void visitRenderables(Renderable::Visitor* visitor, +- bool debugRenderables = false) = 0; ++ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } + + /** Sets whether or not the debug display of this object is enabled. + @remarks +Index: ogre/OgreMain/include/OgreRenderQueueListener.h +=================================================================== +--- ogre/OgreMain/include/OgreRenderQueueListener.h (revision 8145) ++++ ogre/OgreMain/include/OgreRenderQueueListener.h (working copy) +@@ -31,7 +31,9 @@ + + #include "OgrePrerequisites.h" + #include "OgreRenderQueue.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract interface which classes must implement if they wish to receive +@@ -65,7 +67,7 @@ + for this queue group. + */ + virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, +- bool& skipThisInvocation) = 0; ++ bool& skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } + + /** Event raised after a queue group is rendered. + @remarks +@@ -80,7 +82,7 @@ + events will also be fired for it again. + */ + virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, +- bool& repeatThisInvocation) = 0; ++ bool& repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } + }; + + } +Index: ogre/OgreMain/include/OgreResourceGroupManager.h +=================================================================== +--- ogre/OgreMain/include/OgreResourceGroupManager.h (revision 8145) ++++ ogre/OgreMain/include/OgreResourceGroupManager.h (working copy) +@@ -37,6 +37,7 @@ + #include "OgreArchive.h" + #include "OgreIteratorWrappers.h" + #include <ctime> ++#include <stdexcept> + + namespace Ogre { + +@@ -92,7 +93,7 @@ + parsed. Note that in this case the scriptParseEnded event will not be raised + for this script. + */ +- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; ++ virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } + + /** This event is fired when the script has been fully parsed. + */ +Index: ogre/OgreMain/include/OgreDataStream.h +=================================================================== +--- ogre/OgreMain/include/OgreDataStream.h (revision 8145) ++++ ogre/OgreMain/include/OgreDataStream.h (working copy) +@@ -33,6 +33,7 @@ + #include "OgreString.h" + #include "OgreSharedPtr.h" + #include <istream> ++#include <stdexcept> + + namespace Ogre { + +@@ -79,7 +80,7 @@ + @param count Number of bytes to read + @returns The number of bytes read + */ +- virtual size_t read(void* buf, size_t count) = 0; ++ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } + /** Get a single line from the stream. + @remarks + The delimiter character is not included in the data +Index: ogre/OgreMain/include/OgreConfig.h +=================================================================== +--- ogre/OgreMain/include/OgreConfig.h (revision 8145) ++++ ogre/OgreMain/include/OgreConfig.h (working copy) +@@ -87,7 +87,7 @@ + #define OGRE_MEMORY_ALLOCATOR_NED 2 // you need to have nedmalloc on your path for this + #define OGRE_MEMORY_ALLOCATOR_USER 3 + +-#define OGRE_MEMORY_ALLOCATOR OGRE_MEMORY_ALLOCATOR_STD ++#define OGRE_MEMORY_ALLOCATOR OGRE_MEMORY_ALLOCATOR_NED + + // enable or disable the memory tracker, recording the memory allocations & tracking leaks + // default is to disable since it's expensive, but you can enable if needed per build target +@@ -123,7 +123,7 @@ + to be done in the background. + */ + #ifndef OGRE_THREAD_SUPPORT +-#define OGRE_THREAD_SUPPORT 0 ++#define OGRE_THREAD_SUPPORT 1 + #endif + #if OGRE_THREAD_SUPPORT != 0 && OGRE_THREAD_SUPPORT != 1 && OGRE_THREAD_SUPPORT != 2 + #define OGRE_THREAD_SUPPORT 1 +Index: ogre/OgreMain/include/OgreHardwareBuffer.h +=================================================================== +--- ogre/OgreMain/include/OgreHardwareBuffer.h (revision 8145) ++++ ogre/OgreMain/include/OgreHardwareBuffer.h (working copy) +@@ -31,7 +31,9 @@ + + // Precompiler options + #include "OgrePrerequisites.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract class defining common features of hardware buffers. +@@ -244,7 +246,7 @@ + @param pDest The area of memory in which to place the data, must be large enough to + accommodate the data! + */ +- virtual void readData(size_t offset, size_t length, void* pDest) = 0; ++ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } + /** Writes data to the buffer from an area of system memory; note that you must + ensure that your buffer is big enough. + @param offset The byte offset from the start of the buffer to start writing +@@ -254,7 +256,7 @@ + such that DMA stalls can be avoided; use if you can. + */ + virtual void writeData(size_t offset, size_t length, const void* pSource, +- bool discardWholeBuffer = false) = 0; ++ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } + + /** Copy data from another buffer into this one. + @remarks +Index: ogre/OgreMain/include/OgreAtomicWrappers.h +=================================================================== +--- ogre/OgreMain/include/OgreAtomicWrappers.h (revision 8145) ++++ ogre/OgreMain/include/OgreAtomicWrappers.h (working copy) +@@ -170,7 +170,7 @@ + + } + +- #elif OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_THREAD_SUPPORT ++ #elif OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_THREAD_SUPPORT && ! defined(__PYTHONOGRE_BUILD_CODE) + + #undef NOMINMAX + #define NOMINMAX +Index: ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp +=================================================================== +--- ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp (revision 8151) ++++ ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp (working copy) +@@ -54,6 +54,8 @@ + mSimulationStepSize = 0.01f; + + // Create the dynamics world ++ dInitODE2(0); ++ + mOdeWorld = new dWorld(); + mOdeContactGroup = new dJointGroup(); + +@@ -79,6 +81,7 @@ + // Destroy dynamix world + delete mOdeContactGroup; + delete mOdeWorld; ++ dCloseODE(); + + } + //------------------------------------------------------------------------- \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |