コード例 #1
0
ファイル: in_game.c プロジェクト: mpersano/protozoa
static void
draw(struct game_state *gs)
{
	extern struct game_state *cur_state;
	extern struct game_state playback_state;

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	set_modelview_matrix();

	if (!settings.static_settings || settings.static_settings->background)
		draw_level_background();

	if (cur_state != &playback_state &&
	  settings.control_type == CONTROL_HYBRID &&
	  ship_is_visible())
		draw_crosshair();

	if (inner_state.state != IS_LEVEL_CLEARED &&
	  inner_state.state != IS_LEVEL_TRANSITION &&
	  (inner_state.state != IS_WAVE_CLEARED ||
	  inner_state.tics < WAVE_CLEARED_TICS/2))
		draw_arena_outline(cur_arena, 1, cur_arena->border_type);

	draw_explosions();
	draw_particles();

	if (ship_is_visible()) {
		draw_ship();
		draw_missiles();
		draw_bombs();
		draw_lasers();
		draw_foes();
		draw_powerups();
	}

	draw_in_game_texts();
	draw_text();

	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();
}
コード例 #2
0
ファイル: main.c プロジェクト: dorkster/espada
//------------------------------
// Drawing functions
//------------------------------
void draw_everything()
{
    // Fill the screen with black
    SDL_FillRect(screen,NULL, 0x000000);
    
    // Draw background
    draw_background();
    
    // Draw the title screen
    if(gamestate_title == true)
        draw_titlescreen();
    else
    {
        // Draw the game objects
        if(gamestate_over == false)
            draw_player();
        draw_enemies();
        draw_explosions();
        draw_lasers();
        draw_info();
        draw_statustext();
    }
}