void SoundStartup( void ) { int32 status; int fxdevicetype; void * initdata = 0; // if they chose None lets return if (FXDevice < 0) { return; } else if (FXDevice == 0) { fxdevicetype = ASS_AutoDetect; } else { fxdevicetype = FXDevice - 1; } // #ifdef _WIN32 // initdata = (void *) win_gethwnd(); // #endif status = FX_Init( fxdevicetype, NumVoices, &NumChannels, &NumBits, &MixRate, initdata ); if ( status == FX_Ok ) { FX_SetVolume( FXVolume ); FX_SetReverseStereo(ReverseStereo); status = FX_SetCallBack( testcallback ); } if ( status != FX_Ok ) { sprintf(tempbuf, "Sound startup error: %s", FX_ErrorString( FX_Error )); gameexit(tempbuf); } FXDevice = 0; }
static int osdcmd_vidmode(const osdfuncparm_t *parm) { int newbpp = ScreenBPP, newwidth = ScreenWidth, newheight = ScreenHeight, newfs = ScreenMode; if (parm->numparms < 1 || parm->numparms > 4) return OSDCMD_SHOWHELP; switch (parm->numparms) { case 1: // bpp switch newbpp = Batol(parm->parms[0]); break; case 2: // res switch newwidth = Batol(parm->parms[0]); newheight = Batol(parm->parms[1]); break; case 3: // res & bpp switch case 4: newwidth = Batol(parm->parms[0]); newheight = Batol(parm->parms[1]); newbpp = Batol(parm->parms[2]); if (parm->numparms == 4) newfs = (Batol(parm->parms[3]) != 0); break; } if (setgamemode(newfs,newwidth,newheight,newbpp)) { initprintf("vidmode: Mode change failed!\n"); if (setgamemode(ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP)) gameexit("vidmode: Reset failed!\n"); } ScreenBPP = newbpp; ScreenWidth = newwidth; ScreenHeight = newheight; ScreenMode = newfs; onvideomodechange(ScreenBPP>8); vscrn(); return OSDCMD_OK; }
int osdcmd_quit(const osdfuncparm_t *parm) { extern long quittimer; parm=parm; if (!gamequit && numplayers > 1) { if((ps[myconnectindex].gm&MODE_GAME)) { gamequit = 1; quittimer = totalclock+120; } else { sendlogoff(); gameexit(" "); } } else if (numplayers < 2) gameexit(" "); return OSDCMD_OK; }
// This function will quit the game void CVARDEFS_FunctionQuit(void* var) { if( numplayers > 1 ) { if(ps[myconnectindex].gm&MODE_GAME) { gamequit = 1; CONSOLE_SetActive(0); } else { sendlogoff(); gameexit(" "); } } else if( numplayers < 2 ) gameexit(" "); }
static int osdcmd_restartvid(const osdfuncparm_t *parm) { extern long qsetmode; resetvideomode(); if (setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP)) gameexit("restartvid: Reset failed...\n"); onvideomodechange(ScreenBPP>8); vscrn(); return OSDCMD_OK; }
void SoundShutdown( void ) { int32 status; // if they chose None lets return if (FXDevice == NumSoundCards) return; status = FX_Shutdown(); if ( status != FX_Ok ) { puts("Error initializing sound."); gameexit(""); } }
void SoundShutdown( void ) { int32 status; // if they chose None lets return if (FXDevice < 0) return; if (MusicVoice >= 0) { MusicShutdown(); } status = FX_Shutdown(); if ( status != FX_Ok ) { sprintf(tempbuf, "Sound shutdown error: %s", FX_ErrorString( FX_Error )); gameexit(tempbuf); } }