Reorganizing file structure.

This commit is contained in:
Steffen Fündgens 2014-11-17 13:36:05 +01:00
parent c0a730f58a
commit 29f4cf6279
13 changed files with 9 additions and 9 deletions

View File

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 166 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -37,8 +37,8 @@ void Application::init()
// define where shaders and textures can be found:
ACGL::Base::Settings::the()->setResourcePath("../");
ACGL::Base::Settings::the()->setShaderPath("Shader/");
ACGL::Base::Settings::the()->setTexturePath("Geometry/");
ACGL::Base::Settings::the()->setGeometryPath("Geometry/");
ACGL::Base::Settings::the()->setTexturePath("Levels/Textures/");
ACGL::Base::Settings::the()->setGeometryPath("Levels/Geometry/");
// construct VAO to give shader correct Attribute locations
ACGL::OpenGL::SharedArrayBuffer ab = std::make_shared<ACGL::OpenGL::ArrayBuffer>();

View File

@ -13,10 +13,10 @@ Terrain::~Terrain() {
void Terrain::load() {
filePath = "../Levels/LevelTest/terrain/"; //TODO remove this, its only for testing
filePath = "../Levels/heightmapLvlTest.png"; //TODO remove this, its only for testing
std::vector<unsigned char> image; //the raw pixels
unsigned error = lodepng::decode(image, heightmapWidth, heightmapHeight, filePath + "heightmap.png");
unsigned error = lodepng::decode(image, heightmapWidth, heightmapHeight, filePath);
if (error) {
std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl;
}
@ -41,7 +41,7 @@ void Terrain::makeTriangleMesh(){
ab->defineAttribute("aTexCoord", GL_FLOAT, 2);
ab->defineAttribute("aNormal", GL_FLOAT, 3);
unsigned int rowNum=0, columnNum=0, dataCount=0, abNumFloats=8; //initializing:
unsigned int rowNum=0, columnNum=0, dataCount=0, floatsPerVertex=8; //initializing:
bool movingRight = true, isUp = true;
int numVertices = (this->heightmapHeight - 1) * (this->heightmapWidth * 2 + 1) + 1;
float* abData = new float[numVertices * floatsPerVertex];
@ -56,9 +56,9 @@ void Terrain::makeTriangleMesh(){
else if (movingRight) {
if (columnNum == this->heightmapWidth - 1) {
set_abData(abData, dataCount, rowNum, columnNum);
dataCount += abNumFloats;
dataCount += floatsPerVertex;
set_abData(abData, dataCount, rowNum, columnNum);
dataCount += abNumFloats;
dataCount += floatsPerVertex;
movingRight = false;
rowNum = rowNum + 1;
}
@ -71,9 +71,9 @@ void Terrain::makeTriangleMesh(){
else {
if (columnNum == 0){
set_abData(abData, dataCount, rowNum, columnNum);
dataCount += abNumFloats;
dataCount += floatsPerVertex;
set_abData(abData, dataCount, rowNum, columnNum);
dataCount += abNumFloats;
dataCount += floatsPerVertex;
movingRight = true;
rowNum = rowNum + 1;
}