Skip to content

Commit

Permalink
J2DScreen: Remove default J2DGrafContext
Browse files Browse the repository at this point in the history
  • Loading branch information
themikelester committed Dec 24, 2024
1 parent 3fba4cd commit 7ad0b9b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Common/JSYSTEM/J2Dv1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 7ad0b9b

Please sign in to comment.