@@ -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() | |||
@@ -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) { |
@@ -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) |