diff options
-rw-r--r-- | common/util.cpp | 13 | ||||
-rw-r--r-- | common/util.h | 1 | ||||
-rw-r--r-- | engines/drascula/drascula.cpp | 19 |
3 files changed, 16 insertions, 17 deletions
diff --git a/common/util.cpp b/common/util.cpp index fc5fe9a4e5..b38dfa6664 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -592,3 +592,16 @@ void CDECL warning(const char *s, ...) { #endif #endif } + +char *scumm_strrev(char *str) { + if (!str) + return str; + int len = strlen(str); + if (len < 2) + return str; + char *p1, *p2; + for (p1 = str, p2 = str + len - 1; p1 < p2; p1++, p2--) { + SWAP(*p1, *p2); + } + return str; +} diff --git a/common/util.h b/common/util.h index 2325ba523a..0d63af0878 100644 --- a/common/util.h +++ b/common/util.h @@ -289,5 +289,6 @@ void CDECL debugC(int level, uint32 engine_level, const char *s, ...) GCC_PRINTF extern int gDebugLevel; +char *scumm_strrev(char *str); #endif diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index f83e52f893..cff57d0ab5 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $UR$ + * $URL$ * $Id$ * */ @@ -29,6 +29,7 @@ #include "common/file.h" #include "common/savefile.h" #include "common/config-manager.h" +//#include "common/util.h" #include "base/plugins.h" #include "base/version.h" @@ -2080,22 +2081,6 @@ 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]; |