Skip to content

Commit

Permalink
(x): removed forward declarations for tFontDefHashElement and tKernin…
Browse files Browse the repository at this point in the history
…gHashElement.
  • Loading branch information
Panajev committed Jun 29, 2012
1 parent f874b8d commit 89244ec
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 130 deletions.
48 changes: 31 additions & 17 deletions cocos2d/CCLabelBMFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ enum {
kCCLabelAutomaticWidth = -1,
};

struct _KerningHashElement;

/** @struct ccBMFontDef
BMFont definition
*/
Expand Down Expand Up @@ -73,6 +71,22 @@ typedef struct _BMFontPadding {
int bottom;
} ccBMFontPadding;

#pragma mark - Hash Element
typedef struct _FontDefHashElement
{
NSUInteger key; // key. Font Unicode value
ccBMFontDef fontDef; // font definition
UT_hash_handle hh;
} tFontDefHashElement;

// Equal function for targetSet.
typedef struct _KerningHashElement
{
int key; // key for the hash. 16-bit for 1st element, 16-bit for 2nd element
int amount;
UT_hash_handle hh;
} tKerningHashElement;
#pragma mark -

/** CCBMFontConfiguration has parsed configuration of the the .fnt file
@since v0.8
Expand All @@ -81,21 +95,21 @@ typedef struct _BMFontPadding {
{
// atlas name
NSString *atlasName_;

// XXX: Creating a public interface so that the bitmapFontArray[] is accesible
@public

// BMFont definitions
struct _FontDefHashElement *fontDefDictionary_;

tFontDefHashElement *fontDefDictionary_;
// FNTConfig: Common Height. Should be signed (issue #1343)
NSInteger commonHeight_;

// Padding
ccBMFontPadding padding_;

// values for kerning
struct _KerningHashElement *kerningDictionary_;
tKerningHashElement *kerningDictionary_;
}

// atlasName
Expand All @@ -109,7 +123,7 @@ typedef struct _BMFontPadding {


/** CCLabelBMFont is a subclass of CCSpriteBatchNode
Features:
- Treats each character like a CCSprite. This means that each individual character can be:
- rotated
Expand All @@ -120,22 +134,22 @@ typedef struct _BMFontPadding {
- It can be used as part of a menu item.
- anchorPoint can be used to align the "label"
- Supports AngelCode text format
Limitations:
- All inner characters are using an anchorPoint of (0.5f, 0.5f) and it is not recommend to change it
because it might affect the rendering
CCLabelBMFont implements the protocol CCLabelProtocol, like CCLabel and CCLabelAtlas.
CCLabelBMFont has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite.
If in doubt, use CCLabelBMFont instead of CCLabelAtlas / CCLabel.
Supported editors:
- http://glyphdesigner.71squared.com/
- http://www.bmglyph.com/
- http://www.n4te.com/hiero/hiero.jnlp
- http://slick.cokeandcode.com/demos/hiero.jnlp
- http://www.angelcode.com/products/bmfont/
@since v0.8
*/

Expand All @@ -146,16 +160,16 @@ typedef struct _BMFontPadding {

// name of fntFile
NSString *fntFile_;

// initial string without line breaks
NSString *initialString_;
// max width until a line break is added
float width_;
// alignment of all lines
CCTextAlignment alignment_;

CCBMFontConfiguration *configuration_;

// texture RGBA
GLubyte opacity_;
ccColor3B color_;
Expand Down
Loading

0 comments on commit 89244ec

Please sign in to comment.