From 7ad0b9bf98e6eaa93afbaa30c9262d75d372c35f Mon Sep 17 00:00:00 2001 From: Mike Lester Date: Tue, 24 Dec 2024 04:30:50 -0700 Subject: [PATCH] J2DScreen: Remove default J2DGrafContext --- src/Common/JSYSTEM/J2Dv1.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Common/JSYSTEM/J2Dv1.ts b/src/Common/JSYSTEM/J2Dv1.ts index d92f5023f..bbe1b17c2 100644 --- a/src/Common/JSYSTEM/J2Dv1.ts +++ b/src/Common/JSYSTEM/J2Dv1.ts @@ -451,20 +451,15 @@ export class J2DPicture extends J2DPane { //#region J2DScreen export class J2DScreen extends J2DPane { public color: Color - private defaultCtx: J2DGrafContext; constructor(data: SCRN, cache: GfxRenderCache) { super(data.panes[0], cache, null); - this.defaultCtx = new J2DGrafContext(cache.device, 0.0, 0.0, 640.0, 480.0, -1.0, 0.0); this.color = data.inf1.color; } - override draw(renderInstManager: GfxRenderInstManager, viewerRenderInput: ViewerRenderInput, ctx2D: J2DGrafContext | null, offsetX?: number, offsetY?: number): void { - if (ctx2D !== null) { - super.draw(renderInstManager, viewerRenderInput, ctx2D, offsetX, offsetY); - } else { - super.draw(renderInstManager, viewerRenderInput, this.defaultCtx, offsetX, offsetY); - } + override draw(renderInstManager: GfxRenderInstManager, viewerRenderInput: ViewerRenderInput, ctx2D: J2DGrafContext, offsetX?: number, offsetY?: number): void { + assert(!!ctx2D); + super.draw(renderInstManager, viewerRenderInput, ctx2D, offsetX, offsetY); } }