forked from Kolyah35/minecraft-pe-0.6.1
fix msvc build & mingw build
1. Include unified header files using lowercase filenames 2. Change special characters to escape sequences to solve encoding issues
This commit is contained in:
@@ -186,7 +186,7 @@ void Font::draw( const std::string& str, float x, float y, int color, bool darke
|
||||
glPushMatrix2();
|
||||
glTranslatef2((GLfloat)x, (GLfloat)y, 0.0f);
|
||||
for (unsigned int i = 0; i < str.length(); i++) {
|
||||
while (str.length() > i + 1 && str[i] == '§') {
|
||||
while (str.length() > i + 1 && str[i] == '\xa7') {
|
||||
int cc = hex.find((char)tolower(str[i + 1]));
|
||||
if (cc < 0 || cc > 15) cc = 15;
|
||||
lists[index++] = listPos + 256 + cc + (darken ? 16 : 0);
|
||||
@@ -235,7 +235,7 @@ int Font::width( const std::string& str )
|
||||
int len = 0;
|
||||
|
||||
for (unsigned int i = 0; i < str.length(); i++) {
|
||||
if (str[i] == '§') {
|
||||
if (str[i] == '\xa7') {
|
||||
i++;
|
||||
} else {
|
||||
//int ch = SharedConstants.acceptableLetters.indexOf(str.charAt(i));
|
||||
@@ -274,7 +274,7 @@ std::string Font::sanitize( const std::string& str )
|
||||
int j = 0;
|
||||
|
||||
for (unsigned int i = 0; i < str.length(); i++) {
|
||||
if (str[i] == '§') {
|
||||
if (str[i] == '\xa7') {
|
||||
i++;
|
||||
//} else if (SharedConstants.acceptableLetters.indexOf(str.charAt(i)) >= 0) {
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user