Exemplo n.º 1
0
void vs_render(scene *scene) {
    vs_local *local = scene_get_userdata(scene);

    game_player *player1 = game_state_get_player(scene->gs, 0);
    game_player *player2 = game_state_get_player(scene->gs, 1);

    // player 1 HAR
    object_render(&local->player1_har);

    // player 2 HAR
    object_render(&local->player2_har);

    // player 1 portrait
    object_render(&local->player1_portrait);

    // player 2 portrait
    object_render(&local->player2_portrait);


    font_render_shadowed(&font_small, local->vs_str, 160-((strlen(local->vs_str)*font_small.w)/2), 0, COLOR_YELLOW, TEXT_SHADOW_RIGHT|TEXT_SHADOW_BOTTOM);


    if (player2->selectable) {
        // arena selection
        video_render_sprite(&local->arena_select_bg, 55, 150, BLEND_ALPHA, 0);

        object_render(&local->arena_select);

        // arena name
        font_render_wrapped(&font_small, lang_get(56+local->arena), 56+72, 153, (211-72)-4, COLOR_GREEN);

        // arena description
        font_render_wrapped(&font_small, lang_get(66+local->arena), 56+72, 160, (211-72)-4, COLOR_GREEN);
    } else if (player2->pilot_id == 10 && settings_get()->gameplay.difficulty < 2) {
        // kriessack, but not on Veteran or higher
        font_render_wrapped(&font_small, lang_get(747), 59, 160, 200, COLOR_YELLOW);
    } else {
        font_render_wrapped(&font_small, lang_get(749+(11*player1->pilot_id)+player2->pilot_id), 59, 160, 150, COLOR_YELLOW);
        font_render_wrapped(&font_small, lang_get(870+(11*player2->pilot_id)+player1->pilot_id), 320-(59+150), 180, 150, COLOR_YELLOW);
    }
}
Exemplo n.º 2
0
void newsroom_overlay_render(scene *scene) {
    newsroom_local *local = scene_get_userdata(scene);

    // Render screencapture
    har_screencaps *caps = &(game_state_get_player(scene->gs, (local->won ? 0 : 1))->screencaps);
    if(local->screen == 0) {
        if(caps->ok[SCREENCAP_POSE])
            video_render_sprite_size(&caps->cap[SCREENCAP_POSE], 165, 15, SCREENCAP_W, SCREENCAP_H);
    } else {
        if(caps->ok[SCREENCAP_BLOW])
            video_render_sprite_size(&caps->cap[SCREENCAP_BLOW], 165, 15, SCREENCAP_W, SCREENCAP_H);
    }

    // Render text
    if(str_size(&local->news_str) > 0) {
        video_render_sprite(&local->news_bg, 20, 140, BLEND_ALPHA, 0);
        font_render_wrapped(&font_small, str_c(&local->news_str), 30, 150, 250, COLOR_YELLOW);
    }

    // Dialog
    if(dialog_is_visible(&local->continue_dialog)) {
        dialog_render(&local->continue_dialog);
    }
}
Exemplo n.º 3
0
void cutscene_render_overlay(scene *scene) {
    cutscene_local *local = scene_get_userdata(scene);
    font_render_wrapped(&font_small, local->current, local->text_x, local->text_y, local->text_width, local->color);
}
Exemplo n.º 4
0
void melee_render(scene *scene) {
    animation *ani;
    int current_a = 5*row_a + column_a;
    int current_b = 5*row_b + column_b;


    if (selection == 0) {
        video_render_sprite_flip(&feh, 70, 0, BLEND_ALPHA, FLIP_NONE);
        video_render_sprite_flip(&bleh, 0, 62, BLEND_ALPHA, FLIP_NONE);

        // player bio
        font_render_wrapped(&font_small, lang_get(135+current_a), 4, 66, 152, COLOR_GREEN);
        // player stats
        font_render(&font_small, lang_get(216), 74+27, 4, COLOR_GREEN);
        font_render(&font_small, lang_get(217), 74+19, 22, COLOR_GREEN);
        font_render(&font_small, lang_get(218), 74+12, 40, COLOR_GREEN);
        progressbar_render(&bar_power[0]);
        progressbar_render(&bar_agility[0]);
        progressbar_render(&bar_endurance[0]);

        if (scene->player2.selectable) {
            video_render_sprite_flip(&feh, 320-70-feh.w, 0, BLEND_ALPHA, FLIP_NONE);
            video_render_sprite_flip(&bleh, 320-bleh.w, 62, BLEND_ALPHA, FLIP_NONE);
            // player bio
            font_render_wrapped(&font_small, lang_get(135+current_b), 320-bleh.w+4, 66, 152, COLOR_GREEN);
            // player stats
            font_render(&font_small, lang_get(216), 320-66-feh.w+27, 4, COLOR_GREEN);
            font_render(&font_small, lang_get(217), 320-66-feh.w+19, 22, COLOR_GREEN);
            font_render(&font_small, lang_get(218), 320-66-feh.w+12, 40, COLOR_GREEN);
            progressbar_render(&bar_power[1]);
            progressbar_render(&bar_agility[1]);
            progressbar_render(&bar_endurance[1]);
        } else {
            // 'choose your pilot'
            font_render_wrapped(&font_small, lang_get(187), 160, 97, 160, COLOR_GREEN);
        }
    }
    ani = array_get(&scene->animations, 5);

    if (scene->player2.selectable) {
        video_render_sprite_flip(array_get(&ani->sprites, 0), 254, 0, BLEND_ALPHA, FLIP_NONE);
    } else {
        video_render_sprite_flip(array_get(&ani->sprites, 1), 162, 0, BLEND_ALPHA, FLIP_NONE);
    }
    if (selection == 0) {
        // player 1 name
        font_render_wrapped(&font_small, lang_get(20+current_a), 0, 52, 66, COLOR_BLACK);

        if (scene->player2.selectable) {
            // player 2 name
            font_render_wrapped(&font_small, lang_get(20+current_b), 320-66, 52, 66, COLOR_BLACK);
        }

        render_highlights(scene);
        for(int i = 0; i < 10; i++) {
            ani = array_get(&scene->animations, 3);

            video_render_sprite_flip(array_get(&ani->sprites, i), players[i].sprite->pos_x, players[i].sprite->pos_y, BLEND_ALPHA, FLIP_NONE);

            if (i == current_a) {
                // render the big portrait
                ani = array_get(&scene->animations, 4);
                video_render_sprite_flip(array_get(&ani->sprites, i), players_big[i].sprite->pos_x, players_big[i].sprite->pos_y, BLEND_ALPHA, FLIP_NONE);
            }

            if (scene->player2.selectable && i == current_b) {
                // render the big portrait
                ani = array_get(&scene->animations, 4);
                video_render_sprite_flip(array_get(&ani->sprites, i), 320-(players_big[i].sprite->img->w + players_big[i].sprite->pos_x), players_big[i].sprite->pos_y, BLEND_ALPHA, FLIP_HORIZONTAL);
            }
        }
    } else {
        // render the stupid unselected HAR portraits before anything
        // so we can render anything else on top of them
        sd_sprite *sprite = scene->bk->anims[1]->animation->sprites[0];
        ani = array_get(&scene->animations, 1);
        video_render_sprite_flip(array_get(&ani->sprites, 0), sprite->pos_x, sprite->pos_y, BLEND_ALPHA, FLIP_NONE);

        render_highlights(scene);

        // currently selected player
        ani = array_get(&scene->animations, 4);
        video_render_sprite_flip(array_get(&ani->sprites, player_id_a), players_big[player_id_a].sprite->pos_x, players_big[player_id_a].sprite->pos_y, BLEND_ALPHA, FLIP_NONE);

        //currently selected HAR
        video_render_sprite_flip(&harportraits[current_a], 11 + (62*column_a), 115 + (42*row_a), BLEND_ALPHA, FLIP_NONE);
        animationplayer_render(&harplayer_a);

        // player 1 name
        font_render_wrapped(&font_small, lang_get(20+player_id_a), 0, 52, 66, COLOR_BLACK);

        if (scene->player2.selectable) {
            // player 2 name
            font_render_wrapped(&font_small, lang_get(20+player_id_b), 320-66, 52, 66, COLOR_BLACK);

            // currently selected player
            video_render_sprite_flip(array_get(&ani->sprites, player_id_b), 320-(players_big[player_id_b].sprite->img->w + players_big[player_id_b].sprite->pos_x),
                    players_big[player_id_b].sprite->pos_y, BLEND_ALPHA, FLIP_HORIZONTAL);
            // currently selected HAR
            video_render_sprite_flip(&harportraits[current_b], 11 + (62*column_b), 115 + (42*row_b), BLEND_ALPHA, FLIP_NONE);
            animationplayer_render(&harplayer_b);
        } else {
            // 'choose your HAR'
            font_render_wrapped(&font_small, lang_get(186), 160, 97, 160, COLOR_GREEN);
        }
    }
}