Downloads containing CGA.mut

Downloads
Name Author Game Mode Rating
JJ2 1.23 vanilla: Miscellaneous stuff Violet CLM Multiple N/A Download file

File preview

jjPAL CGAConversion;
void onLevelLoad() {
	jjPAL CGA;
	const array<array<uint8>> SourceColors = {
		{0x00,0x00,0x00},
		{0x00,0x00,0xAA},
		{0x00,0xAA,0x00},
		{0x00,0xAA,0xAA},
		{0xAA,0x00,0x00},
		{0xAA,0x00,0xAA},
		{0xAA,0x55,0x00},
		{0xAA,0xAA,0xAA},
		{0x55,0x55,0x55},
		{0x55,0x55,0xFF},
		{0x55,0xFF,0x55},
		{0x55,0xFF,0xFF},
		{0xFF,0x55,0x55},
		{0xFF,0x55,0xFF},
		{0xFF,0xFF,0x55},
		{0xFF,0xFF,0xFF}
	};
	for (uint i = 0; i < SourceColors.length; ++i) {
		const array<uint8>@ channels = SourceColors[i];
		CGA.color[24 + i] = jjPALCOLOR(channels[0], channels[1], channels[2]);
	}
	for (uint i = 1; i < 255; ++i)
		CGAConversion.color[i] = CGA.color[CGA.findNearestColor(jjPalette.color[i])];
}

int lastColorDepth = 16;
void onMain() {
	if (lastColorDepth != jjColorDepth) {
		lastColorDepth = jjColorDepth;
		((lastColorDepth == 8) ? CGAConversion : jjBackupPalette).apply();
	}
}

bool onDrawAmmo(jjPLAYER@, jjCANVAS@ screen) {
	if (jjColorDepth != 8)
		screen.drawString(0x8000, 80, "Use 8-bit Color", STRING::LARGE);
	return false;
}