diff options
author | Sven Hesse | 2009-05-31 02:15:43 +0000 |
---|---|---|
committer | Sven Hesse | 2009-05-31 02:15:43 +0000 |
commit | 896df6daf337bf83f27193918eb386321c4b0166 (patch) | |
tree | c124f8f102052cdd6207e2507d097aff4bc7f44e /engines/gob/helper.h | |
parent | c938667d4b60005a926007376305f3da8621f7c7 (diff) | |
download | scummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.tar.gz scummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.tar.bz2 scummvm-rg350-896df6daf337bf83f27193918eb386321c4b0166.zip |
- A new save system for the GobEngine, one that is not fundamentally broken and is versioned. Unfortunately, this invalidates most save games created on big-endian machines, since endian-issues was a main problem with the old system
- Removed the now superfluous variables sizes
svn-id: r41056
Diffstat (limited to 'engines/gob/helper.h')
-rw-r--r-- | engines/gob/helper.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/gob/helper.h b/engines/gob/helper.h index 3e4e3387bc..5bedf81014 100644 --- a/engines/gob/helper.h +++ b/engines/gob/helper.h @@ -49,6 +49,22 @@ inline char *strdupcpy(const char *str) { return nstr; } +/** A strcat that new[]s the buffer. */ +inline char *strdupcat(const char *str1, const char *str2) { + if (!str1 || !str2) + return 0; + + size_t len1 = strlen(str1); + size_t len2 = strlen(str2); + + char *nstr = new char[len1 + len2 + 1]; + + memcpy(nstr, str1, len1); + memcpy(nstr + len1, str2, len2 + 1); + + return nstr; +} + /** A "smart" reference counting templated class. */ template<typename T> class ReferenceCounter { |