[Scummvm-cvs-logs] SF.net SVN: scummvm:[55598] tools/trunk/engines/mohawk/construct_mohawk.cpp
tdhs at users.sourceforge.net
tdhs at users.sourceforge.net
Fri Jan 28 19:58:14 CET 2011
Revision: 55598
http://scummvm.svn.sourceforge.net/scummvm/?rev=55598&view=rev
Author: tdhs
Date: 2011-01-28 18:58:12 +0000 (Fri, 28 Jan 2011)
Log Message:
-----------
TOOLS: Add code to construct_mohawk to deal with '/' and '\' in names as per extract_mohawk.
Modified Paths:
--------------
tools/trunk/engines/mohawk/construct_mohawk.cpp
Modified: tools/trunk/engines/mohawk/construct_mohawk.cpp
===================================================================
--- tools/trunk/engines/mohawk/construct_mohawk.cpp 2011-01-28 17:29:08 UTC (rev 55597)
+++ tools/trunk/engines/mohawk/construct_mohawk.cpp 2011-01-28 18:58:12 UTC (rev 55598)
@@ -490,8 +490,22 @@
printf("resourceId : %d\n", resourceId);
Common::String resourceName;
- if (resourceFilename[nameStart] == '_')
- resourceName = Common::String(resourceFilename+nameStart+1, strlen(resourceFilename));
+ if (resourceFilename[nameStart] == '_') {
+ resourceName = Common::String(resourceFilename+nameStart+1, resourceFilename+strlen(resourceFilename));
+
+ for (uint j = 0; j < resourceName.size(); j++) {
+ //printf("DEBUG: j: %d resourceName[j]: %c\n", j, resourceName[j]);
+ if (resourceName[j] == '\\') {
+ if (j+1 < resourceName.size() && resourceName[j+1] == '\\') {
+ //printf("\tUnpadded \ at %d\n", j);
+ resourceName.deleteChar(j);
+ } else {
+ //printf("\tReplaced \ at %d with %c\n", j, '/');
+ resourceName.setChar('/', j);
+ }
+ }
+ }
+ }
printf("resourceName : \"%s\"\n", resourceName.c_str());
Common::File *resourceIn = new Common::File(resourceFile, "rb");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list