summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/RasterFont.cpp
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2014-03-11 00:30:55 +1300
committerMatthew Parlane <parlane@gmail.com>2014-03-11 00:35:07 +1300
commit31cfc73a09a8685cbab20502b4bc132e98e2feb5 (patch)
treec7eb3a0906bab0eb711bd7c79166c96fe97ec488 /Source/Core/VideoBackends/OGL/RasterFont.cpp
parent4591464486d696a300cc914f6c2a3cce8af2d666 (diff)
Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/RasterFont.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/RasterFont.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/OGL/RasterFont.cpp b/Source/Core/VideoBackends/OGL/RasterFont.cpp
index 1b7845887b..55b6f280b3 100644
--- a/Source/Core/VideoBackends/OGL/RasterFont.cpp
+++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp
@@ -141,9 +141,9 @@ RasterFont::RasterFont()
glActiveTexture(GL_TEXTURE0+8);
glBindTexture(GL_TEXTURE_2D, texture);
u32* texture_data = new u32[char_width*char_count*char_height];
- for(u32 y=0; y<char_height; y++) {
- for(u32 c=0; c<char_count; c++) {
- for(u32 x=0; x<char_width; x++) {
+ for (u32 y=0; y<char_height; y++) {
+ for (u32 c=0; c<char_count; c++) {
+ for (u32 x=0; x<char_width; x++) {
bool pixel = (0 != (rasters[c][y] & (1<<(char_width-x-1))));
texture_data[char_width*char_count*y+char_width*c+x] = pixel ? -1 : 0;
}
@@ -195,22 +195,22 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
GLfloat x = GLfloat(start_x);
GLfloat y = GLfloat(start_y);
- for(size_t i=0; i<length; i++) {
+ for (size_t i=0; i<length; i++) {
u8 c = text[i];
- if(c == '\n') {
+ if (c == '\n') {
x = GLfloat(start_x);
y -= delta_y + border_y;
continue;
}
// do not print spaces, they can be skipped easily
- if(c == ' ') {
+ if (c == ' ') {
x += delta_x + border_x;
continue;
}
- if(c < char_offset || c >= char_count+char_offset) continue;
+ if (c < char_offset || c >= char_count+char_offset) continue;
vertices[usage++] = x;
vertices[usage++] = y;
@@ -245,7 +245,7 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
x += delta_x + border_x;
}
- if(!usage) {
+ if (!usage) {
delete [] vertices;
return;
}
@@ -258,7 +258,7 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
s_shader.Bind();
- if(color != cached_color) {
+ if (color != cached_color) {
glUniform4f(uniform_color_id, GLfloat((color>>16)&0xff)/255.f,GLfloat((color>>8)&0xff)/255.f,GLfloat((color>>0)&0xff)/255.f,GLfloat((color>>24)&0xff)/255.f);
cached_color = color;
}