aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-07-27 04:23:22 +0000
committerTorbjörn Andersson2007-07-27 04:23:22 +0000
commit548a1394e1c3279b7674ac8ab7d8b3206f19e787 (patch)
tree254fa3bb4b040f4c1fbfc6bd64d8e4b5b927c619 /engines
parent178bf76aae147a2a78ff8165dece9afb71ddc876 (diff)
downloadscummvm-rg350-548a1394e1c3279b7674ac8ab7d8b3206f19e787.tar.gz
scummvm-rg350-548a1394e1c3279b7674ac8ab7d8b3206f19e787.tar.bz2
scummvm-rg350-548a1394e1c3279b7674ac8ab7d8b3206f19e787.zip
The strrev() function is non-standard. Replace with public domain version by
Bob Stout. (It would of course have been trivial to write my own, but Bob's version does it in place, which is quite magical.) svn-id: r28230
Diffstat (limited to 'engines')
-rw-r--r--engines/drascula/drascula.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index ff3b49f46d..f83e52f893 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -2048,8 +2048,8 @@ void DrasculaEngine::color_abc(int cl) {
palJuego[254][3] = 0;
} else if (cl == 7) {
palJuego[254][0] = 0x38;
- palJuego[254][1] = 0;
- palJuego[254][2] = 0;
+ palJuego[254][1] = 0;
+ palJuego[254][2] = 0;
palJuego[254][3] = 0;
} else if (cl == 8) {
palJuego[254][0] = 0x3F;
@@ -2080,6 +2080,22 @@ char DrasculaEngine::LimitaVGA(char valor) {
return (valor & 0x3F) * (valor > 0);
}
+// Public domain strrev() function by Bob Stout.
+// Should perhaps be moved to common/util.cpp or similar.
+
+static char *scumm_strrev(char *str) {
+ char *p1, *p2;
+
+ if (!str || !*str)
+ return str;
+ for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2) {
+ *p1 ^= *p2;
+ *p2 ^= *p1;
+ *p1 ^= *p2;
+ }
+ return str;
+}
+
void DrasculaEngine::centra_texto(char mensaje[], int x_texto, int y_texto) {
char bb[190], m2[190], m1[190] ,mb[10][40];
char m3[190];
@@ -2111,12 +2127,12 @@ void DrasculaEngine::centra_texto(char mensaje[], int x_texto, int y_texto) {
tut:
strcpy(bb, m1);
- strrev(bb);
+ scumm_strrev(bb);
if (x_texto1 < x_texto2) {
strcpy(m3, strrchr(m1, ' '));
strcpy(m1, strstr(bb, " "));
- strrev(m1);
+ scumm_strrev(m1);
m1[strlen(m1) - 1] = '\0';
strcat(m3, m2);
strcpy(m2, m3);
@@ -2129,9 +2145,9 @@ tut:
if (!strcmp(m2, ""))
goto imprimir;
- strrev(m2);
+ scumm_strrev(m2);
m2[strlen(m2) - 1] = '\0';
- strrev(m2);
+ scumm_strrev(m2);
strcpy(m1, m2);
strcpy(m2, "");
conta_f++;