Преглед на файлове

Merge branch 'master' of https://github.com/taylor001/crown

mikymod преди 12 години
родител
ревизия
e0ff2a1780

+ 2 - 1
engine/compilers/BundleCompiler.cpp

@@ -24,6 +24,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 */
 
+#include <inttypes.h>
 #include "BundleCompiler.h"
 #include "Vector.h"
 #include "DynamicString.h"
@@ -67,7 +68,7 @@ bool BundleCompiler::compile(const char* bundle_dir, const char* source_dir)
 		uint32_t resource_type_hash = hash::murmur2_32(filename_extension, string::strlen(filename_extension), 0);
 
 		char out_name[65];
-		snprintf(out_name, 65, "%.16llx", filename_hash);
+		snprintf(out_name, 65, "%"PRIx64"", filename_hash);
 
 		Log::i("%s <= %s", out_name, filename);
 

+ 4 - 1
engine/resource/FileBundle.cpp

@@ -25,6 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 */
 
 #include <stdio.h>
+#include <inttypes.h>
 
 #include "Allocator.h"
 #include "Bundle.h"
@@ -61,7 +62,7 @@ public:
 	{
 		// Convert name/type into strings
 		char resource_name[512];
-		snprintf(resource_name, 512, "%.16llx", name.id);
+		snprintf(resource_name, 512, "%"PRIx64"", name.id);
 		
 		// Search the resource in the filesystem
 		// bool exists = m_filesystem.exists(resource_name);
@@ -70,6 +71,8 @@ public:
 		// Open the resource and check magic number/version
 		File* file = m_filesystem.open(resource_name, FOM_READ);
 
+		CE_ASSERT(file != NULL, "Resource %s does not exist", resource_name);
+
 		ResourceHeader header;
 		file->read(&header, sizeof(ResourceHeader));
 

+ 0 - 1
engine/resource/LuaResource.h

@@ -53,7 +53,6 @@ public:
 	static void* load(Allocator& allocator, Bundle& bundle, ResourceId id)
 	{
 		File* file = bundle.open(id);
-		CE_ASSERT(file != NULL, "Resource does not exist: %.16llx", id.id);
 
 		const size_t file_size = file->size() - 12;
 		LuaResource* res = (LuaResource*) allocator.allocate(sizeof(LuaResource));

+ 0 - 2
engine/resource/MeshResource.h

@@ -56,8 +56,6 @@ public:
 	{
 		File* file = bundle.open(id);
 
-		CE_ASSERT(file != NULL, "Resource does not exist: %.16llx", id.id);
-
 		MeshResource* resource = (MeshResource*)allocator.allocate(sizeof(MeshResource));
 		file->read(&resource->m_header, sizeof(MeshHeader));
 

+ 5 - 5
engine/resource/ResourceManager.cpp

@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 */
 
 #include <algorithm>
-
+#include <inttypes.h>
 #include "Types.h"
 #include "ResourceManager.h"
 #include "ResourceRegistry.h"
@@ -63,7 +63,7 @@ ResourceId ResourceManager::load(const char* type, const char* name)
 //-----------------------------------------------------------------------------
 void ResourceManager::unload(ResourceId name)
 {
-	CE_ASSERT(has(name), "Resource not loaded: %.16llx", name.id);
+	CE_ASSERT(has(name), "Resource not loaded:" "%"PRIx64"", name.id);
 
 	ResourceEntry* entry = find(name);
 
@@ -87,7 +87,7 @@ bool ResourceManager::has(ResourceId name) const
 //-----------------------------------------------------------------------------
 const void* ResourceManager::data(ResourceId name) const
 {
-	CE_ASSERT(has(name), "Resource not loaded: %.16llx", name.id);
+	CE_ASSERT(has(name), "Resource not loaded:" "%"PRIx64"", name.id);
 
 	return find(name)->resource;
 }
@@ -95,7 +95,7 @@ const void* ResourceManager::data(ResourceId name) const
 //-----------------------------------------------------------------------------
 bool ResourceManager::is_loaded(ResourceId name) const
 {
-	CE_ASSERT(has(name), "Resource not loaded: %.16llx", name.id);
+	CE_ASSERT(has(name), "Resource not loaded:" "%"PRIx64"", name.id);
 
 	return find(name)->resource != NULL;
 }
@@ -103,7 +103,7 @@ bool ResourceManager::is_loaded(ResourceId name) const
 //-----------------------------------------------------------------------------
 uint32_t ResourceManager::references(ResourceId name) const
 {
-	CE_ASSERT(has(name), "Resource not loaded: %.16llx", name.id);
+	CE_ASSERT(has(name), "Resource not loaded:" "%"PRIx64"", name.id);
 
 	return find(name)->references;
 }

+ 0 - 2
engine/resource/SoundResource.h

@@ -53,8 +53,6 @@ public:
 	{
 		File* file = bundle.open(id);
 
-		CE_ASSERT(file != NULL, "Resource does not exist: %.16llx", id.id);
-
 		SoundResource* resource = (SoundResource*)allocator.allocate(sizeof(SoundResource));
 
 		file->read(&resource->m_header, sizeof(SoundHeader));

+ 0 - 2
engine/resource/TextureResource.h

@@ -57,8 +57,6 @@ public:
 	{
 		File* file = bundle.open(id);
 
-		CE_ASSERT(file != NULL, "Resource does not exist: %.16llx", id.id);
-
 		TextureResource* resource = (TextureResource*)allocator.allocate(sizeof(TextureResource));
 
 		file->read(&resource->m_header, sizeof(TextureHeader));