void JE_drawOptions( void ) { SDL_Surface *temp_surface = VGAScreen; VGAScreen = VGAScreenSeg; Player *this_player = &player[twoPlayerMode ? 1 : 0]; for (uint i = 0; i < COUNTOF(this_player->sidekick); ++i) { JE_OptionType *this_option = &options[this_player->items.sidekick[i]]; this_player->sidekick[i].ammo = this_player->sidekick[i].ammo_max = this_option->ammo; this_player->sidekick[i].ammo_refill_ticks = this_player->sidekick[i].ammo_refill_ticks_max = (105 - this_player->sidekick[i].ammo) * 4; this_player->sidekick[i].style = this_option->tr; this_player->sidekick[i].animation_enabled = (this_option->option == 1); this_player->sidekick[i].animation_frame = 0; this_player->sidekick[i].charge = 0; this_player->sidekick[i].charge_ticks = 20; // draw initial sidekick HUD const int y = hud_sidekick_y[twoPlayerMode ? 1 : 0][i]; fill_rectangle_xy(VGAScreenSeg, 284, y, 284 + 28, y + 15, 0); if (this_option->icongr > 0) blit_sprite(VGAScreenSeg, 284, y, OPTION_SHAPES, this_option->icongr - 1); // sidekick HUD icon draw_segmented_gauge(VGAScreenSeg, 284, y + 13, 112, 2, 2, MAX(1, this_player->sidekick[i].ammo_max / 10), this_player->sidekick[i].ammo); } VGAScreen = temp_surface; JE_drawOptionLevel(); }
static void draw() { clear(); blit_sprite(315,240-16, &video, SCALE, sprite, 35*5, 0); update_screen(); SDL_Delay(20); }