| 667 | |
| 668 | protected: |
| 669 | explicit Processing(std::string name) : |
| 670 | Effect(std::move(name)), |
| 671 | m_enabledText(getFont(), "Processing: Enabled"), |
| 672 | m_instructions(getFont(), "Press Space to enable/disable processing") |
| 673 | { |
| 674 | m_listener.setPosition({(windowWidth - 20.f) / 2.f, (windowHeight - 20.f) / 2.f}); |
| 675 | m_listener.setFillColor(sf::Color::Red); |
| 676 | |
| 677 | m_enabledText.setPosition({windowWidth / 2.f - 120.f, windowHeight * 3.f / 4.f - 50.f}); |
| 678 | m_instructions.setPosition({windowWidth / 2.f - 250.f, windowHeight * 3.f / 4.f}); |
| 679 | |
| 680 | // Load the music file |
| 681 | if (!m_music.openFromFile(resourcesDir() / "doodle_pop.ogg")) |
| 682 | { |
| 683 | std::cerr << "Failed to load " << (resourcesDir() / "doodle_pop.ogg").string() << std::endl; |
| 684 | std::abort(); |
| 685 | } |
| 686 | |
| 687 | // Set the music to loop |
| 688 | m_music.setLooping(true); |
| 689 | |
| 690 | // Set attenuation to a nice value |
| 691 | m_music.setAttenuation(0.0f); |
| 692 | } |
| 693 | |
| 694 | sf::Music& getMusic() |
| 695 | { |
nothing calls this directly
no test coverage detected