[Scummvm-git-logs] scummvm master -> 2165b74060868e532a8b10be9d3b5a06fd7a3362

sev- sev at scummvm.org
Tue Feb 25 00:04:46 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2165b74060 DIRECTOR: Added explanatory comments


Commit: 2165b74060868e532a8b10be9d3b5a06fd7a3362
    https://github.com/scummvm/scummvm/commit/2165b74060868e532a8b10be9d3b5a06fd7a3362
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-25T01:04:26+01:00

Commit Message:
DIRECTOR: Added explanatory comments

Changed paths:
    engines/director/util.cpp


diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index a7f27d0302..718491651e 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -214,13 +214,14 @@ Common::String convertMacFilename(const char *name) {
 	while (myIsSpace(*ptr))
 		ptr--;
 
-	/* Count suffix digits (up to whole filename less a character). */
 	int numDigits = 0;
 	char digits[10];
 
+	// Count trailing digits, but leave front letter
 	while (myIsDigit(*ptr) && (numDigits < (8 - 1)))
 		digits[++numDigits] = *ptr--;
 
+	// Count file name without vowels, spaces and digits in-between
 	ptr = name;
 	int cnt = 0;
 	while (cnt < (8 - numDigits) && ptr < &name[origlen]) {
@@ -235,8 +236,11 @@ Common::String convertMacFilename(const char *name) {
 		cnt++;
 	}
 
+	// Make sure all trailing digits fit
 	int numVowels = 8 - (numDigits + cnt);
 	ptr = name;
+
+	// Put enough characters from beginning
 	for (cnt = 0; cnt < (8 - numDigits) && ptr < &name[origlen];) {
 		char c = toupper(*ptr++);
 
@@ -255,7 +259,7 @@ Common::String convertMacFilename(const char *name) {
 		cnt++;
 	}
 
-
+	// Now attach all digits
 	while (numDigits)
 		res += digits[numDigits--];
 




More information about the Scummvm-git-logs mailing list