mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user