aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/saga.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga/saga.h')
-rw-r--r--engines/saga/saga.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 34937c5131..589be1becc 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -381,30 +381,21 @@ struct ImageHeader {
};
struct StringsTable {
- byte *stringsPointer;
- int stringsCount;
- const char **strings;
+ Common::Array<char> buffer;
+ Common::Array<char *> strings;
- const char *getString(int index) const {
- if ((stringsCount <= index) || (index < 0)) {
+ const char *getString(uint index) const {
+ if ((strings.size() <= index) || (index < 0)) {
// This occurs at the end of Ted's chapter, right after the ending cutscene
- warning("StringsTable::getString wrong index 0x%X (%d)", index, stringsCount);
+ warning("StringsTable::getString wrong index 0x%X (%d)", index, strings.size());
return "";
}
return strings[index];
}
- void freeMem() {
- free(strings);
- free(stringsPointer);
- memset(this, 0, sizeof(*this));
- }
-
- StringsTable() {
- memset(this, 0, sizeof(*this));
- }
- ~StringsTable() {
- freeMem();
+ void clear() {
+ strings.clear();
+ buffer.clear();
}
};