Moved to raylib 4.2.0. Renamed some directory functions to raylib 4.2.0 conventions. Removed GenMeshBinormals and GetRayCollisionModel. Sound and music pan.

This commit is contained in:
jussi
2022-08-19 13:38:09 +03:00
parent 4f54a0a499
commit 49f1dad6b9
13 changed files with 665 additions and 352 deletions

View File

@@ -520,6 +520,30 @@ int laudioSetSoundPitch( lua_State *L ) {
return 1;
}
/*
> success = RL_SetSoundPan( Sound sound, float pan )
Set pan for a sound ( 0.5 is center )
- Failure return false
- Success return true
*/
int laudioSetSoundPan( lua_State *L ) {
if ( !lua_isnumber( L, -2 ) || !lua_isnumber( L, -1 ) ) {
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetSoundPan( Sound sound, float pitch )" );
lua_pushboolean( L, false );
return 1;
}
if ( !validSound( lua_tointeger( L, -2 ) ) ) {
lua_pushboolean( L, false );
return 1;
}
SetSoundPan( *state->sounds[ lua_tointeger( L, -2 ) ], lua_tonumber( L, -1 ) );
lua_pushboolean( L, true );
return 1;
}
/*
> success = RL_WaveFormat( Wave wave, int sampleRate, int sampleSize, int channels )
@@ -760,6 +784,26 @@ int laudioSetMusicPitch( lua_State *L ) {
return 1;
}
/*
> success = RL_SetMusicPan( float pan )
Set pan for a music ( 0.5 is center )
- Failure return false
- Success return true
*/
int laudioSetMusicPan( lua_State *L ) {
if ( !lua_isnumber( L, -1 ) ) {
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetMusicPan( float pan )" );
lua_pushboolean( L, false );
return 1;
}
SetMusicPitch( state->music, lua_tonumber( L, -1 ) );
lua_pushboolean( L, true );
return 1;
}
/*
> length = RL_GetMusicTimeLength()