Fix coding style and remove tabs here and there.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index b4a96dd..30f9793 100644
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -205,7 +205,7 @@ void FTFace::BuildKerningCache()
kernAdvance.x = 0;
kernAdvance.y = 0;
kerningCache = new FTGL_DOUBLE[FTFace::MAX_PRECOMPUTED
- * FTFace::MAX_PRECOMPUTED * 2];
+ * FTFace::MAX_PRECOMPUTED * 2];
for(unsigned int j = 0; j < FTFace::MAX_PRECOMPUTED; j++)
{
for(unsigned int i = 0; i < FTFace::MAX_PRECOMPUTED; i++)
diff --git a/src/FTGlyph/FTTextureGlyph.cpp b/src/FTGlyph/FTTextureGlyph.cpp
index 4450760..4e564b6 100644
--- a/src/FTGlyph/FTTextureGlyph.cpp
+++ b/src/FTGlyph/FTTextureGlyph.cpp
@@ -36,19 +36,21 @@
#define FTGL_ASSERTS_SHOULD_SOFT_FAIL
#ifdef FTGL_ASSERTS_SHOULD_SOFT_FAIL
- #define FTASSERT(x) \
- if (!(x)) \
- { \
- fprintf(stderr,"ASSERTION FAILED (%s:%d)(soft): %s\n",__FILE__,__LINE__,#x); \
- }
+# define FTASSERT(x) \
+ if (!(x)) \
+ { \
+ fprintf(stderr, "ASSERTION FAILED (%s:%d)(soft): %s\n", \
+ __FILE__, __LINE__, #x); \
+ }
#else
- #define FTASSERT(x) \
- if (!(x)) \
- { \
- fprintf(stderr,"ASSERTION FAILED (%s:%d): %s\n",__FILE__,__LINE__,#x); \
- int *a = (int*)0x0; \
- *a = 0xD15EA5ED; \
- }
+# define FTASSERT(x) \
+ if (!(x)) \
+ { \
+ fprintf(stderr, "ASSERTION FAILED (%s:%d): %s\n", \
+ __FILE__, __LINE__, #x); \
+ int *a = (int*)0x0; \
+ *a = 0xD15EA5ED; \
+ }
#endif
@@ -103,40 +105,42 @@ FTTextureGlyphImpl::FTTextureGlyphImpl(FT_GlyphSlot glyph, int id, int xOffset,
if(destWidth && destHeight)
{
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); {
-
- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- glBindTexture(GL_TEXTURE_2D, glTextureID);
- GLint w,h;
- glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH,&w);
- glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_HEIGHT,&h);
-
- FTASSERT(xOffset >= 0);
- FTASSERT(yOffset >= 0);
- FTASSERT(destWidth >= 0);
- FTASSERT(destHeight >= 0);
- FTASSERT(xOffset+destWidth <= w);
- FTASSERT(yOffset+destHeight <= h);
-
- if (yOffset+destHeight > h)
- {
- //We'll only get here if we are soft-failing our asserts. In that case,
- //since the data we're trying to put into our texture is too long,
- //we'll only copy a portion of the image.
- destHeight = h-yOffset;
- }
- if (destHeight >= 0)
- {
- glTexSubImage2D(GL_TEXTURE_2D, 0, xOffset, yOffset, destWidth, destHeight, GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.buffer);
- }
-
- } glPopClientAttrib();
+ glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+
+ glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ GLint w,h;
+
+ glBindTexture(GL_TEXTURE_2D, glTextureID);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
+
+ FTASSERT(xOffset >= 0);
+ FTASSERT(yOffset >= 0);
+ FTASSERT(destWidth >= 0);
+ FTASSERT(destHeight >= 0);
+ FTASSERT(xOffset + destWidth <= w);
+ FTASSERT(yOffset + destHeight <= h);
+
+ if (yOffset + destHeight > h)
+ {
+ // We'll only get here if we are soft-failing our asserts. In that
+ // case, since the data we're trying to put into our texture is
+ // too long, we'll only copy a portion of the image.
+ destHeight = h - yOffset;
+ }
+ if (destHeight >= 0)
+ {
+ glTexSubImage2D(GL_TEXTURE_2D, 0, xOffset, yOffset,
+ destWidth, destHeight, GL_ALPHA, GL_UNSIGNED_BYTE,
+ bitmap.buffer);
+ }
+
+ glPopClientAttrib();
}
-
// 0
// +----+
// | |