Now instead of hammering your working directory, all operations happen in-memory using two new classes, MemoryBuffer and MemorySpan. This has already fixed numerous bugs especially around handling model files. All operations on files inside dat's now happen on memory buffers, with an option to write them to a file. A lot of now useless debug messages are removed too, as that made some operations needlessly bound by the speed of your console output.
27 lines
No EOL
399 B
C++
27 lines
No EOL
399 B
C++
#pragma once
|
|
|
|
#include <string_view>
|
|
#include <vector>
|
|
#include <array>
|
|
|
|
#include "memorybuffer.h"
|
|
|
|
struct Vertex {
|
|
std::array<float, 3> position;
|
|
std::array<float, 3> normal;
|
|
};
|
|
|
|
struct Part {
|
|
std::vector<Vertex> vertices;
|
|
std::vector<uint16_t> indices;
|
|
};
|
|
|
|
struct Lod {
|
|
std::vector<Part> parts;
|
|
};
|
|
|
|
struct Model {
|
|
std::vector<Lod> lods;
|
|
};
|
|
|
|
Model parseMDL(MemorySpan data); |