like songs and courses: it's difficult to guarantee that all references
to them are updated if they're deleted or reallocated, which is a brittleness
that leads to obscure bugs.
A general fix for this is to avoid storing pointers to objects, and
to use IDs instead; for example, SongID to reference a song (which
tags by directory). This leads to an efficiency problem: searching
a map<RString> is much more expensive. We need a robust way to
cache the results.
Implement CachedObject<T>, CachedObjectPointer<T>. This implements
caching pointers to objects, negative caching, clearing cache when objects
are deleted, and clearing negative cache when objects are created.
I still don't completely like this because after FinishStage(), if an extra stage has been earned, it is immediately in that stage which is sort of strange for SEval. Even worse, if an extra stage was earned in the past but not for the current stage, then the stage doesn't change. (E.g., earn extra stage but not second extra stage, or earn second extra stage.) So once an extra stage has been earned, SEval will be called twice for the same stage. A per-player m_iExtraStagesPlayed could be added to fix this, but it doesn't seem worth it.
increased stack size ( i think in RageSurface_Load_GIF.cpp:189 LocalColorMap should be passed by reference not through stack)
enabled optimizations for relase mode
lua functions:
bool SetProfileIndex(PlayerNumber, profileindex)
if profileindex == -2 - unloads specified player
if profileindex == -1 - sets choosed profile to none (if any human player profileindex is set to -1 then screen cannot finish)
also joins player if player was not joined before
if profileindex == 0 - sets choosed profile to use memory card (memory card should be mounted at this point)
if profileindex >0 and profilexindex <numlocalprofiles - sets choosed profile to one of local profiles
other values returns false
true is returned on successful operation
int GetProfileIndex(PlayerNumber)
returns selected profileindex for player
bool Finish
tries to load selected profiles and proceed to next screen
returns false if not all players are finished choosing or players have selected the same local profiles
Cancel - returns to previous screen