games/galaxy: simplify zoom loop
This commit is contained in:
parent
acd1a3edda
commit
2c6c64c474
|
@ -356,33 +356,23 @@ dozoom(void)
|
||||||
double f, olds;
|
double f, olds;
|
||||||
|
|
||||||
setcursor(mc, &zoomcursor);
|
setcursor(mc, &zoomcursor);
|
||||||
|
|
||||||
|
z = mc->xy;
|
||||||
|
olds = scale;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
for(;;) {
|
readmouse(mc);
|
||||||
readmouse(mc);
|
if(mc->buttons != 2)
|
||||||
if(mc->buttons == 0)
|
|
||||||
continue;
|
|
||||||
if(mc->buttons != 2)
|
|
||||||
goto End;
|
|
||||||
break;
|
break;
|
||||||
}
|
d = subpt(mc->xy, z);
|
||||||
z = mc->xy;
|
f = tanh((double)d.y/200) + 1;
|
||||||
olds = scale;
|
|
||||||
pause(0, 0);
|
pause(0, 0);
|
||||||
for(;;) {
|
scale = f*olds;
|
||||||
readmouse(mc);
|
drawglxy();
|
||||||
if(mc->buttons != 2)
|
|
||||||
break;
|
|
||||||
drawglxy();
|
|
||||||
line(screen, z, (Point){z.x, mc->xy.y}, Enddisc, Enddisc, 0, display->white, ZP);
|
|
||||||
d = subpt(mc->xy, z);
|
|
||||||
f = tanh((double)d.y/200) + 1;
|
|
||||||
scale = f*olds;
|
|
||||||
}
|
|
||||||
pause(1, 0);
|
pause(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
End:
|
|
||||||
setcursor(mc, cursor);
|
setcursor(mc, cursor);
|
||||||
|
pause(1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue