[Scummvm-git-logs] scummvm-tools master -> 4434fc6f19837dc2cef0e83ae8f1fd74ba9aa178
sev-
sev at scummvm.org
Mon Mar 9 14:46:49 UTC 2020
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
4a06f70d62 PRINCE: Built-in credits.pl file
6246065a9b PRINCE: Generate .po for translation, not for the original
5b307902d5 PRINCE: Add date to the credits for tracking translations.dat version
c2ccd50faa PRINCE: Added script for automatic generation of prince_translations.dat
4434fc6f19 PRINCE: Made pack_prince.cpp portable for the line endings
Commit: 4a06f70d62fa78942fa427f79f5eb7f1cccbcad0
https://github.com/scummvm/scummvm-tools/commit/4a06f70d62fa78942fa427f79f5eb7f1cccbcad0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-09T11:28:40+01:00
Commit Message:
PRINCE: Built-in credits.pl file
Changed paths:
engines/prince/po-parse.pl
diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl
index 7724e4fd9..56f7a43e2 100644
--- a/engines/prince/po-parse.pl
+++ b/engines/prince/po-parse.pl
@@ -133,22 +133,6 @@ sub process_mob($) {
close OUT;
}
-sub process_credits($) {
- my $file = shift;
-
- open(*OUT, ">$file") or die "Cannot open file $file: $!";
-
- print OUT "credits.dat\n";
-
- for my $n (sort {$a<=>$b} keys $data{'credits.txt'}) {
- $data{'credits.txt'}{$n} =~ s/\\n/\n/g;
-
- print OUT "$data{'credits.txt'}{$n}";
- }
-
- close OUT;
-}
-
sub process_talk($) {
my $file = shift;
@@ -237,3 +221,81 @@ sub process_talk($) {
close OUT;
}
+
+sub process_credits($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ print OUT <<EOF;
+credits.dat
+
+
+
+
+GALADOR - THE PRINCE AND THE COWARD
+v1.3 - ENGLISH
+
+
+
+
+#
+
+
+
+SCENARIO
+
+Adrian Chmielarz
+Jacek Piekara
+
+
+
+#
+GRAPHICS AND ANIMATION
+
+Andrzej Kukuta
+Grzegorz Miechowski
+Juliusz Gruber
+Pawet Piotrowski
+Andrzej Mitula
+Ireneusz Konior
+Pawet Miechowski
+
+#
+
+
+
+PROGRAMMING
+
+Maciej Marzec
+
+
+
+
+#
+
+MUSIC
+
+Karim Martusewicz
+
+SOUND EFFECTS
+
+Adam "Scorpik" Skorupa
+
+
+#
+
+
+
+ENGLISH LOCALIZATION
+
+ShinjiGR
+
+
+
+
+##
+EOF
+
+ close OUT;
+}
Commit: 6246065a9bd04d3cf9266728f6d202ad2a4877d9
https://github.com/scummvm/scummvm-tools/commit/6246065a9bd04d3cf9266728f6d202ad2a4877d9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-09T14:01:47+01:00
Commit Message:
PRINCE: Generate .po for translation, not for the original
Changed paths:
engines/prince/po-parse.pl
diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl
index 56f7a43e2..aa465869a 100644
--- a/engines/prince/po-parse.pl
+++ b/engines/prince/po-parse.pl
@@ -24,7 +24,9 @@ my $idx2 = "";
my $seenheader = 0;
my $inmsgid = 0;
+my $inmsgstr = 0;
our %data;
+our %data1;
open IN, $ARGV[1];
@@ -37,6 +39,8 @@ while (<IN>) {
$seenheader = 1;
+ $inmsgid = $inmsgstr = 0;
+
next;
}
@@ -45,6 +49,12 @@ while (<IN>) {
next;
}
+ if (/^msgstr ""$/) {
+ $inmsgid = 0;
+ $inmsgstr = 1;
+ next;
+ }
+
if (/^msgid (.*)$/) {
my $s = $1;
@@ -55,14 +65,30 @@ while (<IN>) {
$inmsgid = 0;
}
+ if (/^msgstr (.*)$/) {
+ my $s = $1;
+
+ $s =~ s/(^")|("$)//g;
+
+ $data1{$fname}{$idx1} = $s;
+
+ $inmsgstr = 0;
+ }
+
if (/^"(.*)"$/) {
if ($inmsgid) {
$data{$fname}{$idx1} .= $1;
+ } elsif ($inmsgstr) {
+ $data1{$fname}{$idx1} .= $1;
}
}
+}
- if (/^msgstr/) {
- $inmsgid = 0;
+for my $f (keys %data) {
+ for my $k (keys %{$data{$f}}) {
+ if (not exists $data1{$f}{$k}) {
+ warn "Missing msgstr $f:$k";
+ }
}
}
@@ -82,8 +108,8 @@ sub process_inv($) {
print OUT "invtxt.dat\n";
- for my $n (sort {$a<=>$b} keys $data{'invtxt.txt'}) {
- print OUT "$n. $data{'invtxt.txt'}{$n}\n";
+ for my $n (sort {$a<=>$b} keys $data1{'invtxt.txt'}) {
+ print OUT "$n. $data1{'invtxt.txt'}{$n}\n";
}
close OUT;
@@ -96,8 +122,8 @@ sub process_varia($) {
print OUT "variatxt.dat\n";
- for my $n (sort {$a<=>$b} keys $data{'variatxt.txt'}) {
- print OUT "$n. $data{'variatxt.txt'}{$n}\n";
+ for my $n (sort {$a<=>$b} keys $data1{'variatxt.txt'}) {
+ print OUT "$n. $data1{'variatxt.txt'}{$n}\n";
}
close OUT;
@@ -112,7 +138,7 @@ sub process_mob($) {
my $pn = 0;
- for my $n (sort {$a<=>$b} keys $data{'mob.lst'}) {
+ for my $n (sort {$a<=>$b} keys $data1{'mob.lst'}) {
my $p1 = int($n / 1000);
if ($p1 != $pn) {
@@ -123,7 +149,7 @@ sub process_mob($) {
}
$pn = $p1;
}
- print OUT "$data{'mob.lst'}{$n}\n";
+ print OUT "$data1{'mob.lst'}{$n}\n";
}
for my $i (($pn+1)..61) {
@@ -140,10 +166,10 @@ sub process_talk($) {
print OUT "talktxt.dat\n";
- for my $f (sort grep /^dialog/, keys %data) {
+ for my $f (sort grep /^dialog/, keys %data1) {
$f =~ /dialog(\d+)/;
my $dialog = $1;
- my $hasDialog = !!grep { $_ > 100 } keys $data{$f};
+ my $hasDialog = !!grep { $_ > 100 } keys $data1{$f};
if ($hasDialog) {
print OUT "\@DIALOGBOX_LINES:\n";
@@ -154,8 +180,8 @@ sub process_talk($) {
my $seenDialogBox = 0;
my $prevBox = -1;
- for my $n (sort {$a<=>$b} keys $data{$f}) {
- my $s = $data{$f}{$n};
+ for my $n (sort {$a<=>$b} keys $data1{$f}) {
+ my $s = $data1{$f}{$n};
if ($n < 100) {
while ($s =~ /^P#/) {
print OUT "#PAUSE\n";
Commit: 5b307902d51bd43ef1647cd730986bffda411c25
https://github.com/scummvm/scummvm-tools/commit/5b307902d51bd43ef1647cd730986bffda411c25
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-09T15:15:50+01:00
Commit Message:
PRINCE: Add date to the credits for tracking translations.dat version
Changed paths:
engines/prince/po-parse.pl
diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl
index aa465869a..68b7eccac 100644
--- a/engines/prince/po-parse.pl
+++ b/engines/prince/po-parse.pl
@@ -9,6 +9,7 @@ sub process_varia($);
sub process_mob($);
sub process_credits($);
sub process_talk($);
+sub convert_utf($$);
use open qw/:std :utf8/;
@@ -55,6 +56,8 @@ while (<IN>) {
next;
}
+ $_ = convert_utf $lang, $_;
+
if (/^msgid (.*)$/) {
my $s = $1;
@@ -93,14 +96,21 @@ for my $f (keys %data) {
}
-process_inv "invtxt.txt.out1";
-process_varia "variatxt.txt.out1";
-process_mob "mob.txt.out1";
-process_credits "credits.txt.out1";
-process_talk "talktxt.txt.out1";
+process_inv "invtxt.txt";
+process_varia "variatxt.txt";
+process_mob "mob.txt";
+process_credits "credits.txt";
+process_talk "talktxt.txt";
exit;
+sub convert_utf($$) {
+ my $lang = shift;
+ my $s = shift;
+
+ return $s;
+}
+
sub process_inv($) {
my $file = shift;
@@ -253,6 +263,8 @@ sub process_credits($) {
open(*OUT, ">$file") or die "Cannot open file $file: $!";
+ $now_string = gmtime;
+
print OUT <<EOF;
credits.dat
@@ -260,7 +272,8 @@ credits.dat
GALADOR - THE PRINCE AND THE COWARD
-v1.3 - ENGLISH
+v2.0 - ENGLISH
+Built on: $now_string
@@ -316,6 +329,7 @@ Adam "Scorpik" Skorupa
ENGLISH LOCALIZATION
ShinjiGR
+ScummVM Team
Commit: c2ccd50faa7145b76974e81289a14ebce61d91d5
https://github.com/scummvm/scummvm-tools/commit/c2ccd50faa7145b76974e81289a14ebce61d91d5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-09T15:45:49+01:00
Commit Message:
PRINCE: Added script for automatic generation of prince_translations.dat
Changed paths:
A engines/prince/gen-translations.sh
diff --git a/engines/prince/gen-translations.sh b/engines/prince/gen-translations.sh
new file mode 100755
index 000000000..19ac300d1
--- /dev/null
+++ b/engines/prince/gen-translations.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+cp -v ../../../scummvm/devtools/create_prince/en.po .
+perl po-parse.pl en en.po
+../../scummvm-tools-cli --tool pack_prince .
+cp prince_translation.dat ../../../scummvm/dists/engine-data/
Commit: 4434fc6f19837dc2cef0e83ae8f1fd74ba9aa178
https://github.com/scummvm/scummvm-tools/commit/4434fc6f19837dc2cef0e83ae8f1fd74ba9aa178
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-09T15:46:16+01:00
Commit Message:
PRINCE: Made pack_prince.cpp portable for the line endings
Changed paths:
engines/prince/pack_prince.cpp
diff --git a/engines/prince/pack_prince.cpp b/engines/prince/pack_prince.cpp
index d6902c955..5e266f04a 100644
--- a/engines/prince/pack_prince.cpp
+++ b/engines/prince/pack_prince.cpp
@@ -144,16 +144,16 @@ void PackPrince::packVariaTxt() {
// Header test
byte c;
std::string name, examTxt;
- while ((c = _databank.readByte()) != '\r') {
- name += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ name += c;
}
if (name.compare("variatxt.dat")) {
error("Wrong header in variatxt.txt");
}
// Skip comment until first number
- while ((c = _databank.readByte()) != '\r');
- _databank.readByte(); // skip '\n'
+ while ((c = _databank.readByte()) != '\n');
// Loading to array:
const int kVariaTxtSize = 6000;
@@ -175,7 +175,10 @@ void PackPrince::packVariaTxt() {
// Text:
newVariaTxt._txt.clear();
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -186,8 +189,6 @@ void PackPrince::packVariaTxt() {
// Set VariaTxt in array
variaTxtList[id]._txt = newVariaTxt._txt;
- // Skip '\n' and test eof
- _databank.readByte();
if ((uint)_databank.pos() == fileSize) {
break;
}
@@ -222,8 +223,9 @@ void PackPrince::packInvTxt() {
// Header test
byte c;
std::string name, examTxt;
- while ((c = _databank.readByte()) != '\r') {
- name += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ name += c;
}
if (name.compare("invtxt.dat")) {
error("Wrong header in invtxt.txt");
@@ -257,7 +259,10 @@ void PackPrince::packInvTxt() {
_databank.readByte(); // skip second space
// Exam text:
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -268,8 +273,6 @@ void PackPrince::packInvTxt() {
// Add new item to list
invTxtList[id] = newInvTxt;
- // Skip '\n' and test eof
- _databank.readByte();
if ((uint)_databank.pos() == fileSize) {
break;
} else {
@@ -314,13 +317,13 @@ void PackPrince::packCredits() {
// Header test
byte c;
std::string line;
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
if (line.compare("credits.dat")) {
error("Wrong header in credits.txt");
}
- _databank.readByte(); // skip '\n'
// Packing:
while (1) {
@@ -355,22 +358,24 @@ void PackPrince::packTalkTxt() {
// Header test
byte c;
std::string line;
- while ((c = idsFile.readByte()) != '\r') {
- line += c;
+ while ((c = idsFile.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
if (line.compare("talktxt_ids")) {
error("Wrong header in talktxt_ids.txt");
}
- idsFile.readByte(); // skip '\n'
// IDs loading
for (int i = 0; i < kSetStringValues; i++) {
int value = 0;
- while ((c = idsFile.readByte()) != '\r') {
+ while ((c = idsFile.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
value *= 10;
value += c - 48;
}
- idsFile.readByte(); // skip '\n'
setStringIdArray[i] = value;
}
idsFile.close();
@@ -381,13 +386,13 @@ void PackPrince::packTalkTxt() {
// Header test
line.clear();
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
if (line.compare("talktxt.dat")) {
error("Wrong header in talktxt.txt");
}
- _databank.readByte(); // skip '\n'
// Start pos of talkTxt file for later offset setting
int startTalkTxtPos = _fFiles.pos();
@@ -405,10 +410,10 @@ void PackPrince::packTalkTxt() {
while (1) {
line.clear();
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
- _databank.readByte(); // skip '\n'
for (int i = 0; i < kSetStringValues; i++) {
if (id == setStringIdArray[i]) {
@@ -453,10 +458,10 @@ void PackPrince::talkTxtWithDialog() {
while (1) {
// Special dialog data
line.clear();
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
- _databank.readByte(); // skip '\n'
if (!line.compare("#HERO")) {
tempTalkBeforeBox._dialogData = 1;
@@ -476,7 +481,10 @@ void PackPrince::talkTxtWithDialog() {
// Line of text
tempTalkBeforeBox._txt.clear();
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -485,7 +493,6 @@ void PackPrince::talkTxtWithDialog() {
}
c = 0;
tempTalkBeforeBox._txt += c;
- _databank.readByte(); // skip '\n'
beforeDialogBoxArray.push_back(tempTalkBeforeBox);
}
@@ -520,16 +527,21 @@ void PackPrince::talkTxtWithDialog() {
// Text number
int textNr = 0;
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
textNr *= 10;
textNr += c - 48;
}
tempDialogBoxLine._dialogData = textNr;
- _databank.readByte(); // skip '\n'
// Line of text
tempDialogBoxLine._txt.clear();
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -538,7 +550,6 @@ void PackPrince::talkTxtWithDialog() {
}
c = 0;
tempDialogBoxLine._txt += c;
- _databank.readByte(); // skip '\n'
allDialogBoxesArray[dbNr].push_back(tempDialogBoxLine);
}
@@ -559,12 +570,12 @@ void PackPrince::talkTxtWithDialog() {
while (1) {
// Special dialog data
line.clear();
- while ((c = _databank.readByte()) != '\r' && c != ' ') {
- line += c;
+ while ((c = _databank.readByte()) != '\n' && c != ' ') {
+ if (c != '\r')
+ line += c;
}
// Check if #END
if (!line.compare("#END")) {
- _databank.readByte(); // skip '\n'
break;
}
if (!line.compare("#HERO")) {
@@ -576,14 +587,16 @@ void PackPrince::talkTxtWithDialog() {
} else if (!line.compare("#PAUSE")) {
tempDialogOptionsLine._dialogData = 254;
tempDialogOptionsLine._txt.clear();
- _databank.readByte(); // skip '\n'
allDialogOptionsArray[dbOptNr].push_back(tempDialogOptionsLine);
continue;
} else {
if (!line.compare("#ENABLE")) { // 0 - 15
tempDialogOptionsLine._dialogData = 240;
uint8 value = 0;
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
value *= 10;
value += c - 48;
}
@@ -603,16 +616,16 @@ void PackPrince::talkTxtWithDialog() {
tempDialogOptionsLine._txt += _databank.readByte() - 48;
_databank.readByte(); // skip '\r'
}
- _databank.readByte(); // skip '\n'
allDialogOptionsArray[dbOptNr].push_back(tempDialogOptionsLine);
continue;
}
- _databank.readByte(); // skip '\n'
-
// Line of text
tempDialogOptionsLine._txt.clear();
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -621,16 +634,15 @@ void PackPrince::talkTxtWithDialog() {
}
c = 0;
tempDialogOptionsLine._txt += c;
- _databank.readByte(); // skip '\n'
allDialogOptionsArray[dbOptNr].push_back(tempDialogOptionsLine);
}
dbOptNr++;
// Check if #ENDEND, skip @DIALOG_OPT %d
line.clear();
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
- _databank.readByte(); // skip '\n'
if (!line.compare("#ENDEND")) {
break;
}
@@ -713,10 +725,10 @@ void PackPrince::talkTxtNoDialog() {
// Special dialog data
line.clear();
- while ((c = _databank.readByte()) != '\r') {
- line += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ line += c;
}
- _databank.readByte(); // skip '\n'
if (!line.compare("#HERO")) {
tempNormalLine._dialogData = 1;
@@ -733,7 +745,7 @@ void PackPrince::talkTxtNoDialog() {
break;
} else {
if (line[0] == '#') {
- printf("UNKNOWN pragma: %s", line.c_str());
+ printf("UNKNOWN pragma: %s\n", line.c_str());
break;
} else {
tempNormalLine._txt = line;
@@ -746,7 +758,10 @@ void PackPrince::talkTxtNoDialog() {
if (havePragma) {
// Line of text
tempNormalLine._txt.clear();
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -755,7 +770,6 @@ void PackPrince::talkTxtNoDialog() {
}
c = 0;
tempNormalLine._txt += c;
- _databank.readByte(); // skip '\n'
}
normalLinesArray.push_back(tempNormalLine);
@@ -778,13 +792,13 @@ void PackPrince::packMobs() {
// Header test
byte c;
std::string name, examTxt;
- while ((c = _databank.readByte()) != '\r') {
- name += c;
+ while ((c = _databank.readByte()) != '\n') {
+ if (c != '\r')
+ name += c;
}
if (name.compare("mob.lst")) {
error("Wrong header in mob.txt");
}
- _databank.readByte(); // skip '\n'
// Skip comment until first location nr
while ((c = _databank.readByte()) != '\n');
@@ -817,8 +831,8 @@ void PackPrince::packMobs() {
nr += c - 48;
}
nr--;
- _databank.readByte(); // skip '\r'
- _databank.readByte(); // skip '\n'
+ if (_databank.readByte() == '\r') // skip '\r'
+ _databank.readByte(); // skip '\n'
} else {
c = correctPolishLetter(c); // temporary
newMob._name += c; // first letter of name
@@ -847,7 +861,10 @@ void PackPrince::packMobs() {
_databank.readByte(); // skip second space
// Exam text:
- while ((c = _databank.readByte()) != '\r') {
+ while ((c = _databank.readByte()) != '\n') {
+ if (c == '\r')
+ continue;
+
c = correctPolishLetter(c); // temporary
if (c == '|') {
c = 10;
@@ -863,9 +880,6 @@ void PackPrince::packMobs() {
newMob._examTxt += c;
}
- // Skip '\n'
- _databank.readByte();
-
// Add new item to list
allLocations[nr].push_back(newMob);
}
More information about the Scummvm-git-logs
mailing list