FBC: NIGHT SHIFT - made 1080p the default with the raw scene palette and an unfiltered HUD
This commit is contained in:
parent
46ab750256
commit
7afe0f38af
2 changed files with 35 additions and 14 deletions
|
|
@ -34,6 +34,10 @@ cmake --build build -j6
|
||||||
./build/cntrl --seed 42
|
./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),
|
Dev tools: `--bot` (kiting autopilot), `--no-damage` (stress mode),
|
||||||
`--screenshot <path> [--screenshot-at <sec>]` for automated visual checks;
|
`--screenshot <path> [--screenshot-at <sec>]` for automated visual checks;
|
||||||
F12 saves a screenshot on demand.
|
F12 saves a screenshot on demand.
|
||||||
|
|
|
||||||
45
src/main.cpp
45
src/main.cpp
|
|
@ -18,13 +18,20 @@
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr float kFixedDt = 1.0f / 60.0f;
|
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 {
|
struct Options {
|
||||||
std::uint64_t seed = 0xC0FFEEULL;
|
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 <path>: capture the framebuffer
|
const char* screenshot_path = nullptr; // --screenshot <path>: capture the framebuffer
|
||||||
float screenshot_at = 3.0f; // --screenshot-at <sec>: when to capture
|
float screenshot_at = 3.0f; // --screenshot-at <sec>: when to capture
|
||||||
bool bot = false; // --bot: kiting autopilot (M6 balance-bot seed)
|
bool bot = false; // --bot: kiting autopilot (M6 balance-bot seed)
|
||||||
bool no_damage = false; // --no-damage: stress-test mode
|
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) {
|
Options parse_options(int argc, char** argv) {
|
||||||
|
|
@ -40,6 +47,14 @@ Options parse_options(int argc, char** argv) {
|
||||||
opts.bot = true;
|
opts.bot = true;
|
||||||
} else if (std::strcmp(argv[i], "--no-damage") == 0) {
|
} else if (std::strcmp(argv[i], "--no-damage") == 0) {
|
||||||
opts.no_damage = true;
|
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;
|
return opts;
|
||||||
|
|
@ -80,19 +95,17 @@ InputState read_input(const Game& game, bool bot) {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
SetTraceLogLevel(LOG_WARNING);
|
SetTraceLogLevel(LOG_WARNING);
|
||||||
InitWindow(1280, 720, "FBC: NIGHT SHIFT — pre-alpha");
|
|
||||||
SetTargetFPS(60);
|
|
||||||
|
|
||||||
const Options opts = parse_options(argc, argv);
|
const Options opts = parse_options(argc, argv);
|
||||||
|
InitWindow(opts.width, opts.height, "FBC: NIGHT SHIFT — pre-alpha");
|
||||||
|
SetTargetFPS(60);
|
||||||
Game game(opts.seed);
|
Game game(opts.seed);
|
||||||
game.config.no_player_damage = opts.no_damage;
|
game.config.no_player_damage = opts.no_damage;
|
||||||
Presenter presenter;
|
Presenter presenter;
|
||||||
presenter.init(game.config.arena_half);
|
presenter.init(game.config.arena_half);
|
||||||
|
|
||||||
// Full-screen post FX keyed to corruption (docs/ART_DIRECTION.md "Post FX"):
|
// The scene renders to a texture and is blitted raw by default. --post-fx
|
||||||
// the frame renders to a texture, then assets/shaders/post_fx.fs draws it
|
// opts into the corruption grade, bloom, VHS noise and damage flash from
|
||||||
// with VHS noise, chromatic aberration and a red Hiss tint that intensifies
|
// assets/shaders/post_fx.fs (docs/ART_DIRECTION.md "Post FX").
|
||||||
// as the House decays. Missing shader degrades to a plain blit.
|
|
||||||
RenderTexture2D post_target =
|
RenderTexture2D post_target =
|
||||||
LoadRenderTexture(GetScreenWidth(), GetScreenHeight());
|
LoadRenderTexture(GetScreenWidth(), GetScreenHeight());
|
||||||
|
|
||||||
|
|
@ -140,6 +153,9 @@ int main(int argc, char** argv) {
|
||||||
const int loc_bloom = post_ok
|
const int loc_bloom = post_ok
|
||||||
? GetShaderLocation(post_shader, "texture1") : -1;
|
? 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;
|
float accumulator = 0.0f;
|
||||||
bool screenshot_taken = false;
|
bool screenshot_taken = false;
|
||||||
while (!WindowShouldClose()) {
|
while (!WindowShouldClose()) {
|
||||||
|
|
@ -151,15 +167,14 @@ int main(int argc, char** argv) {
|
||||||
accumulator -= kFixedDt;
|
accumulator -= kFixedDt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scene + UI render into the post-FX target, then the corruption shader
|
// Only the scene renders into the post-FX target: bloom, corruption and
|
||||||
// paints the final frame.
|
// the damage flash must never tint the HUD.
|
||||||
BeginTextureMode(post_target);
|
BeginTextureMode(post_target);
|
||||||
ClearBackground(Color{24, 24, 27, 255});
|
ClearBackground(Color{24, 24, 27, 255});
|
||||||
presenter.draw_scene(game);
|
presenter.draw_scene(game);
|
||||||
ui::draw_all(game);
|
|
||||||
EndTextureMode();
|
EndTextureMode();
|
||||||
|
|
||||||
if (post_ok && bloom_ok) {
|
if (use_bloom) {
|
||||||
const Rectangle full = {
|
const Rectangle full = {
|
||||||
0.0f, 0.0f, static_cast<float>(post_target.texture.width),
|
0.0f, 0.0f, static_cast<float>(post_target.texture.width),
|
||||||
-static_cast<float>(post_target.texture.height)};
|
-static_cast<float>(post_target.texture.height)};
|
||||||
|
|
@ -199,8 +214,8 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
if (post_ok) BeginShaderMode(post_shader);
|
if (use_post) BeginShaderMode(post_shader);
|
||||||
if (post_ok) {
|
if (use_post) {
|
||||||
if (bloom_ok && loc_bloom >= 0) {
|
if (bloom_ok && loc_bloom >= 0) {
|
||||||
SetShaderValueTexture(post_shader, loc_bloom,
|
SetShaderValueTexture(post_shader, loc_bloom,
|
||||||
bloom_a.texture);
|
bloom_a.texture);
|
||||||
|
|
@ -218,7 +233,9 @@ int main(int argc, char** argv) {
|
||||||
static_cast<float>(post_target.texture.width),
|
static_cast<float>(post_target.texture.width),
|
||||||
-static_cast<float>(post_target.texture.height)},
|
-static_cast<float>(post_target.texture.height)},
|
||||||
Vector2{0.0f, 0.0f}, WHITE);
|
Vector2{0.0f, 0.0f}, WHITE);
|
||||||
if (post_ok) EndShaderMode();
|
if (use_post) EndShaderMode();
|
||||||
|
|
||||||
|
ui::draw_all(game);
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
||||||
// Dev tools: --screenshot <path> [--screenshot-at <sec>] captures the
|
// Dev tools: --screenshot <path> [--screenshot-at <sec>] captures the
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue