- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/packedfontbase.h

    00001 /* Contributed by Jeff Laing
    00002  * 20080414
    00003  */
    00004
    00005 #ifndef _PACKED_FONT_BASE_
    00006 #define _PACKED_FONT_BASE_
    00007
    00008 #include <nds.h>
    00009 #include "fontbase.h"
    00010
    00011 namespace WoopsiUI {
    00012
    00017         class PackedFontBase : public FontBase
    00018         {
    00019         public:
    00031                 PackedFontBase(
    00032                         u8 first, u8 last,
    00033                         const u16 *glyphData,
    00034                         const u16 *glyphOffset,
    00035                         const u8 *glyphWidth,
    00036                         const u8 height,
    00037                         const u8 spWidth,
    00038                         const u8 fixedWidth = 0)
    00039                         :
    00040                           FontBase(height, 0),
    00041                           _first(first), _last(last),
    00042                           _glyphData(glyphData), _glyphOffset(glyphOffset), _glyphWidth(glyphWidth),
    00043                           _fontWidth(0),        // Thanks, John
    00044                           _spWidth(spWidth), _widMax(fixedWidth) { }
    00045
    00052                 inline void setFontWidth(u8 fontWidth) { _fontWidth = (fontWidth && (fontWidth < _widMax)) ? _widMax : fontWidth; }
    00053
    00068                 virtual s16 drawChar(
    00069                         u16* bitmap,
    00070                         u16 bitmapWidth, u16 bitmapHeight,
    00071                         char letter,
    00072                         s16 x, s16 y,
    00073                         u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2);
    00074
    00080                 virtual u16 getStringWidth(const char* text) const;
    00081
    00090                 virtual u16 getStringWidth(const char* text, u16 length) const;
    00091
    00097                 virtual u16 getCharWidth(char letter) const;
    00098
    00102                 const bool isCharBlank(const char letter) const;
    00103
    00117                 virtual void renderChar(
    00118                         const u16* pixelData, u16 pixelsPerRow,
    00119                         u16* bitmap, u16 bitmapWidth,
    00120                         s16 x, s16 y,
    00121                         u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2) = 0;
    00122
    00123         protected:
    00124                 u8 _first;
    00125                 u8 _last;
    00126                 const u16 *_glyphData;
    00127                 const u16 *_glyphOffset;
    00128                 const u8 *_glyphWidth;
    00129                 u8 _fontWidth;
    00130                 u8 _spWidth;
    00131                 u8 _widMax;
    00132         };
    00133 }
    00134
    00135 #endif

All Classes Functions Variables Enumerations Enumerator