1
0
Fork 0

FGFontCache::initializeFonts() now portable across platform through the use of plib

This commit is contained in:
fredb 2008-06-07 08:10:46 +00:00
parent bfc1967529
commit 7c8c8ff381

View file

@ -3,7 +3,7 @@
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <plib/ul.h>
#include "new_gui.hxx" #include "new_gui.hxx"
@ -559,11 +559,11 @@ bool FGFontCache::initializeFonts()
{ {
static string fontext("txf"); static string fontext("txf");
init(); init();
DIR* fontdir = opendir(_path.c_str()); ulDir* fontdir = ulOpenDir(_path.c_str());
if (!fontdir) if (!fontdir)
return false; return false;
const dirent *dirEntry; const ulDirEnt *dirEntry;
while ((dirEntry = readdir(fontdir)) != 0) { while ((dirEntry = ulReadDir(fontdir)) != 0) {
SGPath path(_path); SGPath path(_path);
path.append(dirEntry->d_name); path.append(dirEntry->d_name);
if (path.extension() == fontext) { if (path.extension() == fontext) {
@ -574,7 +574,7 @@ bool FGFontCache::initializeFonts()
delete f; delete f;
} }
} }
closedir(fontdir); ulCloseDir(fontdir);
return true; return true;
} }