TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
590 stars 156 forks source link

Setting average sampled color from texture to light entity uses commas for color #603

Closed Aciz closed 6 years ago

Aciz commented 6 years ago

Pressing SHIFT + MOUSE3 to set average sampled color of currently selected texture to light color uses commas as separators for _color values. I believe the issue is this line: https://github.com/TTimo/GtkRadiant/blob/8557f1820f8e0c7cef9d52a78b2847fa401a4a95/radiant/drag.cpp#L498

which should instead be:

strBuff.Format( "%.6f %.6f %.6f",pTex->color[0], pTex->color[1], pTex->color[2] );

I am certainly not 100% sure if this is the correct solution, but regardless the functionality sets wrong separator.

Pan7 commented 6 years ago

It creates space separated values for me like this:

0.131906 0.131906 0.566156

Aciz commented 6 years ago

@Pan7 This is the result I'm getting.

https://i.imgur.com/a1oVdRh.png

From what I've been googling, I believe locale affects the separator? I'm on Windows 10 Pro x64, with Finnish locale & keyboard layout.

Pan7 commented 6 years ago

The problem is CString Format is using your locale. See https://github.com/TTimo/GtkRadiant/blob/8557f1820f8e0c7cef9d52a78b2847fa401a4a95/radiant/main.cpp#L462

Aciz commented 6 years ago

Yes, that's what I understood as well, after looking more into it. But is there no way to force it to use dots as separators? Because commas do not work, the lights just default to white.

Pan7 commented 6 years ago

It should not use commas but i don't find where it sets the locale wrong.

Aciz commented 6 years ago

I have fixed this by changing the formatting options of my locale to use dots instead of commas as decimal symbol. Hopefully it won't mess up other things anywhere. Still, isn't there a way to force it to use dots instead of whatever is the locale default?

Garux commented 6 years ago

commas moar commas

Aciz commented 6 years ago

These used to be commas for me as well, just never paid attention to them since commas work fine there. Now these are dots as well though.

Garux commented 6 years ago

FP for mouse sensitivity doesn't work tho ¯\_(ツ)_/¯