From 0bf9e4dbc5902238d91785a404b911ea56e86ea8 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 12 Oct 2003 04:09:46 +0000 Subject: [PATCH] crash error --- changelog.txt | 5 ++++- src/ZE_ZFont.cpp | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index ae929dd..ce79882 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,5 @@ ZEngine Version Log for Version 0.8.5 -$Id: changelog.txt,v 1.53 2003/10/05 20:05:57 cozman Exp $ +$Id: changelog.txt,v 1.54 2003/10/12 04:09:46 cozman Exp $ Changes are marked with symbols that describe them: ! is code that breaks backwards compatibility (used after 0.8.0-rc1, previous versions broke compatibility) @@ -10,6 +10,9 @@ Changes are marked with symbols that describe them: (Note: Depreciated code (that marked with a *) is likely to disappear completely at the next major version.) +0.8.6 + # Fixed ZImage crash on missing image. ZFont crash fix relys on SDL_ttf 2.0.7 + 0.8.5 + OpenFromZip code added for ZImage,ZFont and ZSound. + Zlib/Unzip code added directly into ZEngine. diff --git a/src/ZE_ZFont.cpp b/src/ZE_ZFont.cpp index 5cae2cb..d3786c8 100644 --- a/src/ZE_ZFont.cpp +++ b/src/ZE_ZFont.cpp @@ -13,7 +13,7 @@ \brief Source file for ZFont. Implementation of ZFont, the basic Font class for ZEngine. -
$Id: ZE_ZFont.cpp,v 1.14 2003/10/05 19:59:29 cozman Exp $
+
$Id: ZE_ZFont.cpp,v 1.15 2003/10/12 04:09:46 cozman Exp $
\author James Turk **/ @@ -85,18 +85,24 @@ void ZFont::Release() void ZFont::DrawText(std::string text, ZImage &image) const { - if(text.length() == 0) - text = " "; - image.Attach(TTF_RenderText_Blended(rFont, text.c_str(), rColor)); - image.SetAlpha(rColor.unused); //the images alpha comes from the SetColor a parameter + if(rFont) + { + if(text.length() == 0) + text = " "; + image.Attach(TTF_RenderText_Blended(rFont, text.c_str(), rColor)); + image.SetAlpha(rColor.unused); //the images alpha comes from the SetColor a parameter + } } void ZFont::DrawShadedText(std::string text, ZImage &image) const { - if(text.length() == 0) - text = " "; - image.Attach(TTF_RenderText_Shaded(rFont, text.c_str(), rColor, rBGColor)); - image.SetAlpha(rColor.unused); + if(rFont) + { + if(text.length() == 0) + text = " "; + image.Attach(TTF_RenderText_Shaded(rFont, text.c_str(), rColor, rBGColor)); + image.SetAlpha(rColor.unused); + } } void ZFont::SetColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)