Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,4 @@ vcpkg_installed
build
out
enc_temp_folder
/path_sources
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
cmake_minimum_required(VERSION 3.30)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-extra-arg=/EHsc;-p=build")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

project(ArrowVortex)
set(CMAKE_CONFIGURATION_TYPES Debug;Release;MinSizeRel)
if("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
set(tidy_flags "--fix-errors;--fix-notes")
set(format_flags "-i")
else()
set(tidy_flags "--warnings-as-errors=*")
set(format_flags "--dry-run")
endif()
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;--extra-arg-before=/EHsc;${tidy_flags};-p=build")

set(CMAKE_CONFIGURATION_TYPES Debug Release)
project(ArrowVortex)

include_directories("${PROJECT_SOURCE_DIR}/src")

Expand All @@ -29,3 +36,13 @@ install(TARGETS ArrowVortex RUNTIME)
install(DIRECTORY bin/assets DESTINATION bin)
install(DIRECTORY bin/noteskins DESTINATION bin)
install(DIRECTORY bin/settings DESTINATION bin)

file(GLOB_RECURSE path_sources "src/*.cpp" "src/*.hpp" "src/*.c" "src/*.h")
add_custom_target(format ALL)
add_custom_command(
TARGET format
POST_BUILD
COMMAND clang-format ${format_flags} -Werror -style=file ${path_sources}
USES_TERMINAL
)
add_dependencies(format ArrowVortex)
14 changes: 13 additions & 1 deletion CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ]
},
{
"name": "Reformat",
"generator": "Ninja",
"configurationType": "MinSizeRel",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"intelliSenseMode": "windows-clang-x64"
}
]
}
}
8 changes: 4 additions & 4 deletions src/Dialogs/SongProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct DialogSongProperties::BannerWidget : public GuiWidget {
};

struct DialogSongProperties::CdTitleWidget : public GuiWidget {
CdTitleWidget(GuiContext* gui) : GuiWidget(gui) {
explicit CdTitleWidget(GuiContext* gui) : GuiWidget(gui) {
width_ = BANNER_W;
height_ = 75;
}
Expand All @@ -48,14 +48,14 @@ struct DialogSongProperties::CdTitleWidget : public GuiWidget {
auto h = tex.height();
auto w = tex.width();
// Scale the CD Title to fit if it is too big
auto aspect = (float)w / (float)h;
auto aspect = static_cast<float>(w) / static_cast<float>(h);
if (h > height_) {
h = height_;
w = (int)round((h * aspect));
w = static_cast<int>(round(h * aspect));
}
if (w > width_) {
w = width_;
h = (int)round((w / aspect));
h = static_cast<int>(round(w / aspect));
}
// Place the CD Title in the middle of the box
r = {rect_.x + (width_ - w) / 2, rect_.y + (height_ - h) / 2, w, h};
Expand Down
Binary file modified src/System/ArrowVortex.rc
Binary file not shown.