Exemplo n.º 1
0
/**
 * Generic palette fader/unfader. Creates a 'FadeProcess' process
 * for each palette that is to fade.
 * @param multTable			Fixed point color multiplier table
 * @param noFadeTable		List of palettes not to fade
 */
static void Fader(const long multTable[], SCNHANDLE noFadeTable[]) {
	PALQ *pPal;	// palette manager iterator

	if (TinselV2) {
		// The is only ever one cuncurrent fade
		// But this could be a fade out and the fade in is still going!
		CoroScheduler.killMatchingProcess(PID_FADER);
		NoFadingPalettes();
	}

	// create a process for each palette in the palette queue
	for (pPal = GetNextPalette(NULL); pPal != NULL; pPal = GetNextPalette(pPal)) {
		bool bFade = true;
			// assume we want to fade this palette

		// is palette in the list of palettes not to fade
		if (noFadeTable != NULL) {
			// there is a list of palettes not to fade
			for (int i = 0; noFadeTable[i] != 0; i++) {
				if (pPal->hPal == noFadeTable[i]) {
					// palette is in the list - dont fade it
					bFade = false;

					// leave loop prematurely
					break;
				}
			}
		}

		if (bFade) {
			FADE fade;

			// fill in FADE struct
			fade.pColorMultTable	= multTable;
			fade.pPalQ		= pPal;

			// create a fader process for this palette
			CoroScheduler.createProcess(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
		}
	}
}
Exemplo n.º 2
0
/**
 * Generic palette fader/unfader. Creates a 'FadeProcess' process
 * for each palette that is to fade.
 * @param multTable			Fixed point color multiplier table
 */
static void Fader(const long multTable[]) {
	PALQ *pPal;	// palette manager iterator

	if (TinselV2) {
		// The is only ever one cuncurrent fade
		// But this could be a fade out and the fade in is still going!
		CoroScheduler.killMatchingProcess(PID_FADER);
		NoFadingPalettes();
	}

	// create a process for each palette in the palette queue
	for (pPal = GetNextPalette(NULL); pPal != NULL; pPal = GetNextPalette(pPal)) {
		FADE fade;

		// fill in FADE struct
		fade.pColorMultTable	= multTable;
		fade.pPalQ		= pPal;

		// create a fader process for this palette
		CoroScheduler.createProcess(PID_FADER, FadeProcess, (void *)&fade, sizeof(FADE));
	}
}