summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.c b/main.c
index f0620e4..1e0aa37 100644
--- a/main.c
+++ b/main.c
@@ -172,7 +172,7 @@ void
redraw(void)
{
Rectangle r;
- Point p;
+ Point p, dp;
memimagedraw(fb, fb->r, pal[Cbg], ZP, nil, ZP, SoverD);
for(r = ZR; r.min.y < bob.spr->r.max.y; r.min.y++){
@@ -180,11 +180,11 @@ redraw(void)
r.max.y = r.min.y+1;
for(; r.min.x < bob.spr->r.max.x; r.min.x++){
r.max.x = r.min.x+1;
- if(memcmp(byteaddr(bob.spr, r.min), byteaddr(pal[Cmask], ZP), bob.spr->depth/8) != 0){
- p = addpt(r.min,subpt(bob.p, Pt(Dx(bob.spr->r)/2,Dy(bob.spr->r)/2)));
- p = rotatept(p, bob.roll, bob.p);
- toroidwarp(&p);
- memimagedraw(fb, Rpt(p,addpt(p,Pt(1,1))), bob.spr, r.min, nil, ZP, SoverD);
+ p = rotatept(r.min, bob.roll, Pt(Dx(bob.spr->r)/2,Dy(bob.spr->r)/2));
+ if(memcmp(byteaddr(bob.spr, p), byteaddr(pal[Cmask], ZP), bob.spr->depth/8) != 0){
+ dp = addpt(r.min, bob.p);
+ toroidwarp(&dp);
+ memimagedraw(fb, Rpt(dp,addpt(dp, Pt(1,1))), bob.spr, p, nil, ZP, SoverD);
}
}
}