From 16a2048a2cc6a766b36d1e90f7d8f160563dc140 Mon Sep 17 00:00:00 2001 From: Emil Laine Date: Sun, 24 Apr 2016 01:33:27 +0300 Subject: [PATCH] Fix warning -Wchar-subscripts --- Sources/Engine/Graphics/Font.cpp | 4 ++-- Sources/Engine/Graphics/Font.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Engine/Graphics/Font.cpp b/Sources/Engine/Graphics/Font.cpp index f3fe2c7..d5fd8d4 100644 --- a/Sources/Engine/Graphics/Font.cpp +++ b/Sources/Engine/Graphics/Font.cpp @@ -99,7 +99,7 @@ void CFontData::Read_t( CTStream *inFile) // throw char * SetCharSpacing(+1); SetLineSpacing(+1); SetSpaceWidth(0.5f); - fd_fcdFontCharData[' '].fcd_pixStart = 0; + fd_fcdFontCharData[(int)' '].fcd_pixStart = 0; } void CFontData::Write_t( CTStream *outFile) // throw char * @@ -201,7 +201,7 @@ void CFontData::Make_t( const CTFileName &fnTexture, PIX pixCharWidth, PIX pixCh iLetter++; // skip carriage return } // set default space width - fd_fcdFontCharData[' '].fcd_pixStart = 0; + fd_fcdFontCharData[(int)' '].fcd_pixStart = 0; SetSpaceWidth(0.5f); // all done diff --git a/Sources/Engine/Graphics/Font.h b/Sources/Engine/Graphics/Font.h index cacb307..f5056a5 100644 --- a/Sources/Engine/Graphics/Font.h +++ b/Sources/Engine/Graphics/Font.h @@ -71,7 +71,7 @@ public: inline void SetFixedWidth(void) { fd_bFixedWidth = TRUE; }; inline void SetVariableWidth(void) { fd_bFixedWidth = FALSE; }; inline void SetSpaceWidth( FLOAT fWidthRatio) { // relative to char cell width (1/2 is default) - fd_fcdFontCharData[' '].fcd_pixEnd = (PIX)(fd_pixCharWidth*fWidthRatio); } + fd_fcdFontCharData[(int)' '].fcd_pixEnd = (PIX)(fd_pixCharWidth*fWidthRatio); } void Read_t( CTStream *inFile); // throw char * void Write_t( CTStream *outFile); // throw char *