]> Dogcows Code - chaz/yoink/blob - src/TilemapFont.cc
cc995ba71746a549aa9ccb4d5fa987da96382477
[chaz/yoink] / src / TilemapFont.cc
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #include <iostream>
13
14 #include "TilemapFont.hh"
15
16
17 TilemapFont::TilemapFont() :
18 moof::texture("Font") {}
19
20
21 void TilemapFont::tile_coordinates(char symbol, moof::scalar coords[8],
22 moof::texture::orientation what)
23 {
24 int index = 0;
25
26 if (symbol >= ' ' && symbol <= '_')
27 {
28 index = symbol - 32;
29 }
30 else if (symbol >= 'a' && symbol <= '~')
31 {
32 index = symbol - 64;
33 }
34 else
35 {
36 index = 0;
37 }
38
39 moof::texture::tile_coordinates(index, coords, what);
40 }
41
This page took 0.031836 seconds and 3 git commands to generate.