Fix brick.print()
This commit is contained in:
parent
2df90152fe
commit
e8e31e6aa7
@ -239,7 +239,7 @@ extern "C" void drawPanic(int code) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isValidImage(Buffer buf) {
|
bool isValidImage(Buffer buf) {
|
||||||
return buf->length >= 3 && buf->data[0] == 0xf0;
|
return buf != NULL && buf->length >= 3 && buf->data[0] == 0xf0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Makes an image bound to a buffer. */
|
/** Makes an image bound to a buffer. */
|
||||||
|
@ -112,10 +112,10 @@ namespace brick {
|
|||||||
let byteWidth = (currFont.charWidth + 7) >> 3
|
let byteWidth = (currFont.charWidth + 7) >> 3
|
||||||
let charSize = byteWidth * currFont.charHeight
|
let charSize = byteWidth * currFont.charHeight
|
||||||
let imgBuf = output.createBuffer(2 + charSize)
|
let imgBuf = output.createBuffer(2 + charSize)
|
||||||
let img = screen.imageOf(imgBuf)
|
|
||||||
let double = (mode & Draw.Quad) ? 4 : (mode & Draw.Double) ? 2 : 1
|
let double = (mode & Draw.Quad) ? 4 : (mode & Draw.Double) ? 2 : 1
|
||||||
imgBuf[0] = 0xf0
|
imgBuf[0] = 0xf0
|
||||||
imgBuf[1] = currFont.charWidth
|
imgBuf[1] = currFont.charWidth
|
||||||
|
let img = screen.imageOf(imgBuf)
|
||||||
while (cp < text.length) {
|
while (cp < text.length) {
|
||||||
let ch = text.charCodeAt(cp++)
|
let ch = text.charCodeAt(cp++)
|
||||||
if (ch == 10) {
|
if (ch == 10) {
|
||||||
|
Loading…
Reference in New Issue
Block a user