diff --git a/HISTORY.md b/HISTORY.md index ee4166948..f9f33ef31 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -149,7 +149,7 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v Complete [raylib Lua binding](https://github.com/raysan5/raylib-lua). All raylib functions plus the +60 code examples have been ported to Lua, now Lua users can enjoy coding videogames in Lua while using all the internal power of raylib. This addition also open the doors to Lua scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to Lua scripts while keep using raylib functionality. -Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/audio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more! +Completely redesigned [audio module](https://github.com/raysan5/raylib/blob/master/src/raudio.c). Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. [FLAC file format support](https://github.com/raysan5/raylib/blob/master/src/external/dr_flac.h) has also been added. In the same line, [OpenAL Soft](https://github.com/kcat/openal-soft) backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more! [Physac](https://github.com/victorfisac/Physac) module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by [@victorfisac](https://github.com/victorfisac), multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing! diff --git a/README.md b/README.md index 2967ffb38..b11665c8d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ features raylib uses on its [core](https://github.com/raysan5/raylib/blob/master/src/core.c) module the outstanding [GLFW3](http://www.glfw.org/) library, embedded inside raylib in the form of [rglfw](https://github.com/raysan5/raylib/blob/master/src/rglfw.c) module, avoiding that way external dependencies. -raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/audio.c) module, the amazing [mini_al](https://github.com/dr-soft/mini_al) audio library, single-file header-only and supporting multiple platforms and multiple audio backends. +raylib uses on its [audio](https://github.com/raysan5/raylib/blob/master/src/raudio.c) module, the amazing [mini_al](https://github.com/dr-soft/mini_al) audio library, single-file header-only and supporting multiple platforms and multiple audio backends. raylib uses internally multiple single-file header-only libraries to support multiple fileformats loading and saving, all those libraries are embedded with raylib and available in [src/external](https://github.com/raysan5/raylib/tree/master/src/external) directory. diff --git a/examples/others/audio_standalone.c b/examples/others/raudio_standalone.c similarity index 94% rename from examples/others/audio_standalone.c rename to examples/others/raudio_standalone.c index f08fbf823..930bde858 100644 --- a/examples/others/audio_standalone.c +++ b/examples/others/raudio_standalone.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [audio] example - Using audio module as standalone module +* raylib [audio] example - Using raudio module as standalone module * * NOTE: This example does not require any graphic device, it can run directly on console. * @@ -13,7 +13,7 @@ * * COMPILATION: * gcc -c ..\..\src\external\mini_al.c -Wall -I. -* gcc -o audio_standalone.exe audio_standalone.c ..\..\src\audio.c ..\..\src\external\stb_vorbis.c mini_al.o / +* gcc -o audio_standalone.exe audio_standalone.c ..\..\src\raudio.c mini_al.o / * -I..\..\src -I..\..\src\external -L. -Wall -std=c99 / * -DAUDIO_STANDALONE -DSUPPORT_FILEFORMAT_WAV -DSUPPORT_FILEFORMAT_OGG * @@ -22,7 +22,7 @@ * This example is licensed under an unmodified zlib/libpng license, which is an OSI-certified, * BSD-like license that allows static linking with closed source software: * -* Copyright (c) 2014-2018 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -41,7 +41,7 @@ * ********************************************************************************************/ -#include "audio.h" // Audio library +#include "raudio.h" // raylib audio library #include // Required for: printf() diff --git a/projects/Geany/raylib_compile_sources.bat b/projects/Geany/raylib_compile_sources.bat index 8a5c1e7b1..708873c25 100644 --- a/projects/Geany/raylib_compile_sources.bat +++ b/projects/Geany/raylib_compile_sources.bat @@ -23,14 +23,14 @@ gcc -O2 -c shapes.c -std=c99 -Wall -DPLATFORM_DESKTOP gcc -O2 -c textures.c -std=c99 -Wall -DPLATFORM_DESKTOP gcc -O2 -c text.c -std=c99 -Wall -DPLATFORM_DESKTOP gcc -O2 -c models.c -std=c99 -Wall -DPLATFORM_DESKTOP -gcc -O2 -c audio.c -std=c99 -Wall -DPLATFORM_DESKTOP +gcc -O2 -c raudio.c -std=c99 -Wall -DPLATFORM_DESKTOP gcc -O2 -c external/mini_al.c -Wall -I. gcc -O2 -c utils.c -std=c99 -Wall -DPLATFORM_DESKTOP :: . :: . > Generate raylib library :: ------------------------------ -ar rcs libraylib.a core.o rglfw.o shapes.o textures.o text.o models.o audio.o mini_al.o utils.o +ar rcs libraylib.a core.o rglfw.o shapes.o textures.o text.o models.o raudio.o mini_al.o utils.o :: . :: > Installing raylib library :: ----------------------------- diff --git a/projects/Notepad++/npes_saved_mingw.txt b/projects/Notepad++/npes_saved_mingw.txt index 6857fa13d..6d10a1b0c 100644 Binary files a/projects/Notepad++/npes_saved_mingw.txt and b/projects/Notepad++/npes_saved_mingw.txt differ diff --git a/projects/Notepad++/npes_saved_tcc.txt b/projects/Notepad++/npes_saved_tcc.txt index 6b8d6f2e2..32d72c2f8 100644 Binary files a/projects/Notepad++/npes_saved_tcc.txt and b/projects/Notepad++/npes_saved_tcc.txt differ diff --git a/projects/scripts/linux-build.sh b/projects/scripts/linux-build.sh index 851ea1a53..abbe0e47d 100755 --- a/projects/scripts/linux-build.sh +++ b/projects/scripts/linux-build.sh @@ -114,7 +114,7 @@ if [ ! -d "$TEMP_DIR" ]; then mkdir -p $TEMP_DIR cd $TEMP_DIR RAYLIB_DEFINES="-D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33" - RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/audio.c $RAYLIB_SRC/rglfw.c $RAYLIB_SRC/external/mini_al.c" + RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/raudio.c $RAYLIB_SRC/rglfw.c $RAYLIB_SRC/external/mini_al.c" RAYLIB_INCLUDE_FLAGS="-I$RAYLIB_SRC -I$RAYLIB_SRC/external/glfw/include" if [ -n "$REALLY_QUIET" ]; then diff --git a/projects/scripts/osx-build.sh b/projects/scripts/osx-build.sh index 36558f63f..fd4f77b72 100755 --- a/projects/scripts/osx-build.sh +++ b/projects/scripts/osx-build.sh @@ -108,7 +108,7 @@ if [ ! -d "$TEMP_DIR" ]; then mkdir -p $TEMP_DIR cd $TEMP_DIR RAYLIB_DEFINES="-D_DEFAULT_SOURCE -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33" - RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/audio.c $RAYLIB_SRC/external/mini_al.c" + RAYLIB_C_FILES="$RAYLIB_SRC/core.c $RAYLIB_SRC/shapes.c $RAYLIB_SRC/textures.c $RAYLIB_SRC/text.c $RAYLIB_SRC/models.c $RAYLIB_SRC/utils.c $RAYLIB_SRC/raudio.c $RAYLIB_SRC/external/mini_al.c" RAYLIB_INCLUDE_FLAGS="-I$RAYLIB_SRC -I$RAYLIB_SRC/external/glfw/include" if [ -n "$REALLY_QUIET" ]; then diff --git a/projects/scripts/windows-build.bat b/projects/scripts/windows-build.bat index c4be4c893..e56141bcb 100644 --- a/projects/scripts/windows-build.bat +++ b/projects/scripts/windows-build.bat @@ -159,7 +159,7 @@ IF NOT EXIST !TEMP_DIR!\ ( cd !TEMP_DIR! REM Raylib's src folder set "RAYLIB_DEFINES=/D_DEFAULT_SOURCE /DPLATFORM_DESKTOP /DGRAPHICS_API_OPENGL_33" - set RAYLIB_C_FILES="!RAYLIB_SRC!\core.c" "!RAYLIB_SRC!\shapes.c" "!RAYLIB_SRC!\textures.c" "!RAYLIB_SRC!\text.c" "!RAYLIB_SRC!\models.c" "!RAYLIB_SRC!\utils.c" "!RAYLIB_SRC!\audio.c" "!RAYLIB_SRC!\rglfw.c" "!RAYLIB_SRC!\external\mini_al.c" + set RAYLIB_C_FILES="!RAYLIB_SRC!\core.c" "!RAYLIB_SRC!\shapes.c" "!RAYLIB_SRC!\textures.c" "!RAYLIB_SRC!\text.c" "!RAYLIB_SRC!\models.c" "!RAYLIB_SRC!\utils.c" "!RAYLIB_SRC!\raudio.c" "!RAYLIB_SRC!\rglfw.c" "!RAYLIB_SRC!\external\mini_al.c" set RAYLIB_INCLUDE_FLAGS=/I"!RAYLIB_SRC!" /I"!RAYLIB_SRC!\external\glfw\include" IF DEFINED REALLY_QUIET ( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a91f13a7..504930d4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,7 +51,7 @@ if(USE_AUDIO) else() MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)") set(INCLUDE_AUDIO_MODULE 0) - list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/audio.c) + list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/raudio.c) set(sources ${raylib_sources}) endif() @@ -250,7 +250,7 @@ file(COPY "raylib.h" DESTINATION ".") file(COPY "rlgl.h" DESTINATION ".") file(COPY "physac.h" DESTINATION ".") file(COPY "raymath.h" DESTINATION ".") -file(COPY "audio.h" DESTINATION ".") +file(COPY "raudio.h" DESTINATION ".") # Print the flags for the user message(STATUS "Compiling with the flags:") diff --git a/src/CMakeOptions.txt b/src/CMakeOptions.txt index ee63c5b45..b69c443f6 100644 --- a/src/CMakeOptions.txt +++ b/src/CMakeOptions.txt @@ -61,7 +61,7 @@ option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON) option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON) option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON) -# audio.c +# raudio.c option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON) option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON) option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON) diff --git a/src/Makefile b/src/Makefile index 2c2bfb279..b99ff711e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -403,7 +403,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif ifeq ($(INCLUDE_AUDIO_MODULE),TRUE) - OBJS += audio.o + OBJS += raudio.o OBJS += mini_al.o endif @@ -529,7 +529,7 @@ models.o : models.c raylib.h rlgl.h raymath.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -D$(GRAPHICS) # Compile audio module -audio.o : audio.c raylib.h +raudio.o : raudio.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) # Compile mini_al audio library diff --git a/src/config.h b/src/config.h index 6d16207c8..d45ff7078 100644 --- a/src/config.h +++ b/src/config.h @@ -25,7 +25,7 @@ * **********************************************************************************************/ -#define RAYLIB_VERSION "2.3-dev" +#define RAYLIB_VERSION "2.4-dev" // Edit to control what features Makefile'd raylib is compiled with #if defined(RAYLIB_CMAKE) diff --git a/src/config.h.in b/src/config.h.in index 928405cdf..b1c524f7e 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -65,7 +65,7 @@ * NOTE: Some generated meshes DO NOT include generated texture coordinates */ #cmakedefine SUPPORT_MESH_GENERATION 1 -// audio.c +// raudio.c /* Desired fileformats to be supported for loading. */ #cmakedefine SUPPORT_FILEFORMAT_WAV 1 #cmakedefine SUPPORT_FILEFORMAT_OGG 1 diff --git a/src/libraylib.a b/src/libraylib.a new file mode 100644 index 000000000..5aa7099dc Binary files /dev/null and b/src/libraylib.a differ diff --git a/src/audio.c b/src/raudio.c similarity index 99% rename from src/audio.c rename to src/raudio.c index a76481b41..3510acd5f 100644 --- a/src/audio.c +++ b/src/raudio.c @@ -12,7 +12,7 @@ * * CONFIGURATION: * -* #define AUDIO_STANDALONE +* #define RAUDIO_STANDALONE * Define to use the module as standalone library (independently of raylib). * Required types and functions are defined in the same module. * @@ -70,8 +70,8 @@ * **********************************************************************************************/ -#if defined(AUDIO_STANDALONE) - #include "audio.h" +#if defined(RAUDIO_STANDALONE) + #include "raudio.h" #include // Required for: va_list, va_start(), vfprintf(), va_end() #else #include "raylib.h" // Declares module functions @@ -169,7 +169,7 @@ typedef struct MusicData { unsigned int samplesLeft; // Number of samples left to end } MusicData; -#if defined(AUDIO_STANDALONE) +#if defined(RAUDIO_STANDALONE) typedef enum { LOG_INFO = 0, LOG_ERROR, @@ -201,7 +201,7 @@ static Wave LoadFLAC(const char *fileName); // Load FLAC file static Wave LoadMP3(const char *fileName); // Load MP3 file #endif -#if defined(AUDIO_STANDALONE) +#if defined(RAUDIO_STANDALONE) bool IsFileExtension(const char *fileName, const char *ext); // Check file extension void TraceLog(int msgType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG) #endif @@ -1918,7 +1918,7 @@ static Wave LoadMP3(const char *fileName) #endif // Some required functions for audio standalone module version -#if defined(AUDIO_STANDALONE) +#if defined(RAUDIO_STANDALONE) // Check file extension bool IsFileExtension(const char *fileName, const char *ext) { diff --git a/src/audio.h b/src/raudio.h similarity index 100% rename from src/audio.h rename to src/raudio.h