⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 globalstorage.cpp

📁 这个是symbian下的一个蛮庞大的3D游戏源代码!对于学习3D开发的人有很大的帮助!
💻 CPP
字号:
#include <lang/GlobalStorage.h>
#ifdef __SYMBIAN32__
#include <e32std.h>
#endif
#ifdef __SERIES60_3X__
#include <e32svr.h>
#endif
#include <string.h>
#include <config.h>


namespace lang
{


#ifndef __SYMBIAN32__
GlobalStorage GlobalStorage::sm_instance;
#elif defined(__SERIES60_3X__)
static GlobalStorage s_instance;
#endif


GlobalStorage::GlobalStorage()
{
	// a bit ugly but this class contains only regular pointers
	// and we don't want to end up forgetting to initialize some pointer
	memset( this, 0, sizeof(GlobalStorage) );
}

#ifdef __SYMBIAN32__
GlobalStorage& GlobalStorage::get()
{
#ifdef __SERIES60_3X__

	return s_instance;

#else

	GlobalStorage* gs = reinterpret_cast<GlobalStorage*>( Dll::Tls() );
	if ( !gs )
	{
		gs = new GlobalStorage;
		Dll::SetTls( gs );
	}
	return *gs;
		
#endif
}
#endif // __SYMBIAN32__


} // lang

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -