mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add heightmap:resize(int, int, str)
This commit is contained in:
parent
e560236a8c
commit
8c0a3f4260
4 changed files with 114 additions and 1 deletions
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
#include "typedefs.hpp"
|
||||
|
||||
enum class InterpolationType {
|
||||
NEAREST,
|
||||
LINEAR,
|
||||
CUBIC,
|
||||
};
|
||||
|
||||
class Heightmap {
|
||||
std::vector<float> buffer;
|
||||
uint width, height;
|
||||
|
|
@ -14,8 +20,13 @@ public:
|
|||
buffer.resize(width*height);
|
||||
}
|
||||
|
||||
Heightmap(uint width, uint height, std::vector<float> buffer)
|
||||
: width(width), height(height), buffer(std::move(buffer)) {}
|
||||
|
||||
~Heightmap() = default;
|
||||
|
||||
void resize(uint width, uint height, InterpolationType interpolation);
|
||||
|
||||
uint getWidth() const {
|
||||
return width;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue