コード例 #1
0
ファイル: gfxutil.cpp プロジェクト: CypherXG/UAE4Droid
void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs)
{
    int i;
    for (i = 0; i < 4096; i++) {
	int r = i >> 8;
	int g = (i >> 4) & 0xF;
	int b = i & 0xF;
	xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs);
    }
}
コード例 #2
0
ファイル: svga.c プロジェクト: Pa0l0ne/Amiga360
static int get_color (int r, int g, int b, xcolnr *cnp)
{
    if (colors_allocated == 256)
	return -1;
    *cnp = colors_allocated;
    palette_entries[colors_allocated][0] = doMask (r, 6, 0);
    palette_entries[colors_allocated][1] = doMask (g, 6, 0);
    palette_entries[colors_allocated][2] = doMask (b, 6, 0);
    vga_setpalette(colors_allocated, doMask (r, 6, 0), doMask (g, 6, 0), doMask (b, 6, 0));
    colors_allocated++;
    return 1;
}