aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/screen.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-12-03 21:30:41 +0000
committerTorbjörn Andersson2008-12-03 21:30:41 +0000
commita871e0115174040ca8a331ec80616605d3cad1a2 (patch)
treec06724888313200ac9418b080e6decbec685e1a4 /engines/sword2/screen.cpp
parent87db0af8a04ddd4673b6b43db69dc7ece30c2836 (diff)
downloadscummvm-rg350-a871e0115174040ca8a331ec80616605d3cad1a2.tar.gz
scummvm-rg350-a871e0115174040ca8a331ec80616605d3cad1a2.tar.bz2
scummvm-rg350-a871e0115174040ca8a331ec80616605d3cad1a2.zip
Converted the credits scroller to use readLine_NEW() instead of readLine_OLD().
svn-id: r35224
Diffstat (limited to 'engines/sword2/screen.cpp')
-rw-r--r--engines/sword2/screen.cpp42
1 files changed, 26 insertions, 16 deletions
diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp
index d656674a98..b552f385a9 100644
--- a/engines/sword2/screen.cpp
+++ b/engines/sword2/screen.cpp
@@ -932,7 +932,32 @@ void Screen::rollCredits() {
while (1) {
char buffer[80];
- char *line = f.readLine_OLD(buffer, sizeof(buffer));
+ char *line = f.readLine_NEW(buffer, sizeof(buffer));
+
+ if (line) {
+ // Replace invalid character codes prevent the 'dud'
+ // symbol from showing up in the credits.
+
+ for (byte *ptr = (byte *)line; *ptr; ptr++) {
+ switch (*ptr) {
+ case 9:
+ // The German credits contain these.
+ // Convert them to spaces.
+ *ptr = 32;
+ break;
+ case 10:
+ // LF is treated as end of line.
+ *ptr = 0;
+ break;
+ case 170:
+ // The Spanish credits contain these.
+ // Convert them to periods.
+ *ptr = '.';
+ default:
+ break;
+ }
+ }
+ }
if (!line || *line == 0) {
if (!hasCenterMark) {
@@ -950,21 +975,6 @@ void Screen::rollCredits() {
continue;
}
- // Replace invalid character codes to avoid the credits to show
- // the 'dud' symbol.
-
- for (byte *ptr = (byte *)line; *ptr; ptr++) {
- // The German credits contains character code 9. We
- // replace them with spaces.
- if (*ptr == 9)
- *ptr = 32;
-
- // The Spanish credits contains character code 170. We
- // replace them with dots.
- if (*ptr == 170)
- *ptr = '.';
- }
-
char *center_mark = strchr(line, '^');
if (center_mark) {