Bug 3604 - Colour codes at the beginning of lines do not display on screen
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: SVN HEAD
Hardware: All All
: P3 minor
Assignee: Tim Angus
QA Contact: Tremulous Bugs
URL:
Depends on:
Blocks:
 
Reported: 2008-04-19 16:06 EDT by Ben Millwood
Modified: 2009-10-06 13:11:48 EDT
1 user (show)

See Also:


Attachments
store two colour codes in Item_Text_Wrap (2.49 KB, patch)
2008-06-12 11:16 EDT, Ben Millwood
Patch based on svn 1094 (1.14 KB, patch)
2008-07-02 17:08 EDT, Amanieu d'Antras
Patch based on svn 1094 (1.33 KB, patch)
2008-07-03 06:17 EDT, Amanieu d'Antras
Patch based on svn 1094 (1.32 KB, patch)
2008-07-03 16:11 EDT, Amanieu d'Antras

Description Ben Millwood 2008-04-19 16:06:25 EDT
It seems that colour codes shown on the screen are ignored if they are at the beginning of the line

My guess is this is the result of r1083. They still show in the console fine, but using:

]/bind \ "echo ^1foo"

when \ is pressed with the console closed foo appears in white.
Comment 1 Ben Millwood 2008-06-12 11:16:24 EDT
Created attachment 1782 [details]
store two colour codes in Item_Text_Wrap

Thanks Amanieu for finding the function containing the bug.
I still don't quite understand the workings of said function, so I'm not too confident about this patch, but I can't reproduce the bug with it applied.
Comment 2 Ben Millwood 2008-06-27 21:42:14 EDT
I think this patch might fail when chat text wraps twice, to three lines.
No idea why though.
Comment 3 Amanieu d'Antras 2008-07-02 17:08:31 EDT
Created attachment 1801 [details]
Patch based on svn 1094

A few bugs in the existing implementation, fixed with this patch (not benmachine's):
- First color code is not taken into account because 'p' only starts after the first set of color codes have been stripped.
- Color is reset after 2 lines because of the Com_Memset that resets 'c'
- Second color string check loop will never be used
Comment 4 Amanieu d'Antras 2008-07-03 06:17:08 EDT
Created attachment 1802 [details]
Patch based on svn 1094

Don't propagate color codes when there is a manual newline.
Comment 5 Amanieu d'Antras 2008-07-03 16:11:24 EDT
Created attachment 1803 [details]
Patch based on svn 1094

Make initial color ^7 instead of nothing, prevents overflows.
Comment 6 Chris "Lakitu7" Schwarz 2009-10-06 13:11:48 EDT
Fixed at r1741. Thanks.