diff options
| author | realtradam <[email protected]> | 2022-01-21 20:50:55 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-21 20:50:55 -0500 |
| commit | 253d04b86952b021370eec7957784719900cb3ef (patch) | |
| tree | afcf9ec96bcf6aac297ff58a7d97126c49f42e6a /vendor | |
| parent | 7e10d9b61c9341acc63e4bd135db05f0cafccc00 (diff) | |
| download | FelFlameEngine-253d04b86952b021370eec7957784719900cb3ef.tar.gz FelFlameEngine-253d04b86952b021370eec7957784719900cb3ef.zip | |
added blend mode
Diffstat (limited to 'vendor')
| -rw-r--r-- | vendor/include/raylib/raudio.h | 3 | ||||
| -rw-r--r-- | vendor/include/raylib/raylib.h | 7 | ||||
| -rw-r--r-- | vendor/include/raylib/raymath.h | 15 | ||||
| -rw-r--r-- | vendor/include/raylib/rlgl.h | 87 | ||||
| -rw-r--r-- | vendor/lib/tux/mruby/libmruby.a | bin | 8576116 -> 8577692 bytes | |||
| -rw-r--r-- | vendor/lib/tux/raylib/libraylib.a | bin | 2519508 -> 2520054 bytes | |||
| -rw-r--r-- | vendor/lib/web/mruby/libmruby.a | bin | 1448662 -> 1449104 bytes | |||
| -rw-r--r-- | vendor/lib/web/raylib/libraylib.a | bin | 1035342 -> 1034962 bytes |
8 files changed, 73 insertions, 39 deletions
diff --git a/vendor/include/raylib/raudio.h b/vendor/include/raylib/raudio.h index dbcfbd6..35c850b 100644 --- a/vendor/include/raylib/raudio.h +++ b/vendor/include/raylib/raudio.h @@ -155,6 +155,7 @@ int GetSoundsPlaying(void); // Get number of bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) +void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.0 to 1.0, 0.5=center) void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format Wave WaveCopy(Wave wave); // Copy a wave to a new wave void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range @@ -173,6 +174,7 @@ void PauseMusicStream(Music music); // Pause music p void ResumeMusicStream(Music music); // Resume playing paused music void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +void SetMusicPan(Music sound, float pan); // Set pan for a music (0.0 to 1.0, 0.5=center) void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) @@ -189,6 +191,7 @@ bool IsAudioStreamPlaying(AudioStream stream); // Check if audi void StopAudioStream(AudioStream stream); // Stop audio stream void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +void SetAudioStreamPan(AudioStream strean, float pan); // Set pan for audio stream (0.0 to 1.0, 0.5=center) void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams #ifdef __cplusplus diff --git a/vendor/include/raylib/raylib.h b/vendor/include/raylib/raylib.h index a2e3ea9..6c6baa7 100644 --- a/vendor/include/raylib/raylib.h +++ b/vendor/include/raylib/raylib.h @@ -1499,10 +1499,11 @@ RLAPI int GetSoundsPlaying(void); // Get num RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI void SetSoundPan(Sound sound, float pan); // Set pan for a sound (0.5 is center) RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range -RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array +RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a 32bit float data array RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() // Music management functions @@ -1518,6 +1519,7 @@ RLAPI void ResumeMusicStream(Music music); // Resume RLAPI void SeekMusicStream(Music music, float position); // Seek music to a position (in seconds) RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI void SetMusicPan(Music music, float pan); // Set pan for a music (0.5 is center) RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) @@ -1533,6 +1535,7 @@ RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check i RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +RLAPI void SetAudioStreamPan(AudioStream stream, float pan); // Set pan for audio stream (0.5 is centered) RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams #if defined(__cplusplus) diff --git a/vendor/include/raylib/raymath.h b/vendor/include/raylib/raymath.h index 9b86b29..8a54bbc 100644 --- a/vendor/include/raylib/raymath.h +++ b/vendor/include/raylib/raymath.h @@ -334,6 +334,21 @@ RMAPI Vector2 Vector2Normalize(Vector2 v) return result; } +// Transforms a Vector2 by a given Matrix +RMAPI Vector2 Vector2Transform(Vector2 v, Matrix mat) +{ + Vector2 result = { 0 }; + + float x = v.x; + float y = v.y; + float z = 0; + + result.x = mat.m0*x + mat.m4*y + mat.m8*z + mat.m12; + result.y = mat.m1*x + mat.m5*y + mat.m9*z + mat.m13; + + return result; +} + // Calculate linear interpolation between two vectors RMAPI Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount) { diff --git a/vendor/include/raylib/rlgl.h b/vendor/include/raylib/rlgl.h index 37af998..16f4190 100644 --- a/vendor/include/raylib/rlgl.h +++ b/vendor/include/raylib/rlgl.h @@ -3544,53 +3544,66 @@ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode) unsigned int vertexShaderId = 0; unsigned int fragmentShaderId = 0; + // Compile vertex shader (if provided) if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER); - if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER); - - // Load shader program if provided vertex/fragment shaders compile successfully - if ((vertexShaderId != 0) && (fragmentShaderId != 0)) id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId); + // In case no vertex shader was provided or compilation failed, we use default vertex shader + if (vertexShaderId == 0) vertexShaderId = RLGL.State.defaultVShaderId; - // Once shader program is compiled, we can detach and delete vertex/fragment shaders - // NOTE: Vertex - if (vertexShaderId != 0) - { - // Detach shader before deletion to make sure memory is freed - glDetachShader(id, vertexShaderId); - glDeleteShader(vertexShaderId); - } - if (fragmentShaderId != 0) - { - // Detach shader before deletion to make sure memory is freed - glDetachShader(id, fragmentShaderId); - glDeleteShader(fragmentShaderId); - } + // Compile fragment shader (if provided) + if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER); + // In case no fragment shader was provided or compilation failed, we use default fragment shader + if (fragmentShaderId == 0) fragmentShaderId = RLGL.State.defaultFShaderId; - if (id == 0) - { - // In case shader loading fails, we return the default shader - TRACELOG(RL_LOG_WARNING, "SHADER: Failed to load custom shader code, using default shader"); - id = RLGL.State.defaultShaderId; - } + // In case vertex and fragment shader are the default ones, no need to recompile, we can just assign the default shader program id + if ((vertexShaderId == RLGL.State.defaultVShaderId) && (fragmentShaderId == RLGL.State.defaultFShaderId)) id = RLGL.State.defaultShaderId; else { - // Get available shader uniforms - // NOTE: This information is useful for debug... - int uniformCount = -1; - glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount); + // One of or both shader are new, we need to compile a new shader program + id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId); - for (int i = 0; i < uniformCount; i++) + // We can detach and delete vertex/fragment shaders (if not default ones) + // NOTE: We detach shader before deletion to make sure memory is freed + if (vertexShaderId != RLGL.State.defaultVShaderId) { - int namelen = -1; - int num = -1; - char name[256] = { 0 }; // Assume no variable names longer than 256 - GLenum type = GL_ZERO; + glDetachShader(id, vertexShaderId); + glDeleteShader(vertexShaderId); + } + if (fragmentShaderId != RLGL.State.defaultFShaderId) + { + glDetachShader(id, fragmentShaderId); + glDeleteShader(fragmentShaderId); + } + + // In case shader program loading failed, we assign default shader + if (id == 0) + { + // In case shader loading fails, we return the default shader + TRACELOG(RL_LOG_WARNING, "SHADER: Failed to load custom shader code, using default shader"); + id = RLGL.State.defaultShaderId; + } + /* + else + { + // Get available shader uniforms + // NOTE: This information is useful for debug... + int uniformCount = -1; + glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &uniformCount); - // Get the name of the uniforms - glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name); + for (int i = 0; i < uniformCount; i++) + { + int namelen = -1; + int num = -1; + char name[256] = { 0 }; // Assume no variable names longer than 256 + GLenum type = GL_ZERO; - name[namelen] = 0; - TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name)); + // Get the name of the uniforms + glGetActiveUniform(id, i, sizeof(name) - 1, &namelen, &num, &type, name); + + name[namelen] = 0; + TRACELOGD("SHADER: [ID %i] Active uniform (%s) set at location: %i", id, name, glGetUniformLocation(id, name)); + } } + */ } #endif diff --git a/vendor/lib/tux/mruby/libmruby.a b/vendor/lib/tux/mruby/libmruby.a Binary files differindex 88f14d9..ed0414b 100644 --- a/vendor/lib/tux/mruby/libmruby.a +++ b/vendor/lib/tux/mruby/libmruby.a diff --git a/vendor/lib/tux/raylib/libraylib.a b/vendor/lib/tux/raylib/libraylib.a Binary files differindex 546e4ad..b86a37f 100644 --- a/vendor/lib/tux/raylib/libraylib.a +++ b/vendor/lib/tux/raylib/libraylib.a diff --git a/vendor/lib/web/mruby/libmruby.a b/vendor/lib/web/mruby/libmruby.a Binary files differindex c491465..2680589 100644 --- a/vendor/lib/web/mruby/libmruby.a +++ b/vendor/lib/web/mruby/libmruby.a diff --git a/vendor/lib/web/raylib/libraylib.a b/vendor/lib/web/raylib/libraylib.a Binary files differindex 975cf28..03e18dd 100644 --- a/vendor/lib/web/raylib/libraylib.a +++ b/vendor/lib/web/raylib/libraylib.a |
