diff options
| author | ilotterytea <iltsu@alright.party> | 2024-12-11 17:21:18 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-12-11 17:21:18 +0500 |
| commit | d5c3260848f9051beb96fb96473a560f51a8ed25 (patch) | |
| tree | 8382e6a73942fb78ff22cb375f626b12a57a713a | |
| parent | 68684685f1c83c641d5a720d17760ab940b29b44 (diff) | |
feat: resize the star image
| -rw-r--r-- | src/constants.h | 3 | ||||
| -rw-r--r-- | src/main.c | 6 |
2 files changed, 9 insertions, 0 deletions
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 @@ -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); |
