SethRobinson / proton

Proton SDK: Seth's GL/GLES messy multi-platform C++ game SDK. Can output to Windows, OS X, iOS, Android, Linux (Raspbian too), HTML5, Flash
Other
79 stars 16 forks source link

FocusInputComponent: It's possible to go through a std::list backwards #14

Closed iProgramMC closed 8 months ago

iProgramMC commented 2 years ago

https://github.com/SethRobinson/proton/blob/master/shared/Entity/Entity.cpp#L188-L210

It's actually possible, by using std::list::rbegin (points to the end of the list), and std::list::rend (points to the element before the first list element, works the same as std::list::begin and std::list::end)

std::<container type here>::reverse_iterator is very helpful in this case. With a little hacking I'm pretty sure it's possible.

NOTE: I tried just copying the contents of CallFunctionRecursively, it didn't work but I will try with something else