From 7afe0f38af2e9f57c33f7a5bbb2d61b16b0cbc0d Mon Sep 17 00:00:00 2001 From: dandovlatov Date: Mon, 23 Nov 2026 17:38:05 +0400 Subject: [PATCH] FBC: NIGHT SHIFT - made 1080p the default with the raw scene palette and an unfiltered HUD --- README.md | 4 ++++ src/main.cpp | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 70626ad..e3cf323 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ cmake --build build -j6 ./build/cntrl --seed 42 ``` +The window defaults to 1920×1080; pass `--720p` for the smaller 1280×720 view +(`--1080p` restores the default). The scene is shown with its raw palette by +default; pass `--post-fx` for the graded/bloomed/VHS look. + Dev tools: `--bot` (kiting autopilot), `--no-damage` (stress mode), `--screenshot [--screenshot-at ]` for automated visual checks; F12 saves a screenshot on demand. diff --git a/src/main.cpp b/src/main.cpp index dbeaa9c..a6b3fa6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,13 +18,20 @@ namespace { constexpr float kFixedDt = 1.0f / 60.0f; +constexpr int k1080pWidth = 1920; +constexpr int k1080pHeight = 1080; +constexpr int k720pWidth = 1280; +constexpr int k720pHeight = 720; struct Options { std::uint64_t seed = 0xC0FFEEULL; + int width = k1080pWidth; // 1080p by default; --720p for the old size + int height = k1080pHeight; const char* screenshot_path = nullptr; // --screenshot : capture the framebuffer float screenshot_at = 3.0f; // --screenshot-at : when to capture bool bot = false; // --bot: kiting autopilot (M6 balance-bot seed) bool no_damage = false; // --no-damage: stress-test mode + bool post_fx = false; // --post-fx: opt into graded/bloomed look }; Options parse_options(int argc, char** argv) { @@ -40,6 +47,14 @@ Options parse_options(int argc, char** argv) { opts.bot = true; } else if (std::strcmp(argv[i], "--no-damage") == 0) { opts.no_damage = true; + } else if (std::strcmp(argv[i], "--1080p") == 0) { + opts.width = k1080pWidth; + opts.height = k1080pHeight; + } else if (std::strcmp(argv[i], "--720p") == 0) { + opts.width = k720pWidth; + opts.height = k720pHeight; + } else if (std::strcmp(argv[i], "--post-fx") == 0) { + opts.post_fx = true; } } return opts; @@ -80,19 +95,17 @@ InputState read_input(const Game& game, bool bot) { int main(int argc, char** argv) { SetTraceLogLevel(LOG_WARNING); - InitWindow(1280, 720, "FBC: NIGHT SHIFT — pre-alpha"); - SetTargetFPS(60); - const Options opts = parse_options(argc, argv); + InitWindow(opts.width, opts.height, "FBC: NIGHT SHIFT — pre-alpha"); + SetTargetFPS(60); Game game(opts.seed); game.config.no_player_damage = opts.no_damage; Presenter presenter; presenter.init(game.config.arena_half); - // Full-screen post FX keyed to corruption (docs/ART_DIRECTION.md "Post FX"): - // the frame renders to a texture, then assets/shaders/post_fx.fs draws it - // with VHS noise, chromatic aberration and a red Hiss tint that intensifies - // as the House decays. Missing shader degrades to a plain blit. + // The scene renders to a texture and is blitted raw by default. --post-fx + // opts into the corruption grade, bloom, VHS noise and damage flash from + // assets/shaders/post_fx.fs (docs/ART_DIRECTION.md "Post FX"). RenderTexture2D post_target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); @@ -140,6 +153,9 @@ int main(int argc, char** argv) { const int loc_bloom = post_ok ? GetShaderLocation(post_shader, "texture1") : -1; + const bool use_post = opts.post_fx && post_ok; + const bool use_bloom = use_post && bloom_ok; + float accumulator = 0.0f; bool screenshot_taken = false; while (!WindowShouldClose()) { @@ -151,15 +167,14 @@ int main(int argc, char** argv) { accumulator -= kFixedDt; } - // Scene + UI render into the post-FX target, then the corruption shader - // paints the final frame. + // Only the scene renders into the post-FX target: bloom, corruption and + // the damage flash must never tint the HUD. BeginTextureMode(post_target); ClearBackground(Color{24, 24, 27, 255}); presenter.draw_scene(game); - ui::draw_all(game); EndTextureMode(); - if (post_ok && bloom_ok) { + if (use_bloom) { const Rectangle full = { 0.0f, 0.0f, static_cast(post_target.texture.width), -static_cast(post_target.texture.height)}; @@ -199,8 +214,8 @@ int main(int argc, char** argv) { } BeginDrawing(); - if (post_ok) BeginShaderMode(post_shader); - if (post_ok) { + if (use_post) BeginShaderMode(post_shader); + if (use_post) { if (bloom_ok && loc_bloom >= 0) { SetShaderValueTexture(post_shader, loc_bloom, bloom_a.texture); @@ -218,7 +233,9 @@ int main(int argc, char** argv) { static_cast(post_target.texture.width), -static_cast(post_target.texture.height)}, Vector2{0.0f, 0.0f}, WHITE); - if (post_ok) EndShaderMode(); + if (use_post) EndShaderMode(); + + ui::draw_all(game); EndDrawing(); // Dev tools: --screenshot [--screenshot-at ] captures the