MQtoSMTL Override Color Correction
Posted: Wed Nov 05, 2003 1:31 am
The color being passed to MQtoSMTL is (typically) an ARGB value ... SMTL uses standard RGB like a regular HTML doc, so we need to convert the ARGB value back to RGB before pushing it in to the the output line. I did this very simply right before the while loop. Also, to ensure that MQ doesn't simply default to white when there are other colors present and an override is passed, (like SuperWho which starts the string w/ a color change), I insert the override color before we start processing the input instead of only when there isn't a color set before it. Below is the code to be inserted to make these fixes.
Code: Select all
int TotalColors=0; // this MUST be signed.[color=red]
if (ColorOverride>0xFF000000) ColorOverride^=0xFF000000;
// Always wrap the output in the default override color.
pchar_out_string_position+=InsertColor(&out[pchar_out_string_position],ColorOverride);
CurrentColor=ColorOverride;[/color]
while(in[pchar_in_string_position]!=0 && pchar_out_string_position<maxlen)