Tweaking, fixed a very old off by one bug on voxel gen

This commit is contained in:
MitchellHansen
2017-10-21 06:54:09 -07:00
parent dcf355c636
commit 36bf5697fa
9 changed files with 54 additions and 47 deletions

View File

@@ -23,7 +23,7 @@
#include "util.hpp"
#include <SFML/Graphics.hpp>
#include "CLCaster.h"
//#include "CLCaster.h"
#include "Camera.h"
#include "Input.h"
#include "LightController.h"
@@ -36,15 +36,17 @@
#undef ERROR
#include "Logger.h"
class CLCaster;
class Application {
public:
const int WINDOW_X = 1600;
const int WINDOW_Y = 900;
static const int WINDOW_X = 1600;
static const int WINDOW_Y = 900;
const int MAP_X = 64;
const int MAP_Y = 64;
const int MAP_Z = 64;
static const int MAP_X = 32;
static const int MAP_Y = 32;
static const int MAP_Z = 32;
Application();
~Application();

View File

@@ -7,6 +7,7 @@
#include "LightController.h"
#include "Camera.h"
#include <GL/glew.h>
#include <Application.h>
#include <unordered_map>
#include "Logger.h"
#include "map/Map.h"

View File

@@ -25,7 +25,7 @@ struct OctState {
class Octree {
public:
static const int buffer_size = 300000;
static const int buffer_size = 100000;
Octree();
~Octree() {};
@@ -42,13 +42,13 @@ public:
// know when to switch buffers
uint64_t *descriptor_buffer;
uint64_t descriptor_buffer_position = buffer_size;
uint64_t descriptor_buffer_position = buffer_size - 1;
uint32_t *attachment_lookup;
uint64_t attachment_lookup_position = buffer_size;
uint64_t attachment_lookup_position = buffer_size - 1;
uint64_t *attachment_buffer;
uint64_t attachment_buffer_position = buffer_size;
uint64_t attachment_buffer_position = buffer_size - 1;
unsigned int trunk_cutoff = 3;
uint64_t root_index = 0;

View File

@@ -150,20 +150,20 @@ inline std::string read_file(std::string file_name){
inline void PrettyPrintUINT64(uint64_t i, std::stringstream* ss) {
//*ss << "[" << std::bitset<15>(i) << "]";
//*ss << "[" << std::bitset<1>(i >> 15) << "]";
//*ss << "[" << std::bitset<8>(i >> 16) << "]";
//*ss << "[" << std::bitset<8>(i >> 24) << "]";
//*ss << "[" << std::bitset<32>(i >> 32) << "]\n";
*ss << "[" << std::bitset<15>(i) << "]";
*ss << "[" << std::bitset<1>(i >> 15) << "]";
*ss << "[" << std::bitset<8>(i >> 16) << "]";
*ss << "[" << std::bitset<8>(i >> 24) << "]";
*ss << "[" << std::bitset<32>(i >> 32) << "]";
}
inline void PrettyPrintUINT64(uint64_t i) {
//std::cout << "[" << std::bitset<15>(i) << "]";
//std::cout << "[" << std::bitset<1>(i >> 15) << "]";
//std::cout << "[" << std::bitset<8>(i >> 16) << "]";
//std::cout << "[" << std::bitset<8>(i >> 24) << "]";
//std::cout << "[" << std::bitset<32>(i >> 32) << "]" << std::endl;
std::cout << "[" << std::bitset<15>(i) << "]";
std::cout << "[" << std::bitset<1>(i >> 15) << "]";
std::cout << "[" << std::bitset<8>(i >> 16) << "]";
std::cout << "[" << std::bitset<8>(i >> 24) << "]";
std::cout << "[" << std::bitset<32>(i >> 32) << "]" << std::endl;
}
inline void DumpLog(std::stringstream* ss, std::string file_name) {