#pragma once
#include <stdint.h>
#include "draw.h"

namespace wad {

    struct filelump_t {
        uint32_t filepos;
        uint32_t size;
        char name[8];
    };

    void init(const char *filename);
    uint8_t *load(const char *name);
    uint8_t *load(const char *prev, const char *name, int *size=nullptr);

    uint32_t *loadPalette(int index);

    draw::surface_t *loadFlat(const char *name);
    draw::surface_t *loadTexture(const char *name);
    draw::surface_t *loadPatch(const char *name);
}