Exemplo n.º 1
0
void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
	// TODO: Put effect functions into an array

	switch (effectNum) {

	case 0:		// No effect
		vfx00(surface, palette, newPalette, colorCount);
		break;

	case 1:
		vfx01(surface, palette, newPalette, colorCount);
		break;

	case 2:
		vfx02(surface, palette, newPalette, colorCount);
		break;

	case 3:
		vfx03(surface, palette, newPalette, colorCount);
		break;

	case 4:
		vfx04(surface, palette, newPalette, colorCount);
		break;

	case 5:
		vfx05(surface, palette, newPalette, colorCount);
		break;

	case 6:		// "Curtain open" effect
		vfx06(surface, palette, newPalette, colorCount);
		break;

	case 7:		// "Curtain close" effect
		vfx07(surface, palette, newPalette, colorCount);
		break;

	case 8:
		vfx08(surface, palette, newPalette, colorCount);
		break;

	case 9:		// "Checkerboard" effect
		vfx09(surface, palette, newPalette, colorCount);
		break;

	case 10:	// "Screen wipe in", left to right
		vfx10(surface, palette, newPalette, colorCount);
		break;

	case 11:	// "Screen wipe in", right to left
		vfx11(surface, palette, newPalette, colorCount);
		break;

	case 12:	// "Screen wipe in", top to bottom
		vfx12(surface, palette, newPalette, colorCount);
		break;

	case 13:	// "Screen wipe in", bottom to top
		vfx13(surface, palette, newPalette, colorCount);
		break;

	case 14:	// "Screen open" effect
		vfx14(surface, palette, newPalette, colorCount);
		break;

	case 15:
		vfx15(surface, palette, newPalette, colorCount);
		break;

	case 16:
		vfx16(surface, palette, newPalette, colorCount);
		break;

	case 17:	// Palette fadeout/fadein
		vfx17(surface, palette, newPalette, colorCount);
		break;

	case 18:
		vfx18(surface, palette, newPalette, colorCount);
		break;

	case 19:
		vfx19(surface, palette, newPalette, colorCount);
		break;

	case 20:
		vfx20(surface, palette, newPalette, colorCount);
		break;

	default:
		vfx00(surface, palette, newPalette, colorCount);
		warning("Unimplemented visual effect %d", effectNum);

	}

}
Exemplo n.º 2
0
void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
	// Workaround: we set up the final palette beforehand, to reduce CPU usage during the screen effect.
	// The visual difference is not noticeable, but CPU load is much much less (as palette updates are very expensive).
	// The palette changes in the effects have been removed, where applicable, to reduce CPU load
	setPalette(palette);

	// TODO: Put effect functions into an array

	switch (effectNum) {

	case 0:		// No effect
		vfx00(surface, palette, newPalette, colorCount);
		break;

	case 1:
		vfx01(surface, palette, newPalette, colorCount);
		break;

	case 2:
		vfx02(surface, palette, newPalette, colorCount);
		break;

	case 3:
		vfx03(surface, palette, newPalette, colorCount);
		break;

	case 4:
		vfx04(surface, palette, newPalette, colorCount);
		break;

	case 5:
		vfx05(surface, palette, newPalette, colorCount);
		break;

	case 6:		// "Curtain open" effect
		vfx06(surface, palette, newPalette, colorCount);
		break;

	case 7:		// "Curtain close" effect
		vfx07(surface, palette, newPalette, colorCount);
		break;

	case 8:
		vfx08(surface, palette, newPalette, colorCount);
		break;

	case 9:		// "Checkerboard" effect
		vfx09(surface, palette, newPalette, colorCount);
		break;

	case 10:	// "Screen wipe in", left to right
		vfx10(surface, palette, newPalette, colorCount);
		break;

	case 11:	// "Screen wipe in", right to left
		vfx11(surface, palette, newPalette, colorCount);
		break;

	case 12:	// "Screen wipe in", top to bottom
		vfx12(surface, palette, newPalette, colorCount);
		break;

	case 13:	// "Screen wipe in", bottom to top
		vfx13(surface, palette, newPalette, colorCount);
		break;

	case 14:	// "Screen open" effect
		vfx14(surface, palette, newPalette, colorCount);
		break;

	case 15:
		vfx15(surface, palette, newPalette, colorCount);
		break;

	case 16:
		vfx16(surface, palette, newPalette, colorCount);
		break;

	case 17:	// Palette fadeout/fadein
		vfx17(surface, palette, newPalette, colorCount);
		break;

	case 18:
		vfx18(surface, palette, newPalette, colorCount);
		break;

	case 19:
		vfx19(surface, palette, newPalette, colorCount);
		break;

	case 20:
		vfx20(surface, palette, newPalette, colorCount);
		break;

	default:
		vfx00(surface, palette, newPalette, colorCount);
		warning("Unimplemented visual effect %d", effectNum);

	}

}