add cover.png; fixed cmake

This commit is contained in:
VisualGMQ 2022-02-17 17:28:26 +08:00
parent 831e767cf9
commit 1d7a4618f5
6 changed files with 14 additions and 11 deletions

View File

@ -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")

BIN
assets/cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

@ -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/

View File

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

View File

@ -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_);
}

View File

@ -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();
}