From: <cad...@li...> - 2005-11-29 22:42:00
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns=3D"http://www.w3.org/1999/xhtml"> <head><style type=3D"text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: = #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li { font-family: verdana,arial,helvetica= ,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; fo= nt-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padd= ing: 6px; } #msg ul, pre { overflow: auto; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt= ;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:aut= o;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patc= h .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 = 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 = 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[287] tiki/sdl/src/init_shutdown.cpp: If we fail to init OpenAL, i= ngore further OpenAL init calls and allow the app to start without sound.= </title> </head> <body> <div id=3D"msg"> <dl> <dt>Revision</dt> <dd>287</dd> <dt>Author</dt> <dd>atani</dd> <dt>Date</dt> <dd>2005-11-29 14:33:30 -0800 (Tue, 29 Nov 2005)</dd> </dl> <h3>Log Message</h3> <pre>If we fail to init OpenAL, ingore further OpenAL init calls and allo= w the app to start without sound.</pre> <h3>Modified Paths</h3> <ul> <li><a href=3D"#tikisdlsrcinit_shutdowncpp">tiki/sdl/src/init_shutdown.cp= p</a></li> </ul> </div> <div id=3D"patch"> <h3>Diff</h3> <a id=3D"tikisdlsrcinit_shutdowncpp"></a> <div class=3D"modfile"><h4>Modified: tiki/sdl/src/init_shutdown.cpp (286 = =3D> 287)</h4> <pre class=3D"diff"> <span class=3D"info">--- tiki/sdl/src/init_shutdown.cpp 2005-11-28 09:07:= 26 UTC (rev 286) +++ tiki/sdl/src/init_shutdown.cpp 2005-11-29 22:33:30 UTC (rev 287) </span><span class=3D"lines">@@ -31,20 +31,23 @@ </span><span class=3D"cx"> dev =3D alcOpenDevice("sdl"); </span><span class=3D"cx"> if(dev =3D=3D NULL) </span><span class=3D"cx"> { </span><del>- fprintf(stderr, "alcOpenDevice returned NULL: %s\n&qu= ot;, alGetError()); - return false; </del><ins>+ fprintf(stderr, "Unable to initialize OpenAL: %s\n&quo= t;, alGetError()); </ins><span class=3D"cx"> } </span><del>- context =3D alcCreateContext(dev, NULL); - if(context =3D=3D NULL) </del><ins>+ else </ins><span class=3D"cx"> { </span><del>- fprintf(stderr, "alcCreateContext returned NULL: %s\n= ", alGetError()); - return false; </del><ins>+ context =3D alcCreateContext(dev, NULL); + if(context =3D=3D NULL) + { + fprintf(stderr, "alcCreateContext returned NULL: %s\n", alG= etError()); + } + else + { + alcMakeContextCurrent(context); + alutInitWithoutContext(&argc, argv); + Audio::Sound::initGlobal(); + Audio::Stream::initGlobal(); + } </ins><span class=3D"cx"> } </span><del>- alcMakeContextCurrent(context); - alutInitWithoutContext(&argc, argv); - - Audio::Sound::initGlobal(); - Audio::Stream::initGlobal(); </del><span class=3D"cx"> GL::Plxcompat::plx_mat3d_init(640, 480); </span><span class=3D"cx"> return Hid::init(); </span><span class=3D"cx"> } </span></pre> </div> </div> </body> </html> |