[Scummvm-git-logs] scummvm-tools master -> a8c0871c64b1b186779ec07a9008621dae487298
sev-
sev at scummvm.org
Sat Mar 28 18:13:28 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
a8c0871c64 PRINCE: Generate empty moblist names and pack them accordingly
Commit: a8c0871c64b1b186779ec07a9008621dae487298
https://github.com/scummvm/scummvm-tools/commit/a8c0871c64b1b186779ec07a9008621dae487298
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-28T19:09:37+01:00
Commit Message:
PRINCE: Generate empty moblist names and pack them accordingly
Changed paths:
engines/prince/extract_prince.cpp
engines/prince/pack_prince.cpp
diff --git a/engines/prince/extract_prince.cpp b/engines/prince/extract_prince.cpp
index d24e83b58..eb1814962 100644
--- a/engines/prince/extract_prince.cpp
+++ b/engines/prince/extract_prince.cpp
@@ -204,9 +204,8 @@ void ExtractPrince::exportMobs(FileData fileData) {
mobName += c;
namePointer++;
}
- if (mobName.size()) {
- _fFiles.print("%s - ", mobName.c_str());
- }
+
+ _fFiles.print("%s - ", mobName.c_str());
byte *examPointer = fileData._fileTable + examTextOffset;
mobExamText.clear();
@@ -235,9 +234,8 @@ void ExtractPrince::exportMobs(FileData fileData) {
}
};
}
- if (mobName.size()) {
- _fFiles.print("\n");
- }
+ _fFiles.print("\n");
+
streamPos += kMobsStructSize;
}
free(fileData._fileTable);
diff --git a/engines/prince/pack_prince.cpp b/engines/prince/pack_prince.cpp
index 5e266f04a..c0235a591 100644
--- a/engines/prince/pack_prince.cpp
+++ b/engines/prince/pack_prince.cpp
@@ -823,12 +823,12 @@ void PackPrince::packMobs() {
}
// Test if end of location - next number
- if ((c = _databank.readByte()) > 47 && c < 58) {
+ if ((c = _databank.readByte()) >= '0' && c <= '9') {
// Set location nr:
- nr = c - 48;
+ nr = c - '0';
while ((c = _databank.readByte()) != '.') {
nr *= 10;
- nr += c - 48;
+ nr += c - '0';
}
nr--;
if (_databank.readByte() == '\r') // skip '\r'
@@ -844,12 +844,16 @@ void PackPrince::packMobs() {
}
// No mobs in this location
- if ((c = _databank.readByte()) > 47 && c < 58) {
+ if ((c = _databank.readByte()) >= '0' && c <= '9') {
_databank.seek(-1, SEEK_CUR);
continue;
} else {
- c = correctPolishLetter(c); // temporary
- newMob._name += c;
+ if (c == '-') {
+ _databank.seek(-1, SEEK_CUR);
+ } else {
+ c = correctPolishLetter(c); // temporary
+ newMob._name += c;
+ }
}
// Name:
@@ -858,7 +862,8 @@ void PackPrince::packMobs() {
newMob._name += c;
}
newMob._name.erase(newMob._name.size() - 1); // remove first space
- _databank.readByte(); // skip second space
+ if (_databank.readByte() != ' ') // skip second space
+ _databank.seek(-1, SEEK_CUR);
// Exam text:
while ((c = _databank.readByte()) != '\n') {
More information about the Scummvm-git-logs
mailing list