mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-02-28 23:41:33 +01:00
fix compilation errors on windows
This commit is contained in:
parent
14221192de
commit
ce3f4e7b56
@ -15,6 +15,8 @@ In other words, how to create a new F.E.I.S. executable from the source code.
|
||||
```console
|
||||
$ meson setup build
|
||||
```
|
||||
|
||||
If you are compiling for a release and not a debug build, use `--buildtype=release`
|
||||
|
||||
If you want to compile the unit tests as well, pass in `-D tests=true`.
|
||||
You can also set this option later by doing :
|
||||
|
@ -61,11 +61,13 @@ Once you're done `pacman -Syu`ing and `pacman -Su`ing your system, open a new
|
||||
|
||||
```console
|
||||
$ pacman -S \
|
||||
mingw-w64-x86_64-meson \
|
||||
mingw-w64-x86_64-cmake \
|
||||
mingw-w64-x86_64-sfml \
|
||||
mingw-w64-x86_64-boost \
|
||||
mingw-w64-x86_64-ntldd-git
|
||||
mingw-w64-ucrt-x86_64-meson \
|
||||
mingw-w64-ucrt-x86_64-cmake \
|
||||
mingw-w64-ucrt-x86_64-sfml \
|
||||
mingw-w64-ucrt-x86_64-ntldd-git \
|
||||
mingw-w64-ucrt-x86_64-aubio \
|
||||
mingw-w64-ucrt-x86_64-eigen3 \
|
||||
mingw-w64-ucrt-x86_64-fftw
|
||||
```
|
||||
|
||||
Once this is done, open a new `MSYS2 MinGW x64` terminal and follow the
|
||||
|
@ -387,9 +387,13 @@ std::vector<TempoCandidate> estimate_offset(const std::vector<BPMFitness>& bpm_c
|
||||
const Fraction off_beat_offset_estimate = on_beat_offset_estimate + interval_in_seconds / 2;
|
||||
float average_onbeat_amplitude = 0;
|
||||
float average_offbeat_amplitude = 0;
|
||||
for (std::size_t i = 0; (off_beat_offset_estimate + i * interval_in_seconds) * sample_rate < mono_sample_count; i++) {
|
||||
const auto on_beat_sample = static_cast<std::size_t>((on_beat_offset_estimate + i * interval_in_seconds) * sample_rate);
|
||||
const auto off_beat_sample = static_cast<std::size_t>((on_beat_offset_estimate + i * interval_in_seconds) * sample_rate);
|
||||
for (
|
||||
std::size_t i = 0;
|
||||
(off_beat_offset_estimate + Fraction{i} * interval_in_seconds) * sample_rate < Fraction{mono_sample_count};
|
||||
i++
|
||||
) {
|
||||
const auto on_beat_sample = static_cast<std::size_t>((on_beat_offset_estimate + Fraction{i} * interval_in_seconds) * sample_rate);
|
||||
const auto off_beat_sample = static_cast<std::size_t>((on_beat_offset_estimate + Fraction{i} * interval_in_seconds) * sample_rate);
|
||||
average_onbeat_amplitude += slope.at(on_beat_sample);
|
||||
average_offbeat_amplitude += slope.at(off_beat_sample);
|
||||
}
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include <SFML/System/Err.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <cstdint>
|
||||
|
||||
#include "mp3_reader.hpp"
|
||||
|
||||
|
@ -242,13 +242,13 @@ Fraction convert_to_fraction(const Decimal& d) {
|
||||
|
||||
Fraction round_beats(const Fraction& beats, const std::uint64_t denominator) {
|
||||
const auto actual_denominator = std::max<std::uint64_t>(denominator, 1);
|
||||
const auto nearest = round_fraction(beats * actual_denominator);
|
||||
const auto nearest = round_fraction(beats * Fraction{actual_denominator});
|
||||
return nearest / Fraction{actual_denominator};
|
||||
};
|
||||
|
||||
Fraction floor_beats(const Fraction& beats, const std::uint64_t denominator) {
|
||||
const auto actual_denominator = std::max<std::uint64_t>(denominator, 1);
|
||||
const auto nearest = floor_fraction(beats * actual_denominator);
|
||||
const auto nearest = floor_fraction(beats * Fraction{actual_denominator});
|
||||
return nearest / Fraction{actual_denominator};
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,7 @@ SpriteSheet::SpriteSheet(
|
||||
columns(columns),
|
||||
rows(rows)
|
||||
{
|
||||
if (not tex.loadFromFile(texture_path)) {
|
||||
if (not tex.load_from_path(texture_path)) {
|
||||
throw std::runtime_error(
|
||||
"Cannot open file "
|
||||
+texture_path.string()
|
||||
|
Loading…
x
Reference in New Issue
Block a user