Skip to content
Snippets Groups Projects
Commit c7ca34ae authored by rswindell's avatar rswindell
Browse files

Display a warning there's a palette defined in an XBin file and the

terminal doesn't support loadable palettes.
If fonts aren't supported in the terminal and there's fonts in the XBin,
display a warning about that too.
Updated paren style to match ec's, being polite an' all.
parent 8988ee53
No related branches found
No related tags found
No related merge requests found
...@@ -135,8 +135,20 @@ function drawFile(file) { ...@@ -135,8 +135,20 @@ function drawFile(file) {
image = xbin.read(f); image = xbin.read(f);
} }
f.close(); f.close();
if (image.font && image.font.length && image.charheight != cterm.charheight(console.screen_rows)) { var warning = '';
alert(format("Warning: file intended for a different char height (%u), font not used.", image.charheight)); if (image.font) {
if (cterm.supports_fonts() == false)
warning += "Warning: your terminal does not support loadable fonts; font not used.\r\n";
else if (image.font.length && image.charheight != cterm.charheight(console.screen_rows))
warning += format("Warning: file intended for a different char height (%u); font not used.\r\n"
,image.charheight);
}
if (image.palette) {
if (cterm.supports_palettes() == false)
warning += "Warning: your terminal does not support loadable palettes; palette not used.\r\n";
}
if (warning.length) {
alert(warning);
console.pause(); console.pause();
} }
cterm.xbin_draw(image); cterm.xbin_draw(image);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment