Skip to content

Commit

Permalink
Refactor: Replace font namespace implementation with PathDirectory
Browse files Browse the repository at this point in the history
Font names are now represented as Uri within the collection itself.
Also a directory hierarchy may be defined within each namespace.

Statistical information useful for analyzing efficency of the font
namespace hashes can be retrieved in _DEBUG builds using ccmd fontstats
  • Loading branch information
danij-deng committed Oct 27, 2011
1 parent f017f70 commit daeb3cc
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 402 deletions.
7 changes: 5 additions & 2 deletions doomsday/engine/portable/include/fonts.h
Expand Up @@ -38,11 +38,14 @@

struct ded_compositefont_s;

// Substrings in Font names are delimited by this character.
#define FONTDIRECTORY_DELIMITER '/'

/// Register the console commands, variables, etc..., of this module.
void Fonts_Register(void);

/// Initialize this module.
void Fonts_Init(void);
void Fonts_Initialize(void);

/// Shutdown this module.
void Fonts_Shutdown(void);
Expand Down Expand Up @@ -89,7 +92,7 @@ ddstring_t** Fonts_CollectNames(int* count);
font_t* Fonts_ToFont(fontnum_t num);

/// @return Unique name associated with the specified Font.
fontnum_t Fonts_ToIndex(font_t* font);
fontnum_t Fonts_ToFontNum(font_t* font);

/// @return Font associated with @a uri else @c NULL.
font_t* Fonts_FontForUri(const Uri* uri);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/con_busy.c
Expand Up @@ -288,7 +288,7 @@ static void Con_BusyPrepareResources(void)
font_t* font = Fonts_LoadExternal(fonts[fontIdx].name, fonts[fontIdx].path);
if(NULL != font)
{
busyFont = Fonts_ToIndex(font);
busyFont = Fonts_ToFontNum(font);
FR_SetFont(busyFont);
FR_LoadDefaultAttrib();
busyFontHgt = FR_SingleLineHeight("Busy");
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/dd_main.c
Expand Up @@ -1466,7 +1466,7 @@ int DD_Main(void)
Sys_Init();
F_Init();

Fonts_Init();
Fonts_Initialize();
if(!isDedicated)
{
FR_Init();
Expand Down

0 comments on commit daeb3cc

Please sign in to comment.