From: <mk...@us...> - 2003-10-22 12:39:52
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21918 Modified Files: CSPSim.cpp Log Message: Index: CSPSim.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/CSPSim.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CSPSim.cpp 20 Oct 2003 00:23:23 -0000 1.37 --- CSPSim.cpp 21 Oct 2003 21:13:01 -0000 1.38 *************** *** 664,668 **** if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) != 0) { ! printf("Unable to initialize SDL: %s\n", SDL_GetError()); CSP_LOG(APP, ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); return 1; --- 664,668 ---- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) != 0) { ! std::cerr << "Unable to initialize SDL: " << SDL_GetError() << "\n"; CSP_LOG(APP, ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); return 1; *************** *** 688,692 **** if (m_SDLScreen == NULL) { ! printf("Unable to set video mode: %s\n", SDL_GetError()); CSP_LOG(APP, ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); return 1; --- 688,692 ---- if (m_SDLScreen == NULL) { ! std::cerr << "Unable to set video mode: " << SDL_GetError() << "\n"; CSP_LOG(APP, ERROR, "ERROR! Unable to initialize SDL: " << SDL_GetError()); return 1; *************** *** 702,719 **** SDL_EnableUNICODE(1); ! std::string sound_path = getDataPath("SoundPath"); ! if ( SDL_LoadWAV(simdata::ospath::join(sound_path, "avionturbine5.wav").c_str(), ! &m_audioWave.spec, &m_audioWave.sound, &m_audioWave.soundlen) == NULL ) { ! CSP_LOG(APP, ERROR, "Couldn't load " << sound_path << "/avionturbine5.wav: " << SDL_GetError()); ! ::exit(1); ! } ! m_audioWave.spec.callback = fillerup; ! /* Initialize fillerup() variables */ ! if ( SDL_OpenAudio(&m_audioWave.spec, NULL) < 0 ) { ! fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); ! SDL_FreeWAV(m_audioWave.sound); ! ::exit(2); } bool mute = g_Config.getBool("Testing", "Mute", false, true); --- 702,719 ---- SDL_EnableUNICODE(1); ! // some simple sdl sound testing std::string sound_path = getDataPath("SoundPath"); ! std::string test_sound = simdata::ospath::join(sound_path, "avionturbine5.wav"); ! if (SDL_LoadWAV(test_sound.c_str(), &m_audioWave.spec, &m_audioWave.sound, ! &m_audioWave.soundlen) == NULL) { ! CSP_LOG(APP, WARNING, "Couldn't load '" << test_sound << "': " << SDL_GetError()); ! } else { ! m_audioWave.spec.callback = fillerup; ! /* Initialize fillerup() variables */ ! if (SDL_OpenAudio(&m_audioWave.spec, NULL) < 0) { ! CSP_LOG(APP, ERROR, "Couldn't open audio: " << SDL_GetError()); ! SDL_FreeWAV(m_audioWave.sound); ! } } bool mute = g_Config.getBool("Testing", "Mute", false, true); |