Original Post
HI I'm trying to come up with a way to sequence code easily and without using a million classes.
I want to be able to execute code x frames in the future for y frame duration - something like this:
if (HitSomething)
{
Seq(10,20,PlaySound,"CrashHit.wav"); // Call fun Playsound("CrashHit.wav") in 10 frames time for 20 frames
Seq(10,50,StarFlare,10,20,1.5,4); // Call func StarFlare(10,20,1.5,5) in 10 frames time for 50 frames
}
This is great because it can handle any function, and the code is localised. I can do this - but it's alot of work to get the Variadic stuff working across different platform - requires some hardcore asm to calc the Param stack Size and setup the epilog code e.t.c.
wondering if there are any neat tricks to get something similar.
I want to be able to execute code x frames in the future for y frame duration - something like this:
if (HitSomething)
{
Seq(10,20,PlaySound,"CrashHit.wav"); // Call fun Playsound("CrashHit.wav") in 10 frames time for 20 frames
Seq(10,50,StarFlare,10,20,1.5,4); // Call func StarFlare(10,20,1.5,5) in 10 frames time for 50 frames
}
This is great because it can handle any function, and the code is localised. I can do this - but it's alot of work to get the Variadic stuff working across different platform - requires some hardcore asm to calc the Param stack Size and setup the epilog code e.t.c.
wondering if there are any neat tricks to get something similar.