From 989f3b946207167eb2a1e258a48f16592183f356 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Mon, 20 Dec 2010 00:12:41 +0300 Subject: [PATCH] More const-correctness in Text.{cpp,h} --- Source/Text.cpp | 14 +++++++------- Source/Text.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Text.cpp b/Source/Text.cpp index e1c2878..0652c87 100644 --- a/Source/Text.cpp +++ b/Source/Text.cpp @@ -116,12 +116,12 @@ void Text::BuildFont() // Build Our Font Display List } // Loop Until All 256 Are Built } -void Text::glPrint(float x, float y, char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrint(x, y, string, set, size, width, height, 0, strlen(string)); } -void Text::_glPrint(float x, float y, char *string, int set, float size, float width, float height,int start,int end, int offset) // Where The Printing Happens +void Text::_glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end, int offset) // Where The Printing Happens { if (set>1) { @@ -152,26 +152,26 @@ void Text::_glPrint(float x, float y, char *string, int set, float size, float w glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); } -void Text::glPrint(float x, float y, char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens +void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 0); } -void Text::glPrintOutline(float x, float y, char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrintOutline(x, y, string, set, size, width, height, 0, strlen(string)); } -void Text::glPrintOutline(float x, float y, char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens +void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height,int start,int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 256); } -void Text::glPrintOutlined(float x, float y, char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutlined(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glPrintOutlined(1, 1, 1, x, y, string, set, size, width, height); } -void Text::glPrintOutlined(float r, float g, float b, float x, float y, char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutlined(float r, float g, float b, float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens { glColor4f(0,0,0,1); glPrintOutline( x-2*size, y-2*size, string, set, size*2.5/2, width, height); diff --git a/Source/Text.h b/Source/Text.h index d2502ab..eba2159 100644 --- a/Source/Text.h +++ b/Source/Text.h @@ -37,18 +37,18 @@ public: void LoadFontTexture(const char *fileName); void BuildFont(); - void glPrint(float x, float y, char *string, int set, float size, float width, float height); - void glPrintOutline(float x, float y, char *string, int set, float size, float width, float height); - void glPrint(float x, float y, char *string, int set, float size, float width, float height,int start,int end); - void glPrintOutline(float x, float y, char *string, int set, float size, float width, float height,int start,int end); - void glPrintOutlined(float x, float y, char *string, int set, float size, float width, float height); - void glPrintOutlined(float r, float g, float b, float x, float y, char *string, int set, float size, float width, float height); + void glPrint(float x, float y, const char *string, int set, float size, float width, float height); + void glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height); + void glPrint(float x, float y, const char *string, int set, float size, float width, float height,int start,int end); + void glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height,int start,int end); + void glPrintOutlined(float x, float y, const char *string, int set, float size, float width, float height); + void glPrintOutlined(float r, float g, float b, float x, float y, const char *string, int set, float size, float width, float height); Text(); ~Text(); private: - void _glPrint(float x, float y, char *string, int set, float size, float width, float height, int start, int end, int offset); + void _glPrint(float x, float y, const char *string, int set, float size, float width, float height, int start, int end, int offset); }; #endif -- 2.39.2