rpms/ember/devel ember-0.5.5-ogre161.patch, NONE, 1.1 ember.spec, 1.14, 1.15

Alexey Torkhov atorkhov at fedoraproject.org
Mon Mar 2 10:12:59 UTC 2009


Author: atorkhov

Update of /cvs/pkgs/rpms/ember/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14366

Modified Files:
	ember.spec 
Added Files:
	ember-0.5.5-ogre161.patch 
Log Message:
* Mon Mar 02 2009 Alexey Torkhov <atorkhov at gmail.com> - 0.5.5-5
- Update for new OGRE


ember-0.5.5-ogre161.patch:

--- NEW FILE ember-0.5.5-ogre161.patch ---
commit 66fde188a7bd093cf1bbd9ffff6ca609c74482ef
Author: Erik Hjortsberg <erik.hjortsberg at iteam.se>
Date:   Tue Feb 10 21:38:56 2009 +0100

    Use the Ogre memory allocation where required.
    Also cleaned up some memory leaks in the sound handling code.

diff --git a/src/components/ogre/ogreopcode/include/OgreCollisionManager.h b/src/components/ogre/ogreopcode/include/OgreCollisionManager.h
index 13d8ccc..de75cbe 100644
--- a/src/components/ogre/ogreopcode/include/OgreCollisionManager.h
+++ b/src/components/ogre/ogreopcode/include/OgreCollisionManager.h
@@ -11,7 +11,7 @@
 ///  A lot of the code is based on the Nebula Opcode Collision module, see docs/Nebula_license.txt
 ///
 ///  OgreOpcode is free software; you can redistribute it and/or
-///  modify it under the terms of the GNU Lesser General Public
+///  modify it under the terms of the GNU Lesser General Public
 ///  License as published by the Free Software Foundation; either
 ///  version 2.1 of the License, or (at your option) any later version.
 ///
@@ -20,7 +20,7 @@
 ///  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
+///  You should have received a copy of the GNU Lesser General Public
 ///  License along with OgreOpcode; if not, write to the Free Software
 ///  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ///
diff --git a/src/components/ogre/ogreopcode/include/OgreOpcodeDebugObject.h b/src/components/ogre/ogreopcode/include/OgreOpcodeDebugObject.h
index 89bec2d..00de02c 100644
--- a/src/components/ogre/ogreopcode/include/OgreOpcodeDebugObject.h
+++ b/src/components/ogre/ogreopcode/include/OgreOpcodeDebugObject.h
@@ -10,7 +10,7 @@
 ///  A lot of the code is based on the Nebula Opcode Collision module, see docs/Nebula_license.txt
 ///  
 ///  OgreOpcode is free software; you can redistribute it and/or
-///  modify it under the terms of the GNU Lesser General Public
+///  modify it under the terms of the GNU Lesser General Public
 ///  License as published by the Free Software Foundation; either
 ///  version 2.1 of the License, or (at your option) any later version.
 ///  
@@ -19,7 +19,7 @@
 ///  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
+///  You should have received a copy of the GNU Lesser General Public
 ///  License along with OgreOpcode; if not, write to the Free Software
 ///  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ///  
@@ -60,7 +60,7 @@ namespace OgreOpcode
 
 		protected:
 
-			std::vector<Ogre::Vector3> _points;
+			std::vector<Ogre::Vector3, Ogre::STLAllocator<Ogre::Vector3, Ogre::CategorisedAlignAllocPolicy<Ogre::MEMCATEGORY_GEOMETRY> > > _points;
 			bool _drawn;
 		};
 #endif
diff --git a/src/components/ogre/sound/SoundAction.cpp b/src/components/ogre/sound/SoundAction.cpp
index bf6edef..0725da5 100644
--- a/src/components/ogre/sound/SoundAction.cpp
+++ b/src/components/ogre/sound/SoundAction.cpp
@@ -76,12 +76,11 @@ namespace EmberOgre
 
 		SoundGroup* newGroup = new SoundGroup();
 
-		std::list<SoundDefinition*>::const_iterator beg = groupModel->getSamplesBegin();
-		std::list<SoundDefinition*>::const_iterator end = groupModel->getSamplesEnd();
-		for (; beg != end; beg++)
+		const SoundGroupDefinition::SoundDefinitionStore& soundDefinitions = groupModel->getSoundDefinitions();
+		for (SoundGroupDefinition::SoundDefinitionStore::const_iterator I; I != soundDefinitions.end(); I++)
 		{
 			// Register Individual samples
-			SoundDefinition* thisModel = *beg;
+			const SoundDefinition& thisModel = *I;
 			newGroup->addSound(thisModel);
 		}
 
