emilib
magica_voxel.hpp
1 // By Emil Ernerfeldt 2017
2 // LICENSE:
3 // This software is dual-licensed to the public domain and under the following
4 // license: you are granted a perpetual, irrevocable license to copy, modify,
5 // publish, and distribute this file as you see fit.
6 
7 #pragma once
8 
9 #include <cstdint>
10 #include <vector>
11 
12 namespace emilib {
13 namespace magica_voxel {
14 
15 struct RGBA { uint8_t r, g, b, a; };
16 struct Voxel { uint8_t x, y, z, color; };
17 
18 struct Model
19 {
20  int version = -1;
21  int size[3] = {0};
22  RGBA palette[256];
23  std::vector<Voxel> voxels;
24 };
25 
27 std::vector<Model> load(const char* path);
28 
29 } // namespace magica_voxel
30 } // namespace emilib
Definition: magica_voxel.hpp:16
Definition: magica_voxel.hpp:15
Definition: magica_voxel.hpp:18
Definition: coroutine.hpp:18