Several functions used to load external files have been reviewed to just load the full file with LoadFileData() and load data from memory from there. This way all file access functionality is centralized in utils module.
Functions reviewed: LoadDDS(), LoadPKM(), LoadKTX(), LoadPVR(), LoadASTC(), SaveKTX()
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.
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.
Actually this function is useless and potentially dangerous, internally, a shallow copy of data was done. Same could be accomplished accesing image.data directly.
Now it's blazing fast. It modifies image.data directly.
Previous version could take up to 3-4 seconds to draw a line... now it takes some nanoseconds...
NOTE: This functionality has an important issue, line space is fixed to 1.5 font.baseSize pixels, depending on the font and how it has been generated that spacing could be too wide or too narrow...
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