This commit is contained in:
KikooDX 2021-05-26 11:27:15 +02:00
parent 2a2ccb6595
commit d3f4919af1
2 changed files with 16 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

@ -4,6 +4,7 @@
#include <gint/std/string.h>
bopti_image_t *vimg_bar3;
color_t *vcol_bar3; /* was black */
static void init_vimg_bar3(void);
@ -54,8 +55,11 @@ bar_deinit(void)
void
init_vimg_bar3(void)
{
int i;
color_t *palette;
const int sizeof_bimg_bar_3 =
sizeof(bimg_bar3) + 2 * sizeof(color_t) + /* palette */
sizeof(bimg_bar3) + 16 * sizeof(color_t) + /* palette */
(bimg_bar3.width + 1) / 2 * bimg_bar3.height; /* data */
/* allocate memory! */
@ -63,4 +67,15 @@ init_vimg_bar3(void)
/* copy original image to allocated area */
memcpy(vimg_bar3, &bimg_bar3, sizeof_bimg_bar_3);
/* find black color in palette */
palette = vimg_bar3->data;
i = -1;
while (++i < 16)
if (palette[i] == C_BLACK)
break;
vcol_bar3 = &palette[i];
/* DEBUG */
*vcol_bar3 = C_GREEN;
}