From 8b0e30d3798cd5bdce2c3a34a3c384e90dceac99 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 26 Apr 2005 00:04:45 +0000 Subject: Changed keyboard control to integrate better with mouse walk, changed location of packet.list and chatlog.txt and removed name from player chat "balloon". --- src/resources/resourcemanager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/resources/resourcemanager.cpp') diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index b26aeb5d..8606816e 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -286,16 +286,19 @@ void *ResourceManager::loadFile(const std::string &fileName, int &fileSize) PHYSFS_file* file = PHYSFS_openRead(fileName.c_str()); // If the handler is an invalid pointer indicate failure - if (file == NULL) return NULL; + if (file == NULL) { + logger.log("Warning: %s failed to load!", fileName.c_str()); + return NULL; + } - // Print file information message + // Get the size of the file fileSize = PHYSFS_fileLength(file); - // Allocate memory in the buffer and load the file + // Allocate memory and load the file void *buffer = malloc(fileSize); PHYSFS_read(file, buffer, 1, fileSize); - // Close the file and let the user deallocate the memory (safe?) + // Close the file and let the user deallocate the memory PHYSFS_close(file); return buffer; -- cgit v1.2.3-70-g09d2