mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-08 04:12:50 +00:00
ads-game:: fix texture glitches
This commit is contained in:
parent
0c6d83b702
commit
bcd6d772f6
@ -87,7 +87,8 @@ void draw_texture(texture_to_use& tu) {
|
|||||||
|
|
||||||
ld MWIDTH = tex.tx * .5 / tex.ty;
|
ld MWIDTH = tex.tx * .5 / tex.ty;
|
||||||
|
|
||||||
println(hlog, "shift = ", current.shift, " end = ", tu.to);
|
array<hyperpoint, 3> pts;
|
||||||
|
int pts_id = 0;
|
||||||
|
|
||||||
auto add = [&] (int x, int y) {
|
auto add = [&] (int x, int y) {
|
||||||
ld x0 = (y-(YSCALE/2.)) / YSCALE * M_PI * 4;
|
ld x0 = (y-(YSCALE/2.)) / YSCALE * M_PI * 4;
|
||||||
@ -134,6 +135,14 @@ void draw_texture(texture_to_use& tu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
curvepoint(cr.h);
|
curvepoint(cr.h);
|
||||||
|
cr.h[2]++; cr.h /= cr.h[2];
|
||||||
|
pts[pts_id++] = cr.h;
|
||||||
|
|
||||||
|
if(pts_id == 3) {
|
||||||
|
ld area = (pts[0] ^ pts[1])[2] + (pts[1] ^ pts[2])[2] + (pts[2] ^ pts[0])[2];
|
||||||
|
if(area < 0) { et.tinf.tvertices.resize(et.tinf.tvertices.size()-3); curvedata.resize(curvedata.size()-3); }
|
||||||
|
pts_id = 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for(int x=0; x<XSCALE; x++)
|
for(int x=0; x<XSCALE; x++)
|
||||||
@ -141,8 +150,8 @@ void draw_texture(texture_to_use& tu) {
|
|||||||
add(x, y);
|
add(x, y);
|
||||||
add(x+1, y);
|
add(x+1, y);
|
||||||
add(x, y+1);
|
add(x, y+1);
|
||||||
add(x+1, y);
|
|
||||||
add(x, y+1);
|
add(x, y+1);
|
||||||
|
add(x+1, y);
|
||||||
add(x+1, y+1);
|
add(x+1, y+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user