HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.92k stars 427 forks source link

Use `FlxColorInt` instead of `Int` for RGBA to reduce variable size for CPP target #3167

Closed Just-Feeshy closed 4 weeks ago

Just-Feeshy commented 4 weeks ago

It is just an area for memory usage optimization for the CPP target. The main purpose is to use C's uint8_t instead of regular int to avoid wasting memory.

Geokureli commented 4 weeks ago

furthermore, I'm a little skeptical of the benefits without seeing actual test results, please do some tests and ensure the following:

Just-Feeshy commented 4 weeks ago

I'm so sorry, I forgot to take account for the rest of the methods when doing my own test.

Geokureli commented 4 weeks ago

@Just-Feeshy is this not salvageable?

Just-Feeshy commented 3 weeks ago

@Just-Feeshy is this not salvageable?

It is, but I realized I made many initial mistakes in the placement of FlxColorInt. I'm also trying to think of a good test to demonstrate with as little time as possible, and I don't want to mess anything up.