Skip to content

[multi] Avoid direct file access, read data from memory #1232

Closed
@raysan5

Description

@raysan5

One of the big changes of raylib 3.0 was changing most of the functions reading data from files to reading data from a pre-loaded buffer, this way all external files are loaded into memory using LoadFileData()/LoadFileText() and then the buffers are processed. Consequently, multiple internal function were adapted to receive a data buffer instead of the filename.

But there are still some internal functions left:

module function type details state
text LoadBMFont() text Contains external image file reference ✔️
textures LoadDDS() bin DDS file format ✔️
textures LoadPKM() bin PKM file format ✔️
textures LoadKTX() bin KTX file format ✔️
textures LoadPVR() bin PVR file format ✔️
textures LoadASTC() bin ASTC file format ✔️
textures SaveKTX() bin KTS file format saving ✔️
textures ExportImageAsCode() text Save image data as text code file ✔️
models LoadOBJ() text Parses OBJ text data but internally access .mtl file... 💬
models LoadIQM() bin IQM mesh/anims file format ✔️
models LoadModelAnimations() bin IQM file format anims loading... ✔️
models ExportMesh() text Exports mesh data as an OBJ text file... ✔️
raudio LoadWAV() bin WAV file format ✔️
raudio SaveWAV() bin WAV file saving ✔️
raudio ExportWaveAsCode() text Exports wave data as text code file... ✔️

Those functions have not been changed because I'm considering moving that functionality out of raylib modules to external libraries.

Note that this change does not mean adding functions for the users to allow file-formats loading from a user-provided memory buffer but support that feature internally by raylib when processing external files, just to avoid FILE operations on the module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions