Forums

Full Version: Pause when braking, brake lights don't work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For some reason, now the brake lights on the cars don't work, and I get a brief "hang" or pause of the game where the screen freezes for half a second or so. I'm not sure what's causing this...but it makes "brake late" really difficult. Has anybody else noticed this?
I haven't noticed this, but then I usually run with the "in car" view - it's typically a much better overall feel for me.
I don't have this issue either.
Well brake lights still don't work for whatever reason, but I figured out what the pause on braking was - I had the brake button on my joystick mapped to the same thing as "take screenshot". No wonder I had so many screenshots...I guess it would be a good thing to check for duplicate control assignments and disallow them...except in the case of maybe clutch and shifting buttons...hmmm...
You have to admit, that's pretty hilarious. ;-)
Non-working brake light is caused by this line in Gl_Car::exterior_model (),
Code:
joeexterior.AdditiveTexture(settings.GetFullDataPath("cars/" + m_car_file + "/brake.joe"), 1);

joeexterior.AdditiveTexture() is actually trying to load the texture from cars/<carname>/brake.png". (as a side note, there is a slight re-direction in AdditiveTexture() which converts the file extention from .joe to .png. This had me confused for quite a while)

Anyway, in the car data files, brake.png is actually at cars/<carname>/textures/brake.png. So the above line should be changed to
Code:
joeexterior.AdditiveTexture(settings.GetFullDataPath("cars/" + m_car_file + "/textures/brake.joe"), 1);

After this change, the brake light comes on when I press brake. However, when I use the handbrake, the brake light stays on even I release the handbrake button. This seems to be another bug.


There are some other problems with this block of codes in Gl_Car::exterior_model (),
Code:
joeglass.Load(settings.GetFullDataPath("cars/" + m_car_file + "/glass.joe"));
joeglass.AdditiveTexture(settings.GetFullDataPath("cars/" + m_car_file + "/brake-glass.joe"), 1);
joeglass.Load(settings.GetFullDataPath("cars/" + m_car_file + "/glass.joe"));
joeglass.AdditiveTexture(settings.GetFullDataPath("cars/" + m_car_file + "/brake-glass.joe"), 1);
Seems to me the 2 lines are repeated. Also, what is brake-glass.joe? Is it different from brake.joe?
Thanks for finding this! I've fixed it and checked it in. Smile
Quote:After this change, the brake light comes on when I press brake. However, when I use the handbrake, the brake light stays on even I release the handbrake button. This seems to be another bug.
The cause of this bug is in Gl_Car::draw().
Code:
bool illum = false;
if (brakesetting != 0)
        illum = true;
Seems due to the keyboard control ramping, once the key is released, the final brakesetting value is not exactly 0, but a negative number very close to 0. I think the condition should be changed to
Code:
if (brakesetting > 0)