Subversion Repositories Kolibri OS

Rev

Rev 5235 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5235 Rev 5237
Line 333... Line 333...
333
    float clamp1[4] = { 0.45, 0.69, 0.65, 0.87 }; // 0.8 to 0.86
333
    float clamp1[4] = { 0.45, 0.69, 0.65, 0.87 }; // 0.8 to 0.86
334
    float clamp2[4] = { 0.90, 0.75, 0.85, 0.92 };
334
    float clamp2[4] = { 0.90, 0.75, 0.85, 0.92 };
335
    float radiuses[4] = { 0.9667, 0.997, 1.2, 0.87 };
335
    float radiuses[4] = { 0.9667, 0.997, 1.2, 0.87 };
Line 336... Line 336...
336
    
336
    
337
    float colors_r[4] = { 0.3, 0.997, 1.0, 0.9 };
337
    float colors_r[4] = { 0.3, 0.997, 1.0, 0.9 };
338
    float colors_g[4] = { 0.2, 0.875, 1.0, 0.6 };
338
    float colors_g[4] = { 0.2, 0.875, 1.0, 0.5 };
339
    float colors_b[4] = { 0.1, 0.763, 1.0, 0.3 };
339
    float colors_b[4] = { 0.1, 0.763, 1.0, 0.1 };
Line 340... Line 340...
340
    // 1: 0.5, 0.74, 0.79
340
    // 1: 0.5, 0.74, 0.79
Line 341... Line 341...
341
 
341
 
Line 446... Line 446...
446
    };
446
    };
Line 447... Line 447...
447
 
447
 
Line 448... Line -...
448
 
-
 
449
};
-
 
450
 
-
 
451
void game_textout_init(int set_to_ortho, int font_index) {
-
 
452
    
-
 
453
//    CHECK_GL("textout init: start");
-
 
454
//
-
 
455
//    glDisable(GL_DEPTH_TEST);
-
 
456
//    CHECK_GL("textout init: disable depth test");
-
 
457
//
-
 
458
//    rs_sh_use(game.text_shader);
-
 
459
//    CHECK_GL("textout init: use text shader");
-
 
460
//    glBindTexture(GL_TEXTURE_2D, game.font_texture[font_index]);
-
 
461
//    CHECK_GL("textout init: glBindTexture");
-
 
462
//    glUniform1i( game.text_shader[RS_SH_SAMPLER0_ID], 0 );
-
 
463
//    if (set_to_ortho) {
-
 
464
//        rs_mx_ortho1h_proj();
-
 
465
//    }
-
 
466
//
-
 
467
//    CHECK_GL("textout init: label d");
-
 
468
//
-
 
469
//    glUniformMatrix4fv( game.text_shader[RS_SH_PROJ_ID], 1, GL_FALSE, rs_reg.mx_proj );
-
 
470
//
-
 
471
//    CHECK_GL("textout init: label e");
-
 
472
//
-
 
473
//    glUniform4f( game.text_shader[RS_SH_COLOR_ID], 0.0, 0.0, 0.0, 0.0 );
-
 
474
//
-
 
Line 475... Line 448...
475
//    CHECK_GL("textout init: end");
448
 
476
};
449
};
477
 
450
 
Line 501... Line 474...
501
        };
474
        };
502
        s++;
475
        s++;
503
        i++;
476
        i++;
504
    };
477
    };
Line 505... Line -...
505
    
-
 
506
//    for (i = 0; i < 8; i++) {
-
 
507
//        texture_draw(&game.framebuffer, &game.tex_font[i], 40+8+game.tx+i*game.tex_font[i].w, 80+game.ty, DRAW_MODE_ALPHA);
-
 
508
//    }
-
 
509
    
-
 
510
    
-
 
511
 
-
 
512
//    //char *s = "12345_QUICK_BROWN_FOX_JUMPS_OVER_A_LAZY_DOG";
-
 
513
//
-
 
514
//    float w = 2.0*h/3.0;
-
 
515
//    int len = strlen(s);
-
 
516
//
-
 
517
//    x -= (float) align * 0.5 * len * w;
-
 
518
//
-
 
519
//    float sx = 0.0;
-
 
520
//    float sy = 0.0;
-
 
521
//
-
 
522
//
-
 
523
//
-
 
524
//    int i;
-
 
525
//    for (i = 0; i < len; i++) {
-
 
526
//        unsigned char c = s[i];
-
 
527
//
-
 
528
//        if (c == '\n') {
-
 
529
//            sx = 0.0;
-
 
530
//            sy += h;
-
 
531
//            continue;
-
 
532
//        };
-
 
533
//
-
 
534
//        if (c == ' ') {
-
 
535
//            sx += w;
-
 
536
//            continue;
-
 
537
//        };
-
 
538
//
-
 
539
//        c = (c-48)%64;
-
 
540
//        float tx = 1.0 / 8.0 * (c % 8);
-
 
541
//        float ty = 1.0 / 8.0 * (c / 8);
-
 
542
//
-
 
543
//        glUniform4fv( game.text_shader[RS_SH_SCALE_ID], 1, &(game_colors[4*0]) ); // black shadow
-
 
544
//        glrsDrawRect_full(sx + x + h/12,
-
 
545
//                          sy + y-h/2 + h/12,
-
 
546
//                          sx + x + w + h/12,
-
 
547
//                          sy + y+h/2 + h/12,
-
 
548
//                          tx, ty, tx+1.0/8.0, ty+1.0/8.0,
-
 
549
//                          game.text_shader[RS_SH_POS_ID], game.text_shader[RS_SH_UV_ID],
-
 
550
//                          0.0, 0.0, 0.0 );
-
 
551
//
-
 
552
//        glUniform4fv( game.text_shader[RS_SH_SCALE_ID], 1, &(game_colors[4*color]) );
-
 
553
////        glUniform3f( game.text_shader[RS_SH_TIME_ID], 1.0, 1.0, 0.0 );
-
 
554
//        glrsDrawRect_full(sx + x,
-
 
555
//                          sy + y-h/2,
-
 
556
//                          sx + x + w,
-
 
557
//                          sy + y+h/2,
-
 
558
//                          tx, ty, tx+1.0/8.0, ty+1.0/8.0,
-
 
559
//                          game.text_shader[RS_SH_POS_ID], game.text_shader[RS_SH_UV_ID],
-
 
560
//                          0.0, 0.0, 0.0 );
-
 
561
//        sx += w;
-
 
Line 562... Line 478...
562
//    }
478