From 4e8b20bcd545af0ee3c1d5ecd82df99a9c95f597 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Tue, 8 Oct 2024 19:19:58 -0700 Subject: [PATCH] fix some more --- libs/arcadeshield/test.ts | 2 +- libs/bitmap/bitmap.cpp | 2 ++ pxtarget.json | 1 - sim/state/bitmap.ts | 11 +++++------ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/arcadeshield/test.ts b/libs/arcadeshield/test.ts index d4646e0fee8..de610e97277 100644 --- a/libs/arcadeshield/test.ts +++ b/libs/arcadeshield/test.ts @@ -6,7 +6,7 @@ basic.showNumber(present ? 1 : 0) // set palette before creating screen, which initializes the display __screenhelpers.setPalette(hex`000000ffffffff2121ff93c4ff8135fff609249ca378dc52003fad87f2ff8e2ec4a4839f5c406ce5cdc491463d000000`) -const screen = bitmap.create( +const screen = bitmaps.create( __screenhelpers.displayWidth(), __screenhelpers.displayHeight() ) diff --git a/libs/bitmap/bitmap.cpp b/libs/bitmap/bitmap.cpp index 046b9d3636e..997f32fa848 100644 --- a/libs/bitmap/bitmap.cpp +++ b/libs/bitmap/bitmap.cpp @@ -1478,7 +1478,9 @@ namespace bitmaps { Bitmap_ ofBuffer(Buffer buf) { return BitmapMethods::convertAndWrap(buf); } +} +namespace bitmaps { /** * Create new empty (transparent) bitmap */ diff --git a/pxtarget.json b/pxtarget.json index 5bf1984cf2e..ee683c82138 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -180,7 +180,6 @@ "dockerImage": "pext/yotta:gcc5" }, "multiVariants": [ - "mbdal", "mbcodal" ], "alwaysMultiVariant" : true, diff --git a/sim/state/bitmap.ts b/sim/state/bitmap.ts index 1a0d8145a2a..feb188952bf 100644 --- a/sim/state/bitmap.ts +++ b/sim/state/bitmap.ts @@ -530,13 +530,13 @@ namespace pxsim.BitmapMethods { export function drawIcon(img: RefImage, icon: RefBuffer, x: number, y: number, color: number) { const src: Uint8Array = icon.data - if (!bitmap.isValidImage(icon)) + if (!bitmaps.isValidImage(icon)) return if (src[1] != 1) return // only mono - let width = bitmap.bufW(src) - let height = bitmap.bufH(src) - let byteH = bitmap.byteHeight(height, 1) + let width = bitmaps.bufW(src) + let height = bitmaps.bufH(src) + let byteH = bitmaps.byteHeight(height, 1) x |= 0 y |= 0 @@ -940,7 +940,7 @@ namespace pxsim.BitmapMethods { } -namespace pxsim.bitmap { +namespace pxsim.bitmaps { export function byteHeight(h: number, bpp: number) { if (bpp == 1) return h * bpp + 7 >> 3 @@ -997,7 +997,6 @@ namespace pxsim.bitmap { return new RefImage(w, h, 4) } - // TODO: move to image namespace export function ofBuffer(buf: RefBuffer): RefImage { const src: Uint8Array = buf.data