From: Brad A. <br...@us...> - 2012-08-20 21:56:01
|
gemrb: Infinity Engine emulator The branch master has been updated via 28f535ec732497222591f29b057630850783efc6 (commit) Summary of changes: gemrb/plugins/BAMImporter/BAMFontManager.cpp | 11 ++++++++--- gemrb/plugins/BAMImporter/BAMFontManager.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) from 6426089e8b2613e48fe861871881b8eda068c3fa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=28f535ec732497222591f29b057630850783efc6 commit 28f535ec732497222591f29b057630850783efc6 Author: Brad Allred <bra...@me...> Date: Mon Aug 20 15:55:25 2012 -0600 BAM fonts: re-factor the "states" hack to work with non-english lets check if the file is a "states" file instead. diff --git a/gemrb/plugins/BAMImporter/BAMFontManager.cpp b/gemrb/plugins/BAMImporter/BAMFontManager.cpp index 45a5587..841d5f0 100644 --- a/gemrb/plugins/BAMImporter/BAMFontManager.cpp +++ b/gemrb/plugins/BAMImporter/BAMFontManager.cpp @@ -31,11 +31,17 @@ BAMFontManager::~BAMFontManager(void) BAMFontManager::BAMFontManager(void) { + isStateFont = false; bamImp = new BAMImporter(); } bool BAMFontManager::Open(DataStream* stream) { + char tmp[16]; // 16 is the fileneame length in DataStream + strncpy(tmp, stream->filename, 6); // only copy length of "STATES" characters so we can match "STATES2" or others too + if (strcasecmp(tmp, "STATES") == 0) { + isStateFont = true; + } return bamImp->Open(stream); } @@ -77,9 +83,8 @@ Font* BAMFontManager::GetFont(ieWord FirstChar, glyphs[i - glyphIndexOffset] = af->GetFrame(0, i); // Hack to work around original data where some status icons have inverted x and y positions (ie level up icon) - // the only fonts with cycle count > 1 where cycle count and frame count are not equal are initials and states - // TODO: check if this is true across all game types and languages. checked with english BG1 and BG2. - if (CyclesCount != af->GetFrameCount()) { + // isStateFont is set in Open() and simply compares the first 6 characters of the file with "STATES" + if (isStateFont) { // since initials and state icons should all be the same size/position we can just take the position of the first one glyphs[i - glyphIndexOffset]->YPos = glyphs[0]->YPos; } diff --git a/gemrb/plugins/BAMImporter/BAMFontManager.h b/gemrb/plugins/BAMImporter/BAMFontManager.h index af94397..5cee79d 100644 --- a/gemrb/plugins/BAMImporter/BAMFontManager.h +++ b/gemrb/plugins/BAMImporter/BAMFontManager.h @@ -31,6 +31,7 @@ class BAMFontManager : public FontManager private: /** private data members */ BAMImporter* bamImp; + bool isStateFont; public: /** public data members */ private: ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |