mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-07 16:30:18 +00:00
commit
15f0f86534
1 changed files with 9 additions and 16 deletions
|
@ -25761,7 +25761,7 @@ got_font_index:
|
||||||
|
|
||||||
void sub__font(int32 f, int32 i, int32 passed) {
|
void sub__font(int32 f, int32 i, int32 passed) {
|
||||||
//_FONT "?[,?]"
|
//_FONT "?[,?]"
|
||||||
static int32 i2;
|
int32 i2 = 0; //no need for a static variable here, when we just init it to zero before ever using it.
|
||||||
static img_struct *im;
|
static img_struct *im;
|
||||||
if (new_error)
|
if (new_error)
|
||||||
return;
|
return;
|
||||||
|
@ -25785,19 +25785,12 @@ void sub__font(int32 f, int32 i, int32 passed) {
|
||||||
}
|
}
|
||||||
im = &img[i];
|
im = &img[i];
|
||||||
// validate f
|
// validate f
|
||||||
i2 = 0;
|
if ((f == 8) || (f == 9) || ((f > 13) && (f < 18))) // built-in fonts 8, 9, 14, 15, 16, 17 should be valid
|
||||||
if (f == 8)
|
|
||||||
i2 = 1;
|
|
||||||
if (f == 9)
|
|
||||||
i2 = 1;
|
|
||||||
if (f == 14)
|
|
||||||
i2 = 1;
|
|
||||||
if (f == 15)
|
|
||||||
i2 = 1;
|
|
||||||
if (f == 16)
|
|
||||||
i2 = 1;
|
|
||||||
if (f == 17)
|
|
||||||
i2 = 1;
|
i2 = 1;
|
||||||
|
if (((f == 9) || (f == 15) || (f == 17)) && (!im->text)) { // but 9, 15, and 17 are *ONLY* valid for text screes
|
||||||
|
error(5);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (f >= 32 && f <= lastfont) {
|
if (f >= 32 && f <= lastfont) {
|
||||||
if (font[f])
|
if (font[f])
|
||||||
i2 = 1;
|
i2 = 1;
|
||||||
|
@ -25807,10 +25800,10 @@ void sub__font(int32 f, int32 i, int32 passed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (im->text && ((fontflags[f] & 16) == 0)) {
|
if (im->text && ((fontflags[f] & 16) == 0)) { // fontflags[f] & 16 is the bit which we set for MONOSPACE fonts. If it's a SCREEN 0 screen, and the font
|
||||||
error(5);
|
error(5);// isn't monospaced, toss and error and return.
|
||||||
return;
|
return;
|
||||||
} // only monospace fonts can be used on text surfaces
|
}
|
||||||
// note: font changes to text screen mode images requires:
|
// note: font changes to text screen mode images requires:
|
||||||
// i) font change across all screen pages
|
// i) font change across all screen pages
|
||||||
// ii) locking of the display
|
// ii) locking of the display
|
||||||
|
|
Loading…
Reference in a new issue