From 4295a17c2323d025aad8ccd7084a8c3bdedfcaa6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 15 Nov 2004 03:03:48 +0000 Subject: o Make GAME_GetFileContext() more object-like o Font::loadFont() now normally survives zero-length fonts as used in demos o Removed unused SndRes::ITEVOC_Resample() o Fixed playing of voice #4 on old DOS targets o Implemented playing voices in VOX (Oki ADPCM) format o Support of Win32 and Linux demos. There was old-style Win32 demo, which is not supported yet, same is with DOS demo. svn-id: r15814 --- saga/font.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'saga/font.cpp') diff --git a/saga/font.cpp b/saga/font.cpp index 736237c6d4..d317b17a94 100644 --- a/saga/font.cpp +++ b/saga/font.cpp @@ -37,8 +37,8 @@ Font::Font(SagaEngine *vm) : _vm(vm), _initialized(false) { int i; // Load font module resource context - if (GAME_GetFileContext(&_fontContext, - GAME_RESOURCEFILE, 0) != SUCCESS) { + _fontContext = GAME_GetFileContext(GAME_RESOURCEFILE, 0); + if (_fontContext == NULL) { error("Font::Font(): Couldn't get resource context."); } @@ -102,7 +102,8 @@ int Font::loadFont(uint32 font_rn, int font_id) { } if (fontres_len < FONT_DESCSIZE) { - error("Font::loadFont(): Invalid font length."); + warning("Font::loadFont(): Invalid font length (%d < %d)", fontres_len, FONT_DESCSIZE); + return FAILURE; } MemoryReadStream readS(fontres_p, fontres_len); @@ -119,7 +120,7 @@ int Font::loadFont(uint32 font_rn, int font_id) { fh.c_width = readS.readUint16LE(); fh.row_length = readS.readUint16LE(); - debug(1, "Font::loadFont(): Reading font resource..."); + debug(1, "Font::loadFont(): Reading font resource #%d...", font_rn); debug(2, "Character width: %d", fh.c_width); debug(2, "Character height: %d", fh.c_height); -- cgit v1.2.3