static void vis_fft(void) { int i, y; /*this is the size of vis_overlay.width*/ unsigned char outfft[120]; if (_vis_virgin) { vgamem_ovl_alloc(&vis_overlay); _vis_virgin = 0; } _draw_vis_box(); song_lock_audio(); vgamem_ovl_clear(&vis_overlay,0); _get_columns_from_fft(outfft,current_fft_data); for (i = 0; i < 120; i++) { y = outfft[i]; /*reduce range */ y >>= 3; if (y > 15) y = 15; if (y > 0) { vgamem_ovl_drawline(&vis_overlay,i,15-y,i,15,5); } } vgamem_ovl_apply(&vis_overlay); song_unlock_audio(); }
static void vis_oscilloscope(void) { if (_vis_virgin) { vgamem_ovl_alloc(&vis_overlay); _vis_virgin = 0; } _draw_vis_box(); song_lock_audio(); if (status.vis_style == VIS_MONOSCOPE) { if (audio_output_bits == 16) { draw_sample_data_rect_16(&vis_overlay,audio_buffer, audio_buffer_samples, audio_output_channels,1); } else { draw_sample_data_rect_8(&vis_overlay,(void*)audio_buffer, audio_buffer_samples, audio_output_channels,1); } } else if (audio_output_bits == 16) { draw_sample_data_rect_16(&vis_overlay,audio_buffer,audio_buffer_samples, audio_output_channels,audio_output_channels); } else { draw_sample_data_rect_8(&vis_overlay,(void *)audio_buffer,audio_buffer_samples, audio_output_channels,audio_output_channels); } song_unlock_audio(); }
void show_about(void) { static int didit = 0; struct dialog *d; unsigned char *p; int x, y; fake_driver = (rand() & 3) ? 0 : 1; if (!didit) { vgamem_ovl_alloc(&logo_image); it_logo = xpmdata(_logo_it_xpm); schism_logo = xpmdata(_logo_schism_xpm); didit=1; } if (status.flags & CLASSIC_MODE) { p = it_logo ? it_logo->pixels : NULL; } else { p = schism_logo ? schism_logo->pixels : NULL; } /* this is currently pretty gross */ vgamem_ovl_clear(&logo_image, 2); if (p) { int c = (status.flags & CLASSIC_MODE) ? 11 : 0; for (y = 0; y < LOGO_HEIGHT; y++) { for (x = 0; x < LOGO_WIDTH; x++) { if (p[x]) { vgamem_ovl_drawpixel(&logo_image, x+2, y+6, c); } } vgamem_ovl_drawpixel(&logo_image, x, y+6, 2); vgamem_ovl_drawpixel(&logo_image, x+1, y+6, 2); p += LOGO_PITCH; } } create_button(widgets_about + 0, 33,32, 12, 0,0,0,0,0, dialog_yes_NULL, "Continue", 3); d = dialog_create_custom(11,16, 58, 19, widgets_about, 1, 0, about_draw_const, NULL); d->action_yes = about_close; d->action_no = about_close; d->action_cancel = about_close; /* okay, in just a moment, we're going to the module page. * if your modules dir is large enough, this causes an annoying pause. * to defeat this, we start scanning *NOW*. this makes startup "feel" * faster. */ status.flags |= DIR_MODULES_CHANGED; pages[PAGE_LOAD_MODULE].set_page(); }