aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-10-20 10:36:48 +0000
committernathan <nathansmith@disroot.org>2025-10-20 10:36:48 +0000
commit5f402fc99a19d7d73ba75f632aed5cbef7e3920a (patch)
tree05494e50e2dbcd65835e89065637a53724acf913
parent27cf645101e295671a8381447a9cd1e9244a914c (diff)
downloadFindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.tar.gz
FindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.tar.bz2
FindThings-5f402fc99a19d7d73ba75f632aed5cbef7e3920a.zip
Fuck ultra wide
-rw-r--r--src/game.c49
-rw-r--r--src/game.h4
-rw-r--r--src/settings.c2
3 files changed, 45 insertions, 10 deletions
diff --git a/src/game.c b/src/game.c
index 6166ac7..913be9c 100644
--- a/src/game.c
+++ b/src/game.c
@@ -30,6 +30,19 @@ void resetScreenScale(Game* game)
width,
height
};
+
+ // Fuck ultra-wide.
+ game->screen.ultraWideMode = renderWidth / renderHeight >= MAX_ASPECT;
+
+ if (game->screen.ultraWideMode)
+ {
+ game->screen.destination = (Rectangle){
+ renderWidth / 2.0,
+ renderHeight / 2.0,
+ renderWidth,
+ renderHeight
+ };
+ }
}
void initGame(Game* game)
@@ -78,13 +91,33 @@ void drawGameScreen(Game* game)
{
Texture texture = game->screen.render.texture;
- DrawTexturePro(
- texture,
- (Rectangle){0.0, 0.0, texture.width, -texture.height},
- game->screen.destination,
- (Vector2){0.0, 0.0},
- 0.0,
- WHITE);
+ if (game->screen.ultraWideMode)
+ {
+ BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
+ DrawTexturePro(
+ texture,
+ (Rectangle){0.0, 0.0, texture.width, -texture.height},
+ game->screen.destination,
+ (Vector2){GetRenderWidth() / 2.0, GetRenderHeight() / 2.0},
+ (int)(GetTime() * ULTRA_WIDE_SPIN_SPEED) % 360,
+ WHITE);
+ EndShaderMode();
+
+ DrawText("FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE FUCK ULTRA WIDE",
+ 0.0, 0.0, 50, RED);
+ }
+ else
+ {
+ BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
+ DrawTexturePro(
+ texture,
+ (Rectangle){0.0, 0.0, texture.width, -texture.height},
+ game->screen.destination,
+ (Vector2){0.0, 0.0},
+ 0.0,
+ WHITE);
+ EndShaderMode();
+ }
}
void updateGameScene(Game* game)
@@ -108,9 +141,7 @@ void updateGameScene(Game* game)
ClearBackground(BLACK);
- BeginShaderMode(game->assets.shaders[POSTPROCESSING_SHADER]);
drawGameScreen(game);
- EndShaderMode();
}
void handleGameResize(Game* game)
diff --git a/src/game.h b/src/game.h
index d75fd4a..14d6502 100644
--- a/src/game.h
+++ b/src/game.h
@@ -8,6 +8,9 @@
#ifndef GAME_H
#define GAME_H
+#define MAX_ASPECT 2.0 // Fuck ultra-wide.
+#define ULTRA_WIDE_SPIN_SPEED 50.0
+
typedef enum {
MAIN_MENU_SCENE,
GAME_SCENE
@@ -25,6 +28,7 @@ struct Game {
RenderTexture render;
float scale;
Rectangle destination;
+ bool ultraWideMode;
} screen;
};
diff --git a/src/settings.c b/src/settings.c
index 55ebb9c..159cb6a 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -9,7 +9,7 @@ Settings defaultSettings()
.screenHeight = 447,
.edgeDetectionWidth = 80.0,
.edgeDetectionHeight = 60.0,
- .edgeDetectionFactor = 0.1,
+ .edgeDetectionFactor = 0.11,
.gamma = 0.6,
.colorCount = 11.0,
.mouseSpeed = 0.1,