minor optimize
This commit is contained in:
parent
d56c0be9bd
commit
8acb0749fb
@ -58,9 +58,11 @@ void LightSolver::solve(){
|
|||||||
remqueue.pop();
|
remqueue.pop();
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
int x = entry.x+coords[i*3+0];
|
int imul3 = i*3;
|
||||||
int y = entry.y+coords[i*3+1];
|
int x = entry.x+coords[imul3];
|
||||||
int z = entry.z+coords[i*3+2];
|
int y = entry.y+coords[imul3+1];
|
||||||
|
int z = entry.z+coords[imul3+2];
|
||||||
|
|
||||||
Chunk* chunk = chunks->getChunkByVoxel(x,y,z);
|
Chunk* chunk = chunks->getChunkByVoxel(x,y,z);
|
||||||
if (chunk) {
|
if (chunk) {
|
||||||
int lx = x - chunk->x * CHUNK_W;
|
int lx = x - chunk->x * CHUNK_W;
|
||||||
@ -85,9 +87,11 @@ void LightSolver::solve(){
|
|||||||
addqueue.pop();
|
addqueue.pop();
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
int x = entry.x+coords[i*3+0];
|
int imul3 = i*3;
|
||||||
int y = entry.y+coords[i*3+1];
|
int x = entry.x+coords[imul3];
|
||||||
int z = entry.z+coords[i*3+2];
|
int y = entry.y+coords[imul3+1];
|
||||||
|
int z = entry.z+coords[imul3+2];
|
||||||
|
|
||||||
Chunk* chunk = chunks->getChunkByVoxel(x,y,z);
|
Chunk* chunk = chunks->getChunkByVoxel(x,y,z);
|
||||||
if (chunk) {
|
if (chunk) {
|
||||||
int lx = x - chunk->x * CHUNK_W;
|
int lx = x - chunk->x * CHUNK_W;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user