瀏覽代碼

Do not read the resource seed in ResourceManager

Daniele Bartolini 12 年之前
父節點
當前提交
bac3f13613
共有 2 個文件被更改,包括 3 次插入20 次删除
  1. 2 19
      engine/resource/ResourceManager.cpp
  2. 1 1
      engine/resource/ResourceManager.h

+ 2 - 19
engine/resource/ResourceManager.cpp

@@ -25,41 +25,24 @@ OTHER DEALINGS IN THE SOFTWARE.
 */
 */
 
 
 #include <algorithm>
 #include <algorithm>
-#include <cstdio>
 
 
 #include "Types.h"
 #include "Types.h"
 #include "ResourceManager.h"
 #include "ResourceManager.h"
 #include "ResourceRegistry.h"
 #include "ResourceRegistry.h"
-#include "Allocator.h"
 #include "StringUtils.h"
 #include "StringUtils.h"
 #include "Hash.h"
 #include "Hash.h"
-#include "Device.h"
-#include "Filesystem.h"
-#include "TextReader.h"
-#include "DiskFile.h"
 #include "TempAllocator.h"
 #include "TempAllocator.h"
-#include "List.h"
 
 
 namespace crown
 namespace crown
 {
 {
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-ResourceManager::ResourceManager(Bundle& bundle) :
+ResourceManager::ResourceManager(Bundle& bundle, uint32_t seed) :
 	m_resource_heap("resource", default_allocator()),
 	m_resource_heap("resource", default_allocator()),
 	m_loader(bundle, m_resource_heap),
 	m_loader(bundle, m_resource_heap),
-	m_seed(0),
+	m_seed(seed),
 	m_resources(default_allocator())
 	m_resources(default_allocator())
 {
 {
-	DiskFile* seed_file = device()->filesystem()->open("seed.ini", FOM_READ);
-	TextReader reader(*seed_file);
-
-	char tmp_buf[32];
-	reader.read_string(tmp_buf, 32);
-
-	device()->filesystem()->close(seed_file);
-
-	sscanf(tmp_buf, "%u", &m_seed);
-
 	m_loader.start();
 	m_loader.start();
 }
 }
 
 

+ 1 - 1
engine/resource/ResourceManager.h

@@ -54,7 +54,7 @@ class ResourceManager
 public:
 public:
 
 
 	/// The resources will be loaded from @a bundle.
 	/// The resources will be loaded from @a bundle.
-							ResourceManager(Bundle& bundle);
+							ResourceManager(Bundle& bundle, uint32_t seed);
 							~ResourceManager();
 							~ResourceManager();
 
 
 	/// Loads the resource by @a name and returns its ResourceId.
 	/// Loads the resource by @a name and returns its ResourceId.