Your first question is trick to explain, but I'll do my best.
function pulsate_text_stop(var,PANEL*); is what is called a "function prototype".
Its not a real function, its just pretending to be one, so the compiler knows its name and parameters.
Notice that my "pulsate_text" function calls on "pulsate_text_stop". It cant do this
until the compiler know about pulsate_text_stop.
BUT the real pulsate_text_stop comes AFTER pulsate_text so the compiler doesnt know it exists, and would fail.
BUT, by putting a prototype of pulsate_text_stop in before pulsate_text, then the compiler knows how to use
pulsate_text_stop, and then continues compiling.
Then, when it finds the next pulsate_text_stop, the compiler compiles it, over-writing any references to
the prototype. All Good!
Normally one would say, "just put pulsate_text_stop in front of pulsate_text!".
I cant do that, because pulsate_text_stop contains a reference to pulsate_text, and then I would
just have the same problem again. Catch-22. Thats why we use prototypes...
Second question would take a lot of explaining too, but I will tell you this following code-snippet
WILL work, if you created another panel called "options_panel" and gave it some buttons and text's.
function pulsate_text(var butt_over, PANEL* this_pan)
{
proc_kill((void*)pulsate_text);
pulsate_text_stop(butt_over, this_pan); //reset all text sizes for this panel
//
TEXT* this_text;
switch(this_pan)
{
case start_panel:
switch(butt_over)
{
case 1: this_text = newgame_txt;
case 2: this_text = loadgame_txt;
case 3: this_text = options_txt;
}
case options_panel:
switch(butt_over)
{
case 1: this_text = set_resolution_txt;
case 2: this_text = set_sounds_txt;
case 3: this_text = set_controls_txt;
}
}
//
while(1)
{
this_text.font = medium44_font; wait (-0.2);
this_text.font = large50_font; wait (-0.2);
this_text.font = medium44_font; wait (-0.2);
this_text.font = normal38_font; wait (-0.2);
}
}
Does that answer the second question?
I think that will do for this post anyways...