use default if not provided by caller

This commit is contained in:
tTh 2023-10-02 18:26:11 +02:00
parent 56250127bc
commit cced0a8811
1 changed files with 9 additions and 2 deletions

View File

@ -165,6 +165,9 @@ int rp, gp, bp;
int x2, y2; int x2, y2;
uint16_t mask; uint16_t mask;
RGBA blanc = { 255, 255, 255, 255, 0, 0 },
noir = { 0, 0, 0, 64, 0, 0 };
if (flags) { if (flags) {
fprintf(stderr, "in %s, useless flags 0x%x is useless\n", fprintf(stderr, "in %s, useless flags 0x%x is useless\n",
__func__, flags); __func__, flags);
@ -175,11 +178,15 @@ fprintf(stderr, "%s: ltr %3d '%c' %4d %4d\n", __func__, lettre,
isprint(lettre) ? lettre : ' ', xpos, ypos); isprint(lettre) ? lettre : ' ', xpos, ypos);
#endif #endif
/*
* use default if not provided my caller
*/
if (NULL==pap) pap = &blanc;
if (NULL==ink) ink = &noir;
/* +-------------------------------+ /* +-------------------------------+
| WTF ? no boundary check ? | | WTF ? no boundary check ? |
+-------------------------------+ */ +-------------------------------+ */
for (y=0; y<24; y++) { for (y=0; y<24; y++) {
mask = 0x8000; mask = 0x8000;
y2 = y + ypos; y2 = y + ypos;