[Add] Support for mousewheel to zoom in/out of map.

This commit is contained in:
Allanis 2013-04-19 20:22:04 +01:00
parent 8fd0e73e66
commit cc9ffd1e60

View File

@ -219,6 +219,11 @@ static void map_mouse(SDL_Event* event, double mx, double my) {
switch(event->type) { switch(event->type) {
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
if(event->button.button == SDL_BUTTON_WHEELUP)
map_buttonZoom("btnZoomOut");
else if(event->button.button == SDL_BUTTON_WHEELDOWN)
map_buttonZoom("btnZoomIn");
// Selecting star system. // Selecting star system.
for(i = 0; i < systems_nstack; i++) { for(i = 0; i < systems_nstack; i++) {
x = systems_stack[i].pos.x * map_zoom; x = systems_stack[i].pos.x * map_zoom;