void SCR_StopCinematic(void) { cl.cinematictime = 0; /* done */ if (cin.pic) { Z_Free(cin.pic); cin.pic = NULL; } if (cin.pic_pending) { Z_Free(cin.pic_pending); cin.pic_pending = NULL; } if (cl.cinematicpalette_active) { R_SetPalette(NULL); cl.cinematicpalette_active = false; } if (cl.cinematic_file) { FS_FCloseFile(cl.cinematic_file); cl.cinematic_file = 0; } if (cin.hnodes1) { Z_Free(cin.hnodes1); cin.hnodes1 = NULL; } /* switch back down to 11 khz sound if necessary */ if (cin.restart_sound) { cin.restart_sound = false; CL_Snd_Restart_f(); } }
static void SoundResetDefaultsFunc ( void *unused ) { Cvar_SetToDefault ("s_volume"); Cvar_SetToDefault ("cd_nocd"); Cvar_SetToDefault ("cd_loopcount"); Cvar_SetToDefault ("s_khz"); Cvar_SetToDefault ("s_loadas8bit"); Cvar_SetToDefault ("s_primary"); Menu_DrawTextBox (168, 192, 36, 3); SCR_DrawString (188, 192+MENU_FONT_SIZE, ALIGN_CENTER, S_COLOR_ALT"Restarting the sound system. This", 255); SCR_DrawString (188, 192+MENU_FONT_SIZE*2, ALIGN_CENTER, S_COLOR_ALT"could take up to a minute, so", 255); SCR_DrawString (188, 192+MENU_FONT_SIZE*3, ALIGN_CENTER, S_COLOR_ALT"please be patient.", 255); // the text box won't show up unless we do a buffer swap GLimp_EndFrame(); CL_Snd_Restart_f(); SoundSetMenuItemValues(); }
static void UpdateSoundQualityFunc ( void *unused ) { //Knightmare- added DMP's 44/48 KHz sound support //** DMP check the newly added sound quality menu options switch (s_options_sound_quality_list.curvalue) { case 1: Cvar_SetValue( "s_khz", 22 ); Cvar_SetValue( "s_loadas8bit", false ); break; case 2: Cvar_SetValue( "s_khz", 44 ); Cvar_SetValue( "s_loadas8bit", false ); break; case 3: Cvar_SetValue( "s_khz", 48 ); Cvar_SetValue( "s_loadas8bit", false ); break; default: Cvar_SetValue( "s_khz", 11 ); Cvar_SetValue( "s_loadas8bit", true ); break; } //** DMP end sound menu changes Cvar_SetValue ("s_primary", s_options_sound_compatibility_list.curvalue); Menu_DrawTextBox (168, 192, 36, 3); SCR_DrawString (188, 192+MENU_FONT_SIZE, ALIGN_CENTER, S_COLOR_ALT"Restarting the sound system. This", 255); SCR_DrawString (188, 192+MENU_FONT_SIZE*2, ALIGN_CENTER, S_COLOR_ALT"could take up to a minute, so", 255); SCR_DrawString (188, 192+MENU_FONT_SIZE*3, ALIGN_CENTER, S_COLOR_ALT"please be patient.", 255); // the text box won't show up unless we do a buffer swap GLimp_EndFrame(); CL_Snd_Restart_f(); }
/* ================== SCR_PlayCinematic ================== */ void SCR_PlayCinematic (char *arg) { int width, height; byte *palette; char name[MAX_OSPATH], *dot; int old_khz; // make sure CD isn't playing music CDAudio_Stop(); cl.cinematicframe = 0; dot = strstr (arg, "."); if (dot && Q_streq(dot, ".pcx")) { // static pcx image Com_sprintf (name, sizeof(name), "pics/%s", arg); SCR_LoadPCX (name, &cin.pic, &palette, &cin.width, &cin.height); cl.cinematicframe = -1; cl.cinematictime = 1; SCR_EndLoadingPlaque(); cls.state = ca_active; cl_scores_setinuse_all(false); // jitscores - clear scoreboard if (!cin.pic) { Com_Printf ("%s not found.\n", name); cl.cinematictime = 0; } else { memcpy (cl.cinematicpalette, palette, sizeof(cl.cinematicpalette)); Z_Free (palette); } return; } Com_sprintf (name, sizeof(name), "video/%s", arg); FS_FOpenFile (name, &cl.cinematic_file); if (!cl.cinematic_file) { SCR_FinishCinematic(); cl.cinematictime = 0; // done return; } SCR_EndLoadingPlaque(); cls.state = ca_active; cl_scores_setinuse_all(false); // jitscores - clear scoreboard FS_Read (&width, 4, cl.cinematic_file); FS_Read (&height, 4, cl.cinematic_file); cin.width = LittleLong(width); cin.height = LittleLong(height); FS_Read (&cin.s_rate, 4, cl.cinematic_file); cin.s_rate = LittleLong(cin.s_rate); FS_Read (&cin.s_width, 4, cl.cinematic_file); cin.s_width = LittleLong(cin.s_width); FS_Read (&cin.s_channels, 4, cl.cinematic_file); cin.s_channels = LittleLong(cin.s_channels); Huff1TableInit (); // switch up to 22 khz sound if necessary old_khz = Cvar_VariableValue ("s_khz"); if (old_khz != cin.s_rate/1000) { cin.restart_sound = true; Cvar_SetValue ("s_khz", cin.s_rate/1000); CL_Snd_Restart_f (); Cvar_SetValue ("s_khz", old_khz); } cl.cinematicframe = 0; cin.pic = SCR_ReadNextFrame (); cl.cinematictime = Sys_Milliseconds (); }
/* ================== SCR_PlayCinematic ================== */ void SCR_PlayCinematic (char *arg) { int32_t width, height; byte *palette; char name[MAX_OSPATH], *dot; int32_t old_khz; cin.isStaticPic = false; // Knightmare added cl.cinematicframe = 0; dot = strstr (arg, "."); if (dot && !strcmp (dot, ".pcx")) { // static pcx image Com_sprintf (name, sizeof(name), "pics/%s", arg); SCR_LoadPCX (name, &cin.pic, &palette, &cin.width, &cin.height); cl.cinematicframe = -1; cl.cinematictime = 1; SCR_EndLoadingPlaque (); cls.state = ca_active; if (!cin.pic) { Com_Printf ("%s not found.\n", name); cl.cinematictime = 0; } else { memcpy (cl.cinematicpalette, palette, sizeof(cl.cinematicpalette)); Z_Free (palette); // Knightmare- HACK to show JPG endscreens cin.isStaticPic = true; Com_sprintf (cin.picName, sizeof(cin.picName), "/pics/%s", arg); } return; } Com_sprintf (name, sizeof(name), "video/%s", arg); FS_FOpenFile (name, &cl.cinematic_file, FS_READ); if (!cl.cinematic_file) { //Com_Error (ERR_DROP, "Cinematic %s not found.\n", name); //Com_Printf (S_COLOR_YELLOW"Cinematic %s not found.\n", name); SCR_FinishCinematic (); cl.cinematictime = 0; // done return; } SCR_EndLoadingPlaque (); cls.state = ca_active; FS_Read (&width, 4, cl.cinematic_file); FS_Read (&height, 4, cl.cinematic_file); cin.width = LittleLong(width); cin.height = LittleLong(height); FS_Read (&cin.s_rate, 4, cl.cinematic_file); cin.s_rate = LittleLong(cin.s_rate); FS_Read (&cin.s_width, 4, cl.cinematic_file); cin.s_width = LittleLong(cin.s_width); FS_Read (&cin.s_channels, 4, cl.cinematic_file); cin.s_channels = LittleLong(cin.s_channels); Huff1TableInit (); // switch up to 22 khz sound if necessary old_khz = Cvar_VariableValue ("s_khz"); if (old_khz < cin.s_rate/1000) // Knighmare- changed != to < { cin.restart_sound = true; Cvar_SetValue ("s_khz", cin.s_rate/1000); CL_Snd_Restart_f (); Cvar_SetValue ("s_khz", old_khz); } cl.cinematicframe = 0; cin.pic = SCR_ReadNextFrame (); cl.cinematictime = Sys_Milliseconds (); }