mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
minor optimize
This commit is contained in:
parent
d56c0be9bd
commit
8acb0749fb
1 changed files with 10 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue