Fix switch/case code style

For readability and consistency, indent case statatements, and remove
unnecessary additional blocks.
This commit is contained in:
Romain Vimont 2018-03-15 16:00:40 +01:00
parent 047179f232
commit 080df5eb5d

View file

@ -79,16 +79,15 @@ static void event_loop(void) {
break; break;
case SDL_WINDOWEVENT: case SDL_WINDOWEVENT:
switch (event.window.event) { switch (event.window.event) {
case SDL_WINDOWEVENT_EXPOSED: case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_SIZE_CHANGED: case SDL_WINDOWEVENT_SIZE_CHANGED:
screen_render(&screen); screen_render(&screen);
break; break;
} }
break; break;
case SDL_TEXTINPUT: { case SDL_TEXTINPUT:
input_manager_process_text_input(&input_manager, &event.text); input_manager_process_text_input(&input_manager, &event.text);
break; break;
}
case SDL_KEYDOWN: case SDL_KEYDOWN:
case SDL_KEYUP: case SDL_KEYUP:
input_manager_process_key(&input_manager, &event.key); input_manager_process_key(&input_manager, &event.key);
@ -96,15 +95,13 @@ static void event_loop(void) {
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
input_manager_process_mouse_motion(&input_manager, &event.motion); input_manager_process_mouse_motion(&input_manager, &event.motion);
break; break;
case SDL_MOUSEWHEEL: { case SDL_MOUSEWHEEL:
input_manager_process_mouse_wheel(&input_manager, &event.wheel); input_manager_process_mouse_wheel(&input_manager, &event.wheel);
break; break;
}
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP: { case SDL_MOUSEBUTTONUP:
input_manager_process_mouse_button(&input_manager, &event.button); input_manager_process_mouse_button(&input_manager, &event.button);
break; break;
}
} }
} }
} }