当前位置: 首页>>代码示例>>C++>>正文


C++ PointerWrap::GetPPtr方法代码示例

本文整理汇总了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
}
开发者ID:RachelBryk,项目名称:dolphin,代码行数:41,代码来源:State.cpp

示例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;
}
开发者ID:BlackBeetleKing,项目名称:dolphin,代码行数:64,代码来源:State.cpp


注:本文中的PointerWrap::GetPPtr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。