Migrate to a software rasterizer to dramatically improve performance

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-16 00:03:21 +01:00
parent 59fc530a1a
commit 752c143234
15 changed files with 553 additions and 522 deletions

View File

@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:wolf_3d_data_types/wolf_3d_data_types.dart';
import 'package:wolf_3d_renderer/color_palette.dart';
class WeaponPainter extends CustomPainter {
final Sprite? sprite;
@@ -24,11 +23,11 @@ class WeaponPainter extends CustomPainter {
for (int x = 0; x < 64; x++) {
for (int y = 0; y < 64; y++) {
int colorByte = sprite![x][y];
int colorByte = sprite!.pixels[x * 64 + y];
if (colorByte != 255) {
// 255 is our transparent magenta
_paint.color = ColorPalette.vga[colorByte];
_paint.color = Color(ColorPalette.vga32Bit[colorByte]);
canvas.drawRect(
Rect.fromLTWH(