fixed clang warnings
This commit is contained in:
@@ -100,7 +100,6 @@ void ALStream::update(double delta) {
|
|||||||
uint buffer;
|
uint buffer;
|
||||||
AL_CHECK(alSourceUnqueueBuffers(source, 1, &buffer));
|
AL_CHECK(alSourceUnqueueBuffers(source, 1, &buffer));
|
||||||
unusedBuffers.push(buffer);
|
unusedBuffers.push(buffer);
|
||||||
std::cout << "unqueue " << buffer << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint preloaded = 0;
|
uint preloaded = 0;
|
||||||
@@ -109,15 +108,12 @@ void ALStream::update(double delta) {
|
|||||||
if (preloadBuffer(buffer, loop)) {
|
if (preloadBuffer(buffer, loop)) {
|
||||||
preloaded++;
|
preloaded++;
|
||||||
unusedBuffers.pop();
|
unusedBuffers.pop();
|
||||||
std::cout << "queue " << buffer << std::endl;
|
|
||||||
AL_CHECK(alSourceQueueBuffers(source, 1, &buffer));
|
AL_CHECK(alSourceQueueBuffers(source, 1, &buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (speaker->isStopped() && !speaker->isStoppedManually()) {
|
if (speaker->isStopped() && !speaker->isStoppedManually()) {
|
||||||
std::cout << "preloaded " << preloaded << std::endl;
|
|
||||||
if (preloaded) {
|
if (preloaded) {
|
||||||
speaker->play();
|
speaker->play();
|
||||||
std::cout << "speaker restored" << std::endl;
|
|
||||||
} else {
|
} else {
|
||||||
speaker->stop();
|
speaker->stop();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ public:
|
|||||||
return totalSamples;
|
return totalSamples;
|
||||||
}
|
}
|
||||||
|
|
||||||
duration_t getTotalDuration() const {
|
duration_t getTotalDuration() const override {
|
||||||
return static_cast<duration_t>(totalSamples) /
|
return static_cast<duration_t>(totalSamples) /
|
||||||
static_cast<duration_t>(sampleRate);
|
static_cast<duration_t>(sampleRate);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -96,43 +96,43 @@ public:
|
|||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void close() {
|
void close() override {
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
ov_clear(&vf);
|
ov_clear(&vf);
|
||||||
closed = true;
|
closed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isOpen() const {
|
bool isOpen() const override {
|
||||||
return !closed;
|
return !closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t getTotalSamples() const {
|
size_t getTotalSamples() const override {
|
||||||
return totalSamples;
|
return totalSamples;
|
||||||
}
|
}
|
||||||
|
|
||||||
duration_t getTotalDuration() const {
|
duration_t getTotalDuration() const override {
|
||||||
return static_cast<duration_t>(totalSamples) /
|
return static_cast<duration_t>(totalSamples) /
|
||||||
static_cast<duration_t>(sampleRate);
|
static_cast<duration_t>(sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint getChannels() const {
|
uint getChannels() const override {
|
||||||
return channels;
|
return channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint getSampleRate() const {
|
uint getSampleRate() const override {
|
||||||
return sampleRate;
|
return sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint getBitsPerSample() const {
|
uint getBitsPerSample() const override {
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSeekable() const {
|
bool isSeekable() const override {
|
||||||
return seekable;
|
return seekable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void seek(size_t position) {
|
void seek(size_t position) override {
|
||||||
if (!closed && seekable) {
|
if (!closed && seekable) {
|
||||||
ov_raw_seek(&vf, position);
|
ov_raw_seek(&vf, position);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,10 +150,10 @@ void LevelScreen::update(float delta) {
|
|||||||
updateHotkeys();
|
updateHotkeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto camera = level->player->camera;
|
auto camera = this->level->player->camera;
|
||||||
audio::setListener(
|
audio::setListener(
|
||||||
camera->position,
|
camera->position,
|
||||||
level->player->hitbox->velocity,
|
this->level->player->hitbox->velocity,
|
||||||
camera->position+camera->dir,
|
camera->position+camera->dir,
|
||||||
camera->up
|
camera->up
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user