Browse Source

make clang-tidy happier

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
bcc6e9f421
3 changed files with 4 additions and 4 deletions
  1. 1
    1
      CMakeLists.txt
  2. 2
    2
      libswan/include/swan/Win.h
  3. 1
    1
      libswan/src/Game.cc

+ 1
- 1
CMakeLists.txt View File

@@ -7,7 +7,7 @@ option(USE_CLANG_TIDY "Use clang-tidy for additional checks" ON)
if(USE_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY
clang-tidy
--header-filter=.*
"--header-filter=(libswan|core.mod|src)/.*"
--checks=-*,bugprone-*,cert-*,performance-*,clang-analyzer-*,-cert-dcl16-c,-cert-err58-cpp,-clang-analyzer-optin.cplusplus.VirtualCall)
endif()


+ 2
- 2
libswan/include/swan/Win.h View File

@@ -21,7 +21,7 @@ public:
// For HiDPI, we must set the renderer's logical size.
int w, h;
SDL_GetWindowSize(window_, &w, &h);
SDL_RenderSetLogicalSize(renderer_, w / scale_, h / scale_);
onResize(w, h);

info << "Using renderer: " << rinfo_.name;
}
@@ -33,7 +33,7 @@ public:
}

void onResize(int w, int h) {
SDL_RenderSetLogicalSize(renderer_, w / scale_, h / scale_);
SDL_RenderSetLogicalSize(renderer_, (int)((float)w / scale_), (int)((float)h / scale_));
}

SDL_Rect createDestRect(Vec2 pos, Vec2 pixsize) {

+ 1
- 1
libswan/src/Game.cc View File

@@ -51,7 +51,7 @@ void Game::update(float dt) {
world_->update(dt);

// Zoom the window using the scroll wheel
win_.zoom_ += wasWheelScrolled() * 0.1 * win_.zoom_;
win_.zoom_ += (float)wasWheelScrolled() * 0.1f * win_.zoom_;
if (win_.zoom_ > 3)
win_.zoom_ = 3;
else if (win_.zoom_ < 0.3)

Loading…
Cancel
Save