linuxgurugamer / EngineLightRelit

(Unofficial) Fork of EngineLight for Kerbal Space Program (https://github.com/tatjam/KSP-EngineLight)
MIT License
3 stars 4 forks source link

Fixed emissive, and added solid fuel booster config #16

Closed Vandest1 closed 2 years ago

Vandest1 commented 2 years ago

Hello it's me again ! You know, the noob who doesn't drop it :-p

I'm back again because now we don't get emissive light anymore. It's because emissive colors check is never on "true" when it's compared to "null", so I propose to you to check if its alpha channel is equal to 0 (value when it's declared).

Also, I've made some solid fuel booster config, stock booster that were forgotten since a while. This could be the opportunity to add them.

Have good day

linuxgurugamer commented 2 years ago

Never a problem.

But, since you are doing this, I took a slightly deeper look and saw a few other "new" which might cause memory issues.

for example:

exhaustColor = new Color(exhaustRed, exhaustGreen, exhaustBlue);

Could you take a look at the others in that method and add checks if necessary?

Vandest1 commented 2 years ago

Ok.

I found 3 other new instances in initEngineLights method that can be checked :

  1. exhaustColor (that you've mentioned)
  2. jitterBuffer
  3. lightOffset

For the first two, I did it like I did until now. For the last one, it was roughly the same but I notice that make a new instance was not necessary, and I picked to just set the one that already exist. I thought that it's better to set an instance that already exist than create a new one. I'm right ? If it's the case, I could do the same for Color instances.

linuxgurugamer commented 2 years ago

Always better to use an existing one rather than create a new one, as long as it works. Less overhead

Vandest1 commented 2 years ago

Ok, that is what I thought. So, I will do it to Color instances also.

Vandest1 commented 2 years ago

It's done ! I removed Color instances and I replaced them with settings of those that already exist.

Also, I remade config of solid fuel boosters. Emissive needed to be adjusted to match with nozzle. (This is what took me most time ...)

Tell me what do think about it.