Replace GDI rendering with font atlas and direct pixel writes
Build a monochrome font atlas at startup (BuildAtlas), then render terminal cells by writing palette indices directly into 8bpp DIB row buffers (RenderRow). Each dirty row reaches the screen via a single SetDIBitsToDevice call instead of ~12 GDI calls (TextOut, SetTextColor, SetBkColor, BitBlt). This reduces per-frame GDI overhead by ~10x, targeting smooth playback of BBS door games on Win16. Key changes: - TTermCell FG/BG from TColor to Byte (palette index 0-15) - Font atlas: render 256 CP437 glyphs into monochrome bitmap, extract per-glyph pixel masks via GetBitmapBits - Per-row 8bpp DIB buffers via GlobalAlloc replace dual memory DCs - RenderRow: zero-GDI atlas lookup + byte writes with cursor overlay - FlipToScreen: ScrollDC on screen only, SetDIBitsToDevice per dirty row - Text blink via FTextBlinkOn + re-render replaces dual-buffer phase swap - Removed: CreateBuffers, DestroyBuffers, PaintLine, ClearBufRect, RedrawBuffers, DrawRow, FBufDC/FBufBmp/FBlinkPhase fields Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd55adae4f
commit
0ff633f605
1 changed files with 423 additions and 450 deletions
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue