diff options
Diffstat (limited to 'src')
| -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); |
