feat: Increase rendering resolution for Flutter and GLSL renderers to enhance visual clarity

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-20 17:45:54 +01:00
parent 5e19f3c098
commit 1e5222368a
3 changed files with 11 additions and 11 deletions

View File

@@ -198,17 +198,16 @@ class SixelRenderer extends CliRendererBackend<String> {
_outputHeight = math.max(1, (_outputWidth / _targetAspectRatio).floor()); _outputHeight = math.max(1, (_outputWidth / _targetAspectRatio).floor());
} }
// Horizontal: cell-width estimates vary by terminal/font and cause right-shift // Horizontal: cell-width estimates vary by terminal/font and can cause
// clipping, so keep the image at column 0. // right-shift clipping, so keep the image anchored at column 0.
// Vertical: use a conservative row estimate and keep one spare row so the // Vertical: keep one spare row to avoid scroll, but anchor to the bottom
// terminal does not scroll the image upward when its actual cell height is // of the viewport so we avoid obvious empty space under the image.
// smaller than our approximation.
final int imageRows = math.max( final int imageRows = math.max(
1, 1,
(_outputHeight / _defaultLineHeightPx).ceil() + _terminalRowSafetyMargin, (_outputHeight / _defaultLineHeightPx).ceil() + _terminalRowSafetyMargin,
); );
_offsetColumns = 0; _offsetColumns = 0;
_offsetRows = math.max(0, (terminalRows - imageRows) ~/ 2); _offsetRows = math.max(0, terminalRows - imageRows);
if (_offsetColumns != previousOffsetColumns || if (_offsetColumns != previousOffsetColumns ||
_offsetRows != previousOffsetRows || _offsetRows != previousOffsetRows ||

View File

@@ -24,8 +24,8 @@ class WolfFlutterRenderer extends BaseWolfRenderer {
class _WolfFlutterRendererState class _WolfFlutterRendererState
extends BaseWolfRendererState<WolfFlutterRenderer> { extends BaseWolfRendererState<WolfFlutterRenderer> {
static const int _renderWidth = 320; static const int _renderWidth = 640;
static const int _renderHeight = 200; static const int _renderHeight = 400;
final SoftwareRenderer _renderer = SoftwareRenderer(); final SoftwareRenderer _renderer = SoftwareRenderer();
ui.Image? _renderedFrame; ui.Image? _renderedFrame;
@@ -34,7 +34,8 @@ class _WolfFlutterRendererState
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// Match the original Wolf3D software resolution for the pixel renderer. // Render at 2x canonical resolution so menu/UI edges stay crisp and avoid
// bleed when the output is scaled to the host viewport.
if (widget.engine.frameBuffer.width != _renderWidth || if (widget.engine.frameBuffer.width != _renderWidth ||
widget.engine.frameBuffer.height != _renderHeight) { widget.engine.frameBuffer.height != _renderHeight) {
widget.engine.setFrameBuffer(_renderWidth, _renderHeight); widget.engine.setFrameBuffer(_renderWidth, _renderHeight);

View File

@@ -31,8 +31,8 @@ class WolfGlslRenderer extends BaseWolfRenderer {
} }
class _WolfGlslRendererState extends BaseWolfRendererState<WolfGlslRenderer> { class _WolfGlslRendererState extends BaseWolfRendererState<WolfGlslRenderer> {
static const int _renderWidth = 640; static const int _renderWidth = 960;
static const int _renderHeight = 400; static const int _renderHeight = 600;
final SoftwareRenderer _renderer = SoftwareRenderer(); final SoftwareRenderer _renderer = SoftwareRenderer();