diff options
author | spew <devnull@localhost> | 2017-03-12 18:33:54 -0500 |
---|---|---|
committer | spew <devnull@localhost> | 2017-03-12 18:33:54 -0500 |
commit | 3f2d3721ded93048c8f8897a3c28e61852475e7e (patch) | |
tree | 3a4e83b3d484ebcb6f11ed74c75e3b23dfd2692c /sys/src/games | |
parent | dff1e3813fb0deb18ca790b7c28f6a1405720ff6 (diff) |
games/galaxy: avoid unnecessary calculations
It is not necessary to recalculate the center of the
screen every time.
Diffstat (limited to 'sys/src/games')
-rw-r--r-- | sys/src/games/galaxy/galaxy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/games/galaxy/galaxy.c b/sys/src/games/galaxy/galaxy.c index 8323e94da..57f9b7bbb 100644 --- a/sys/src/games/galaxy/galaxy.c +++ b/sys/src/games/galaxy/galaxy.c @@ -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; |