From 9e9c38c68939f59b6e577a8225e38235f5ae2f45 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 9 Jun 2008 14:23:04 +0000 Subject: Bugfix to read the first array element correctly by sev svn-id: r32634 --- engines/drascula/drascula.cpp | 3 ++- engines/drascula/drascula.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index c300066f4f..32ece3cd8a 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -930,10 +930,11 @@ char ***DrasculaEngine::loadTexts(Common::File &in) { res[lang] = (char **)malloc(sizeof(char *) * numTexts); res[lang][0] = pos = (char *)malloc(entryLen); + res[lang][0] = pos + DATAALIGNMENT; in.read(res[lang][0], entryLen); - pos += 4; + pos += DATAALIGNMENT; for (int i = 1; i < numTexts; i++) { pos -= 2; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index f462480ffc..54d6784ec5 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -48,6 +48,7 @@ namespace Drascula { // Do not update this yet. The file is not loaded fully #define DRASCULA_DAT_VER 1 +#define DATAALIGNMENT 4 enum DrasculaGameFeatures { GF_PACKED = (1 << 0) -- cgit v1.2.3