From e33e19d0587146859d48a134ec9fd94e7b7ba5cd Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 8 Dec 2011 14:53:40 +0000 Subject: Initial upload --- nGenEx/FontMgr.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 nGenEx/FontMgr.cpp (limited to 'nGenEx/FontMgr.cpp') diff --git a/nGenEx/FontMgr.cpp b/nGenEx/FontMgr.cpp new file mode 100644 index 0000000..e37b2b9 --- /dev/null +++ b/nGenEx/FontMgr.cpp @@ -0,0 +1,58 @@ +/* Project nGenEx + Destroyer Studios LLC + Copyright © 1997-2004. All Rights Reserved. + + SUBSYSTEM: nGenEx.lib + FILE: FontMgr.cpp + AUTHOR: John DiCamillo + + + OVERVIEW + ======== + Font Resource Manager class implementation +*/ + +#include "MemDebug.h" +#include "FontMgr.h" + +// +--------------------------------------------------------------------+ + +List FontMgr::fonts; + +// +--------------------------------------------------------------------+ + +void +FontMgr::Close() +{ + fonts.destroy(); +} + +// +--------------------------------------------------------------------+ + +void +FontMgr::Register(const char* name, Font* font) +{ + FontItem* item = new(__FILE__,__LINE__) FontItem; + + if (item) { + item->name = name; + item->size = 0; + item->font = font; + + fonts.append(item); + } +} + +// +--------------------------------------------------------------------+ + +Font* +FontMgr::Find(const char* name) +{ + ListIter item = fonts; + while (++item) { + if (item->name == name) + return item->font; + } + + return 0; +} -- cgit v1.1