Commit 95183df2a1731d739250201da81d7d0740d58c52

sammy 2008-05-23T00:16:54

* Start protecting FTBuffer members using getters and setters.

diff --git a/src/FTFont/FTBufferFont.cpp b/src/FTFont/FTBufferFont.cpp
index 29e3058..1ea6a4b 100644
--- a/src/FTFont/FTBufferFont.cpp
+++ b/src/FTFont/FTBufferFont.cpp
@@ -277,7 +277,7 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
         buffer->width = texWidth;
         buffer->height = texHeight;
         buffer->pitch = texWidth;
-        buffer->pos = FTPoint(padding, padding) - bbox.Lower();
+        buffer->Pos(FTPoint(padding, padding) - bbox.Lower());
 
         advanceCache[cacheIndex] =
               FTFontImpl::Render(string, len, FTPoint(), spacing, renderMode);
diff --git a/src/FTGL/FTBuffer.h b/src/FTGL/FTBuffer.h
index 384bbd0..fa11ea9 100644
--- a/src/FTGL/FTBuffer.h
+++ b/src/FTGL/FTBuffer.h
@@ -45,10 +45,30 @@
 class FTGL_EXPORT FTBuffer
 {
     public:
+        /**
+         * Default constructor.
+         */
         FTBuffer();
+
+        /**
+         * Destructor
+         */
         ~FTBuffer();
+
+        inline FTPoint Pos() const
+        {
+            return pos;
+        }
+
+        inline void Pos(FTPoint arg)
+        {
+            pos = arg;
+        }
+
         int width, height, pitch;
         unsigned char *pixels;
+
+    private:
         FTPoint pos;
 };
 
diff --git a/src/FTGlyph/FTBufferGlyph.cpp b/src/FTGlyph/FTBufferGlyph.cpp
index 24d95ed..41bd8a0 100644
--- a/src/FTGlyph/FTBufferGlyph.cpp
+++ b/src/FTGlyph/FTBufferGlyph.cpp
@@ -92,7 +92,7 @@ const FTPoint& FTBufferGlyphImpl::RenderImpl(const FTPoint& pen, int renderMode)
 {
     if(has_bitmap)
     {
-        FTPoint pos(buffer->pos + pen + corner);
+        FTPoint pos(buffer->Pos() + pen + corner);
         int dx = (int)(pos.Xf() + 0.5f);
         int dy = buffer->height - (int)(pos.Yf() + 0.5f);
         unsigned char * dest = buffer->pixels + dx + dy * buffer->pitch;