adwadwa
[vg.git] / vg_ui.h
diff --git a/vg_ui.h b/vg_ui.h
index dc0cceec4288b3dbeb7365d29846e273ad72a918..1e120e28aad5e9e67f3b1796401a19181d9824a3 100644 (file)
--- a/vg_ui.h
+++ b/vg_ui.h
@@ -306,14 +306,11 @@ VG_STATIC void _vg_ui_init(void)
    u32 pixels = 0, total = 256*256, data = 0;
    u8 image[256*256];
    
-   while( pixels < total )
-   {
-      for( int b = 31; b >= 0; b-- )
-      {
-         image[ pixels ++ ] = (compressed[data] & (0x1 << b))? 0xff: 0x00;
+   while( pixels < total ){
+      for( int b = 31; b >= 0; b-- ){
+         image[ pixels ++ ] = (compressed[data] & (0x1u << b))? 0xffu: 0x00u;
          
-         if( pixels >= total )
-         {
+         if( pixels >= total ){
             total = 0;
             break;
          }
@@ -653,16 +650,13 @@ VG_STATIC void ui_text( ui_px pos[2],
        text_cursor[2] = 8*scale;
        text_cursor[3] = 14*scale;
 
-       while( (c = *(_c ++)) )
-       {
-               if( c == '\n' )
-               {
+       while( (c = *(_c ++)) ){
+               if( c == '\n' ){
                        text_cursor[1] += 14*scale;
                        text_cursor[0] = pos[0] + ui_text_line_offset( _c, scale, align );
                        continue;
                }
-               else if( c >= 33 )
-               {
+               else if( c >= 33 ){
                        u8 glyph_base[2];
                        u8 glyph_index = c;
                        glyph_base[0] = glyph_index & 0xf;
@@ -679,20 +673,15 @@ VG_STATIC void ui_text( ui_px pos[2],
                glyph_base[1]+8
             });
                }
-               else if( c == '\x1B' )
-               {
+               else if( c == '\x1B' ){
                        _c ++;
                        u16 colour_id = 0;
-                       for( int i = 0; i < 3; i ++ )
-                       {
-                               if( _c[i] )
-                               {
-                                       if( _c[i] == 'm' )
-                                       {
+                       for( int i = 0; i < 3; i ++ ){
+                               if( _c[i] ){
+                                       if( _c[i] == 'm' ){
                                                _c = _c + i + 1;
                                                
-                                               switch( colour_id )
-                                               {
+                                               switch( colour_id ){
                                                        case '0': current_colour = 0x00ffffff; break;
                                                        case '3'|'1'<<8: current_colour = 0x00201fee; break;
                                                        case '3'|'2'<<8: current_colour = 0x0037e420; break;
@@ -708,8 +697,7 @@ VG_STATIC void ui_text( ui_px pos[2],
                                        
                                        colour_id |= _c[i] << (i*8);
                                } 
-                               else
-                               {
+                               else{
                                        _c = _c +i;
                                        break;
                                }
@@ -717,8 +705,7 @@ VG_STATIC void ui_text( ui_px pos[2],
 
          continue;
                }
-      else if( c == '\t' )
-      {
+      else if( c == '\t' ){
          text_cursor[0] += UI_GLYPH_SPACING_X*scale*4;
          continue;
       }