MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / permutateObjectFilename

Function permutateObjectFilename

src/OpenLoco/src/Objects/ObjectManager.cpp:678–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676 }
677
678 static void permutateObjectFilename(std::string& filename)
679 {
680 auto* firstChar = filename.c_str();
681 auto* endChar = &filename[filename.size()];
682 auto* c = endChar;
683 do
684 {
685 c--;
686 if (c == firstChar)
687 {
688 filename = "00000000";
689 break;
690 }
691 if (*c < '0')
692 {
693 *c = '/';
694 }
695 if (*c == '9')
696 {
697 *c = '@';
698 }
699 if (*c == 'Z')
700 {
701 *c = '/';
702 }
703 *c = *c + 1;
704 } while (*c == '0');
705 }
706
707 // All object files are based on their internal object header name but
708 // there is a chance of a name collision this function works out if the name

Callers 1

findCustomObjectPathFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected