Beispiel #1
0
GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen)
	: _resMan(resMan), _screen(screen) {
	int16 color;

	_sysPalette.timestamp = 0;
	for (color = 0; color < 256; color++) {
		_sysPalette.colors[color].used = 0;
		_sysPalette.colors[color].r = 0;
		_sysPalette.colors[color].g = 0;
		_sysPalette.colors[color].b = 0;
		_sysPalette.intensity[color] = 100;
		_sysPalette.mapping[color] = color;
	}
	// Black and white are hardcoded
	_sysPalette.colors[0].used = 1;
	_sysPalette.colors[255].used = 1;
	_sysPalette.colors[255].r = 255;
	_sysPalette.colors[255].g = 255;
	_sysPalette.colors[255].b = 255;

	_sysPaletteChanged = false;

	// Quest for Glory 3 demo, Eco Quest 1 demo, Laura Bow 2 demo, Police Quest
	// 1 vga and all Nick's Picks all use the older palette format and thus are
	// not using the SCI1.1 palette merging (copying over all the colors) but
	// the real merging done in earlier games. If we use the copying over, we
	// will get issues because some views have marked all colors as being used
	// and those will overwrite the current palette in that case
	if (getSciVersion() < SCI_VERSION_1_1) {
		_useMerging = true;
		_use16bitColorMatch = true;
	} else if (getSciVersion() == SCI_VERSION_1_1) {
		// there are some games that use inbetween SCI1.1 interpreter, so we have
		// to detect if the current game is merging or copying
		_useMerging = _resMan->detectPaletteMergingSci11();
		_use16bitColorMatch = _useMerging;
		// Note: Laura Bow 2 floppy uses the new palette format and is detected
		//        as 8 bit color matching because of that.
	} else {
	    // SCI32
		_useMerging = false;
		_use16bitColorMatch = false; // not verified that SCI32 uses 8-bit color matching
	}

	palVaryInit();

	_macClut = 0;
	loadMacIconBarPalette();

	switch (_resMan->getViewType()) {
	case kViewEga:
		_totalScreenColors = 16;
		break;
	case kViewAmiga:
		_totalScreenColors = 32;
		break;
	case kViewAmiga64:
		_totalScreenColors = 64;
		break;
	case kViewVga:
	case kViewVga11:
			_totalScreenColors = 256;
		break;
	default:
		error("GfxPalette: Unknown view type");
	}

	_remapOn = false;
	resetRemapping();
}
Beispiel #2
0
GfxRemap::GfxRemap(GfxScreen *screen, GfxPalette *palette)
	: _screen(screen), _palette(palette) {
	_remapOn = false;
	resetRemapping();
}