Skip to content

rres-raylib.h LoadWaveFromResource Warning #46

Description

@tgaldi

If the chunk was compressed there is no LoadWaveFromResourceChunk that is called internally like the other loaders, and even if the compType and cipherType flags are cleared manually you hit the warning:

Wave LoadWaveFromResource(rresResourceChunk chunk)
{
    Wave wave = { 0 };

    if (rresGetDataType(chunk.info.type) == RRES_DATA_WAVE)       // Wave data
    {
        if ((chunk.info.compType == RRES_COMP_NONE) && (chunk.info.cipherType == RRES_CIPHER_NONE))
        {
            wave.frameCount = chunk.data.props[0];
            wave.sampleRate = chunk.data.props[1];
            wave.sampleSize = chunk.data.props[2];
            wave.channels = chunk.data.props[3];

            unsigned int size = wave.frameCount*wave.sampleSize*wave.channels/8;
            wave.data = RL_CALLOC(size, 1);
            memcpy(wave.data, chunk.data.raw, size);
        }
        RRES_LOG("RRES: %c%c%c%c: WARNING: Data must be decompressed/decrypted\n", chunk.info.type[0], chunk.info.type[1], chunk.info.type[2], chunk.info.type[3]);
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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