source: trunk/src/forge.cpp @ 172

Last change on this file since 172 was 172, checked in by sam, 9 years ago

Move _strncasecmp define from forge.cpp/tiler.cpp to dict.cpp.

  • Property svn:keywords set to Id
File size: 739 bytes
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
5
6#if defined HAVE_CONFIG_H
7#   include "config.h"
8#endif
9
10#include "core.h"
11
12/*
13 * Forge implementation class
14 */
15
16static class ForgeData
17{
18    friend class Forge;
19
20public:
21    Dict fonts;
22}
23forgedata;
24
25static ForgeData * const data = &forgedata;
26
27/*
28 * Public Forge class
29 */
30
31int Forge::Register(char const *path)
32{
33    int id = data->fonts.MakeSlot(path);
34
35    if (!data->fonts.GetEntity(id))
36    {
37        Font *font = new Font(path);
38        data->fonts.SetEntity(id, font);
39    }
40
41    return id;
42}
43
44void Forge::Deregister(int id)
45{
46    data->fonts.RemoveSlot(id);
47}
48
49Font *Forge::GetFont(int id)
50{
51    return (Font *)data->fonts.GetEntity(id);
52}
53
Note: See TracBrowser for help on using the repository browser.