From 8912c967697854c1d651b4bc37ed6898737cfbd4 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Fri, 3 Jun 2005 08:54:10 +0000 Subject: - replaced loading in cBitmap::Available with a mere access/glob --- bitmap.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bitmap.c b/bitmap.c index a6a5fc7..60f95d7 100644 --- a/bitmap.c +++ b/bitmap.c @@ -1,5 +1,5 @@ /* - * $Id: bitmap.c,v 1.10 2005/01/28 21:26:34 lordjaxom Exp $ + * $Id: bitmap.c,v 1.11 2005/06/03 08:54:10 lordjaxom Exp $ */ #include "bitmap.h" @@ -89,8 +89,15 @@ cText2SkinBitmap *cText2SkinBitmap::Load(const std::string &Filename, int Alpha, bool cText2SkinBitmap::Available(const std::string &Filename, int Alpha, int height, int width, int colors) { - cText2SkinBitmap *bmp = Load(Filename, Alpha, height, width, colors, true); - return bmp != NULL; + if ((int)Filename.find('*') != -1) { + bool result = false; + glob_t gbuf; + if (glob(Filename.c_str(), 0, NULL, &gbuf) == 0) + result = true; + globfree(&gbuf); + return result; + } else + return access(Filename.c_str(), F_OK) == 0; } cText2SkinBitmap::cText2SkinBitmap(void) { -- cgit v1.2.3