aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2011-06-01 15:15:31 +0200
committerMax Horn2011-06-01 15:15:31 +0200
commita4610df4825a89ceda39bf1156d1b97a37cceac8 (patch)
tree8c1fea3f50126079ba64ebf108cb0fd588378960 /engines
parenta4d105c902ce1b24c4edd1f3eb43b995bc46c0dd (diff)
parentafe1a77d573ea15c45848c722732f9e84221c669 (diff)
downloadscummvm-rg350-a4610df4825a89ceda39bf1156d1b97a37cceac8.tar.gz
scummvm-rg350-a4610df4825a89ceda39bf1156d1b97a37cceac8.tar.bz2
scummvm-rg350-a4610df4825a89ceda39bf1156d1b97a37cceac8.zip
Merge branch 'branch-1-3-0' into master
I manually resolved all conflicts, and inspected every single change. Many were due to the version string mismatch and thus easily resolved. The MSVC project files add in the 1-3-0 branch were not merged, neither where the changes to gui/themes/translations.dat. Conflicts: NEWS backends/base-backend.cpp backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp backends/module.mk backends/platform/ds/arm9/makefile backends/platform/psp/README.PSP backends/platform/samsungtv/main.cpp backends/platform/samsungtv/samsungtv.cpp backends/saves/posix/posix-saves.cpp base/commandLine.cpp base/internal_version.h base/main.cpp common/array.h configure devtools/create_project/create_project.cpp dists/android/AndroidManifest.xml dists/android/plugin-manifest.xml dists/iphone/Info.plist dists/irix/scummvm.spec dists/macosx/Info.plist dists/redhat/scummvm-tools.spec dists/redhat/scummvm.spec dists/scummvm.rc dists/slackware/scummvm.SlackBuild dists/wii/meta.xml engines/sci/parser/vocabulary.cpp engines/tinsel/handle.cpp gui/themes/translations.dat
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/font.cpp32
-rw-r--r--engines/saga/font.h4
2 files changed, 36 insertions, 0 deletions
diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp
index a5363909ff..8c3f4d7c42 100644
--- a/engines/saga/font.cpp
+++ b/engines/saga/font.cpp
@@ -40,6 +40,10 @@ Font::Font(SagaEngine *vm) : _vm(vm) {
_fonts.resize(_vm->getFontsCount());
for (i = 0; i < _vm->getFontsCount(); i++) {
+#ifdef __DS__
+ _fonts[i].outline.font = NULL;
+ _fonts[i].normal.font = NULL;
+#endif
loadFont(&_fonts[i], _vm->getFontDescription(i)->fontResourceId);
}
@@ -48,6 +52,18 @@ Font::Font(SagaEngine *vm) : _vm(vm) {
Font::~Font() {
debug(8, "Font::~Font(): Freeing fonts.");
+
+#ifdef __DS__
+ for (int i = 0; i < _vm->getFontsCount(); i++) {
+ if (_fonts[i].outline.font) {
+ free(_fonts[i].outline.font);
+ }
+
+ if (_fonts[i].normal.font) {
+ free(_fonts[i].normal.font);
+ }
+ }
+#endif
}
@@ -104,9 +120,17 @@ void Font::loadFont(FontData *font, uint32 fontResourceId) {
error("Invalid font resource size");
}
+#ifndef __DS__
font->normal.font.resize(fontResourceData.size() - FONT_DESCSIZE);
memcpy(font->normal.font.getBuffer(), fontResourceData.getBuffer() + FONT_DESCSIZE, fontResourceData.size() - FONT_DESCSIZE);
+#else
+ if (font->normal.font) {
+ free(font->normal.font);
+ }
+ font->normal.font = (byte *) malloc(fontResourceData.size() - FONT_DESCSIZE);
+ memcpy(font->normal.font, fontResourceData.getBuffer() + FONT_DESCSIZE, fontResourceData.size() - FONT_DESCSIZE);
+#endif
// Create outline font style
createOutline(font);
@@ -150,7 +174,15 @@ void Font::createOutline(FontData *font) {
font->outline.header.rowLength = newRowLength;
// Allocate new font representation storage
+#ifdef __DS__
+ if (font->outline.font) {
+ free(font->outline.font);
+ }
+
+ font->outline.font = (byte *) calloc(newRowLength * font->outline.header.charHeight, 1);
+#else
font->outline.font.resize(newRowLength * font->outline.header.charHeight);
+#endif
// Generate outline font representation
diff --git a/engines/saga/font.h b/engines/saga/font.h
index 75d5fa95b9..a45299ad48 100644
--- a/engines/saga/font.h
+++ b/engines/saga/font.h
@@ -117,7 +117,11 @@ struct FontCharEntry {
struct FontStyle {
FontHeader header;
FontCharEntry fontCharEntry[256];
+#ifndef __DS__
ByteArray font;
+#else
+ byte* font;
+#endif
};
struct FontData {