本文整理汇总了C++中PointerWrap::GetPPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ PointerWrap::GetPPtr方法的具体用法?C++ PointerWrap::GetPPtr怎么用?C++ PointerWrap::GetPPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointerWrap
的用法示例。
在下文中一共展示了PointerWrap::GetPPtr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoState
static void DoState(PointerWrap &p)
{
u32 version = STATE_VERSION;
{
static const u32 COOKIE_BASE = 0xBAADBABE;
u32 cookie = version + COOKIE_BASE;
p.Do(cookie);
version = cookie - COOKIE_BASE;
}
if (version != STATE_VERSION)
{
// if the version doesn't match, fail.
// this will trigger a message like "Can't load state from other revisions"
// we could use the version numbers to maintain some level of backward compatibility, but currently don't.
p.SetMode(PointerWrap::MODE_MEASURE);
return;
}
p.DoMarker("Version");
// Begin with video backend, so that it gets a chance to clear it's caches and writeback modified things to RAM
g_video_backend->DoState(p);
p.DoMarker("video_backend");
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
Wiimote::DoState(p.GetPPtr(), p.GetMode());
p.DoMarker("Wiimote");
PowerPC::DoState(p);
p.DoMarker("PowerPC");
HW::DoState(p);
p.DoMarker("HW");
CoreTiming::DoState(p);
p.DoMarker("CoreTiming");
Movie::DoState(p);
p.DoMarker("Movie");
#if defined(HAVE_LIBAV) || defined (WIN32)
AVIDump::DoState();
#endif
}
示例2: DoState
static std::string DoState(PointerWrap& p)
{
u32 version = STATE_VERSION;
{
static const u32 COOKIE_BASE = 0xBAADBABE;
u32 cookie = version + COOKIE_BASE;
p.Do(cookie);
version = cookie - COOKIE_BASE;
}
std::string version_created_by = scm_rev_str;
if (version > 42)
p.Do(version_created_by);
else
version_created_by.clear();
if (version != STATE_VERSION)
{
if (version_created_by.empty() && s_old_versions.count(version))
{
// The savestate is from an old version that doesn't
// save the Dolphin version number to savestates, but
// by looking up the savestate version number, it is possible
// to know approximately which Dolphin version was used.
std::pair<std::string, std::string> version_range = s_old_versions.find(version)->second;
std::string oldest_version = version_range.first;
std::string newest_version = version_range.second;
version_created_by = "Dolphin " + oldest_version + " - " + newest_version;
}
// because the version doesn't match, fail.
// this will trigger an OSD message like "Can't load state from other revisions"
// we could use the version numbers to maintain some level of backward compatibility, but currently don't.
p.SetMode(PointerWrap::MODE_MEASURE);
return version_created_by;
}
p.DoMarker("Version");
// Begin with video backend, so that it gets a chance to clear its caches and writeback modified things to RAM
g_video_backend->DoState(p);
p.DoMarker("video_backend");
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
Wiimote::DoState(p.GetPPtr(), p.GetMode());
p.DoMarker("Wiimote");
PowerPC::DoState(p);
p.DoMarker("PowerPC");
HW::DoState(p);
p.DoMarker("HW");
CoreTiming::DoState(p);
p.DoMarker("CoreTiming");
Movie::DoState(p);
p.DoMarker("Movie");
#if defined(HAVE_LIBAV) || defined (WIN32)
AVIDump::DoState();
#endif
return version_created_by;
}