bool LinkPalettes(PaletteT *palette, ...) { int start = 0; va_list ap; va_start(ap, palette); for (;;) { PaletteT *next = va_arg(ap, PaletteT *); /* Just for safety. */ UnlinkPalettes(palette); palette->start = start; palette->next = next; start += palette->count; if (!next) break; palette = next; } va_end(ap); return BOOL(start <= 256); }
/* * Tear down demo. */ void KillDemo() { UnlinkPalettes(R_("11.pal")); UnlinkPalettes(R_("texture-1.pal")); UnlinkPalettes(R_("texture-2.pal")); UnlinkPalettes(R_("texture-3.pal")); UnlinkPalettes(R_("texture-4.pal")); UnlinkPalettes(R_("texture-5.pal")); AudioStreamStop(TheMusic); MemUnref(TheMusic); MemUnref(TheCanvas); }