Commit d7ad5ba5 authored by Denis Salem's avatar Denis Salem

progress on HeightmapBrushes

parent a15ae4d6
......@@ -4,8 +4,20 @@ namespace ProceduralEngine {
HeightmapBrushes::HeightmapBrushes(int * seed) {
m_Seed = seed;
m_Scale = HEIGHTMAP_SCALE;
memset( m_VoronoiBrush0, 0, sizeof(float) * HEIGHTMAP_BRUSHES_COUNT * HEIGHTMAP_AREA);
memset( m_VoronoiBrush1, 0, sizeof(float) * HEIGHTMAP_BRUSHES_COUNT * HEIGHTMAP_AREA);
memset( m_VoronoiBrush2, 0, sizeof(float) * HEIGHTMAP_BRUSHES_COUNT * HEIGHTMAP_AREA);
m_VoronoiBrushes0 = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
m_VoronoiBrushes1 = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
m_VoronoiBrushes2 = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
m_PerlinBrushes = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
m_WarpBrushes = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
m_TurbulenceBrushes = new Heightmap[HEIGHTMAP_BRUSHES_COUNT]();
}
HeightmapBrushes::~HeightmapBrushes() {
delete[] m_VoronoiBrushes0;
delete[] m_VoronoiBrushes1;
delete[] m_VoronoiBrushes2;
delete[] m_PerlinBrushes;
delete[] m_WarpBrushes;
delete[] m_TurbulenceBrushes;
}
}
......@@ -15,23 +15,24 @@ namespace ProceduralEngine {
HeightmapBrushes(int * seed);
~HeightmapBrushes();
Heightmap * GetNonOrientableBrush(int id);
Heightmap * GetVoronoiBrush0(int id);
Heightmap * GetVoronoiBrush1(int id);
Heightmap * GetVoronoiBrush2(int id);
Heightmap * GetPerlinBrush(int id);
Heightmap * GetWarpBrush(int id);
Heightmap * GetTurbulenceBrush(int id);
Heightmap * GetNonOrientableBrushes(int id);
Heightmap * GetVoronoiBrushes0(int id);
Heightmap * GetVoronoiBrushes1(int id);
Heightmap * GetVoronoiBrushes2(int id);
Heightmap * GetPerlinBrushes(int id);
Heightmap * GetWarpBrushes(int id);
Heightmap * GetTurbulenceBrushes(int id);
int GetScale();
private:
Heightmap m_NonOrientableBrush[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_VoronoiBrush0[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_VoronoiBrush1[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_VoronoiBrush2[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_PerlinBrush[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_WarpBrush[HEIGHTMAP_BRUSHES_COUNT];
Heightmap m_TurbulenceBrush[HEIGHTMAP_BRUSHES_COUNT];
Heightmap * m_NonOrientableBrushes;
Heightmap * m_VoronoiBrushes0;
Heightmap * m_VoronoiBrushes1;
Heightmap * m_VoronoiBrushes2;
Heightmap * m_PerlinBrushes;
Heightmap * m_WarpBrushes;
Heightmap * m_TurbulenceBrushes;
int * m_Seed;
int m_Scale;
};
......
......@@ -6,9 +6,9 @@
namespace ProceduralEngine {
typedef float Heightmap[HEIGHTMAP_AREA];
typedef struct Chunk {
Heightmap heightmap;
float heightmap[HEIGHTMAP_AREA];
Chunk * ne;
Chunk * nw;
Chunk * se;
......
......@@ -8,5 +8,5 @@ include_directories("${PROJECT_SOURCE_DIR}/gl3w")
set(EXTERNAL_DEPENDENCIES "-lGL -ldl -lglfw")
add_executable(unit-tests main.cpp)
target_link_libraries (unit-tests gl3w ${EXTERNAL_DEPENDENCIES})
target_link_libraries (unit-tests gl3w ProceduralEngine ${EXTERNAL_DEPENDENCIES})
......@@ -3,7 +3,11 @@
#include <GLFW/glfw3.h>
#include "HeightmapBrushes.hpp"
#include "dataTypes.hpp"
int main(int argc, char ** argv) {
int seed[1024] = {0};
ProceduralEngine::HeightmapBrushes brushes(seed);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment