H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
205 stars 81 forks source link

Avoid runtime indirection when initializing `plCreatable` class indices #1449

Closed dgelessus closed 1 year ago

dgelessus commented 1 year ago

The initialization went through a couple of getter/setter methods (one of them virtual), but the field can easily be made a constant initialized at compile time with no dynamic lookup.

I'm actually fixing a couple of IDE warnings here: one about virtual calls in constructors (ClassIndex()) and one about "unnecessary" semicolons after the plCreator.h REGISTER_* macros.