From 1d7a4618f5311f8372010cad4e1b321732cc00a7 Mon Sep 17 00:00:00 2001 From: VisualGMQ <2142587070@qq.com> Date: Thu, 17 Feb 2022 17:28:26 +0800 Subject: [PATCH] add cover.png; fixed cmake --- CMakeLists.txt | 2 +- assets/cover.png | Bin 0 -> 610 bytes pack.sh | 2 +- src/game/main.cpp | 4 ++-- src/game/stages/gamelogo.cpp | 10 ++++++++++ src/game/stages/welcome.cpp | 7 ------- 6 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 assets/cover.png diff --git a/CMakeLists.txt b/CMakeLists.txt index 57136d0..e95a01d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -project(SpaceSector +project(SpaceWar VERSION 0.1.0 DESCRIPTION "a game made for 1M Game Competition") diff --git a/assets/cover.png b/assets/cover.png new file mode 100644 index 0000000000000000000000000000000000000000..54733b1528e3f8b22b73af96a0bd57132d616a0b GIT binary patch literal 610 zcmV-o0-gPdP)Px%97#k$R9J=0R=-QbKotHi20Gb@;;NM*b`Wy5;^KecCioX9F2zA`jH8Z%Lvho; zpy1{xE-upQ6&w^1T31mJr$QtS`p!$59~Ya59|Usu-rf7&_ugH?Y}@uQ1PYbqNL&Bz zGI6~*OmGz&JG=7z_+U?aouLkd5LxjVKyYsw8|nn-Jk_Rg@(1m~y=lyb>48FJ*(ZGv z#|L|fePF~|zd>?kQ6eFPZy&8D^ z6j%)!HWws9BtlD&Rk!Pa*|zOPeFxIW9)+ZGn1Ei!hmE6wx$Uj`(Chx+DG0ms-wWef z+3Mo3afH$SYd8TFzrFR+zyR|76H0>iMKm!r3jior=6&;zceen5m#2qc`I?JcU)i@B zdS{oBy@L#;V2 w2?6=5V7iV!GYSj<_FM^Vr;3mD>)Z%@0=dBDPR;F&o&W#<07*qoM6N<$f=Or_NdN!< literal 0 HcmV?d00001 diff --git a/pack.sh b/pack.sh index 576f66a..903c3fc 100755 --- a/pack.sh +++ b/pack.sh @@ -5,7 +5,7 @@ if [ -d "./output" ]; then fi mkdir output -cp ./build/SpaceSector output +cp ./build/SpaceWar output cp -r ./assets output rm -rf ./output/assets/test cp ./HowToPlay.md output/ diff --git a/src/game/main.cpp b/src/game/main.cpp index 499bae7..b5c885a 100644 --- a/src/game/main.cpp +++ b/src/game/main.cpp @@ -6,5 +6,5 @@ // RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, SelectScence) // RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, SpaceScence) -RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, WelcomeScence) -// RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, GameLogoScence) +// RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, WelcomeScence) +RUN_WINDOW("Space War v1.0", GameWindowSize.w, GameWindowSize.h, GameLogoScence) diff --git a/src/game/stages/gamelogo.cpp b/src/game/stages/gamelogo.cpp index 42d0009..c5af3ab 100644 --- a/src/game/stages/gamelogo.cpp +++ b/src/game/stages/gamelogo.cpp @@ -12,6 +12,16 @@ void GameLogoScence::OnInit() { sound_.reset(new Sound("assets/1mgame_sound.wav")); soundPlayed_ = false; + GLFWimage image; + image.pixels = stbi_load("assets/cursor.png", &image.width, &image.height, nullptr, 0); + auto cursor = glfwCreateCursor(&image, image.width / 2, image.height / 2); + glfwSetCursor(engine.GetWindow(), cursor); + stbi_image_free(image.pixels); + + image.pixels = stbi_load("assets/cover.png", &image.width, &image.height, nullptr, 0); + glfwSetWindowIcon(engine.GetWindow(), 1, &image); + stbi_image_free(image.pixels); + Renderer::SetCamera(camera_); } diff --git a/src/game/stages/welcome.cpp b/src/game/stages/welcome.cpp index 4862308..b592823 100644 --- a/src/game/stages/welcome.cpp +++ b/src/game/stages/welcome.cpp @@ -9,13 +9,6 @@ void WelcomeScence::OnInit() { startImage_.reset(new Texture("assets/start_btn.png")); exitImage_.reset(new Texture("assets/exit_btn.png")); - - GLFWimage image; - image.pixels = stbi_load("assets/cursor.png", &image.width, &image.height, nullptr, 0); - auto cursor = glfwCreateCursor(&image, image.width / 2, image.height / 2); - glfwSetCursor(engine.GetWindow(), cursor); - stbi_image_free(image.pixels); - LoadResources(); }