summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/msdib.h
blob: 54767e216fb17bad7a68139bf5ef843477a12a8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
/***************************************************************************

    msdib.h

    Microsoft Device-Independent Bitmap file loading.

***************************************************************************/
#ifndef MAME_LIB_UTIL_MSDIB_H
#define MAME_LIB_UTIL_MSDIB_H

#pragma once

#include "bitmap.h"
#include "corefile.h"
#include "osdcore.h"

#include <cstdint>


namespace util {

/***************************************************************************
    CONSTANTS
***************************************************************************/

// Error types
enum class msdib_error
{
	NONE,
	OUT_OF_MEMORY,
	FILE_ERROR,
	BAD_SIGNATURE,
	FILE_TRUNCATED,
	FILE_CORRUPT,
	UNSUPPORTED_FORMAT
};

msdib_error msdib_verify_header(core_file &fp);
msdib_error msdib_read_bitmap(core_file &fp, bitmap_argb32 &bitmap);
msdib_error msdib_read_bitmap_data(core_file &fp, bitmap_argb32 &bitmap, std::uint32_t length, std::uint32_t dirheight = 0U);

} // namespace util

#endif // MAME_LIB_UTIL_MSDIB_H