Browse Source

conversion to new notation, FIX:rbtree needs convertion

mikymod 12 năm trước cách đây
mục cha
commit
b67c6f1a67
3 tập tin đã thay đổi với 71 bổ sung71 xóa
  1. 12 12
      src/Font.cpp
  2. 11 11
      src/Font.h
  3. 48 48
      src/Glyph.h

+ 12 - 12
src/Font.cpp

@@ -34,9 +34,9 @@ namespace crown
 {
 
 FontResource::FontResource() :
-	mMaxTextHeight(0),
-	mMaxCharacterHeight(0),
-	mMaxCharacterWidth(0)
+	m_max_text_height(0),
+	m_max_character_height(0),
+	m_max_character_width(0)
 {
 }
 
@@ -44,26 +44,26 @@ FontResource::~FontResource()
 {
 }
 
-Glyph& FontResource::GetGlyph(uint32_t code)
+Glyph& FontResource::glyph(uint32_t code)
 {
-	if (mCodeGlyphDict.Contains(code))
+	if (m_code_glyph_dict.contains(code))
 	{
-		return mCodeGlyphDict[code];
+		return m_code_glyph_dict[code];
 	}
 
-	static Glyph nullGlyph;
-	return nullGlyph;
+	static Glyph null_glyph;
+	return null_glyph;
 }
 
-void FontResource::SetCodeGlyphMetrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
+void FontResource::set_code_glyph_metrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
 {
-	if (mCodeGlyphDict.Contains(code))
+	if (m_code_glyph_dict.contains(code))
 	{
-		mCodeGlyphDict[code].SetMetrics(left, right, bottom, top, width, height, advance, baseline);
+		m_code_glyph_dict[code].set_metrics(left, right, bottom, top, width, height, advance, baseline);
 	}
 	else
 	{
-		mCodeGlyphDict[code] = Glyph(code, left, right, bottom, top, width, height, advance, baseline);
+		m_code_glyph_dict[code] = Glyph(code, left, right, bottom, top, width, height, advance, baseline);
 	}
 }
 

+ 11 - 11
src/Font.h

@@ -51,24 +51,24 @@ public:
 							FontResource();
 							~FontResource();
 
-	Glyph&					GetGlyph(uint32_t code);	//! Returns the glyph for the desired point32_t code
-	void					SetCodeGlyphMetrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline);
+	Glyph&					glyph(uint32_t code);	//! Returns the glyph for the desired point code
+	void					set_code_glyph_metrics(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline);
 
-	inline uint32_t			_GetMaxTextHeight() { return mMaxTextHeight; }
-	inline uint32_t			_GetMaxCharacterHeight() { return mMaxCharacterHeight; }
-	inline uint32_t			_GetMaxCharacterWidth() { return mMaxCharacterWidth; }
+	inline uint32_t			max_text_height() { return m_max_text_height; }
+	inline uint32_t			max_character_height() { return m_max_character_height; }
+	inline uint32_t			max_character_width() { return m_max_character_width; }
 
-	ResourceId				GetTexture() { return mTexture; }
+	ResourceId				texture() { return m_texture; }
 
 private:
 
-	CodeGlyphDict			mCodeGlyphDict;
+	CodeGlyphDict			m_code_glyph_dict;
 
-	uint32_t				mMaxTextHeight;
-	uint32_t				mMaxCharacterHeight;
-	uint32_t				mMaxCharacterWidth;
+	uint32_t				m_max_text_height;
+	uint32_t				m_max_character_height;
+	uint32_t				m_max_character_width;
 
-	ResourceId				mTexture;
+	ResourceId				m_texture;
 };
 
 } // namespace crown

+ 48 - 48
src/Glyph.h

@@ -37,29 +37,29 @@ public:
 
 	//! Constructor
 	Glyph() :
-		mCodePoint(0),
-		mLeft(0),
-		mRight(0),
-		mBottom(0),
-		mTop(0),
-		mWidth(0),
-		mHeight(0),
-		mAdvance(0),
-		mBaseline(0)
+		m_code_point(0),
+		m_left(0),
+		m_right(0),
+		m_bottom(0),
+		m_top(0),
+		m_width(0),
+		m_height(0),
+		m_advance(0),
+		m_baseline(0)
 	{
 	}
 
 	//! Constructor
 	Glyph(uint32_t code, float left, float right, float bottom, float top, float width, float height, float advance, float baseline) :
-		mCodePoint(code),
-		mLeft(left),
-		mRight(right),
-		mBottom(bottom),
-		mTop(top),
-		mWidth(width),
-		mHeight(height),
-		mAdvance(advance),
-		mBaseline(baseline)
+		m_code_point(code),
+		m_left(left),
+		m_right(right),
+		m_bottom(bottom),
+		m_top(top),
+		m_width(width),
+		m_height(height),
+		m_advance(advance),
+		m_baseline(baseline)
 	{
 	}
 
@@ -69,48 +69,48 @@ public:
 	}
 
 	//! Returns the glyph's metrics
-	void GetMetrics(float& left, float& right, float& bottom, float& top, float& width, float& height, float& advance, float& baseline) const
+	void metrics(float& left, float& right, float& bottom, float& top, float& width, float& height, float& advance, float& baseline) const
 	{
-		left = mLeft;
-		right = mRight;
-		bottom = mBottom;
-		top = mTop;
-		width = mWidth;
-		height = mHeight;
-		advance = mAdvance;
-		baseline = mBaseline;
+		left = m_left;
+		right = m_right;
+		bottom = m_bottom;
+		top = m_top;
+		width = m_width;
+		height = m_height;
+		advance = m_advance;
+		baseline = m_baseline;
 	}
 
 	//! Sets the glyph's metrics
-	void SetMetrics(float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
+	void set_metrics(float left, float right, float bottom, float top, float width, float height, float advance, float baseline)
 	{
-		mLeft = left;
-		mRight = right;
-		mBottom = bottom;
-		mTop = top;
-		mWidth = width;
-		mHeight = height;
-		mAdvance = advance;
-		mBaseline = baseline;
+		m_left = left;
+		m_right = right;
+		m_bottom = bottom;
+		m_top = top;
+		m_width = width;
+		m_height = height;
+		m_advance = advance;
+		m_baseline = baseline;
 	}
 
-	//! Returns the glyph's code point32_t
-	uint32_t GetCodePoint() const
+	//! Returns the glyph's code point
+	uint32_t code_point() const
 	{
-		return mCodePoint;
+		return m_code_point;
 	}
 
 private:
 
-	uint32_t mCodePoint;
-	float mLeft;
-	float mRight;
-	float mBottom;
-	float mTop;
-	float mWidth;
-	float mHeight;
-	float mAdvance;
-	float mBaseline;
+	uint32_t m_code_point;
+	float m_left;
+	float m_right;
+	float m_bottom;
+	float m_top;
+	float m_width;
+	float m_height;
+	float m_advance;
+	float m_baseline;
 };
 
 } // namespace crown