One more file

master
MitchellHansen 8 years ago
parent 0f786b8647
commit 6534e3303b

@ -34,15 +34,15 @@ public:
Octree() { Octree() {
// initialize the first stack block // initialize the first stack block
stack.push_back(new uint64_t[0x8000]); block_stack.push_back(new uint64_t[0x8000]);
for (int i = 0; i < 0x8000; i++) { for (int i = 0; i < 0x8000; i++) {
stack.back()[i] = 0; block_stack.back()[i] = 0;
} }
}; };
~Octree() {}; ~Octree() {};
std::list<uint64_t*> stack; std::list<uint64_t*> block_stack;
uint64_t stack_pos = 0x8000; uint64_t stack_pos = 0x8000;
uint64_t global_pos = 0; uint64_t global_pos = 0;
@ -59,7 +59,7 @@ public:
// Check for the far bit // Check for the far bit
memcpy(&stack.front()[stack_pos + global_pos], children.data(), children.size() * sizeof(uint64_t)); memcpy(&block_stack.front()[stack_pos + global_pos], children.data(), children.size() * sizeof(uint64_t));
// Return the bitmask encoding the index of that value // Return the bitmask encoding the index of that value
// If we tripped the far bit, allocate a far index to the stack and place // If we tripped the far bit, allocate a far index to the stack and place
@ -83,13 +83,13 @@ public:
std::queue<uint64_t> parent_stack; std::queue<uint64_t> parent_stack;
uint64_t head = stack.front()[stack_pos]; uint64_t head = block_stack.front()[stack_pos];
parent_stack.push(head); parent_stack.push(head);
uint64_t index = cp_to_index(head); uint64_t index = cp_to_index(head);
uint64_t child = block_stack.front()[index];
return true; return true;
@ -99,7 +99,7 @@ public:
void print_block(int block_pos) { void print_block(int block_pos) {
std::stringstream sss; std::stringstream sss;
for (int i = 0; i < (int)pow(2, 15); i++) { for (int i = 0; i < (int)pow(2, 15); i++) {
PrettyPrintUINT64(stack.front()[i], &sss); PrettyPrintUINT64(block_stack.front()[i], &sss);
sss << "\n"; sss << "\n";
} }
DumpLog(&sss, "raw_data.txt"); DumpLog(&sss, "raw_data.txt");

Loading…
Cancel
Save