games/galaxy: avoid unnecessary calculations
It is not necessary to recalculate the center of the screen every time.
This commit is contained in:
parent
dff1e3813f
commit
3f2d3721de
1 changed files with 1 additions and 1 deletions
|
@ -357,13 +357,13 @@ dozoom(void)
|
||||||
setcursor(mc, &zoomcursor);
|
setcursor(mc, &zoomcursor);
|
||||||
oxy = mc->xy;
|
oxy = mc->xy;
|
||||||
oscale = scale;
|
oscale = scale;
|
||||||
|
sc = screencenter();
|
||||||
for(;;) {
|
for(;;) {
|
||||||
readmouse(mc);
|
readmouse(mc);
|
||||||
if(mc->buttons != 2)
|
if(mc->buttons != 2)
|
||||||
break;
|
break;
|
||||||
d = subpt(mc->xy, oxy);
|
d = subpt(mc->xy, oxy);
|
||||||
z = tanh((double)d.y/200) + 1;
|
z = tanh((double)d.y/200) + 1;
|
||||||
sc = screencenter();
|
|
||||||
gsc = tovector(sc);
|
gsc = tovector(sc);
|
||||||
pause(0, 0);
|
pause(0, 0);
|
||||||
scale = z*oscale;
|
scale = z*oscale;
|
||||||
|
|
Loading…
Reference in a new issue