Skip to content

Commit

Permalink
Fix clang complaints.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Nov 11, 2023
1 parent dff7c1e commit 4a73418
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
2 changes: 0 additions & 2 deletions libopenage/curve/map_filter_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MapFilterIterator : public CurveIterator<val_t, container_t> {
const time::time_t &to) :
CurveIterator<val_t, container_t>(base, container, from, to) {}

MapFilterIterator(const MapFilterIterator &) = default;

using CurveIterator<val_t, container_t>::operator=;

virtual bool valid() const override {
Expand Down
2 changes: 1 addition & 1 deletion libopenage/gamestate/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void Game::load_path(const util::Path &base_dir,
auto base_path = base_dir.resolve_native_path();
auto search_path = base_dir / mod_dir / search;

auto fileload_func = [&base_path, &mod_dir](const std::string &filename) {
auto fileload_func = [&base_path](const std::string &filename) {
// nyan wants a string filepath, so we have to construct it from the
// path and subpath parameters
log::log(INFO << "Loading .nyan file: " << filename);
Expand Down
3 changes: 2 additions & 1 deletion libopenage/gamestate/terrain_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "gamestate/api/terrain.h"
#include "gamestate/terrain.h"
#include "gamestate/terrain_chunk.h"
#include "gamestate/terrain_tile.h"
#include "renderer/render_factory.h"
#include "renderer/stages/terrain/terrain_render_entity.h"
#include "time/time.h"
Expand Down Expand Up @@ -121,7 +122,7 @@ std::shared_ptr<TerrainChunk> TerrainFactory::add_chunk(const std::shared_ptr<Ga
std::vector<TerrainTile> tiles{};
tiles.reserve(size[0] * size[1]);
for (size_t i = 0; i < size[0] * size[1]; ++i) {
tiles.emplace_back(terrain_obj, test_texture_path, 0.0f);
tiles.push_back({terrain_obj, test_texture_path, terrain_elevation_t::zero()});
}

auto chunk = std::make_shared<TerrainChunk>(size, offset, std::move(tiles));
Expand Down
36 changes: 18 additions & 18 deletions libopenage/renderer/gui/integration/private/gui_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,33 @@ bool GuiTexture::isAtlasTexture() const {
}

namespace {
GLuint create_compatible_texture(GLuint texture_id, GLsizei w, GLsizei h) {
glBindTexture(GL_TEXTURE_2D, texture_id);
// GLuint create_compatible_texture(GLuint texture_id, GLsizei w, GLsizei h) {
// glBindTexture(GL_TEXTURE_2D, texture_id);

GLint min_filter;
GLint mag_filter;
GLint iformat;
// GLint min_filter;
// GLint mag_filter;
// GLint iformat;

glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &min_filter);
glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &mag_filter);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &iformat);
// glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &min_filter);
// glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &mag_filter);
// glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &iformat);

GLuint new_texture_id;
glGenTextures(1, &new_texture_id);
glBindTexture(GL_TEXTURE_2D, new_texture_id);
// GLuint new_texture_id;
// glGenTextures(1, &new_texture_id);
// glBindTexture(GL_TEXTURE_2D, new_texture_id);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);

glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
// glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);

glBindTexture(GL_TEXTURE_2D, 0);
// glBindTexture(GL_TEXTURE_2D, 0);

return new_texture_id;
}
// return new_texture_id;
// }
} // namespace

QSGTexture *GuiTexture::removedFromAtlas(QRhiResourceUpdateBatch *resourceUpdates /* = nullptr */) const {
QSGTexture *GuiTexture::removedFromAtlas(QRhiResourceUpdateBatch * /* resourceUpdates */ /* = nullptr */) const {
if (this->isAtlasTexture()) {
return this->standalone.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ QSize textureSize(const SizedTextureHandle &texture_handle) {
return texture_handle.size;
}

QSize native_size(const TextureHandle &texture_handle) {
QSize native_size(const TextureHandle & /* texture_handle */) {
return QSize(0, 0);
}

Expand Down
2 changes: 1 addition & 1 deletion libopenage/renderer/opengl/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ std::shared_ptr<Renderer> GlWindow::make_renderer() {
auto renderer = std::make_shared<GlRenderer>(this->get_context(),
this->size * this->scale_dpr);

this->add_resize_callback([this, renderer](size_t w, size_t h, double scale) {
this->add_resize_callback([renderer](size_t w, size_t h, double scale) {
// this up-scales all the default framebuffer to the "bigger" highdpi window.
renderer->resize_display_target(w * scale, h * scale);
});
Expand Down

0 comments on commit 4a73418

Please sign in to comment.