mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Add __PsmfPlayerDoState(PointerWrap &p) to sceKernel
This commit is contained in:
parent
6ebb06c171
commit
b16a208453
@ -174,6 +174,7 @@ void __KernelDoState(PointerWrap &p)
|
||||
__MpegDoState(p);
|
||||
__PowerDoState(p);
|
||||
__PsmfDoState(p);
|
||||
__PsmfPlayerDoState(p);
|
||||
__SasDoState(p);
|
||||
__SslDoState(p);
|
||||
__UmdDoState(p);
|
||||
|
@ -373,6 +373,38 @@ void __PsmfDoState(PointerWrap &p)
|
||||
p.DoMarker("scePsmf");
|
||||
}
|
||||
|
||||
void __PsmfPlayerDoState(PointerWrap &p)
|
||||
{
|
||||
int n = (int) psmfPlayerMap.size();
|
||||
p.Do(n);
|
||||
if (p.mode == p.MODE_READ) {
|
||||
std::map<u32, PsmfPlayer *>::iterator it, end;
|
||||
for (it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
psmfMap.clear();
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
u32 key;
|
||||
p.Do(key);
|
||||
PsmfPlayer *psmfplayer = new PsmfPlayer(0);
|
||||
psmfplayer->DoState(p);
|
||||
psmfPlayerMap[key] = psmfplayer;
|
||||
}
|
||||
} else {
|
||||
std::map<u32, PsmfPlayer *>::iterator it, end;
|
||||
for (it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it) {
|
||||
p.Do(it->first);
|
||||
it->second->DoState(p);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Actually load this from a map.
|
||||
psmfPlayerStatus = PSMF_PLAYER_STATUS_NONE;
|
||||
|
||||
p.DoMarker("scePsmfPlayer");
|
||||
}
|
||||
|
||||
void __PsmfShutdown()
|
||||
{
|
||||
for (auto it = psmfMap.begin(), end = psmfMap.end(); it != end; ++it)
|
||||
|
@ -22,4 +22,5 @@ void Register_scePsmfPlayer();
|
||||
|
||||
void __PsmfInit();
|
||||
void __PsmfDoState(PointerWrap &p);
|
||||
void __PsmfPlayerDoState(PointerWrap &p);
|
||||
void __PsmfShutdown();
|
||||
|
Loading…
Reference in New Issue
Block a user