Skip to content

Commit

Permalink
revert to match pxt-arcade
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Aug 21, 2024
1 parent ce176a4 commit 973e648
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 75 deletions.
1 change: 0 additions & 1 deletion libs/arcadeshield/_locales/arcadeshield-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"{id:category}Math": "Math",
"{id:category}Power": "Power",
"{id:category}Scene": "Scene",
"{id:category}Screen": "Screen",
"{id:category}ScreenBitmap": "ScreenBitmap",
"{id:category}Texteffects": "Texteffects",
"{id:category}_helpers_workaround": "_helpers_workaround",
Expand Down
4 changes: 2 additions & 2 deletions libs/arcadeshield/context/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace scene.consoleOverlay {
const marginx = 4;
const marginy = 2;
const consoleFont = bitmap.font5;
const consoleLines = Math.floor(screen.height / (consoleFont.charHeight + marginy)) - 1;
const consoleColumns = Math.floor((screen.width - 2 * marginx) / consoleFont.charWidth);
const consoleLines = Math.floor(theScreen.height / (consoleFont.charHeight + marginy)) - 1;
const consoleColumns = Math.floor((theScreen.width - 2 * marginx) / consoleFont.charWidth);
console.addListener(listener);

export function isVisible() {
Expand Down
2 changes: 1 addition & 1 deletion libs/arcadeshield/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ namespace bitmap {
//% blockId=imagescreen block="screen"
//% help=images/screen-image
export function screenImage(): Bitmap {
return screen;
return theScreen;
}
}
1 change: 0 additions & 1 deletion libs/arcadeshield/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"bitmap.ts",
"bitmap.d.ts",
"init.ts",
"screen.ts",
"fieldeditors.ts",
"text.ts",
"frame.ts",
Expand Down
30 changes: 0 additions & 30 deletions libs/arcadeshield/screen.ts

This file was deleted.

41 changes: 41 additions & 0 deletions libs/arcadeshield/sim/bitmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,3 +1105,44 @@ namespace pxsim.bitmap {
return toBuffer(img)
}
}

namespace pxsim.pxtcore {
export function updateScreen(img: RefImage) {
const state = pxsim.getScreenState();
if (state)
state.showImage(img);
}
export function updateStats(s: string) {
const state = pxsim.getScreenState();
if (state)
state.updateStats(s);
}
export function setPalette(b: RefBuffer) {
const state = pxsim.getScreenState();
if (state)
state.setPalette(b);
}
export function setScreenBrightness(b: number) {
const state = pxsim.getScreenState();
if (state)
state.setScreenBrightness(b);
}
export function displayHeight(): number {
const state = pxsim.getScreenState();
if (state)
return state.displayHeight();
return -1;
}
export function displayWidth(): number {
const state = pxsim.getScreenState();
if (state)
return state.displayWidth();
return -1;
}
export function displayPresent(): boolean {
const state = pxsim.getScreenState();
if (state)
return state.displayPresent();
return false;
}
}
40 changes: 0 additions & 40 deletions libs/arcadeshield/sim/screen.ts

This file was deleted.

0 comments on commit 973e648

Please sign in to comment.