.
守矢諏訪子 <suwako@076.moe>、2026-07-18 12:04
コミット 789b1f2077c08a73065e8a073bf32bef9f8a71fc
・親 dcd5d36
・ファイルを見る
3個のファイル、+13 -5
変更
README.md
| @@ -1,7 +1,14 @@ | ||
| 1 | 1 | # テトリス |
| 2 | 2 | |
| 3 | 3 | ## ビルド |
| 4 | +### Windows | |
| 4 | 5 | ```sh |
| 5 | 6 | $ cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release |
| 7 | +$ cmake --build build --config Release | |
| 8 | +``` | |
| 9 | + | |
| 10 | +### Unix | |
| 11 | +```sh | |
| 12 | +$ cmake -B build -DCMAKE_BUILD_TYPE=Release | |
| 6 | 13 | $ cmake --build build --config Release |
| 7 | 14 | ``` |
変更
main.cc
| @@ -39,15 +39,15 @@ | ||
| 39 | 39 | |
| 40 | 40 | #include <tetris/ass/icon.hh> |
| 41 | 41 | |
| 42 | -constexpr i32 screenWidth = 900; | |
| 43 | -constexpr i32 screenHeight = 700; | |
| 42 | +constexpr i32 ScreenWidth = 900; | |
| 43 | +constexpr i32 ScreenHeight = 700; | |
| 44 | 44 | |
| 45 | 45 | int main() { |
| 46 | 46 | #if PRODUCTION_BUILD == 1 |
| 47 | 47 | SetTraceLogLevel(LOG_NONE); |
| 48 | 48 | #endif |
| 49 | - SetConfigFlags(FLAG_WINDOW_RESIZABLE); | |
| 50 | - InitWindow(screenWidth, screenHeight, "テトリス"); | |
| 49 | + SetConfigFlags(FLAG_WINDOW_HIGHDPI); | |
| 50 | + InitWindow(ScreenWidth, ScreenHeight, "テトリス"); | |
| 51 | 51 | |
| 52 | 52 | Image icon = LoadImageFromMemory(".png", __ass_icon_png, __ass_icon_png_len); |
| 53 | 53 | SetWindowIcon(icon); |
| @@ -44,6 +44,7 @@ | ||
| 44 | 44 | |
| 45 | 45 | #include <cassert> |
| 46 | 46 | #include <iostream> |
| 47 | +#include <cmath> | |
| 47 | 48 | |
| 48 | 49 | namespace tetris::scene { |
| 49 | 50 | constexpr f32 MinTimePassed = 5.f; |
| @@ -102,7 +103,7 @@ | ||
| 102 | 103 | constexpr f32 spacing = 40.f; |
| 103 | 104 | |
| 104 | 105 | auto DrawButton = [&](Font font, cstr text, Vector2 pos, bool selected) { |
| 105 | - f32 scale = selected ? 1.05f + 0.03f * sinf(GetTime() * 8.f) : 1.f; | |
| 106 | + f32 scale = selected ? 1.05f + 0.03f * std::sinf(GetTime() * 8.f) : 1.f; | |
| 106 | 107 | Color canColor = m_InputTimer > MinTimePassed ? RED : GRAY; |
| 107 | 108 | Color color = selected ? canColor : Fade(canColor, 0.5f); |
| 108 | 109 | f32 sizePx = 20.f * scale; |