mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
- Some more minor style cleanup
- Much improved startup log messages
This commit is contained in:
parent
678e50bf8d
commit
134878e996
3 changed files with 20 additions and 13 deletions
|
@ -91,6 +91,7 @@ qboolean QAL_Init( void ) {
|
|||
al_driver = Cvar_Get( "al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE );
|
||||
al_device = Cvar_Get( "al_device", "", CVAR_ARCHIVE );
|
||||
|
||||
Com_Printf("LoadLibrary(%s)\n", al_driver->string);
|
||||
handle = dlopen( al_driver->string, RTLD_LAZY );
|
||||
//Sys_LoadLibrary( al_driver->string, NULL, &handle );
|
||||
if( !handle ) {
|
||||
|
@ -102,25 +103,25 @@ QALC_IMP
|
|||
QAL_IMP
|
||||
#undef QAL
|
||||
|
||||
Com_DPrintf( "...opening OpenAL device: " );
|
||||
Com_Printf( "...opening OpenAL device: " );
|
||||
device = qalcOpenDevice( al_device->string[0] ? al_device->string : NULL );
|
||||
if( !device ) {
|
||||
goto fail;
|
||||
}
|
||||
Com_DPrintf( "ok\n" );
|
||||
Com_Printf( "ok\n" );
|
||||
|
||||
Com_DPrintf( "...creating OpenAL context: " );
|
||||
Com_Printf( "...creating OpenAL context: " );
|
||||
context = qalcCreateContext( device, NULL );
|
||||
if( !context ) {
|
||||
goto fail;
|
||||
}
|
||||
Com_DPrintf( "ok\n" );
|
||||
Com_Printf( "ok\n" );
|
||||
|
||||
Com_DPrintf( "...making context current: " );
|
||||
Com_Printf( "...making context current: " );
|
||||
if( !qalcMakeContextCurrent( context ) ) {
|
||||
goto fail;
|
||||
}
|
||||
Com_DPrintf( "ok\n" );
|
||||
Com_Printf( "ok\n" );
|
||||
|
||||
al_driver->flags |= CVAR_ARCHIVE;
|
||||
al_device->flags |= CVAR_ARCHIVE;
|
||||
|
|
|
@ -109,7 +109,8 @@ qboolean AL_Init( void ) {
|
|||
s_numchannels = i;
|
||||
AL_InitStreamSource();
|
||||
|
||||
Com_Printf( "OpenAL initialized.\n" );
|
||||
Com_Printf("\nOpenAL setting:\n");
|
||||
AL_SoundInfo();
|
||||
return true;
|
||||
|
||||
fail:
|
||||
|
|
|
@ -166,7 +166,7 @@ S_Init ( void )
|
|||
return;
|
||||
}
|
||||
#if USE_OPENAL
|
||||
} // this is a bit ugly but prevents dangling else problems
|
||||
} /* this is a bit ugly but prevents dangling else problems */
|
||||
#endif
|
||||
|
||||
num_sfx = 0;
|
||||
|
@ -174,7 +174,14 @@ S_Init ( void )
|
|||
soundtime = 0;
|
||||
paintedtime = 0;
|
||||
|
||||
Com_Printf( "sound sampling rate: %i\n", dma.speed );
|
||||
#if USE_OPENAL
|
||||
if(sound_started == SS_DMA)
|
||||
{
|
||||
Com_Printf( "Sound sampling rate: %i\n", dma.speed );
|
||||
}
|
||||
#else
|
||||
Com_Printf( "Sound sampling rate: %i\n", dma.speed );
|
||||
#endif
|
||||
|
||||
S_StopAllSounds();
|
||||
OGG_Init();
|
||||
|
@ -825,7 +832,8 @@ S_StartSound ( vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float fvol
|
|||
ps->sfx = sfx;
|
||||
|
||||
#if USE_OPENAL
|
||||
if( sound_started == SS_OAL ) {
|
||||
if( sound_started == SS_OAL )
|
||||
{
|
||||
ps->begin = paintedtime + timeofs * 1000;
|
||||
ps->volume = fvol * 384;
|
||||
}
|
||||
|
@ -1175,9 +1183,6 @@ S_RawSamples ( int samples, int rate, int width, int channels, byte *data, float
|
|||
|
||||
dst = s_rawend & ( MAX_RAW_SAMPLES - 1 );
|
||||
s_rawend++;
|
||||
// s_rawsamples [dst].left = ((char *) data)[src * 2] * intVolume;
|
||||
// s_rawsamples [dst].right = ((char *) data)[src * 2 + 1] * intVolume;
|
||||
/* the above doesn't work for me with U8, only the unsigned ones below do */
|
||||
s_rawsamples [dst].left = (((byte *) data)[src * 2] - 128) * intVolume;
|
||||
s_rawsamples [dst].right = (((byte *) data)[src * 2 + 1] - 128) * intVolume;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue