From d5c3260848f9051beb96fb96473a560f51a8ed25 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 11 Dec 2024 17:21:18 +0500 Subject: feat: resize the star image --- src/constants.h | 3 +++ src/main.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/constants.h b/src/constants.h index 3b9d446..61568d5 100644 --- a/src/constants.h +++ b/src/constants.h @@ -4,4 +4,7 @@ #define STAR_MIN_VELOCITY 1 #define STAR_MAX_VELOCITY 5 +#define STAR_TEXTURE_WIDTH 32 +#define STAR_TEXTURE_HEIGHT 32 + #define SPACE_SIZE 35.0 diff --git a/src/main.c b/src/main.c index 56b66cb..f25a919 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,12 @@ int main(int argc, char* argv[]) { if (FileExists("star.png")) { Image image = LoadImage("star.png"); + + if (image.width != STAR_TEXTURE_WIDTH || + image.height != STAR_TEXTURE_HEIGHT) { + ImageResizeNN(&image, STAR_TEXTURE_WIDTH, STAR_TEXTURE_HEIGHT); + } + Texture2D loadedTexture = LoadTextureFromImage(image); texture = &loadedTexture; UnloadImage(image); -- cgit v1.2.3