diff options
| author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 21:39:21 +0100 | 
|---|---|---|
| committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 21:42:08 +0100 | 
| commit | 517b218b093708ff1a10c3ed2474cf3395564741 (patch) | |
| tree | 7ecd9155e132d1c5382a92c766877fd6de96853d /src/game/interface.cpp | |
| parent | 6dc7ae4f49931f721ad072cc72038cada78b147e (diff) | |
Copyright stuff.
Diffstat (limited to 'src/game/interface.cpp')
| -rw-r--r-- | src/game/interface.cpp | 25 | 
1 files changed, 24 insertions, 1 deletions
diff --git a/src/game/interface.cpp b/src/game/interface.cpp index 0c2125b..5e5dc70 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -1,3 +1,20 @@ +/* +This file is part of Minitrem. + +Minitrem is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Minitrem is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Minitrem.  If not, see <http://www.gnu.org/licenses/>. +*/ +  #include "game.hpp"  #include <iomanip> @@ -39,7 +56,13 @@ void state_t::tick(double dt)  		view_size.y = view_scale * size.y / size.x;  	} -	if (game->selected_units.size() && camera.following) { +	if (!game->selected_units.size() && camera.following) { +		camera.center = camera.follow_center; +		print(text::get(text::FOLLOWING_OFF)); +		camera.following = false; +	} + +	if (camera.following) {  		for (entity_t *ent : game->selected_units)  			follow_center += ent->render_bounds.center();  		follow_center /= game->selected_units.size();  | 
