Skip to content

Commit

Permalink
Update main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Woxel authored Sep 12, 2023
1 parent 8e7ef92 commit 85706d5
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,14 @@ void main_loop()
traceViewPath(1);
if(lray > -1)
{
if(g.pb.w == 1){g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;}
if(mirror == 1)
if(g.pb.w == 1 && isInBounds(g.pb) && g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] == 0)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;
if(mirror == 1)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
}
}
}
}
Expand Down Expand Up @@ -362,13 +365,14 @@ void main_loop()
if(lray > -1)
{
if(g.pb.w == 1 && isInBounds(g.pb) && g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] == 0)
g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;

if(mirror == 1)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
//printf("%f %f %f\n", x, g.pb.y, g.pb.z);
g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;
if(mirror == 1)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
//printf("%f %f %f\n", x, g.pb.y, g.pb.z);
}
}
}
}
Expand Down Expand Up @@ -460,11 +464,14 @@ void main_loop()
traceViewPath(1);
if(lray > -1)
{
if(g.pb.w == 1){g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;}
if(mirror == 1)
if(g.pb.w == 1 && isInBounds(g.pb) && g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] == 0)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
g.voxels[PTI(g.pb.x, g.pb.y, g.pb.z)] = g.st;
if(mirror == 1)
{
const float x = g.pb.x > 64.f ? 64.f+(64.f-g.pb.x) : 64.f + (64.f-g.pb.x);
g.voxels[PTI(x, g.pb.y, g.pb.z)] = g.st;
}
}
}
ptt = t+0.1;
Expand Down

0 comments on commit 85706d5

Please sign in to comment.