diff --git a/src/components/ogre/sound/SoundDefinition.cpp b/src/components/ogre/sound/SoundDefinition.cpp
index 5a51b8f..499f0ba 100644
--- a/src/components/ogre/sound/SoundDefinition.cpp
+++ b/src/components/ogre/sound/SoundDefinition.cpp
@@ -33,17 +33,17 @@ void SoundDefinition::setup(const std::string& filename, SoundGeneral::SoundSamp
 	mVolume = volume;
 }
 
-const std::string& SoundDefinition::getFilename()
+const std::string& SoundDefinition::getFilename() const
 {
 	return mFilename;
 }
 
-SoundGeneral::SoundSampleType SoundDefinition::getFormat()
+SoundGeneral::SoundSampleType SoundDefinition::getFormat() const
 {
 	return mSampleType;
 }
 
-float SoundDefinition::getVolume()
+float SoundDefinition::getVolume() const
 {
 	return mVolume;
 }
diff --git a/src/components/ogre/sound/SoundDefinition.h b/src/components/ogre/sound/SoundDefinition.h
index 5c8f86b..95cb5c7 100644
--- a/src/components/ogre/sound/SoundDefinition.h
+++ b/src/components/ogre/sound/SoundDefinition.h
@@ -44,17 +44,17 @@ public:
 	/**
 	* Return filename
 	*/
-	const std::string& getFilename();
+	const std::string& getFilename() const;
 
 	/**
 	* Return the format
 	*/
-	Ember::SoundGeneral::SoundSampleType getFormat();
+	Ember::SoundGeneral::SoundSampleType getFormat() const;
 
 	/**
 	* Return the sound Volume
 	*/
-	float getVolume();
+	float getVolume() const;
 
 protected:
 	
diff --git a/src/components/ogre/sound/SoundGroup.cpp b/src/components/ogre/sound/SoundGroup.cpp
index f594bf6..82642a3 100644
--- a/src/components/ogre/sound/SoundGroup.cpp
+++ b/src/components/ogre/sound/SoundGroup.cpp
@@ -147,9 +147,9 @@ void SoundGroupBinding::update()
 // 		}
 // 	}
 	
-	void SoundGroup::addSound(SoundDefinition* soundDef)
+	void SoundGroup::addSound(const SoundDefinition& soundDef)
 	{
-		BaseSoundSample* soundSample = EmberServices::getSingleton().getSoundService()->createOrRetrieveSoundSample(soundDef->getFilename());
+		BaseSoundSample* soundSample = EmberServices::getSingleton().getSoundService()->createOrRetrieveSoundSample(soundDef.getFilename());
 		if (soundSample)
 		{
 			mSamples.push_back(soundSample);
diff --git a/src/components/ogre/sound/SoundGroup.h b/src/components/ogre/sound/SoundGroup.h
index 1c89a00..9faf4a0 100644
--- a/src/components/ogre/sound/SoundGroup.h
+++ b/src/components/ogre/sound/SoundGroup.h
@@ -90,7 +90,7 @@ public:
 	*
 	* @param model A sound model containing definitions for the sample.
 	*/
-	void addSound(SoundDefinition* soundDef);
+	void addSound(const SoundDefinition& soundDef);
 
 	/**
 	* Set the group play order.
diff --git a/src/components/ogre/sound/SoundGroupDefinition.cpp b/src/components/ogre/sound/SoundGroupDefinition.cpp
index 44a9612..27c327f 100644
--- a/src/components/ogre/sound/SoundGroupDefinition.cpp
+++ b/src/components/ogre/sound/SoundGroupDefinition.cpp
@@ -34,27 +34,26 @@ namespace EmberOgre {
 
 SoundGroupDefinition::SoundGroupDefinition()
 {
-	mSamples.clear();
+}
+
+SoundGroupDefinition::~SoundGroupDefinition()
+{
+// 	for (SoundDefinitionStore::
 }
 
 void SoundGroupDefinition::insertSample(const std::string& name, SoundGeneral::SoundSampleType type, float volume)
 {
-	SoundDefinition* newDef = new SoundDefinition();
-	newDef->setup(name, type, volume);
+	SoundDefinition newDef;
+	newDef.setup(name, type, volume);
 	mSamples.push_back(newDef);
 
 	S_LOG_INFO("\t-Sample " << name << " created.");
 
 }
-		
-std::list<SoundDefinition*>::const_iterator SoundGroupDefinition::getSamplesBegin()
-{
-	return mSamples.begin();
-}
 
-std::list<SoundDefinition*>::const_iterator SoundGroupDefinition::getSamplesEnd()
+const SoundGroupDefinition::SoundDefinitionStore& SoundGroupDefinition::getSoundDefinitions() const
 {
-	return mSamples.end();
+	return mSamples;
 }
 
 
diff --git a/src/components/ogre/sound/SoundGroupDefinition.h b/src/components/ogre/sound/SoundGroupDefinition.h
index 153c0fb..156b501 100644
--- a/src/components/ogre/sound/SoundGroupDefinition.h
+++ b/src/components/ogre/sound/SoundGroupDefinition.h
@@ -38,26 +38,27 @@ class SoundDefinition;
 class SoundGroupDefinition
 {
 public:
-	typedef std::map<std::string, SoundGroupDefinition*> SoundGroupDefinitionStore;
+	typedef std::list<SoundDefinition> SoundDefinitionStore;
 	SoundGroupDefinition();
 	
+	virtual ~SoundGroupDefinition();
+	
 	/**
 	* Insert a sound sample into this group definition
 	*/
 	void insertSample(const std::string& name, Ember::SoundGeneral::SoundSampleType type, float volume);
 
 	/**
-	* Return an iterator to the first member of the list
-	*/
-	std::list<SoundDefinition*>::const_iterator getSamplesBegin();
-
-	/**
-	* Return an iterator to the last member of the list
-	*/
-	std::list<SoundDefinition*>::const_iterator getSamplesEnd();
+	 * @brief Accessor for the sound definitions store.
+	 * @return 
+	 */
+	const SoundDefinitionStore& getSoundDefinitions() const;
 
 private:
-	std::list<SoundDefinition*> mSamples;
+	/**
+	 * @brief The sounds defined for this group.
+	 */
+	SoundDefinitionStore mSamples;
 };
 
 }

commit b094ad29c01175f412018eb5d289233fc3e7c316
Author: Erik Hjortsberg <erik.hjortsberg at iteam.se>
Date:   Tue Feb 10 20:54:15 2009 +0100

    Use the correct memory allocation as required by Ogre.

diff --git a/src/components/ogre/terrain/TerrainPageFoliage.h b/src/components/ogre/terrain/TerrainPageFoliage.h
index a81ea70..295789d 100644
--- a/src/components/ogre/terrain/TerrainPageFoliage.h
+++ b/src/components/ogre/terrain/TerrainPageFoliage.h
@@ -27,6 +27,7 @@
 #include <OgreCommon.h>
 #include <OgreSharedPtr.h>
 #include <OgreDataStream.h>
+#include <OgreMemoryAllocatorConfig.h>
 
 namespace Ogre
 {
@@ -58,10 +59,10 @@ class TerrainLayerDefinition;
 class TerrainPageFoliage
 {
 public:
-	/**
+	/** 
 	A store of plant positions. We keep this in ogre space for performance reasons.
 	*/
-	typedef std::vector<Ogre::Vector2> PlantStore;
+	typedef std::vector<Ogre::Vector2, Ogre::STLAllocator<Ogre::Vector2, Ogre::CategorisedAlignAllocPolicy<Ogre::MEMCATEGORY_GEOMETRY> > > PlantStore;
 	typedef std::map<int, PlantStore> PlantBatchColumn;
 	typedef std::map<int, PlantBatchColumn> PlantBatchStore;
 	typedef std::map<std::string, PlantBatchStore> PlantStoreMap;

commit 166dc09076d798a380f8ce9fd8943d5edad11a64
Author: Erik Hjortsberg <erik.hjortsberg at iteam.se>
Date:   Sat Jan 24 19:18:46 2009 +0100

    Use the Ogre memory allocators for the Ogre log manager.

diff --git a/src/components/ogre/EmberOgre.cpp b/src/components/ogre/EmberOgre.cpp
index 6ef41b4..e8a19f6 100644
--- a/src/components/ogre/EmberOgre.cpp
+++ b/src/components/ogre/EmberOgre.cpp
@@ -247,7 +247,7 @@ EmberOgre::~EmberOgre()
 	
 	///Ogre is destroyed already, so we can't deregister this: we'll just destroy it
 	delete mLogObserver;
-	delete mOgreLogManager;
+	OGRE_DELETE mOgreLogManager;
 	
 	///delete this first after Ogre has been shut down, since it then deletes the EmberOgreFileSystemFactory instance, and that can only be done once Ogre is shutdown
 	delete mResourceLoader;
@@ -325,7 +325,7 @@ bool EmberOgre::setup()
 	mLogObserver = new OgreLogObserver();
 	
 	///if we do this we will override the automatic creation of a LogManager and can thus route all logging from ogre to the ember log
-	mOgreLogManager = new Ogre::LogManager();
+	mOgreLogManager = OGRE_NEW Ogre::LogManager();
 	Ogre::LogManager::getSingleton().createLog("Ogre", true, false, true);
 	Ogre::LogManager::getSingleton().getDefaultLog()->addListener(mLogObserver);
 

commit 84fe98c193ef8d88972f8bcfa1216140daf0d0a3
Author: Erik Hjortsberg <erik.hjortsberg at iteam.se>
Date:   Sat Jan 24 17:49:35 2009 +0100

    Correctly use the Ogre memory allocators.

diff --git a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/EmberPagingSceneManagerAdapter.cpp b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/EmberPagingSceneManagerAdapter.cpp
index f711b11..6ae7bbc 100644
--- a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/EmberPagingSceneManagerAdapter.cpp
+++ b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/EmberPagingSceneManagerAdapter.cpp
@@ -28,6 +28,7 @@
 #include "OgrePagingLandScapePageManager.h"
 #include "OgrePagingLandScapePage.h"
 #include "OgrePagingLandScapeData2DManager.h"
+#include "OgreMemoryAllocatorConfig.h"
 
 namespace EmberOgre {
 
@@ -105,7 +106,7 @@ namespace EmberOgre {
 			S_LOG_FAILURE("Could not find file "<< filePath);
 			return;
    		}
-		std::ifstream *filestream = new std::ifstream();
+		std::ifstream *filestream = OGRE_NEW_T(std::ifstream, Ogre::MEMCATEGORY_GENERAL)();
 		filestream->open(filePath.c_str(), std::ios::in);
 
 		if (filestream->fail())
@@ -116,7 +117,7 @@ namespace EmberOgre {
 		}
 
 		///this will envelope the file stream pointer and delete it when it's destroyed itself
-		Ogre::FileStreamDataStream* stream = new Ogre::FileStreamDataStream(filePath, filestream, theStat.st_size, true);
+		Ogre::FileStreamDataStream* stream = OGRE_NEW Ogre::FileStreamDataStream(filePath, filestream, theStat.st_size, true);
 		Ogre::DataStreamPtr dataPtr(stream);
 
         if (stream->size() == 0) {
diff --git a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeOptions.cpp b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeOptions.cpp
index e06fd6e..ad0e7d7 100644
--- a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeOptions.cpp
+++ b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeOptions.cpp
@@ -238,7 +238,7 @@ namespace Ogre
         {
             // Wrap as a stream
             DataStreamPtr stream(
-                new FileStreamDataStream(filename, &fs, false));
+                OGRE_NEW FileStreamDataStream(filename, &fs, false));
 
 	        config.load(stream);
 
diff --git a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeSceneManager.cpp b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeSceneManager.cpp
index a2a9e18..c466c94 100644
--- a/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeSceneManager.cpp
+++ b/src/components/ogre/SceneManagers/EmberPagingSceneManager/src/OgrePagingLandScapeSceneManager.cpp
@@ -233,7 +233,7 @@ namespace Ogre
 		if (fs)
 		{
 			// Wrap as a stream
-			DataStreamPtr myStream (new FileStreamDataStream (filename, &fs, false));
+			DataStreamPtr myStream (OGRE_NEW FileStreamDataStream (filename, &fs, false));
 			setWorldGeometry (myStream);
 			return;
 		}

commit 3cfc56eae51e9e7a959e7e82346492d1a68cc07c
Author: Erik Hjortsberg <erik.hjortsberg at iteam.se>
Date:   Sat Jan 24 17:23:29 2009 +0100

    Use the proper Ogre memory allocators.

diff --git a/src/components/ogre/EmberOgreFileSystem.cpp b/src/components/ogre/EmberOgreFileSystem.cpp
index aaa5b54..3042766 100644
--- a/src/components/ogre/EmberOgreFileSystem.cpp
+++ b/src/components/ogre/EmberOgreFileSystem.cpp
@@ -369,24 +369,24 @@ namespace EmberOgre {
         // Use filesystem to determine size
         // (quicker than streaming to the end and back)
         struct stat tagStat;
-	int ret = stat(full_path.c_str(), &tagStat);
+		int ret = stat(full_path.c_str(), &tagStat);
         assert(ret == 0 && "Problem getting file size" );
 
         // Always open in binary mode
-        std::ifstream *origStream = new std::ifstream();
+        std::ifstream *origStream = OGRE_NEW_T(std::ifstream, MEMCATEGORY_GENERAL)();
         origStream->open(full_path.c_str(), std::ios::in | std::ios::binary);
 
         // Should check ensure open succeeded, in case fail for some reason.
         if (origStream->fail())
         {
-            delete origStream;
+            OGRE_DELETE_T(origStream, basic_ifstream, MEMCATEGORY_GENERAL);
             OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND,
                 "Cannot open file: " + filename,
                 "FileSystemArchive::open");
         }
 
         /// Construct return stream, tell it to delete on destroy
-        FileStreamDataStream* stream = new FileStreamDataStream(filename,
+        FileStreamDataStream* stream = OGRE_NEW FileStreamDataStream(filename,
             origStream, tagStat.st_size, true);
         return DataStreamPtr(stream);
     }
@@ -394,7 +394,7 @@ namespace EmberOgre {
     StringVectorPtr FileSystemArchive::list(bool recursive, bool dirs)
     {
 		// directory change requires locking due to saved returns
-        StringVectorPtr ret(new StringVector());
+		StringVectorPtr ret(OGRE_NEW_T(StringVector, MEMCATEGORY_GENERAL)(), SPFM_DELETE_T);
 
         findFiles("*", recursive, dirs, ret.getPointer(), 0);
 
@@ -403,7 +403,7 @@ namespace EmberOgre {
     //-----------------------------------------------------------------------
     FileInfoListPtr FileSystemArchive::listFileInfo(bool recursive, bool dirs)
     {
-        FileInfoListPtr ret(new FileInfoList());
+        FileInfoListPtr ret(OGRE_NEW_T(FileInfoList, MEMCATEGORY_GENERAL)(), SPFM_DELETE_T);
 
         findFiles("*", recursive, dirs, 0, ret.getPointer());
 
@@ -413,7 +413,7 @@ namespace EmberOgre {
     StringVectorPtr FileSystemArchive::find(const String& pattern,
                                             bool recursive, bool dirs)
     {
-        StringVectorPtr ret(new StringVector());
+		StringVectorPtr ret(OGRE_NEW_T(StringVector, MEMCATEGORY_GENERAL)(), SPFM_DELETE_T);
 
         findFiles(pattern, recursive, dirs, ret.getPointer(), 0);
 
@@ -424,7 +424,7 @@ namespace EmberOgre {
     FileInfoListPtr FileSystemArchive::findFileInfo(const String& pattern,
         bool recursive, bool dirs)
     {
-        FileInfoListPtr ret(new FileInfoList());
+		FileInfoListPtr ret(OGRE_NEW_T(FileInfoList, MEMCATEGORY_GENERAL)(), SPFM_DELETE_T);
 
         findFiles(pattern, recursive, dirs, 0, ret.getPointer());
 


Index: ember.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ember/devel/ember.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ember.spec	1 Mar 2009 17:39:55 -0000	1.14
+++ ember.spec	2 Mar 2009 10:12:29 -0000	1.15
@@ -1,6 +1,6 @@
 Name:           ember
 Version:        0.5.5
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        3D client for WorldForge
 
 Group:          Amusements/Games
@@ -8,6 +8,7 @@
 URL:            http://www.worldforge.org/dev/eng/clients/ember
 Source0:        http://downloads.sourceforge.net/worldforge/%{name}-%{version}.tar.bz2
 Patch0:         ember-0.5.5-gcc44.patch
+Patch1:         ember-0.5.5-ogre161.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  SDL-devel tinyxml-devel DevIL-devel cegui-devel ogre-devel
@@ -25,6 +26,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 # Encoding fix
 iconv -f iso-8859-1 -t utf-8 AUTHORS > AUTHORS.conv && mv -f AUTHORS.conv AUTHORS
@@ -87,6 +89,9 @@
 
 
 %changelog
+* Mon Mar 02 2009 Alexey Torkhov <atorkhov at gmail.com> - 0.5.5-5
+- Update for new OGRE
+
 * Sun Mar 01 2009 Alexey Torkhov <atorkhov at gmail.com> - 0.5.5-4
 - Adding unowned directory
 




More information about the fedora-extras-commits mailing list