From: <and...@us...> - 2008-01-30 00:13:57
|
Revision: 559 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=559&view=rev Author: andy_miller Date: 2008-01-29 16:14:01 -0800 (Tue, 29 Jan 2008) Log Message: ----------- General updates to the thirdparty code base Modified Paths: -------------- trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h trunk/python-ogre/ThirdParty/forests/BatchPage.cpp trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp trunk/python-ogre/ThirdParty/forests/GrassLoader.h trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp trunk/python-ogre/ThirdParty/forests/ImpostorPage.h trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.cpp trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.h trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIConfigScriptParser.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIEffect.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIEffect.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIEventArgs.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIHorizontalTrackBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIKeyCode.h trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabelArea.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMemberFunctionPointer.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMouseButtonID.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMouseCursor.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMouseCursor.h trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUINStateButton.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIPoint.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPoint.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIPrecompiledHeaders.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIQuad.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIQuad.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIQuadContainer.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIQuadContainer.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIRect.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIRect.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIRoot.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIRoot.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIScrollPane.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISize.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISize.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSet.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSetManager.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinSetManager.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextHelper.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextHelper.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITree.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertex.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIVertexBuffer.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIVerticalTrackBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIWindow.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWindow.h Added Paths: ----------- trunk/python-ogre/ThirdParty/nxogre/FireState.cpp trunk/python-ogre/ThirdParty/nxogre/FireState.h Modified: trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h =================================================================== --- trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/caelum/CaelumPrerequisites.h 2008-01-30 00:14:01 UTC (rev 559) @@ -25,19 +25,7 @@ #include "Ogre.h" // Define the dll export qualifier if compiling for Windows -// #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 -// #ifdef CAELUM_LIB -// #define DllExport __declspec (dllexport) -// #else -// #ifdef __MINGW32__ -// #define DllExport -// #else -// #define DllExport __declspec (dllimport) -// #endif -// #endif -// #else #define DllExport -// #endif // Define the version code #define CAELUM_VERSION_MAIN 0 Modified: trunk/python-ogre/ThirdParty/forests/BatchPage.cpp =================================================================== --- trunk/python-ogre/ThirdParty/forests/BatchPage.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/BatchPage.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -230,29 +230,36 @@ Pass *pass = tech->getPass(p); //Setup vertex program - pass->setVertexProgram(vertexProgName); - GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters(); + if (pass->getVertexProgramName() == "") + pass->setVertexProgram(vertexProgName); - params->setNamedAutoConstant("objSpaceLight", GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE); - params->setNamedAutoConstant("lightDiffuse", GpuProgramParameters::ACT_DERIVED_LIGHT_DIFFUSE_COLOUR); - params->setNamedAutoConstant("lightAmbient", GpuProgramParameters::ACT_DERIVED_AMBIENT_LIGHT_COLOUR); + try{ + GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters(); - params->setNamedAutoConstant("matAmbient", GpuProgramParameters::ACT_SURFACE_AMBIENT_COLOUR); - params->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX); + params->setNamedAutoConstant("objSpaceLight", GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE); + params->setNamedAutoConstant("lightDiffuse", GpuProgramParameters::ACT_DERIVED_LIGHT_DIFFUSE_COLOUR); + params->setNamedAutoConstant("lightAmbient", GpuProgramParameters::ACT_DERIVED_AMBIENT_LIGHT_COLOUR); - if (fadeEnabled){ - params->setNamedAutoConstant("camPos", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE); + params->setNamedAutoConstant("matAmbient", GpuProgramParameters::ACT_SURFACE_AMBIENT_COLOUR); + params->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX); - //Set fade ranges - params->setNamedAutoConstant("invisibleDist", GpuProgramParameters::ACT_CUSTOM); - params->setNamedConstant("invisibleDist", invisibleDist); + if (fadeEnabled){ + params->setNamedAutoConstant("camPos", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE); - params->setNamedAutoConstant("fadeGap", GpuProgramParameters::ACT_CUSTOM); - params->setNamedConstant("fadeGap", invisibleDist - visibleDist); + //Set fade ranges + params->setNamedAutoConstant("invisibleDist", GpuProgramParameters::ACT_CUSTOM); + params->setNamedConstant("invisibleDist", invisibleDist); - if (pass->getAlphaRejectFunction() == CMPF_ALWAYS_PASS) - pass->setSceneBlending(SBT_TRANSPARENT_ALPHA); + params->setNamedAutoConstant("fadeGap", GpuProgramParameters::ACT_CUSTOM); + params->setNamedConstant("fadeGap", invisibleDist - visibleDist); + + if (pass->getAlphaRejectFunction() == CMPF_ALWAYS_PASS) + pass->setSceneBlending(SBT_TRANSPARENT_ALPHA); + } } + catch (...) { + OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Error configuring batched geometry transitions. If you're using materials with custom vertex shaders, they will need to implement fade transitions to be compatible with BatchPage.", "BatchPage::_updateShaders()"); + } } } Modified: trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp =================================================================== --- trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/BatchedGeometry.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -25,6 +25,7 @@ #include "OgreStringConverter.h" #include "OgreEntity.h" #include "OgreSubMesh.h" +#include "OgreSubEntity.h" #include "OgreMesh.h" #include "OgreMeshManager.h" #include "OgreHardwareBufferManager.h" @@ -55,16 +56,16 @@ void BatchedGeometry::addEntity(Entity *ent, const Vector3 &position, const Quaternion &orientation, const Vector3 &scale, const Ogre::ColourValue &color) { - //For each submesh - Mesh::SubMeshIterator i = ent->getMesh()->getSubMeshIterator(); - while (i.hasMoreElements()){ - //Get the submesh - SubMesh *mesh = i.peekNext(); + //For each subentity + for (uint i = 0; i < ent->getNumSubEntities(); ++i){ + //Get the subentity + SubEntity *subEntity = ent->getSubEntity(i); + SubMesh *subMesh = subEntity->getSubMesh(); //Generate a format string that uniquely identifies this material & vertex/index format - if (mesh->vertexData == NULL) + if (subMesh->vertexData == NULL) OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "BatchedGeometry cannot use meshes with shared vertex data", "BatchedGeometry::addEntity()"); - String formatStr = getFormatString(mesh); + String formatStr = getFormatString(subEntity); //If a batch using an identical format exists... SubBatch *batch; @@ -74,15 +75,12 @@ batch = batchIter->second; } else { //Otherwise create a new batch - batch = new SubBatch(this, mesh); + batch = new SubBatch(this, subEntity); subBatchMap.insert(std::pair<String, SubBatch*>(formatStr, batch)); } //Now add the submesh to the compatible batch - batch->addSubMesh(mesh, position, orientation, scale, color); - - //Next item - i.getNext(); + batch->addSubEntity(subEntity, position, orientation, scale, color); } //Update bounding box @@ -110,14 +108,14 @@ return BatchedGeometry::SubBatchIterator((SubBatchMap&)subBatchMap); } -String BatchedGeometry::getFormatString(SubMesh *mesh) +String BatchedGeometry::getFormatString(SubEntity *ent) { StringUtil::StrStreamType str; - str << mesh->getMaterialName() << "|"; - str << mesh->indexData->indexBuffer->getType() << "|"; + str << ent->getMaterialName() << "|"; + str << ent->getSubMesh()->indexData->indexBuffer->getType() << "|"; - const VertexDeclaration::VertexElementList &elemList = mesh->vertexData->vertexDeclaration->getElements(); + const VertexDeclaration::VertexElementList &elemList = ent->getSubMesh()->vertexData->vertexDeclaration->getElements(); VertexDeclaration::VertexElementList::const_iterator i; for (i = elemList.begin(); i != elemList.end(); ++i) { @@ -229,16 +227,18 @@ -BatchedGeometry::SubBatch::SubBatch(BatchedGeometry *parent, SubMesh *mesh) +BatchedGeometry::SubBatch::SubBatch(BatchedGeometry *parent, SubEntity *ent) { - meshType = mesh; - material = MaterialManager::getSingleton().getByName(mesh->getMaterialName()); + meshType = ent->getSubMesh(); this->parent = parent; built = false; + Material *origMat = ((MaterialPtr)MaterialManager::getSingleton().getByName(ent->getMaterialName())).getPointer(); + material = MaterialManager::getSingleton().getByName(getMaterialClone(origMat)->getName()); + //Setup vertex/index data structure - vertexData = mesh->vertexData->clone(false); - indexData = mesh->indexData->clone(false); + vertexData = meshType->vertexData->clone(false); + indexData = meshType->indexData->clone(false); //Remove blend weights from vertex format const VertexElement* blendIndices = vertexData->vertexDeclaration->findElementBySemantic(VES_BLEND_INDICES); @@ -275,13 +275,23 @@ delete indexData; } -void BatchedGeometry::SubBatch::addSubMesh(SubMesh *mesh, const Vector3 &position, const Quaternion &orientation, const Vector3 &scale, const Ogre::ColourValue &color) +Material *BatchedGeometry::SubBatch::getMaterialClone(Material *mat) { + String clonedName = mat->getName() + "_Batched"; + MaterialPtr clonedMat = MaterialManager::getSingleton().getByName(clonedName); + if (clonedMat.isNull()) + clonedMat = mat->clone(clonedName); + + return clonedMat.getPointer(); +} + +void BatchedGeometry::SubBatch::addSubEntity(SubEntity *ent, const Vector3 &position, const Quaternion &orientation, const Vector3 &scale, const Ogre::ColourValue &color) +{ assert(!built); //Add this submesh to the queue QueuedMesh newMesh; - newMesh.mesh = mesh; + newMesh.mesh = ent->getSubMesh(); newMesh.position = position; newMesh.orientation = orientation; newMesh.scale = scale; @@ -302,8 +312,8 @@ meshQueue.push_back(newMesh); //Increment the vertex/index count so the buffers will have room for this mesh - vertexData->vertexCount += mesh->vertexData->vertexCount; - indexData->indexCount += mesh->indexData->indexCount; + vertexData->vertexCount += ent->getSubMesh()->vertexData->vertexCount; + indexData->indexCount += ent->getSubMesh()->indexData->indexCount; } void BatchedGeometry::SubBatch::build() @@ -640,4 +650,5 @@ { return parent->queryLights(); } + #endif Modified: trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h =================================================================== --- trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/BatchedGeometry.h 2008-01-30 00:14:01 UTC (rev 559) @@ -49,10 +49,10 @@ class SubBatch: public Ogre::Renderable { public: - SubBatch(BatchedGeometry *parent, Ogre::SubMesh *mesh); + SubBatch(BatchedGeometry *parent, Ogre::SubEntity *ent); ~SubBatch(); - void addSubMesh(Ogre::SubMesh *mesh, const Ogre::Vector3 &position, const Ogre::Quaternion &orientation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color = Ogre::ColourValue::White); + void addSubEntity(Ogre::SubEntity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &orientation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color = Ogre::ColourValue::White); void build(); void clear(); @@ -73,6 +73,11 @@ bool castsShadows(void) const { return parent->getCastShadows(); } private: + //This function is used to make a single clone of materials used, since the materials + //will be modified by the batch system (and it wouldn't be good to modify the original materials + //that the user may be using somewhere else). + Ogre::Material *getMaterialClone(Ogre::Material *mat); + //A structure defining the desired position/orientation/scale of a batched mesh. The //SubMesh is not specified since that can be determined by which MeshQueue this belongs to. struct QueuedMesh @@ -100,7 +105,7 @@ }; private: - Ogre::String getFormatString(Ogre::SubMesh *mesh); + Ogre::String getFormatString(Ogre::SubEntity *ent); typedef std::map<Ogre::String, SubBatch*> SubBatchMap; //Stores a list of GeomBatch'es, using a format string (generated with getGeometryFormatString()) as the key value SubBatchMap subBatchMap; Modified: trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp =================================================================== --- trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/GrassLoader.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -43,6 +43,9 @@ { GrassLoader::geom = geom; + heightFunction = NULL; + heightFunctionUserData = NULL; + windDir = Vector3::UNIT_X; densityFactor = 1.0f; renderQueue = RENDER_QUEUE_6; @@ -246,8 +249,8 @@ float y1, y2; if (heightFunction){ - y1 = heightFunction(x1, z1); - y2 = heightFunction(x2, z2); + y1 = heightFunction(x1, z1, heightFunctionUserData); + y2 = heightFunction(x2, z2, heightFunctionUserData); } else { y1 = 0; y2 = 0; @@ -384,8 +387,8 @@ float y1, y2; if (heightFunction){ - y1 = heightFunction(x1, z1); - y2 = heightFunction(x2, z2); + y1 = heightFunction(x1, z1, heightFunctionUserData); + y2 = heightFunction(x2, z2, heightFunctionUserData); } else { y1 = 0; y2 = 0; @@ -420,8 +423,8 @@ float y3, y4; if (heightFunction){ - y3 = heightFunction(x3, z3); - y4 = heightFunction(x4, z4); + y3 = heightFunction(x3, z3, heightFunctionUserData); + y4 = heightFunction(x4, z4, heightFunctionUserData); } else { y3 = 0; y4 = 0; @@ -540,7 +543,7 @@ //Calculate height float y; if (heightFunction){ - y = heightFunction(x, z); + y = heightFunction(x, z, heightFunctionUserData); } else { y = 0; } @@ -675,6 +678,8 @@ { if (material.isNull() || matName != material->getName()){ material = MaterialManager::getSingleton().getByName(matName); + if (material.isNull()) + OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "The specified grass material does not exist", "GrassLayer::setMaterialName()"); shaderNeedsUpdate = true; } } @@ -784,7 +789,7 @@ float z = Math::RangeRandom(page.bounds.top, page.bounds.bottom); //Calculate height - float y = parent->heightFunction(x, z); + float y = parent->heightFunction(x, z, parent->heightFunctionUserData); //Add to list if in range if (y >= min && y <= max){ @@ -839,7 +844,7 @@ //For example, if localDensity is .32, grasses will be added 32% of the time. if (Math::UnitRandom() < densityMap->_getDensityAt_Unfiltered(x, z)){ //Calculate height - float y = parent->heightFunction(x, z); + float y = parent->heightFunction(x, z, parent->heightFunctionUserData); //Add to list if in range if (y >= min && y <= max){ @@ -889,7 +894,7 @@ //For example, if localDensity is .32, grasses will be added 32% of the time. if (Math::UnitRandom() < densityMap->_getDensityAt_Bilinear(x, z)){ //Calculate height - float y = parent->heightFunction(x, z); + float y = parent->heightFunction(x, z, parent->heightFunctionUserData); //Add to list if in range if (y >= min && y <= max){ Modified: trunk/python-ogre/ThirdParty/forests/GrassLoader.h =================================================================== --- trunk/python-ogre/ThirdParty/forests/GrassLoader.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/GrassLoader.h 2008-01-30 00:14:01 UTC (rev 559) @@ -140,16 +140,32 @@ function anything you want): \code - Real getHeightAt(Real x, Real z); + Real getHeightAt(Real x, Real z, void *userData); \endcode - + + \note If you're not using the default coordinate system (where x = right, z = back), the + x/z parameters will actually be representing the appropriate equivalents. + + The userData parameter allows you to include any additional data you want when your height + function is called, and is completely optional (although you can't actually omit it from the + declaration, you can ignore it). Any userData value you choose to supply to setHeightFunction() + will be passed on to your height function every time it is called. + After you've defined a height function, using setHeightFunction is easy: \code pageLoader2D->setHeightFunction(&getHeightAt); + //Or (if you want to pass additional data on to your height function)... + pageLoader2D->setHeightFunction(&getHeightAt, myUserData); \endcode + + In most cases, you may not even need to use the extra "userData" parameter, but it's there in + the event that your height function needs extra contextual data. */ - void setHeightFunction(Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z)) { this->heightFunction = heightFunction; } + void setHeightFunction(Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData), void *userData = NULL) { + this->heightFunction = heightFunction; + heightFunctionUserData = userData; + } /** INTERNAL FUNCTION - DO NOT USE */ @@ -171,7 +187,8 @@ std::list<GrassLayer*> layerList; //Height data - Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z); //Pointer to height function + Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData); //Pointer to height function + void *heightFunctionUserData; //Misc. PagedGeometry *geom; Modified: trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp =================================================================== --- trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/ImpostorPage.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -21,6 +21,7 @@ #include "OgreVector3.h" #include "OgreQuaternion.h" #include "OgreEntity.h" +#include "OgreSubEntity.h" #include "OgreHardwarePixelBuffer.h" using namespace Ogre; @@ -52,7 +53,7 @@ ImpostorPage::~ImpostorPage() { //Delete all impostor batches - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; delete ibatch; @@ -96,7 +97,7 @@ center.y = 0.0f; //Build all batches - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; ibatch->build(); @@ -106,7 +107,7 @@ void ImpostorPage::setVisible(bool visible) { //Update visibility status of all batches - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; ibatch->setVisible(visible); @@ -116,7 +117,7 @@ void ImpostorPage::setFade(bool enabled, Real visibleDist, Real invisibleDist) { //Update fade status of all batches - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; ibatch->setFade(enabled, visibleDist, invisibleDist); @@ -126,7 +127,7 @@ void ImpostorPage::removeEntities() { //Clear all impostor batches - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; ibatch->clear(); @@ -157,7 +158,7 @@ yaw = Math::ATan2(-dir.x, -dir.z); } - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; + std::map<String, ImpostorBatch *>::iterator iter; for (iter = impostorBatches.begin(); iter != impostorBatches.end(); ++iter){ ImpostorBatch *ibatch = iter->second; ibatch->setAngle(pitch.valueDegrees(), yaw.valueDegrees()); @@ -189,8 +190,6 @@ ImpostorBatch::ImpostorBatch(ImpostorPage *group, Entity *entity) { - typedef std::pair<ResourceHandle, ImpostorBatch *> ListItem; - //Render impostor texture for this entity tex = ImpostorTexture::getTexture(group, entity); @@ -205,9 +204,6 @@ yawIndex = -1; setAngle(0.0f, 0.0f); - //Add self to impostorBatches list - group->impostorBatches.insert(ListItem(tex->sourceMesh, this)); - //Init. variables igroup = group; } @@ -225,16 +221,24 @@ ImpostorBatch *ImpostorBatch::getBatch(ImpostorPage *group, Entity *entity) { //Search for an existing impostor batch for this entity - std::map<ResourceHandle, ImpostorBatch *>::iterator iter; - iter = group->impostorBatches.find(entity->getMesh()->getHandle()); + String entityKey = ImpostorBatch::generateEntityKey(entity); + std::map<String, ImpostorBatch *>::iterator iter; + iter = group->impostorBatches.find(entityKey); //If found.. if (iter != group->impostorBatches.end()){ //Return it return iter->second; } else { - //Otherwise, return a new batch - return (new ImpostorBatch(group, entity)); + //Otherwise, create a new batch + ImpostorBatch *batch = new ImpostorBatch(group, entity); + + //Add it to the impostorBatches list + typedef std::pair<String, ImpostorBatch *> ListItem; + group->impostorBatches.insert(ListItem(entityKey, batch)); + + //Return it + return batch; } } @@ -277,24 +281,34 @@ entityBBCenter = Vector3(tex->entityCenter.x, tex->entityCenter.y - tex->entityRadius, tex->entityCenter.z); } +String ImpostorBatch::generateEntityKey(Entity *entity) +{ + StringUtil::StrStreamType entityKey; + entityKey << entity->getMesh()->getName(); + for (uint i = 0; i < entity->getNumSubEntities(); ++i){ + entityKey << "-" << entity->getSubEntity(i)->getMaterialName(); + } + + return entityKey.str(); +} + //------------------------------------------------------------------------------------- -std::map<ResourceHandle, ImpostorTexture *> ImpostorTexture::selfList; +std::map<String, ImpostorTexture *> ImpostorTexture::selfList; unsigned long ImpostorTexture::GUID = 0; //Do not use this constructor yourself - instead, call getTexture() //to get/create an ImpostorTexture for an Entity. ImpostorTexture::ImpostorTexture(ImpostorPage *group, Entity *entity) { - typedef std::pair<ResourceHandle, ImpostorTexture *> ListItem; - //Store scene manager and entity ImpostorTexture::sceneMgr = group->sceneMgr; ImpostorTexture::entity = entity; //Add self to list of ImpostorTexture's - sourceMesh = entity->getMesh()->getHandle(); - selfList.insert(ListItem(sourceMesh, this)); + entityKey = ImpostorBatch::generateEntityKey(entity); + typedef std::pair<String, ImpostorTexture *> ListItem; + selfList.insert(ListItem(entityKey, this)); //Calculate the entity's bounding box and it's diameter boundingBox = entity->getBoundingBox(); @@ -378,7 +392,7 @@ } //Remove self from list of ImpostorTexture's - selfList.erase(sourceMesh); + selfList.erase(entityKey); } void ImpostorTexture::regenerate() @@ -395,7 +409,7 @@ void ImpostorTexture::regenerateAll() { - std::map<ResourceHandle, ImpostorTexture *>::iterator iter; + std::map<String, ImpostorTexture *>::iterator iter; for (iter = selfList.begin(); iter != selfList.end(); ++iter){ iter->second->regenerate(); } @@ -465,10 +479,20 @@ //uint8 oldRenderQueueGroup = entity->getRenderQueueGroup(); entity->setRenderQueueGroup(RENDER_QUEUE_6); - //Calculate the filename used to identity this render + //Calculate the filename used to uniquely identity this render + String strKey = entityKey; + char key[32] = {0}; + unsigned int i = 0; + for (String::const_iterator it = entityKey.begin(); it != entityKey.end(); ++it) + { + key[i] ^= *it; + i = (i+1) % sizeof(key); + } + for (i = 0; i < sizeof(key); ++i) + key[i] = (key[i] % 26) + 'A'; + ResourceGroupManager::getSingleton().addResourceLocation(".", "FileSystem", "BinFolder"); - String fileName = "Impostor." + entity->getMesh()->getGroup() + '.' + entity->getMesh()->getName() - + '.' + StringConverter::toString(textureSize) + ".png"; + String fileName = "Impostor." + String(key, sizeof(key)) + '.' + StringConverter::toString(textureSize) + ".png"; //Attempt to load the pre-render file if allowed bool needsRegen = force; @@ -538,10 +562,26 @@ TextureManager::getSingleton().remove(texName2); } +String ImpostorTexture::removeInvalidCharacters(String s) +{ + StringUtil::StrStreamType s2; + + for (unsigned int i = 0; i < s.length(); ++i){ + char c = s[i]; + if (c == '/' || c == '\\' || c == ':' || c == '*' || c == '?' || c == '\"' || c == '<' || c == '>' || c == '|'){ + s2 << '-'; + } else { + s2 << c; + } + } + + return s2.str(); +} + void ImpostorTexture::removeTexture(ImpostorTexture* Texture) { //Search for an existing impostor texture, in case it was already deleted - for(std::map<ResourceHandle, ImpostorTexture *>::iterator iter=selfList.begin(); + for(std::map<String, ImpostorTexture *>::iterator iter=selfList.begin(); iter!=selfList.end(); ++iter) { if(iter->second==Texture) @@ -556,8 +596,9 @@ ImpostorTexture *ImpostorTexture::getTexture(ImpostorPage *group, Entity *entity) { //Search for an existing impostor texture for the given entity - std::map<ResourceHandle, ImpostorTexture *>::iterator iter; - iter = selfList.find(entity->getMesh()->getHandle()); + String entityKey = ImpostorBatch::generateEntityKey(entity); + std::map<String, ImpostorTexture *>::iterator iter; + iter = selfList.find(entityKey); //If found.. if (iter != selfList.end()){ Modified: trunk/python-ogre/ThirdParty/forests/ImpostorPage.h =================================================================== --- trunk/python-ogre/ThirdParty/forests/ImpostorPage.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/ImpostorPage.h 2008-01-30 00:14:01 UTC (rev 559) @@ -182,7 +182,7 @@ Ogre::Vector3 center; int aveCount; - std::map<Ogre::ResourceHandle, ImpostorBatch *> impostorBatches; + std::map<Ogre::String, ImpostorBatch *> impostorBatches; }; @@ -217,11 +217,11 @@ } void setBillboardOrigin(Ogre::BillboardOrigin origin); - inline void addBillboard(const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color = Ogre::ColourValue::White); - void setAngle(float pitchDeg, float yawDeg); + static Ogre::String generateEntityKey(Ogre::Entity *entity); + protected: ImpostorBatch(ImpostorPage *group, Ogre::Entity *entity); @@ -274,9 +274,12 @@ void renderTextures(bool force); // Renders the impostor texture grid void updateMaterials(); // Updates the materials to use the latest rendered impostor texture grid - static std::map<Ogre::ResourceHandle, ImpostorTexture *> selfList; + Ogre::String removeInvalidCharacters(Ogre::String s); + + static std::map<Ogre::String, ImpostorTexture *> selfList; Ogre::SceneManager *sceneMgr; Ogre::Entity *entity; + Ogre::String entityKey; Ogre::MaterialPtr material[IMPOSTOR_PITCH_ANGLES][IMPOSTOR_YAW_ANGLES]; Ogre::TexturePtr texture; Modified: trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp =================================================================== --- trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/TreeLoader2D.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -29,6 +29,7 @@ //Reset height function heightFunction = NULL; + heightFunctionUserData = NULL; //Make sure the bounds are aligned with PagedGeometry's grid, so the TreeLoader's grid tiles will have a 1:1 relationship actualBounds = bounds; @@ -267,7 +268,7 @@ //Calculate terrain height at pos.x / pos.z to get pos.y if (heightFunction != NULL) - pos.y = heightFunction(pos.x, pos.z); + pos.y = heightFunction(pos.x, pos.z, heightFunctionUserData); else pos.y = 0.0f; @@ -377,7 +378,7 @@ //Calculate terrain height at x / z to get y if (trees->heightFunction != NULL) - currentTreeDat.position.y = trees->heightFunction(currentTreeDat.position.x, currentTreeDat.position.z); + currentTreeDat.position.y = trees->heightFunction(currentTreeDat.position.x, currentTreeDat.position.z, trees->heightFunctionUserData); else currentTreeDat.position.y = 0.0f; Modified: trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h =================================================================== --- trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/forests/TreeLoader2D.h 2008-01-30 00:14:01 UTC (rev 559) @@ -89,6 +89,7 @@ /** \brief Sets the height function used to calculate tree height coordinates \param heightFunction A pointer to a height function + \param userData Optional user data to be supplied to the height function Unless you want all your trees placed at 0 height, you need to specify a height function so TreeLoader2D will be able to calculate the height coordinate. The height function given @@ -96,19 +97,33 @@ function anything you want): \code - Real getHeightAt(Real x, Real z); + Real getHeightAt(Real x, Real z, void *userData); \endcode \note If you're not using the default coordinate system (where x = right, z = back), the x/z parameters will actually be representing the appropriate equivalents. + + The userData parameter allows you to include any additional data you want when your height + function is called, and is completely optional (although you can't actually omit it from the + declaration, you can ignore it). Any userData value you choose to supply to setHeightFunction() + will be passed on to your height function every time it is called. After you've defined a height function, using setHeightFunction is easy: \code pageLoader2D->setHeightFunction(&getHeightAt); + //Or (if you want to pass additional data on to your height function)... + pageLoader2D->setHeightFunction(&getHeightAt, myUserData); \endcode + + In most cases, you may not even need to use the extra "userData" parameter, but it's there in + the event that your height function needs extra contextual data. */ - void setHeightFunction(Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z)) { this->heightFunction = heightFunction; } + void setHeightFunction(Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData), void *userData = NULL) + { + this->heightFunction = heightFunction; + heightFunctionUserData = userData; + } /** \brief Gets an iterator which can be used to access all added trees. @@ -241,7 +256,8 @@ MapFilter colorMapFilter; //Height data - Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z); //Pointer to height function + Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData); //Pointer to height function + void *heightFunctionUserData; //Misc. PagedGeometry *geom; Added: trunk/python-ogre/ThirdParty/nxogre/FireState.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/FireState.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/nxogre/FireState.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -0,0 +1 @@ +// FireState Added: trunk/python-ogre/ThirdParty/nxogre/FireState.h =================================================================== Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h 2008-01-30 00:14:01 UTC (rev 559) @@ -99,21 +99,14 @@ ////////////////////////////////////////////////////////// /** @brief Method Ptr Constructor */ - #ifndef GCC_XML + template <typename T> explicit GroupCallback(T* v, void (T::*Start)(Actor*, Actor*), void (T::*End)(Actor*, Actor*), void (T::*Touch)(Actor*, Actor*)) - : mCallback(new TriMethodCallback<T>(v, Start, End, Touch), bool callbackOwned),mCallbackOwned(callbackOwned) {} - #else - template <typename T> explicit - GroupCallback(T* v, - void (T::*Start)(Actor*, Actor*), - void (T::*End)(Actor*, Actor*), - void (T::*Touch)(Actor*, Actor*)) - : mCallback(new TriMethodCallback<T>(v, Start, End, Touch)) {} - #endif + : mCallback(new TriMethodCallback<T>(v, Start, End, Touch)) {} + ////////////////////////////////////////////////////////// Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -30,14 +30,14 @@ ////////////////////////////////////////////////////////////////////////////////// -NxExtendedVec3 toNxExtendedVec3(const Ogre::Vector3& v) { +inline NxExtendedVec3 toNxExtendedVec3(const Ogre::Vector3& v) { return NxExtendedVec3(v.x,v.y,v.z); } ////////////////////////////////////////////////////////////////////////////////// // Generates a 8 digit ID, based on groupCount and type of object (typeHash) -NxString NxCreateID(unsigned int groupCount, NxString typeHash) { +inline NxString NxCreateID(unsigned int groupCount, NxString typeHash) { std::stringstream ss; ss << typeHash << "-" << std::hex << (rand() % 1024) << "-" << groupCount; return ss.str(); @@ -45,7 +45,7 @@ ////////////////////////////////////////////////////////////////////////////////// -NxMat33 toNxMat33(const Ogre::Matrix3& matrix) { +inline NxMat33 toNxMat33(const Ogre::Matrix3& matrix) { NxReal* c = new NxReal[9]; c[0] = matrix[0][0]; c[1] = matrix[1][0]; c[2] = matrix[2][0]; @@ -63,7 +63,7 @@ ////////////////////////////////////////////////////////////////////////////////// -NxMat34 toNxMat34(const Ogre::Matrix4& matrix) { +inline NxMat34 toNxMat34(const Ogre::Matrix4& matrix) { NxUnderConstruction; @@ -156,10 +156,10 @@ std::stringstream stream; stream << quat.w << " " << quat.x << " " << quat.y << " " << quat.z; return stream.str(); -} +} //////////////////////////////////////////////////////////////// - + template <typename Type> Type NxFromString(const NxString& string) { @@ -167,8 +167,8 @@ Type val = 0; str >> val; return val; -} - +} + //////////////////////////////////////////////////////////////// template <> @@ -206,7 +206,7 @@ return quaternion; -} +} //////////////////////////////////////////////////////////////// @@ -273,9 +273,9 @@ } //////////////////////////////////////////////////////////////// + +inline Pose NxInterpolate(Pose First, Pose Second, NxReal c) { -Pose NxInterpolate(Pose First, Pose Second, NxReal c) { - Pose r; r.v.x = First.v.x * (1 - c) + Second.v.x * c; @@ -287,5 +287,5 @@ } //////////////////////////////////////////////////////////////// - -}; //End of NxOgre namespace. + +}; //End of NxOgre namespace. Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h 2008-01-30 00:14:01 UTC (rev 559) @@ -87,18 +87,18 @@ @result The rotated vector */ NxVec3 NxExport operator* (const NxQuat&, const NxVec3&); - - - // To Strings - - /** @brief Generic class/integral to String. - @note Uses STL stringstream for conversion. - @example - <code> - NxString str = NxToString<float>(1.2345f); - </code> - @result The converted string - */ + + + // To Strings + + /** @brief Generic class/integral to String. + @note Uses STL stringstream for conversion. + @example + <code> + NxString str = NxToString<float>(1.2345f); + </code> + @result The converted string + */ template <typename Type> NxString NxExport NxToString(const Type& type); @@ -281,8 +281,8 @@ /** @brief Interpolates */ - Pose NxExport NxInterpolate(Pose First, Pose Second, NxReal c = 0.5f); + inline Pose NxExport NxInterpolate(Pose First, Pose Second, NxReal c = 0.5f); }; -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -315,7 +315,7 @@ node->detachAllObjects(); node->removeAndDestroyAllChildren(); - mSceneMgr->destroySceneNode(node->getName()); + mSceneMgr->destroySceneNode(node); } @@ -581,4 +581,4 @@ ///////////////////////////////////////////////////////////////////// -}; //End of NxOgre namespace. +}; //End of NxOgre namespace. Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h 2008-01-30 00:14:01 UTC (rev 559) @@ -52,12 +52,12 @@ void fromMat33(const NxMat33&); NxMat33 toMat33() const; - Ogre::Vector3 getVector3() const; - NxVec3 getVec3() const; - Ogre::Quaternion getQuaternion() const; - NxQuat getQuat() const; + inline Ogre::Vector3 getVector3() const; + inline NxVec3 getVec3() const; + inline Ogre::Quaternion getQuaternion() const; + inline NxQuat getQuat() const; - NxString toString() const; + inline NxString toString() const; //////////////////////////////////////////////////////////////////////////////// @@ -100,4 +100,4 @@ }; -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceStreamPtr.h 2008-01-30 00:14:01 UTC (rev 559) @@ -50,7 +50,7 @@ ResourceStreamPtr(); ResourceStreamPtr(ResourceIdentifier); - //ResourceStreamPtr(ResourceIdentifier, void*); + ResourceStreamPtr(ResourceIdentifier, void*); ResourceStreamPtr(const ResourceStreamPtr& r) : pStream(0), pUseCount(0) @@ -172,4 +172,4 @@ }; // End of namespace -#endif +#endif Modified: trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h 2008-01-30 00:14:01 UTC (rev 559) @@ -120,14 +120,13 @@ # define NX_WIN32 # define NX_MEMORY_COOKING 1 # define NX_DISK_COOKING 1 -# define NxExport -// -// # if defined(NXOGRE_EXPORTS) -// # define NxExport __declspec(dllexport) -// # else -// # define NxExport __declspec(dllimport) -// # endif +# if defined(NXOGRE_EXPORTS) +# define NxExport __declspec(dllexport) +# else +# define NxExport __declspec(dllimport) +# endif + # if defined _DEBUG # define NX_DEBUG # endif Modified: trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h =================================================================== --- trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-01-30 00:14:01 UTC (rev 559) @@ -42,8 +42,8 @@ #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 # include "al.h" # include "alc.h" - # include "xram.h" - # define OgreAL_Export + # include "xram.h" + # define OgreAL_Export #elif OGRE_COMPILER == OGRE_COMPILER_GNUC # include "AL/al.h" # include "AL/alc.h" Modified: trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.cpp =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -43,7 +43,8 @@ DynamicsWorld::DynamicsWorld(Ogre::SceneManager *mgr, const Ogre::AxisAlignedBox &bounds, - const Ogre::Vector3 &gravity) : + const Ogre::Vector3 &gravity, + bool init) : CollisionsWorld(mgr, bounds, false), mDebugDrawer(0) { @@ -51,18 +52,19 @@ //btSequentialImpulseConstraintSolver3 mConstraintsolver = new btSequentialImpulseConstraintSolver(); - //mWorld = new btSimpleDynamicsWorld(); - mWorld = new btDiscreteDynamicsWorld(mDispatcher, mBroadphase, mConstraintsolver, &mDefaultCollisionConfiguration); + //only if init is true, otherwise you have to create mWorld manually later on + if (init) { + mWorld = new btDiscreteDynamicsWorld(mDispatcher, mBroadphase, mConstraintsolver, &mDefaultCollisionConfiguration); + static_cast <btDiscreteDynamicsWorld *> (mWorld)->setGravity(btVector3(gravity.x,gravity.y,gravity.z)); + } - - static_cast <btDiscreteDynamicsWorld *> (mWorld)->setGravity(btVector3(gravity.x,gravity.y,gravity.z)); - } // ------------------------------------------------------------------------- DynamicsWorld::~DynamicsWorld() { delete mConstraintsolver; } + // ------------------------------------------------------------------------- void DynamicsWorld::addRigidBody (RigidBody *rb, short collisionGroup, short collisionMask) { @@ -79,13 +81,13 @@ } } // ------------------------------------------------------------------------- - void DynamicsWorld::stepSimulation(const Ogre::Real elapsedTime, int maxSubSteps) + void DynamicsWorld::stepSimulation(const Ogre::Real elapsedTime, int maxSubSteps, const Ogre::Real fixedTimestep) { // Reset Debug Lines if (mDebugDrawer) mDebugDrawer->clear (); - static_cast <btDiscreteDynamicsWorld *> (mWorld)->stepSimulation(elapsedTime, maxSubSteps); + static_cast <btDiscreteDynamicsWorld *> (mWorld)->stepSimulation(elapsedTime, maxSubSteps, fixedTimestep); if (mDebugDrawer) { Modified: trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.h =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/ogrebullet/Dynamics/OgreBulletDynamicsWorld.h 2008-01-30 00:14:01 UTC (rev 559) @@ -32,7 +32,6 @@ #include "OgreBulletCollisionsWorld.h" #include "Debug/OgreBulletCollisionsDebugDrawer.h" - namespace OgreBulletDynamics { // ------------------------------------------------------------------------- @@ -42,12 +41,20 @@ public: DynamicsWorld(Ogre::SceneManager *mgr, const Ogre::AxisAlignedBox &bounds, - const Ogre::Vector3 &gravity); + const Ogre::Vector3 &gravity, + bool init = true); ~DynamicsWorld(); - void stepSimulation(const Ogre::Real elapsedTime, int maxSubSteps = 1); + template <class BTDNYWORLDCLASS> + void createBtDynamicsWorld(BTDNYWORLDCLASS *&createdWorld) + { + createdWorld = new BTDNYWORLDCLASS(mDispatcher, mBroadphase, mConstraintsolver, &mDefaultCollisionConfiguration); + mWorld = createdWorld; + } + void stepSimulation(const Ogre::Real elapsedTime, int maxSubSteps = 1, const Ogre::Real fixedTimestep = 1./60.); + void addRigidBody (RigidBody *rb, short collisionGroup, short collisionMask); void setDebugDrawer(OgreBulletCollisions::DebugDrawer *debugdrawer) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -5,7 +5,7 @@ namespace QuickGUI { - Border::Border(const Ogre::String& name, GUIManager* gm) : + Border::Border(const std::string& name, GUIManager* gm) : Widget(name,gm), mThickness(5), mOverlap(1) @@ -82,7 +82,7 @@ MouseCursor* mc = mGUIManager->getMouseCursor(); mMouseCursorTexture = mc->getTexture(); - Ogre::String skin = mParentWidget->getSkin(); + std::string skin = mParentWidget->getSkin(); switch(mBorderType) { @@ -128,7 +128,7 @@ mBorderType = t; Size parentSize = mParentWidget->getSize(); - Ogre::String parentSkinComponent = mParentWidget->getSkinComponent(); + std::string parentSkinComponent = mParentWidget->getSkinComponent(); switch(mBorderType) { @@ -212,7 +212,7 @@ fireEvent(EVENT_PARENT_CHANGED,args); } - void Border::setSkin(const Ogre::String& skinName, Ogre::String extension, bool recursive) + void Border::setSkin(const std::string& skinName, std::string extension, bool recursive) { SkinSet* ss = SkinSetManager::getSingleton().getSkinSet(skinName); if(ss == NULL) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIBorder.h 2008-01-30 00:14:01 UTC (rev 559) @@ -1,7 +1,7 @@ #ifndef QUICKGUIBORDER_H #define QUICKGUIBORDER_H -#include "QuickGUIPrerequisites.h" +#include "QuickGUIForwardDeclarations.h" #include "QuickGUIWidget.h" namespace QuickGUI @@ -44,12 +44,12 @@ @param ParentWidget parent widget which created this widget. */ - Border(const Ogre::String& name, GUIManager* gm); + Border(const std::string& name, GUIManager* gm); BorderType getBorderType(); void setBorderType(BorderType t); - void setSkin(const Ogre::String& skinName, Ogre::String extension = ".png", bool recursive = false); + void setSkin(const std::string& skinName, std::string extension = ".png", bool recursive = false); protected: virtual ~Border(); @@ -58,11 +58,11 @@ BorderType mBorderType; - Ogre::Real mThickness; - Ogre::Real mOverlap; + float mThickness; + float mOverlap; // used to restore mouse cursor when leaving. - Ogre::String mMouseCursorTexture; + std::string mMouseCursorTexture; void onDragged(const EventArgs& args); void onMouseEnter(const EventArgs& args); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -9,7 +9,7 @@ namespace QuickGUI { - Button::Button(const Ogre::String& name, GUIManager* gm) : + Button::Button(const std::string& name, GUIManager* gm) : Label(name,gm), mButtonDown(false) { Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.h 2008-01-30 00:14:01 UTC (rev 559) @@ -1,7 +1,7 @@ #ifndef QUICKGUIBUTTON_H #define QUICKGUIBUTTON_H -#include "QuickGUIPrerequisites.h" +#include "QuickGUIForwardDeclarations.h" #include "QuickGUILabel.h" namespace QuickGUI @@ -40,7 +40,7 @@ @param ParentWidget parent widget which created this widget. */ - Button(const Ogre::String& name, GUIManager* gm); + Button(const std::string& name, GUIManager* gm); /** * Useful when you want to simulate the button being pressed down by the mouse. Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -4,7 +4,7 @@ namespace QuickGUI { - CheckBox::CheckBox(const Ogre::String& name, GUIManager* gm) : + CheckBox::CheckBox(const std::string& name, GUIManager* gm) : Button(name,gm), mChecked(false) { Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.h 2008-01-30 00:14:01 UTC (rev 559) @@ -9,7 +9,7 @@ public Button { public: - CheckBox(const Ogre::String& name, GUIManager* gm); + CheckBox(const std::string& name, GUIManager* gm); ~CheckBox(); /** Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.cpp 2008-01-30 00:14:01 UTC (rev 559) @@ -7,7 +7,7 @@ namespace QuickGUI { - ComboBox::ComboBox(const Ogre::String& name, GUIManager* gm) : + ComboBox::ComboBox(const std::string& name, GUIManager* gm) : Widget(name,gm), mRightToLeft(false), mSelectedItem(0), @@ -267,20 +267,20 @@ mHighlightPanel->setVisible(false); } - void ComboBox::setDropDownHeight(Ogre::Real pixelHeight) + void ComboBox::setDropDownHeight(float pixelHeight) { mDropDownHeight = pixelHeight; mList->setHeight(mDropDownHeight); } - void ComboBox::setDropDownWidth(Ogre::Real pixelWidth) + void ComboBox::setDropDownWidth(float pixelWidth) { mDropDownWidth = pixelWidth; mList->setWidth(mDropDownWidth); mList->setHorizontalAnchor(ANCHOR_HORIZONTAL_LEFT); } - void ComboBox::setFont(const Ogre::String& fontScriptName, bool recursive) + void ComboBox::setFont(const std::string& fontScriptName, bool recursive) { if(fontScriptName == "") return; @@ -295,7 +295,7 @@ } } - void ComboBox::setHeight(Ogre::Real pixelHeight) + void ComboBox::setHeight(float pixelHeight) { Widget::setHeight(pixelHeight); mAutoSize = false; @@ -324,7 +324,7 @@ //mMenuLabel->setRightToLeft(mRightToLeft); } - void ComboBox::setSize(const Ogre::Real& pixelWidth, const Ogre::Real& pixelHeight) + void ComboBox::setSize(const float& pixelWidth, const float& pixelHeight) { Widget::setSize(pixelWidth,pixelHeight); mAutoSize = false; @@ -335,7 +335,7 @@ ComboBox::setSize(pixelSize.width,pixelSize.height); } - void ComboBox::setSkin(const Ogre::String& skinName, bool recursive) + void ComboBox::setSkin(const std::string& skinName, bool recursive) { Widget::setSkin(skinName,recursive); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIComboBox.h 2008-01-30 00:14:01 UTC (rev 559) @@ -1,7 +1,7 @@ #ifndef QUICKGUICOMBOBOX_H #define QUICKGUICOMBOBOX_H -#include "QuickGUIPrerequisites.h" +#include "QuickGUIForwardDeclarations.h" #include "QuickGUIButton.h" #include "QuickGUIWidget.h" #include "QuickGUIMenuLabel.h" @@ -46,7 +46,7 @@ @param ParentWidget parent widget which created this widget. */ - ComboBox(const Ogre::String& name, GUIManager* gm); + ComboBox(const std::string& name, GUIManager* gm); MenuLabel* addItem(); /** @@ -68,17 +68,17 @@ int getVerticalPixelPadHeight(); void selectItem(unsigned int index); - void setDropDownHeight(Ogre::Real pixelHeight); - void setDropDownWidth(Ogre::Real pixelWidth); - virtual void setFont(const Ogre::String& fontScriptName, bool recursive = false); - virtual void setHeight(Ogre::Real pixelHeight); + void setDropDownHeight(float pixelHeight); + void setDropDownWidth(float pixelWidth); + virtual void setFont(const std::string& fontScriptName, bool recursive = false); + virtual void setHeight(float pixelHeight); void setRightToLeft(bool rightToLeft); /** * Manually set size of widget. */ - virtual void setSize(const Ogre::Real& pixelWidth, const Ogre::Real& pixelHeight); + virtual void setSize(const float& pixelWidth, const float& pixelHeight); virtual void setSize(const Size& pixelSize); - virtual void setSkin(const Ogre::String& skinName, bool recursive = false); + virtual void setSkin(const std::string& skinName, bool recursive = false); void setVerticalPixelPadHeight(unsigned int height); protected: @@ -107,7 +107,7 @@ void onSelection(const EventArgs& args); Quad* mHighlightPanel; - Ogre::String mHighlightSkinComponent; + std::string mHighlightSkinComponent; // The Widget that has been clicked/selected by the user. MenuLabel* mSelectedItem; @@ -118,8 +118,8 @@ // Drop down list. List* mList; - Ogre::Real mDropDownHeight; - Ogre::Real mDropDownWidth; + float mDropDownHeight; + float mDropDownWidth; bool mRightToLeft; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIConfigScriptParser.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIConfigScriptParser.h 2008-01-30 00:12:44 UTC (rev 558) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIConfigScriptParser.h 2008-01-30 00:14:01 UTC (rev 559) @@ -4,9 +4,12 @@ #ifndef __QuickGuiSkinSetParser_h_ #define __QuickGuiSkinSetParser_h_ -#include "QuickGUIPrerequisites.h" +#include "QuickGUIForwardDeclarations.h" #include "QuickGUIExportDLL.h" +#include "OgreScriptLoader.h" +#include "OgreStringVector.h" + namespace QuickGUI { class ConfigNode; @@ -25,12 +28,12 @@ inline static ConfigScriptLoader *getSingletonPtr() { return &getSingleton(); } - Ogre::Real getLoadingOrder() const; + float getLoadingOrder() const; const Ogre::StringVector &getScriptPatterns() const; - ConfigNode *getConfigScript(const Ogre::String &type, const Ogre::String &name); + ConfigNode *... [truncated message content] |