Project

General

Profile

Revision 314

some changes in fonts and ent.c

View differences:

proj.c
80 80
    /// Load stuff
81 81
    {
82 82
        graph_clear_screen();
83
        text_t *txt = text_ctor(default_font, "Loading...");
83
        text_t *txt = text_ctor(font_get_default(), "Loading...");
84 84
        text_set_pos(txt, graph_get_XRes()/2, graph_get_YRes()/2);
85 85
        text_set_valign(txt, text_valign_center);
86 86
        text_set_halign(txt, text_halign_center);
......
100 100
        sp_crosshair = sprite_ctor(bsp_crosshair); if(sp_crosshair == NULL) printf("Failed to get crosshair sprite\n");
101 101
    }
102 102

  
103
    menu_t *main_menu = menu_ctor(default_font);
103
    menu_t *main_menu = menu_ctor(font_get_default());
104 104
    menu_add_item(main_menu, "Single player");
105 105
    menu_add_item(main_menu, "Multiplayer");
106 106
    menu_add_item(main_menu, "Chat");
......
205 205
static int (multiplayer)(void) {
206 206
    int r;
207 207

  
208
    menu_t *main_menu = menu_ctor(default_font);
208
    menu_t *main_menu = menu_ctor(font_get_default());
209 209
    menu_add_item(main_menu, "Create");
210 210
    menu_add_item(main_menu, "Connect");
211 211
    menu_add_item(main_menu, "Back");
......
270 270
    nctp_set_processor(multiplayer_process);/*
271 271

  
272 272
    ent_set_scale(DEFAULT_SCALE);
273
    text_timer_t *in_game_timer = timer_ctor(default_font);
273
    text_timer_t *in_game_timer = timer_ctor(font_get_default());
274 274

  
275 275
    list_t *shooter_list = list_ctor();
276 276

  
......
334 334
    nctp_set_processor(multiplayer_process);
335 335

  
336 336
    ent_set_scale(DEFAULT_SCALE);
337
    text_timer_t *in_game_timer = timer_ctor(default_font);
337
    text_timer_t *in_game_timer = timer_ctor(font_get_default());
338 338

  
339 339
    list_t *shooter_list = list_ctor();
340 340

  
......
398 398

  
399 399
    int r;
400 400

  
401
    menu_t *main_menu = menu_ctor(default_font);
401
    menu_t *main_menu = menu_ctor(font_get_default());
402 402
    menu_add_item(main_menu, "Campaign");
403 403
    menu_add_item(main_menu, "Zombies");
404 404
    menu_add_item(main_menu, "Back");
......
462 462
    int r;
463 463

  
464 464
    ent_set_scale(DEFAULT_SCALE);
465
    text_timer_t *in_game_timer = timer_ctor(default_font);
465
    text_timer_t *in_game_timer = timer_ctor(font_get_default());
466 466

  
467 467
    list_t *shooter_list = list_ctor();
468 468

  
......
570 570
    int r;
571 571

  
572 572
    ent_set_scale(DEFAULT_SCALE);
573
    text_timer_t *in_game_timer = timer_ctor(default_font);
573
    text_timer_t *in_game_timer = timer_ctor(font_get_default());
574 574

  
575 575
    list_t *shooter_list = list_ctor();
576 576

  
......
715 715
        strcpy(buffer2, dest);
716 716
        strncat(buffer2, " <", 2);
717 717
        for(size_t i = CHAT_MAX_NUM-1; i; --i)
718
        text_set_text(t_text[i], text_get_string(t_text[i-1]));
719
        text_set_text(t_text[0], buffer2);
718
        text_set_string(t_text[i], text_get_string(t_text[i-1]));
719
        text_set_string(t_text[0], buffer2);
720 720
        for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
721 721
            if(text_get_string(t_text[i])[0] == '>'){
722 722
                text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
......
749 749
        rectangle_set_fill_trans(r_buffer, GRAPH_TRANSPARENT);
750 750
    }
751 751
    text_t      *t_buffer = NULL; {
752
        t_buffer = text_ctor(default_font, "");
752
        t_buffer = text_ctor(font_get_default(), "");
753 753
        text_set_pos(t_buffer, rectangle_get_x(r_buffer)+50,
754 754
        rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)/2);
755 755
        text_set_halign(t_buffer, text_halign_left);
......
757 757
        text_set_color (t_buffer, TEXT_COLOR);
758 758
    }
759 759
    text_t      *t_size   = NULL; {
760
        t_size = text_ctor(default_font, "");
760
        t_size = text_ctor(font_get_default(), "");
761 761
        text_set_pos(t_size, rectangle_get_x(r_buffer)+rectangle_get_w(r_buffer)-5,
762 762
        rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)-5);
763 763
        text_set_halign(t_size, text_halign_right);
......
766 766
        text_set_size  (t_size, 18);
767 767
        char buffer2[20];
768 768
        sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
769
        text_set_text(t_size, buffer2);
769
        text_set_string(t_size, buffer2);
770 770
    }
771 771

  
772 772
    /** r_text */ {
......
780 780
    }
781 781
    /** t_text */ {
782 782
    for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
783
        t_text[i] = text_ctor(default_font, " ");
783
        t_text[i] = text_ctor(font_get_default(), " ");
784 784
        text_set_pos(t_text[i], rectangle_get_x(r_text)+50,
785 785
        rectangle_get_y(r_text)+rectangle_get_h(r_text)-30-25*i);
786 786
        text_set_halign(t_text[i], text_halign_left);
......
820 820
                    char buffer2[CHAT_MAX_SIZE+3] = "> ";
821 821
                    strncat(buffer2, buffer, strlen(buffer));
822 822
                    for(size_t i = CHAT_MAX_NUM-1; i; --i)
823
                    text_set_text(t_text[i], text_get_string(t_text[i-1]));
824
                    text_set_text(t_text[0], buffer2);
823
                    text_set_string(t_text[i], text_get_string(t_text[i-1]));
824
                    text_set_string(t_text[0], buffer2);
825 825
                    for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
826 826
                        if(text_get_string(t_text[i])[0] == '>'){
827 827
                            text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
......
840 840
                    if(strlen(buffer) < CHAT_MAX_SIZE) strncat(buffer, &c, 1);
841 841
                    else                               printf("Char limit exceeded\n");
842 842
                }
843
                text_set_text(t_buffer, buffer);
843
                text_set_string(t_buffer, buffer);
844 844
                char buffer2[20];
845 845
                sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
846
                text_set_text(t_size, buffer2);
846
                text_set_string(t_size, buffer2);
847 847
                case MOUSE_IRQ:
848 848
                if (counter_mouse_ih >= 3) {
849 849
                    mouse_parse_packet(packet_mouse_ih, &pp);

Also available in: Unified diff