games/galaxy: avoid unnecessary calculations

It is not necessary to recalculate the center of the
screen every time.
This commit is contained in:
spew 2017-03-12 18:33:54 -05:00
parent dff1e3813f
commit 3f2d3721de

View file

@ -357,13 +357,13 @@ dozoom(void)
setcursor(mc, &zoomcursor);
oxy = mc->xy;
oscale = scale;
sc = screencenter();
for(;;) {
readmouse(mc);
if(mc->buttons != 2)
break;
d = subpt(mc->xy, oxy);
z = tanh((double)d.y/200) + 1;
sc = screencenter();
gsc = tovector(sc);
pause(0, 0);
scale = z*oscale;