blecsd 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +220 -0
- package/dist/3d/index.d.ts +5 -0
- package/dist/3d/index.js +1 -0
- package/dist/audio/index.d.ts +177 -0
- package/dist/audio/index.js +1 -0
- package/dist/border-D_Jb4ZJV.d.ts +257 -0
- package/dist/cell-DwIu2ryP.d.ts +505 -0
- package/dist/chunk-2UBBZFE4.js +1 -0
- package/dist/chunk-35LCBY6P.js +1 -0
- package/dist/chunk-3B7MIVW6.js +1 -0
- package/dist/chunk-3EGGGI5J.js +3 -0
- package/dist/chunk-4LWWONFK.js +1 -0
- package/dist/chunk-4X4N4HNQ.js +2 -0
- package/dist/chunk-5PELJRUQ.js +1 -0
- package/dist/chunk-AEJIX2MW.js +1 -0
- package/dist/chunk-AQ7LW75B.js +1 -0
- package/dist/chunk-AXZQAH4X.js +1 -0
- package/dist/chunk-B6Z2JFRY.js +1 -0
- package/dist/chunk-BCADUCOZ.js +1 -0
- package/dist/chunk-C5PCEQ6G.js +1 -0
- package/dist/chunk-CIK4AMUA.js +1 -0
- package/dist/chunk-DNRXW56C.js +1 -0
- package/dist/chunk-FC5FFAAC.js +12 -0
- package/dist/chunk-FGHEFXLK.js +1 -0
- package/dist/chunk-FYEBZAWN.js +1 -0
- package/dist/chunk-G7GIWWLE.js +1 -0
- package/dist/chunk-GYHI26UE.js +1 -0
- package/dist/chunk-H2YAOJDW.js +1 -0
- package/dist/chunk-J4JZ2NU2.js +1 -0
- package/dist/chunk-JKVHO4LH.js +1 -0
- package/dist/chunk-K2B2OXQ5.js +5 -0
- package/dist/chunk-K37L3G4Z.js +4 -0
- package/dist/chunk-KD55INV7.js +1 -0
- package/dist/chunk-KFAK4A3G.js +1 -0
- package/dist/chunk-LCN2ZITE.js +1 -0
- package/dist/chunk-LYSK5S63.js +1 -0
- package/dist/chunk-NZ55KBM6.js +1 -0
- package/dist/chunk-OMMJ7B5P.js +1 -0
- package/dist/chunk-OUXUPF3V.js +33 -0
- package/dist/chunk-OVT2PPGW.js +19 -0
- package/dist/chunk-P6CJO3BC.js +1 -0
- package/dist/chunk-PSXXMBVJ.js +1 -0
- package/dist/chunk-PXXGH3BV.js +1 -0
- package/dist/chunk-QIKIOVP2.js +1 -0
- package/dist/chunk-SHUC6JWA.js +1 -0
- package/dist/chunk-TDXJDLY6.js +6 -0
- package/dist/chunk-TWSWTBYL.js +1 -0
- package/dist/chunk-TYMY2TBR.js +3 -0
- package/dist/chunk-VNZ6CWJA.js +2 -0
- package/dist/chunk-VOCM5T2G.js +5 -0
- package/dist/chunk-W5OU7Z6J.js +1 -0
- package/dist/chunk-WNG4A3K7.js +4 -0
- package/dist/chunk-XQIGERNI.js +1 -0
- package/dist/chunk-XZA63ZPO.js +1 -0
- package/dist/chunk-YAMOSPWB.js +4 -0
- package/dist/chunk-YD6ULIUR.js +1 -0
- package/dist/chunk-Z4EZERNE.js +1 -0
- package/dist/cli/init.d.ts +86 -0
- package/dist/cli/init.js +179 -0
- package/dist/color-B78w3zH-.d.ts +79 -0
- package/dist/components/index.d.ts +10298 -0
- package/dist/components/index.js +1 -0
- package/dist/core/index.d.ts +6700 -0
- package/dist/core/index.js +1 -0
- package/dist/debug/index.d.ts +711 -0
- package/dist/debug/index.js +1 -0
- package/dist/doubleBuffer-CKQFmlPN.d.ts +95 -0
- package/dist/errors/index.d.ts +1110 -0
- package/dist/errors/index.js +1 -0
- package/dist/events-BbbxkgvX.d.ts +125 -0
- package/dist/game/index.d.ts +486 -0
- package/dist/game/index.js +1 -0
- package/dist/gameLoop-BIPW7-OY.d.ts +219 -0
- package/dist/index-zSGJ2eUk.d.ts +3156 -0
- package/dist/index.d.ts +246 -0
- package/dist/index.js +1 -0
- package/dist/input/index.d.ts +158 -0
- package/dist/input/index.js +1 -0
- package/dist/inputActions-CefRUBuT.d.ts +2637 -0
- package/dist/keyParser-Bwm8-l7v.d.ts +229 -0
- package/dist/mouseParser-Cfrbn3AX.d.ts +177 -0
- package/dist/parser-iMHmQuUh.d.ts +265 -0
- package/dist/program-BZaKqDKH.d.ts +141 -0
- package/dist/renderable-jTMOA-GK.d.ts +302 -0
- package/dist/scheduler-DcfoFuum.d.ts +86 -0
- package/dist/schemas/index.d.ts +936 -0
- package/dist/schemas/index.js +1 -0
- package/dist/systems/index.d.ts +4036 -0
- package/dist/systems/index.js +1 -0
- package/dist/terminal/index.d.ts +7357 -0
- package/dist/terminal/index.js +1 -0
- package/dist/terminus-14-bold-HWSPRLJD.js +1 -0
- package/dist/terminus-14-normal-T3SWMH4D.js +1 -0
- package/dist/tilemap-D1HJvKy3.d.ts +1211 -0
- package/dist/types-BcsvoKzf.d.ts +68 -0
- package/dist/utils/index.d.ts +6104 -0
- package/dist/utils/index.js +1 -0
- package/dist/viewport3d-xI33-_wq.d.ts +182 -0
- package/dist/virtualScrollback-DvZTRU8a.d.ts +274 -0
- package/dist/virtualViewport-Dx2iJliO.d.ts +2334 -0
- package/dist/virtualizedLineStore-DwPEvPkk.d.ts +297 -0
- package/dist/widgets/bigText.d.ts +230 -0
- package/dist/widgets/bigText.js +1 -0
- package/dist/widgets/fonts/index.d.ts +211 -0
- package/dist/widgets/fonts/index.js +1 -0
- package/dist/widgets/index.d.ts +8591 -0
- package/dist/widgets/index.js +1 -0
- package/package.json +213 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { S as ScreenBufferData, C as Cell } from './cell-DwIu2ryP.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Double Buffering System
|
|
5
|
+
*
|
|
6
|
+
* Provides efficient rendering through double buffering. The system maintains
|
|
7
|
+
* two buffers (front and back), tracks dirty regions, and computes minimal
|
|
8
|
+
* update sets for efficient terminal output.
|
|
9
|
+
*
|
|
10
|
+
* @module terminal/screen/doubleBuffer
|
|
11
|
+
* @internal This module is internal and used by the rendering system.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import {
|
|
16
|
+
* createDoubleBuffer,
|
|
17
|
+
* getBackBuffer,
|
|
18
|
+
* markDirtyRegion,
|
|
19
|
+
* swapBuffers,
|
|
20
|
+
* getMinimalUpdates,
|
|
21
|
+
* } from 'blecsd';
|
|
22
|
+
*
|
|
23
|
+
* // Create a double buffer
|
|
24
|
+
* const db = createDoubleBuffer(80, 24);
|
|
25
|
+
*
|
|
26
|
+
* // Write to back buffer
|
|
27
|
+
* const back = getBackBuffer(db);
|
|
28
|
+
* setCell(back, 10, 5, createCell('X'));
|
|
29
|
+
*
|
|
30
|
+
* // Mark the region as dirty
|
|
31
|
+
* markDirtyRegion(db, 10, 5, 1, 1);
|
|
32
|
+
*
|
|
33
|
+
* // Get minimal updates and swap
|
|
34
|
+
* const updates = getMinimalUpdates(db);
|
|
35
|
+
* swapBuffers(db);
|
|
36
|
+
*
|
|
37
|
+
* // Output only the changed cells
|
|
38
|
+
* for (const { x, y, cell } of updates) {
|
|
39
|
+
* outputCell(x, y, cell);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A rectangular region of the screen.
|
|
46
|
+
*/
|
|
47
|
+
interface Rect {
|
|
48
|
+
/** Left edge X coordinate */
|
|
49
|
+
readonly x: number;
|
|
50
|
+
/** Top edge Y coordinate */
|
|
51
|
+
readonly y: number;
|
|
52
|
+
/** Width of region */
|
|
53
|
+
readonly w: number;
|
|
54
|
+
/** Height of region */
|
|
55
|
+
readonly h: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Double buffer data structure.
|
|
59
|
+
*
|
|
60
|
+
* Maintains front and back buffers for efficient rendering,
|
|
61
|
+
* along with dirty region tracking.
|
|
62
|
+
*/
|
|
63
|
+
interface DoubleBufferData {
|
|
64
|
+
/** Width of buffers */
|
|
65
|
+
readonly width: number;
|
|
66
|
+
/** Height of buffers */
|
|
67
|
+
readonly height: number;
|
|
68
|
+
/** Front buffer (currently displayed) */
|
|
69
|
+
frontBuffer: ScreenBufferData;
|
|
70
|
+
/** Back buffer (being rendered to) */
|
|
71
|
+
backBuffer: ScreenBufferData;
|
|
72
|
+
/** Dirty regions that need updating */
|
|
73
|
+
readonly dirtyRegions: Rect[];
|
|
74
|
+
/** Full redraw flag */
|
|
75
|
+
fullRedraw: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates a new double buffer system.
|
|
79
|
+
*
|
|
80
|
+
* @param width - Buffer width in cells
|
|
81
|
+
* @param height - Buffer height in cells
|
|
82
|
+
* @param defaultCell - Optional default cell for initialization
|
|
83
|
+
* @returns A new DoubleBufferData
|
|
84
|
+
* @throws {Error} If dimensions are not positive
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* import { createDoubleBuffer } from 'blecsd';
|
|
89
|
+
*
|
|
90
|
+
* const db = createDoubleBuffer(80, 24);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
declare function createDoubleBuffer(width: number, height: number, defaultCell?: Cell): DoubleBufferData;
|
|
94
|
+
|
|
95
|
+
export { type DoubleBufferData as D, createDoubleBuffer as c };
|