source: abuse/trunk/src/imlib/fonts.hpp @ 57

Last change on this file since 57 was 57, checked in by Sam Hocevar, 14 years ago
  • Move each header to the same directory as its corresponding source, to get a better idea of which files are likely to export symbols.
File size: 1.2 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __FONTS_HPP_
11#define __FONTS_HPP_
12#include "image.hpp"
13#include "timage.hpp"
14
15
16
17class texture_font
18{
19  int tl,th;
20  image *let,*fntpat;
21public:
22  texture_font(image *letters, image *font_pattern=NULL);
23  void put_char(image *screen,  int x, int y, char ch);
24  void put_string(image *screen, int x, int y, char const *st);
25  int height() { return th; }
26  int length() { return tl; }
27  int width() { return tl; }
28  image *font_image() { return let; }
29  image *font_patter() { return fntpat; }
30  ~texture_font() { if (let) delete let; if (fntpat) delete fntpat; }
31} ;
32
33class JCFont
34{
35  int tl,th;
36  trans_image *let[256];
37public:
38  JCFont(image *letters);
39  void put_char(image *screen,  int x, int y, char ch, int color=-1);
40  void put_string(image *screen, int x, int y, char const *st, int color=-1);
41  int height() { return th; }
42  int length() { return tl; }
43  int width() { return tl; }
44  ~JCFont();
45} ;
46
47#endif
48
49
Note: See TracBrowser for help on using the repository browser.