diff options
author | Colin Snover | 2017-12-06 16:23:48 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-18 16:30:05 +0200 |
commit | 0851a30769c6307796d6866da073632c83d61185 (patch) | |
tree | 0d58a312ac337d5fbf5a70c51758ead2de7f8189 /engines/agi/agi.h | |
parent | 4db0f20f4797ae909edb785e9a8b03c095386feb (diff) | |
download | scummvm-rg350-0851a30769c6307796d6866da073632c83d61185.tar.gz scummvm-rg350-0851a30769c6307796d6866da073632c83d61185.tar.bz2 scummvm-rg350-0851a30769c6307796d6866da073632c83d61185.zip |
AGI: Replace use of strdup with Common::String
It was also necessary to make sure that the Common::String objects
were initialised correctly by switching to use a C++ container
for engine objects instead of calloc, since they were no longer
C-compatible PODs.
Diffstat (limited to 'engines/agi/agi.h')
-rw-r--r-- | engines/agi/agi.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 2294593427..02a406e6e9 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -31,6 +31,7 @@ #include "common/rect.h" #include "common/rendermode.h" #include "common/stack.h" +#include "common/str.h" #include "common/system.h" #include "engines/engine.h" @@ -354,7 +355,7 @@ struct AgiControllerKeyMapping { struct AgiObject { int location; - char *name; + Common::String name; }; struct AgiDir { @@ -763,7 +764,7 @@ private: int _firstSlot; public: - AgiObject *_objects; // objects in the game + Common::Array<AgiObject> _objects; // objects in the game StringData _stringdata; @@ -852,14 +853,12 @@ public: int showObjects(); int loadObjects(const char *fname); int loadObjects(Common::File &fp); - void unloadObjects(); const char *objectName(uint16 objectNr); int objectGetLocation(uint16 objectNr); void objectSetLocation(uint16 objectNr, int); private: int decodeObjects(uint8 *mem, uint32 flen); int readObjects(Common::File &fp, int flen); - int allocObjects(int); // Logic public: |