|
|
@ -31,24 +31,12 @@ void GUI::output(const string msg) { |
|
|
|
_lines.push_back(msg); |
|
|
|
_lines.push_back(msg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int GUI::main_loop(GameEngine &game, Builder &builder) { |
|
|
|
void GUI::main_loop(SFMLBackend &gui) { |
|
|
|
auto gui = SFMLBackend(game); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gui.startup(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(gui.is_open()) { |
|
|
|
|
|
|
|
builder.event(BuildEvent::GO); |
|
|
|
|
|
|
|
gui.handle_events(); |
|
|
|
gui.handle_events(); |
|
|
|
gui.update_entities(); |
|
|
|
gui.update_entities(); |
|
|
|
gui.update_log(_lines); |
|
|
|
gui.update_log(_lines); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
builder.event(BuildEvent::QUIT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gui.shutdown(); |
|
|
|
|
|
|
|
return EXIT_SUCCESS; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GUI::build_works() { |
|
|
|
void GUI::build_works() { |
|
|
|
building_sound.stop(); |
|
|
|
building_sound.stop(); |
|
|
|
build_works_sound.play(); |
|
|
|
build_works_sound.play(); |
|
|
|