supersampling implementat
This commit is contained in:
@@ -337,6 +337,22 @@ namespace Options {
|
||||
}
|
||||
}
|
||||
|
||||
if (vid.contains("supersampling")) {
|
||||
try {
|
||||
video.supersampling = vid["supersampling"].get_value<bool>();
|
||||
} catch (...) {
|
||||
video.supersampling = Defaults::Video::SUPERSAMPLING;
|
||||
}
|
||||
}
|
||||
|
||||
if (vid.contains("current_postfx_preset")) {
|
||||
try {
|
||||
current_postfx_preset = vid["current_postfx_preset"].get_value<int>();
|
||||
} catch (...) {
|
||||
current_postfx_preset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (vid.contains("vertical_sync")) {
|
||||
try {
|
||||
video.vertical_sync = vid["vertical_sync"].get_value<bool>();
|
||||
@@ -623,6 +639,8 @@ namespace Options {
|
||||
file << " fullscreen: " << (video.fullscreen ? "true" : "false") << "\n";
|
||||
file << " filter: " << filterToString(video.filter) << " # filter: nearest (pixel perfect) | linear (smooth)\n";
|
||||
file << " postfx: " << (video.postfx ? "true" : "false") << "\n";
|
||||
file << " supersampling: " << (video.supersampling ? "true" : "false") << "\n";
|
||||
file << " current_postfx_preset: " << current_postfx_preset << "\n";
|
||||
file << " vertical_sync: " << (video.vertical_sync ? "true" : "false") << "\n";
|
||||
file << " integer_scale: " << (video.integer_scale ? "true" : "false") << "\n";
|
||||
file << " keep_aspect: " << (video.keep_aspect ? "true" : "false") << "\n";
|
||||
@@ -688,7 +706,6 @@ namespace Options {
|
||||
// Carga los presets de PostFX desde el fichero
|
||||
auto loadPostFXFromFile() -> bool {
|
||||
postfx_presets.clear();
|
||||
current_postfx_preset = 0;
|
||||
|
||||
std::ifstream file(postfx_file_path);
|
||||
if (!file.good()) {
|
||||
@@ -718,13 +735,20 @@ namespace Options {
|
||||
parseFloatField(p, "gamma", preset.gamma);
|
||||
parseFloatField(p, "curvature", preset.curvature);
|
||||
parseFloatField(p, "bleeding", preset.bleeding);
|
||||
if (p.contains("supersampling")) {
|
||||
try { preset.supersampling = p["supersampling"].get_value<bool>(); } catch (...) {}
|
||||
}
|
||||
// Nota: 'supersampling' era un campo por-preset (eliminado). Si existe
|
||||
// en el fichero del usuario se ignora silenciosamente (compatible).
|
||||
postfx_presets.push_back(preset);
|
||||
}
|
||||
}
|
||||
|
||||
// Preservar el índice cargado desde config.yaml; clampar al rango válido.
|
||||
if (!postfx_presets.empty()) {
|
||||
current_postfx_preset = std::clamp(
|
||||
current_postfx_preset, 0, static_cast<int>(postfx_presets.size()) - 1);
|
||||
} else {
|
||||
current_postfx_preset = 0;
|
||||
}
|
||||
|
||||
if (console) {
|
||||
std::cout << "PostFX file loaded: " << postfx_presets.size() << " preset(s)\n";
|
||||
}
|
||||
@@ -762,9 +786,7 @@ namespace Options {
|
||||
file << "# gamma: gamma correction input 2.4 / output 2.2\n";
|
||||
file << "# curvature: CRT barrel distortion\n";
|
||||
file << "# bleeding: NTSC horizontal colour bleeding\n";
|
||||
file << "# supersampling: 3x internal resolution, scanlines baked in CPU + linear filter\n";
|
||||
file << "# true = consistent 33% scanlines at any zoom (slight softening at non-3x)\n";
|
||||
file << "# false = sharp pixel art, scanlines depend on zoom (33% at 3x, 25% at 4x)\n";
|
||||
file << "# Note: supersampling is a global toggle in config.yaml, not per-preset.\n";
|
||||
file << "\n";
|
||||
file << "presets:\n";
|
||||
file << " - name: \"CRT\"\n";
|
||||
@@ -775,16 +797,6 @@ namespace Options {
|
||||
file << " gamma: 0.8\n";
|
||||
file << " curvature: 0.0\n";
|
||||
file << " bleeding: 0.0\n";
|
||||
file << " supersampling: false\n";
|
||||
file << " - name: \"CRT-SS\"\n";
|
||||
file << " vignette: 0.6\n";
|
||||
file << " scanlines: 0.7\n";
|
||||
file << " chroma: 0.15\n";
|
||||
file << " mask: 0.6\n";
|
||||
file << " gamma: 0.8\n";
|
||||
file << " curvature: 0.0\n";
|
||||
file << " bleeding: 0.0\n";
|
||||
file << " supersampling: true\n";
|
||||
file << " - name: \"NTSC\"\n";
|
||||
file << " vignette: 0.4\n";
|
||||
file << " scanlines: 0.5\n";
|
||||
@@ -793,7 +805,6 @@ namespace Options {
|
||||
file << " gamma: 0.5\n";
|
||||
file << " curvature: 0.0\n";
|
||||
file << " bleeding: 0.6\n";
|
||||
file << " supersampling: false\n";
|
||||
file << " - name: \"CURVED\"\n";
|
||||
file << " vignette: 0.5\n";
|
||||
file << " scanlines: 0.6\n";
|
||||
@@ -802,7 +813,6 @@ namespace Options {
|
||||
file << " gamma: 0.7\n";
|
||||
file << " curvature: 0.8\n";
|
||||
file << " bleeding: 0.0\n";
|
||||
file << " supersampling: false\n";
|
||||
file << " - name: \"SCANLINES\"\n";
|
||||
file << " vignette: 0.0\n";
|
||||
file << " scanlines: 0.8\n";
|
||||
@@ -811,7 +821,6 @@ namespace Options {
|
||||
file << " gamma: 0.0\n";
|
||||
file << " curvature: 0.0\n";
|
||||
file << " bleeding: 0.0\n";
|
||||
file << " supersampling: false\n";
|
||||
file << " - name: \"SUBTLE\"\n";
|
||||
file << " vignette: 0.3\n";
|
||||
file << " scanlines: 0.4\n";
|
||||
@@ -820,7 +829,6 @@ namespace Options {
|
||||
file << " gamma: 0.3\n";
|
||||
file << " curvature: 0.0\n";
|
||||
file << " bleeding: 0.0\n";
|
||||
file << " supersampling: false\n";
|
||||
|
||||
file.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user