Commit graph

176 commits

Author SHA1 Message Date
raysan5
257f232d41 WARNING: BREAKING CHANGE: Review audio looping system
Current looping system was broken, `loopCount` has been converted to `bool looping` and user can enable/disable with `music.looping = false`. `SetMusicLoopCount()` has been removed.
2020-05-14 14:00:37 +02:00
raysan5
fdad1f023b Avoid all MSVC compile warnings
Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
2020-05-06 19:12:09 +02:00
raysan5
51c3bef497 Review exposed #defines and allow user re-defining
There are multiple #define values around raylib, usually not exposed for redefinition, just reviewed all of them to allow users redefining them on compile time if required.

Also, multiple #define have been renamed and commented.
2020-05-01 17:31:44 +02:00
Louis Johnson
4f40f8bc47
added log warning for unsupported file extension for music stream (#1176)
* added log warning for unsupported file extension for music stream

* updated error log message for music stream when file format isn't supported
2020-04-06 11:26:09 +02:00
Dani Martin
1a948849f3
[cppcheck] Fix minor warnings in models.c and raudio.c (#1162)
Errores fixes:
models.c,2843 Either the condition 'fileData!=NULL' is redundant or there is possible null pointer dereference: fileData.
raudio.c,805, 806, 807, 808, %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
2020-03-30 17:08:01 +02:00
raysan5
d28e73849b Review TRACELOG() messages 2020-03-27 18:49:21 +01:00
raysan5
915b5f370b [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:43:24 +01:00
raysan5
0c6c421508 [raudio] Review TRACELOG() messages, categorized 2020-03-27 17:16:30 +01:00
raysan5
7ae7a87f8a Remove trail spaces 2020-03-25 19:41:51 +01:00
raysan5
2344941974 Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
2020-03-17 13:40:07 +01:00
Ray
05992a6fce Tweaks 2020-02-27 16:37:32 +01:00
Ray
ac73e3b5e2 REDESIGN: ExportWave()
Use new file I/O ABI
2020-02-27 16:15:20 +01:00
Ray
5ff0776235 Remove trail spaces and some tweaks 2020-02-27 13:33:09 +01:00
Ray
0f783aab34 Remove TraceLog() dependency on standalone mode 2020-02-26 20:23:36 +01:00
Ray
51db3b589d Review function name on RAUDIO_STANDALONE 2020-02-18 18:14:22 +01:00
Ray
3f25c52a29 Some security checks in case music is not properly loaded 2020-02-18 16:30:52 +01:00
Ray
91b2dc2aa9 [raudio] ADDED: SetAudioStreamBufferSizeDefault()
There could be some cases where we need to define the internal audio buffer size, now it's possible.

RENAMED: InitAudioBuffer() to LoadAudioBuffer()
RENAMED: CloseAudioBuffer() to UnloadAudioBuffer()

Renamed some defines and reviewed some comments.
2020-02-14 17:13:37 +01:00
Ray
7459a5c6ef Remove "No Audio Buffer" traces 2020-02-14 11:44:50 +01:00
Ray
3b3e163c48 [raudio] Corrected issue with OGG sound loading 2020-02-13 11:41:28 +01:00
Ray
1b20182d33 Updated periodSize reference 2020-02-12 14:45:02 +01:00
Ray
7dfe42d6d0 Trace log comment review 2020-02-12 13:49:08 +01:00
Ray
484c6b360f Reviewed Cppcheck issues #1098 2020-02-12 13:16:18 +01:00
raysan5
28e12a6c6a [raudio] Update to latest miniaudio 0.10 2020-02-10 12:42:40 +01:00
raysan5
131132f17d Minor tweaks 2020-02-10 10:56:48 +01:00
raysan5
9922160ab4 Minor tweaks 2020-02-09 13:23:12 +01:00
Ray
b5fe41f41a Review libc dependencies and remove when possible
Just for clarification, no plans to remove libc dependency, just did some code analysis to see how much raylib depend on stardard C library. My conclusions:

 - stdlib.h: primary dependency is for malloc() and free()
 - stdio.h: primary dependency is for FILE access, maybe it could go through a custom ABI?
 - string.h: just around 8 functions required
 - math.h: just around 8 functions required
 - others: 1-2 functions required for some other headers
2020-02-04 16:55:24 +01:00
David Reid
7024628c65
Update to miniaudio 0.10 (#1092)
* Update to miniaudio 0.10

This replaces the old ma_pcm_converter with ma_data_converter.

At this time of this commit, miniaudio 0.10 is still in the testing
phase. To make it easier to update miniaudio.h during this period, I've
temporarily moved the @raysan5 Win32 customizations to raudio.c because
there may be quite a few updates to miniaudio.h during this time.

* Use miniaudio's built-in volume control.
2020-02-04 13:43:31 +01:00
Ray
c3f06b7470 Remove all trail spaces 2020-02-03 19:26:28 +01:00
Ray
cde26c743c Replace TraceLog() function by TRACELOG macro
Added SUPPORT_TRACELOG_DEBUG config
2020-02-03 19:13:24 +01:00
Ray
40b73a8a91
Develop branch integration (#1091)
* [core] REDESIGNED: Implement global context

* [rlgl] REDESIGNED: Implement global context

* Reviewed globals for Android

* Review Android globals usage

* Update Android globals

* Bump raylib version to 3.0 !!!

* [raudio] REDESIGNED: Implement global context

* [raudio] Reorder functions

* [core] Tweaks on descriptions

* Issues with SUPPORT_MOUSE_GESTURES

* [camera] Use global context

* REDESIGN: Move shapes drawing texture/rec to RLGL context

* Review some issues on standalone mode

* Update to use global context

* [GAME] Upload RE-PAIR game from GGJ2020 -WIP-

* Update game: RE-PAIR

* [utils] TRACELOG macros proposal

* Update config.h
2020-02-03 18:31:30 +01:00
Ray
c715cae18d Some tweaks 2020-01-28 16:40:12 +01:00
Ray
05443cd0c8 Corrected bug #989 2020-01-26 18:29:13 +01:00
jbosh
019434a37e Fix for short non-looping sounds (#1067)
Short non-looping sounds can sometimes think they need to keep playing and will output their first few frames again. This helps to break out of all the loops instead of just this one.
2020-01-14 09:15:52 +01:00
Ray
4211056354 Reviewed some comments 2020-01-08 18:21:08 +01:00
Ray
f46fcb8307 IsAudioBufferPlaying() replace ERROR by WARNING 2020-01-08 12:41:36 +01:00
raysan5
21c30f43d4 Update year to 2020 2020-01-05 20:01:54 +01:00
illegalinstruction
caa1f45643 Forcibly ensure .xm playback starts in the right place; fixes #1043. (#1045) 2019-12-21 13:02:54 +01:00
João Coelho
75b0264f35 fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example

* fixed a few 'ups' moments that could lead to mild head pain and time loss
2019-10-29 15:57:19 +01:00
Ray
1878a9ea01 Corrected possible memory leak #993 2019-10-22 23:15:41 +02:00
Ray
b75511248d Remove trailing spaces 2019-10-17 17:18:03 +02:00
Michael Vetter
047f093503 Remove dead assignments (#980)
The result of `success` is actually never used. Either we should check
for it and return or remove it. I assume just checking the last one is
okay.
2019-10-03 17:06:08 +02:00
Ray
df84f93938 Add security checks on file writting 2019-09-30 17:32:06 +02:00
Ray
861a619053 Review dr_flac usage
Replaced DEPRECATED functions
2019-09-03 23:24:09 +02:00
Ray
fc95ceadf0 Remove sampleLeft from Music struct... -WIP-
...moved to internal AudioBuffer structure as totalFramesProcessed, now time measure works again... but there is some problem with looping...
Also note some inconsistencies between frames and samples, it seems those concepts are not considered correctly in the code.
2019-09-03 23:08:02 +02:00
raysan5
c661cad692 Review all RL_CALLOC() calls
All data should be properly initialized by now
2019-08-27 10:56:49 +02:00
raysan5
c387bc586d RENAMED: IsAudioBufferProcessed() -> IsAudioStreamProcessed()
Renamed for consistency with similar functions
2019-08-13 17:41:31 +02:00
Ray
e6e48675cc Formating tweaks 2019-08-08 23:08:54 +02:00
chriscamacho
2d5cc5ddbf fixed xmloader bug, user must free model shaders and textures as they might be shared (#933) 2019-08-08 09:57:21 +02:00
Ray
251f90cd31 WARNING: Replaced Music pointer by struct
Now, multiple music parameters are exposed to the user!
2019-07-26 10:26:39 +02:00
Ray
ae95111006 Some variables renamed 2019-07-24 22:37:24 +02:00