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);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue