From fa5cebdfd27f7081b37d54401624d2556a04a4d2 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 Oct 2018 16:17:29 +0200 Subject: [PATCH 1/5] Comment tweak --- examples/models/models_yaw_pitch_roll.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index 0dcf8c70..88b0a610 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -5,8 +5,7 @@ * This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Example based on Berni work on Raspberry Pi: -* http://forum.raylib.com/index.php?p=/discussion/124/line-versus-triangle-drawing-order +* Example based on Berni work on Raspberry Pi. * * Copyright (c) 2017 Ramon Santamaria (@raysan5) * From 27592183681cdcaf0378406fbfbb93b60f84bc98 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 Oct 2018 16:17:44 +0200 Subject: [PATCH 2/5] Added comment on issue --- src/audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/audio.c b/src/audio.c index dcde6e65..f0362b2d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1158,8 +1158,9 @@ Music LoadMusicStream(const char *fileName) music->stream = InitAudioStream(music->ctxMp3.sampleRate, 32, music->ctxMp3.channels); - // TODO: It seems the total number of samples is not obtained correctly... - music->totalSamples = (unsigned int)music->ctxMp3.framesRemaining*music->ctxMp3.channels; + // TODO: There is not an easy way to compute the total number of samples available + // in an MP3, frames size could be variable... we tried with a 60 seconds music... but crashes... + music->totalSamples = 60*music->ctxMp3.sampleRate*music->ctxMp3.channels; music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_MP3; music->loopCount = -1; // Infinite loop by default From 16914dfaa2e663b7c862be51b80ce8ea28399c55 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 Oct 2018 21:40:34 +0200 Subject: [PATCH 3/5] Reviewed possible issue with... ...disposing RenderTexture. --- src/rlgl.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index d2b52a47..5bba7238 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1506,9 +1506,17 @@ void rlDeleteTextures(unsigned int id) void rlDeleteRenderTextures(RenderTexture2D target) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (target.id > 0) glDeleteFramebuffers(1, &target.id); if (target.texture.id > 0) glDeleteTextures(1, &target.texture.id); - if (target.depth.id > 0) glDeleteTextures(1, &target.depth.id); + if (target.depth.id > 0) + { +#if defined(GRAPHICS_API_OPENGL_ES2) + glDeleteRenderBuffers(1, &target.depth.id); +#elif defined(GRAPHICS_API_OPENGL_33) + glDeleteTextures(1, &target.depth.id); +#endif + } + + if (target.id > 0) glDeleteFramebuffers(1, &target.id); TraceLog(LOG_INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); #endif @@ -2171,7 +2179,7 @@ void rlUnloadTexture(unsigned int id) // Load a texture to be used for rendering (fbo with color and depth attachments) RenderTexture2D rlLoadRenderTexture(int width, int height) { - RenderTexture2D target; + RenderTexture2D target = { 0 }; target.id = 0; @@ -2251,8 +2259,16 @@ RenderTexture2D rlLoadRenderTexture(int width, int height) default: break; } - glDeleteTextures(1, &target.texture.id); - glDeleteTextures(1, &target.depth.id); + if (target.texture.id > 0) glDeleteTextures(1, &target.texture.id); + if (target.depth.id > 0) + { +#if defined(GRAPHICS_API_OPENGL_ES2) + glDeleteRenderBuffers(1, &target.depth.id); +#elif defined(GRAPHICS_API_OPENGL_33) + glDeleteTextures(1, &target.depth.id); +#endif + } + glDeleteFramebuffers(1, &target.id); } else TraceLog(LOG_INFO, "[FBO ID %i] Framebuffer object created successfully", target.id); From 1f4866276aca19ab138c9938ed5ea782b211c00c Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 Oct 2018 21:50:50 +0200 Subject: [PATCH 4/5] Corrected typo --- src/rlgl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rlgl.h b/src/rlgl.h index 5bba7238..96c91d02 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1510,7 +1510,7 @@ void rlDeleteRenderTextures(RenderTexture2D target) if (target.depth.id > 0) { #if defined(GRAPHICS_API_OPENGL_ES2) - glDeleteRenderBuffers(1, &target.depth.id); + glDeleteRenderbuffers(1, &target.depth.id); #elif defined(GRAPHICS_API_OPENGL_33) glDeleteTextures(1, &target.depth.id); #endif @@ -2263,7 +2263,7 @@ RenderTexture2D rlLoadRenderTexture(int width, int height) if (target.depth.id > 0) { #if defined(GRAPHICS_API_OPENGL_ES2) - glDeleteRenderBuffers(1, &target.depth.id); + glDeleteRenderbuffers(1, &target.depth.id); #elif defined(GRAPHICS_API_OPENGL_33) glDeleteTextures(1, &target.depth.id); #endif From 161b18edea6649a108ef3f7aa37464688adcba07 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 20 Oct 2018 12:30:37 +0200 Subject: [PATCH 5/5] Reviewed possible issue with external libs --- src/Makefile | 3 --- src/core.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 2932e7bb..0cfc82c1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -342,9 +342,6 @@ endif INCLUDE_PATHS = -I. -Iexternal/glfw/include ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - INCLUDE_PATHS += -Iexternal - endif ifeq ($(PLATFORM_OS),BSD) INCLUDE_PATHS += -I/usr/local/include LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) diff --git a/src/core.c b/src/core.c index 41aa181b..91022b11 100644 --- a/src/core.c +++ b/src/core.c @@ -125,7 +125,7 @@ #include // Required for: tolower() [Used in IsFileExtension()] #include // Required for stat() [Used in GetLastWriteTime()] -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(PLATFORM_DESKTOP) && defined(_WIN32) && defined(_MSC_VER) #include "external/dirent.h" // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] #else #include // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()]