More text colors

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby Blµb » Sun Nov 16, 2008 8:09 pm

terencehill wrote:1. Tell me before if u want to work with code in which im still working. I've read this msg too late. I've just made the change and tested it and it works (tested). Div told me that he wanted to fix a function on playerlist.c and I'm not touching it.
2. To test your patch u should connect to a server and change your name using ^xrgb colors... after that u can try as many times as u want.
3. Analyzing your patch I guess that it doesn't work... but however I've my code is working, so we don't discuss this thing anymore...

I'll just look at your changes then :)
it's not like my patch is such a huge change :)
Blµb
Alien trapper
 
Posts: 277
Joined: Thu Mar 29, 2007 1:49 pm

Postby terencehill » Sun Nov 16, 2008 10:40 pm

If some1 wants to help me with suggestions pls comment on this page:
http://sites.google.com/site/terencehil ... evelopment
I've done other stuffs today...

I'm thinking of cut the alpha support coz it's a bit harder to implement (at least for me), or maybe not if some1 helps me coding the alpha thing after the rgb colors are completly implemented.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Mon Nov 17, 2008 5:27 am

The status thing was wrong (iirc) even with the old colors (if you are talking about misaligned strings).

Code: Select all
char c2 = c - (c & 128);
http://www.asciitable.com/ - look below to see extended ASCII table
All chars with value greater than or equal to 128 get 128 subtracted. That said if you have ▓ (178) it is changed to the value of 178-128=50, that is number 2 (check at ASCII table).

c & 128 is bitwise and (&&). It works like this:
abcdefgh - c in binary
10000000 - 128 in binary
Now it does boolean AND between appropiate bit from c and bit from 128.
Example:
10010110 - 150
10000000 - 128
150 & 128 = 1&1 0&0 0&0 1&0 0&0 1&0 1&0 0&0 = 1 0 0 0 0 0 0 0 = 10000000 = 128 in decimal

Code: Select all
    if (d[j] == STRING_COLOR_TAG)
                {
                    *cur++ = STRING_COLOR_TAG;
                    *cur++ = STRING_COLOR_TAG;
                }

Yes, ++ has precedence over *, so pointer is incremented, than dereferenced and changed into whatever STRING_COLOR_TAG is. From the name I guess it used to dump colored player names in linux console, but this is just a wild guess.

Code: Select all
  It seems that name1 is padded with ^7 only when a ^[0-9] but not ^7
    is used in name1. Now we have to append ^7 always after a name!

Not necessarily. The name is parsed correctly if you have ^[0,9] anywhere in your name.
Example:
name ^x834wow^2^x482miau
name ^1blah
works correctly. That means you need to parse the name every time and not only when it has ^[0,9] what I suppose current code does. Finding that place would probably fix it.
Sorry, I can't help more because I don't know what div said to you what is wrong.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby terencehill » Mon Nov 17, 2008 1:45 pm

Tnx for the explanations.

After I have understood that char c2 = c - (c & 128), I was able to patch the function VM_uncolorstring [prvm_cmds.c]. Should be tested btw...

That means you need to parse the name every time and not only when it has ^[0,9] what I suppose current code does. Finding that place would probably fix it.

For now I don't know where...
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby terencehill » Tue Nov 18, 2008 12:56 am

I NEED some HELP: I have to know how to test some functions and to resolve a (the only one?) bug.
Still refer to the same page http://sites.google.com/site/terencehill/Nexuiz/newtextcolorsdevelopment for more infos and to download the patch updated.

I've removed (commenting it) completely the support for alpha change.
The alpha can be implemented later. At least the code will have full support for rgb colors, the more important thing.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby terencehill » Wed Nov 19, 2008 7:09 pm

terencehill wrote:Btw the status command should be fixed!!! after the name it displays the informations with the last color used in the truncated version of the name... It's horrible. And also a carriage return after each player info can increase greatly the legibility. Does any1 want to fix this shit?


.... I've fixed it. Now it's nicer to see, more readable and it displays the complete names.

The patch for this command is needed also to display more chars in names with lots of new color tags. A name like ^xf00t^x0f0e^xf00r^x0f0ence ^4hill without this patch is shown with only 3 chars (a part the truncated tag...): ter^xf0

Download link: http://sites.google.com/site/terencehill/Nexuiz/status.patch

And don't forget, this patch works only in your own server.

Image
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Mr. Bougo » Wed Nov 19, 2008 9:40 pm

Terence, qcsrc/menu/nexuiz/inputbox.c ha changed radically recently. Your patch does not work on the current SVN.

Also, can you please make the patch by right clicking on the menu directory. I have no clue how you did it, but it's just impossible to patch using the normal method. You should definitely use the commandline svn to make your patches, or figure out how tortoisesvn does patches.

Oh and please, use short file names and no whitespaces for your patch files. It's a real pain to read :p
Meh.
Mr. Bougo
Keyboard killer
 
Posts: 760
Joined: Mon Sep 10, 2007 3:29 pm

Postby Alien » Wed Nov 19, 2008 9:44 pm

I copy the patch to both dirs and use patch < patch.patch
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby terencehill » Thu Nov 20, 2008 2:00 am

Patch updated.
download here: http://sites.google.com/site/terencehill/Nexuiz

I'm now really losing my patience.

Div, Blub ar any other ppl that knows better the darkplace code, can plssssssss test those functions left? They are 2 and I guess that they works already, coz the patch is really simple.

SO AGAIN, pls some1 test those fucking functions, if he knows how to do it!!!!

Div, can u pls tell me something, since u asked me to make all stuffs I did?
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby terencehill » Mon Dec 01, 2008 5:29 pm

ok. All the work is done now tnx to the help of Blub.

Here u can download the final patch:
http://sites.google.com/site/terencehil ... evelopment
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron