您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GS_L函数代码示例

51自学网 2021-06-01 20:57:24
  C++
这篇教程C++ GS_L函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GS_L函数的典型用法代码示例。如果您正苦于以下问题:C++ GS_L函数的具体用法?C++ GS_L怎么用?C++ GS_L使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GS_L函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ETH_STREAM_DECL

bool ETHScene::LoadFromFile(const str_type::string& fileName){	Platform::FileManagerPtr fileManager = m_provider->GetFileManager();	if (!fileManager->FileExists(fileName))	{		ETH_STREAM_DECL(ss) << GS_L("ETHScene::Open: file not found (") << fileName << GS_L(")");		m_provider->Log(ss.str(), Platform::FileLogger::ERROR);		return false;	}	m_minSceneHeight = 0.0f;	m_maxSceneHeight = m_provider->GetVideo()->GetScreenSizeF().y;	// Read the header and check if the file is valid	TiXmlDocument doc(fileName);	str_type::string content;	fileManager->GetUTF16FileString(fileName, content);	if (!doc.LoadFile(content, TIXML_ENCODING_LEGACY))	{		ETH_STREAM_DECL(ss) << GS_L("ETHScene::Open: file found, but parsing failed (") << fileName << GS_L(")");		m_provider->Log(ss.str(), Platform::FileLogger::ERROR);		return false;	}	TiXmlHandle hDoc(&doc);	TiXmlHandle hRoot(0);	TiXmlElement *pElement = hDoc.FirstChildElement().Element();	if (!pElement)	{		ETH_STREAM_DECL(ss) << GS_L("ETHScene::Open: couldn't find root element (") << fileName << GS_L(")");		m_provider->Log(ss.str(), Platform::FileLogger::ERROR);		return false;	}	return ReadFromXMLFile(pElement);}
开发者ID:skaflux,项目名称:ethanon,代码行数:36,


示例2: m_fakeEyeManager

ETHPixelLightDiffuseSpecular::ETHPixelLightDiffuseSpecular(VideoPtr video, const str_type::string& shaderPath, ETHFakeEyePositionManagerPtr fakeEyeManager)	: m_fakeEyeManager(fakeEyeManager){	m_video = video;	if (IsSupportedByHardware())	{		m_hPixelLightPS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_PS_Hor_Diff()).c_str(), GSSF_PIXEL, m_profile);		m_vPixelLightPS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_PS_Ver_Diff()).c_str(), GSSF_PIXEL, m_profile);		m_hPixelLightVS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_VS_Hor_Light()).c_str(), GSSF_VERTEX, GSSP_MODEL_2);		m_vPixelLightVS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_VS_Ver_Light()).c_str(), GSSF_VERTEX, GSSP_MODEL_2);		m_hPixelLightSpecularPS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_PS_Hor_Spec()).c_str(), GSSF_PIXEL, m_profile);		m_vPixelLightSpecularPS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::PL_PS_Ver_Spec()).c_str(), GSSF_PIXEL, m_profile);		m_defaultNM = m_video->CreateSprite(ETHGlobal::GetDataResourceFullPath(shaderPath, GS_L("default_nm.png")));	}}
开发者ID:AlternatingCt,项目名称:ethanon,代码行数:15,


示例3: AddLastSlash

gs2d::str_type::string AddLastSlash(const gs2d::str_type::string& path){	if (path.empty())	{		return GS_L("");	}	gs2d::str_type::string r = (path);	FixSlashes(r);	const std::size_t lastChar = r.size()-1;	if (r.at(lastChar) == GS_L('//'))	{		r[lastChar] = GS_L('/');		return r;	}	else if (r.at(lastChar) != GS_L('/'))	{		return r + GS_L("/");	}	else	{		return r;	}}
开发者ID:andresan87,项目名称:Torch,代码行数:24,


示例4: ETHRenderEntity

int ETHScriptWrapper::AddEntity(const str_type::string &file, const Vector3 &v3Pos, const float angle, ETHEntity **ppOutEntity,								const str_type::string &alternativeName, const float scale){	if (WarnIfRunsInMainFunction(GS_L("AddEntity")))		return -1;	const ETHEntityProperties* props = m_entityCache.Get(file, m_provider->GetResourcePath() + ETHDirectories::GetEntityPath(),														 m_provider->GetVideo()->GetFileManager());	if (!props)	{		return -1;	}	const float globalScale = m_provider->GetGlobalScaleManager()->GetScale();	ETHRenderEntity* entity = new ETHRenderEntity(m_provider, *props, angle, scale * globalScale);	entity->SetOrphanPosition(v3Pos);	entity->SetAngle(angle);	if (entity->IsStatic() && entity->IsApplyLight())	{		str_type::stringstream ss;		ss << GS_L("AddEntity - This is a static entity and its lightmap has not been rendered yet. ") << 			  GS_L("It might be incorrectly lit: ") << m_provider->GetResourcePath() << ETHDirectories::GetEntityPath() << file;		ShowMessage(ss.str(), ETH_WARNING);	}	if (ppOutEntity)	{		entity->AddRef();		*ppOutEntity = entity;	}	return m_pScene->AddEntity(entity, alternativeName);}
开发者ID:harmy,项目名称:ethanon,代码行数:36,


示例5: fixedPath

gs2d::SpritePtr ETHGraphicResourceManager::FindSprite(	const str_type::string& fullFilePath,	const str_type::string& fileName,	const str_type::string& resourceDirectory){	std::map<str_type::string, SpriteResource>::iterator iter = m_resource.find(fileName);	if (iter != m_resource.end())	{		str_type::string fixedPath(fullFilePath);		Platform::FixSlashes(fixedPath);		const SpriteResource& resource = iter->second;		if (RemoveResourceDirectory(resourceDirectory, fixedPath) != resource.m_fullOriginPath)		{			str_type::stringstream ss; ss << GS_L("Duplicate resource name found: ") << fixedPath				<< GS_L(" <-> ") << resource.m_fullOriginPath;			ETHResourceProvider::Log(ss.str(), Platform::Logger::ERROR);		}		return resource.m_sprite;	}	else	{		return SpritePtr();	}}
开发者ID:St0l3nID,项目名称:ethanon,代码行数:24,


示例6: GS_L

void ETHEntityProperties::Reset(){	ETHEntityMaterial::Reset();	entityName = GS_L("");	spriteCut = ETH_DEFAULT_SPRITE_CUT;	pivotAdjust = ETH_DEFAULT_PIVOT_ADJUST;	scale = ETH_DEFAULT_SCALE;	staticEntity = ETH_FALSE;	hideFromSceneEditor = ETH_FALSE;	type = ET_HORIZONTAL;	layerDepth = 0.0f;	successfullyLoaded = false;	soundVolume = ETH_DEFAULT_SOUND_VOLUME;	parallaxIntensity = ETH_DEFAULT_PARALLAX_INTENS;	shape = BS_NONE;}
开发者ID:ArthurCalazans,项目名称:ethanon,代码行数:16,


示例7: ReadFromXMLFile

bool ETH_COLLISION_BOX::ReadFromXMLFile(TiXmlElement *pElement){    TiXmlElement *pIter;    pIter = pElement->FirstChild(GS_L("Position"))->ToElement();    if (pIter)    {        pIter->QueryFloatAttribute(GS_L("x"), &pos.x);        pIter->QueryFloatAttribute(GS_L("y"), &pos.y);        pIter->QueryFloatAttribute(GS_L("z"), &pos.z);    }    pIter = pElement->FirstChild(GS_L("Size"))->ToElement();    if (pIter)    {        pIter->QueryFloatAttribute(GS_L("x"), &size.x);        pIter->QueryFloatAttribute(GS_L("y"), &size.y);        pIter->QueryFloatAttribute(GS_L("z"), &size.z);    }    return true;}
开发者ID:andresan87,项目名称:Torch,代码行数:19,


示例8:

///////////////////////////////////////////////////////////////// Float input///////////////////////////////////////////////////////////////GSGUI_FLOAT_INPUT::GSGUI_FLOAT_INPUT(){	//m_video = 0;	//m_input = 0;	m_size = 14.0f;	m_width = 256.0f;	m_active = false;	m_strInput.NumbersOnly(true);	m_strInput.SetString(GS_L("0.0"));	m_text.clear();	m_nMaxChars = 8;	m_min = 0.0f;	m_max = 0.0f;	m_clamp = false;	m_scrollAdd = 0.1f;	m_mouseOver = false;	m_active = false;}
开发者ID:ArthurCalazans,项目名称:ethanon,代码行数:21,


示例9: BeginAmbientPass

bool ETHShaderManager::BeginAmbientPass(const ETHSpriteEntity *pRender, const float maxHeight, const float minHeight){	m_video->SetPixelShader(ShaderPtr());	if (pRender->GetType() == ETH_VERTICAL)	{		m_verticalStaticAmbientVS->SetConstant(GS_L("spaceLength"), (maxHeight-minHeight));		m_video->SetVertexShader(m_verticalStaticAmbientVS);	}	else	{		m_video->SetVertexShader(m_defaultStaticAmbientVS);	}	m_parallaxManager.SetShaderParameters(m_video, m_video->GetVertexShader(), pRender->GetPosition(), false);	m_lastAM = m_video->GetAlphaMode();	return true;}
开发者ID:andresan87,项目名称:Torch,代码行数:18,


示例10: IsTemporary

bool ETHEntity::IsTemporary() const{	unsigned int temporary = 0, existent = 0;	for (std::size_t t=0; t<m_properties.particleSystems.size(); t++)	{		if (m_properties.particleSystems[t]->nParticles > 0)		{			if (m_properties.particleSystems[t]->repeat > 0)				temporary++;			existent++;		}	}	if (existent && temporary == existent && m_properties.spriteFile == GS_L(""))	{		return true;	}	return false;}
开发者ID:angeltown,项目名称:ethanon,代码行数:18,


示例11: GS_L

const gs2d::str_type::string ETHPolygon::GetENMLDeclaration() const{	gs2d::str_type::stringstream ss;	if (!IsValid())		ss << GS_L("/* warning: invalid polygon */ ");	for (std::size_t t = 0; t < m_vertices.size(); t++)	{		ss << GS_L("v") << t << GS_L("{")			<< GS_L("x=") << m_vertices[t].x << GS_L(";y=") << m_vertices[t].y			<< GS_L(";} ");	}	return ss.str();}
开发者ID:angeltown,项目名称:ethanon,代码行数:13,


示例12: CloseW

bool ETHBinaryStream::OpenW(const str_type::string& fileName){	CloseW();	SetFileName(fileName);	#ifdef WIN32		errno_t error = fopen_s(&m_out, GetFileName().c_str(), GS_L("wb"));	#else		int error = 0; m_out = fopen(GetFileName().c_str(), "wb");	#endif	if (!error && m_out)	{		return true;	}	else	{		m_out = 0;		return false;	}}
开发者ID:CeroOscura,项目名称:ethanon,代码行数:19,


示例13: ETH_STREAM_DECL

bool ETHScene::SaveToFile(const str_type::string& fileName){	if (m_buckets.IsEmpty())	{		ETH_STREAM_DECL(ss) << GS_L("ETHScene::Save: there are no entities to save: ") << fileName;		m_provider->Log(ss.str(), Platform::FileLogger::ERROR);		return false;	}	// Write the header to the file	TiXmlDocument doc;	TiXmlDeclaration *pDecl = new TiXmlDeclaration(GS_L("1.0"), GS_L(""), GS_L(""));	doc.LinkEndChild(pDecl);	TiXmlElement *pElement = new TiXmlElement(GS_L("Ethanon"));	doc.LinkEndChild(pElement);	TiXmlElement *pRoot = doc.RootElement();	// write the property header	m_sceneProps.WriteToXMLFile(pRoot);	// start writing entities	TiXmlElement *pEntities = new TiXmlElement(GS_L("EntitiesInScene"));	pRoot->LinkEndChild(pEntities);	// Write every entity	for (ETHBucketMap::iterator bucketIter = m_buckets.GetFirstBucket(); bucketIter != m_buckets.GetLastBucket(); ++bucketIter)	{		ETHEntityList::const_iterator iEnd = bucketIter->second.end();		for (ETHEntityList::iterator iter = bucketIter->second.begin(); iter != iEnd; ++iter)		{			(*iter)->WriteToXMLFile(pEntities);			#if defined(_DEBUG) || defined(DEBUG)			ETH_STREAM_DECL(ss) << GS_L("Entity written to file: ") << (*iter)->GetEntityName();			m_provider->Log(ss.str(), Platform::FileLogger::INFO);			#endif		}	}	doc.SaveFile(fileName);	#ifdef GS2D_STR_TYPE_ANSI	  m_provider->GetFileManager()->ConvertAnsiFileToUTF16LE(fileName);	#endif	return true;}
开发者ID:mattguest,项目名称:ethanon,代码行数:45,


示例14: m_lastAM

ETHShaderManager::ETHShaderManager(VideoPtr video, const str_type::string& shaderPath) :	m_lastAM(GSAM_PIXEL), m_fakeEyeManager(new ETHFakeEyePositionManager){	m_video = video;	m_defaultVS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::DefaultVS()).c_str(), GSSF_VERTEX, GSSP_MODEL_2);	m_particle  = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::Particle_VS()).c_str(), GSSF_VERTEX, GSSP_MODEL_2, "particle");	m_defaultStaticAmbientVS  = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::Ambient_VS_Hor()).c_str(), GSSF_VERTEX, GSSP_MODEL_2);	m_verticalStaticAmbientVS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::Ambient_VS_Ver()).c_str(), GSSF_VERTEX, GSSP_MODEL_2, "vertical");	m_shadowVS = m_video->LoadShaderFromFile(ETHGlobal::GetDataResourceFullPath(shaderPath, ETHShaders::Shadow_VS_Ver()).c_str(), GSSF_VERTEX, GSSP_MODEL_2);	// TODO/TO-DO: use a wider macro here	#ifndef ANDROID		m_projShadow = m_video->CreateSprite(ETHGlobal::GetDataResourceFullPath(shaderPath, GS_L("shadow.dds")));	#else		m_projShadow = m_video->CreateSprite(ETHGlobal::GetDataResourceFullPath(shaderPath, GS_L("shadow.png")));	#endif	{		ETHLightingProfilePtr profile(new ETHVertexLightDiffuse(m_video, shaderPath));		if (profile->IsSupportedByHardware())		{			m_lightingProfiles[VERTEX_LIGHTING_DIFFUSE] = profile;		}	}	{		ETHLightingProfilePtr profile(new ETHPixelLightDiffuseSpecular(m_video, shaderPath, m_fakeEyeManager));		if (profile->IsSupportedByHardware())		{			m_lightingProfiles[PIXEL_LIGHTING_DIFFUSE_SPECULAR] = profile;		}	}	if (m_lightingProfiles.empty())	{		video->Message(GS_L("ETHShaderManager::ETHShaderManager: no lighting profile"), GSMT_WARNING);	}	else	{		m_currentProfile = FindHighestLightingProfile();	}}
开发者ID:andresan87,项目名称:Torch,代码行数:42,


示例15: UnbindFrameBuffer

bool GLVideo::SetRenderTarget(SpritePtr pTarget, const unsigned int target){	if (!pTarget)	{		m_currentTarget.reset();		UnbindFrameBuffer();	}	else	{		if (pTarget->GetType() == Sprite::T_TARGET)		{			m_currentTarget = pTarget->GetTexture();		}		else		{			Message(GS_L("The current sprite has no render target texture"), GSMT_ERROR);		}	}	return true;}
开发者ID:St0l3nID,项目名称:ethanon,代码行数:20,


示例16: m_provider

ETHParticleManager::ETHParticleManager(	ETHResourceProviderPtr provider,	const str_type::string& file,	const Vector2& v2Pos,	const Vector3& v3Pos,	const float angle,	const float entityVolume) :	m_provider(provider){	ETHParticleSystem partSystem;	if (partSystem.ReadFromFile(file, m_provider->GetFileManager()))	{		CreateParticleSystem(partSystem, v2Pos, v3Pos, angle, entityVolume, 1.0f);	}	else	{		ETH_STREAM_DECL(ss) << GS_L("ETHParticleManager: file not found: ") << file;		m_provider->Log(ss.str(), Platform::FileLogger::ERROR);	}}
开发者ID:angeltown,项目名称:ethanon,代码行数:20,


示例17: GS_L

void ParticleEditor::SetupMenu(){	m_fileMenu.SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), GS_L("Menu"), m_menuSize*m_menuScale, m_menuWidth*2, true);	m_fileMenu.AddButton(SAVE_SYSTEM);	m_fileMenu.AddButton(SAVE_SYSTEM_AS);	m_fileMenu.AddButton(OPEN_SYSTEM);	m_fileMenu.AddButton(LOAD_BMP);	m_fileMenu.AddButton(LOAD_BG);	m_fileMenu.AddButton(_S_GOTO_PROJ);	m_alphaModes.SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth*2, true, false, false);	m_alphaModes.AddButton(ALPHA_MODE_PIXEL, true);	m_alphaModes.AddButton(ALPHA_MODE_ADD, false);	m_alphaModes.AddButton(ALPHA_MODE_MODULATE, false);	m_animationModes.SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth*2, true, false, false);	m_animationModes.AddButton(ANIMATION_MODE_ANIMATE, true);	m_animationModes.AddButton(ANIMATION_MODE_PICK, false);	SetMenuConstants();}
开发者ID:CeroOscura,项目名称:ethanon,代码行数:21,


示例18: GS2D_UNUSED_ARGUMENT

bool ETHVertexLightDiffuse::BeginLightPass(ETHSpriteEntity *pRender, Vector3 &v3LightPos, const Vector2 &v2Size,	const ETHLight* light, const float maxHeight, const float minHeight, const float lightIntensity,	const bool drawToTarget){	GS2D_UNUSED_ARGUMENT(drawToTarget);	const Vector2 &v2Origin = pRender->ComputeOrigin(v2Size);	const Vector3 &v3EntityPos = pRender->GetPosition();	m_video->SetPixelShader(ShaderPtr());	ShaderPtr pLightShader;	if (pRender->GetType() == ETH_VERTICAL)	{		m_vVertexLightVS->SetConstant(GS_L("spaceLength"), (maxHeight-minHeight));		m_vVertexLightVS->SetConstant(GS_L("topLeft3DPos"), v3EntityPos-(Vector3(v2Origin.x, 0, -v2Origin.y)));		pLightShader = m_vVertexLightVS;	}	else	{		m_hVertexLightVS->SetConstant(GS_L("topLeft3DPos"), v3EntityPos-Vector3(v2Origin, 0));		pLightShader = m_hVertexLightVS;	}	m_video->SetVertexShader(pLightShader);	m_lastAM = m_video->GetAlphaMode();	m_video->SetAlphaMode(GSAM_ADD);	// Set a depth value depending on the entity type	pRender->SetDepth(maxHeight, minHeight); 	pLightShader->SetConstant(GS_L("pivotAdjust"), pRender->GetProperties()->pivotAdjust);	pLightShader->SetConstant(GS_L("lightPos"), v3LightPos);	pLightShader->SetConstant(GS_L("lightRange"), light->range);	pLightShader->SetConstant(GS_L("lightColor"), light->color);	pLightShader->SetConstant(GS_L("lightIntensity"), lightIntensity);	return true;}
开发者ID:andresan87,项目名称:Torch,代码行数:38,


示例19:

ETHEntity *ETHScriptWrapper::SeekEntity(const int id){	if (WarnIfRunsInMainFunction(GS_L("SeekEntity")))		return 0;	ETHEntity *pEntity = m_pScene->GetBucketManager().SeekEntity(id);	if (pEntity)	{		// don't let it return temporary handles		if (pEntity->IsTemporary())		{			return 0;		}		else		{			pEntity->AddRef();			return pEntity;		}	}	return 0;}
开发者ID:AlternatingCt,项目名称:ethanon,代码行数:21,


示例20: Vector3

void ETHParticleSystem::Reset(){	alphaMode = Video::AM_PIXEL;	nParticles = 0;	lifeTime = 0.0f;	randomizeLifeTime = 0.0f;	size = 1.0f;	growth = 0.0f;	minSize = 0.0f;	maxSize = 99999.0f;	repeat = 0;	randomizeSize = 0.0f;	randAngleStart = 0.0f;	angleStart = 0.0f;	emissive = Vector3(1,1,1);	allAtOnce = false;	boundingSphere = 512.0f;	soundFXFile = GS_L("");	bitmapFile = ETH_DEFAULT_PARTICLE_BITMAP;	spriteCut = Vector2i(1,1);	animationMode = PLAY_ANIMATION;}
开发者ID:skaflux,项目名称:ethanon,代码行数:22,


示例21: switch

str_type::string SDLInput::GetLastCharInput() const{	if (SDLWindow::m_lastCharInput.length() == 1)	{		str_type::char_t c = SDLWindow::m_lastCharInput[0];		switch (c)		{		case 0x00:		case 0x01:		case 0x02:		case 0x03:		case 0x04:		case 0x05:		case 0x06:		case 0x07:		case 0x08:		case 0x0E:		case 0x0F:		case 0x10:		case 0x11:		case 0x12:		case 0x13:		case 0x14:		case 0x15:		case 0x16:		case 0x17:		case 0x18:		case 0x19:		case 0x1A:		case 0x1B:		case 0x7F:			return GS_L("");		}	}	return SDLWindow::m_lastCharInput;}
开发者ID:CeroOscura,项目名称:ethanon,代码行数:36,


示例22: GS_L

ETH_STARTUP_RESOURCES_ENML_FILE::ETH_STARTUP_RESOURCES_ENML_FILE(const str_type::string& fileName, const Platform::FileManagerPtr& fileManager){    emtprojFilename = GS_L("");    escFilename = GS_L("");    str_type::string out;    fileManager->GetAnsiFileString(fileName, out);    enml::File file(out);    if (file.getError() == enml::enmlevSUCCESS)    {        emtprojFilename = file.get(GS_L("startup"), GS_L("project"));        escFilename = file.get(GS_L("startup"), GS_L("scene"));    }    else    {#ifdef GS2D_STR_TYPE_WCHAR        std::wcerr#else        std::cerr#endif                << file.getErrorString() << std::endl;    }}
开发者ID:andresan87,项目名称:Torch,代码行数:23,


示例23: GetCurrentProjectPath

void ParticleEditor::ParticlePanel(){	std::string programPath = GetCurrentProjectPath(false);	const VideoPtr& video = m_provider->GetVideo();	const InputPtr& input = m_provider->GetInput();	GSGUI_BUTTON file_r = m_fileMenu.PlaceMenu(Vector2(0,m_menuSize*2));	if (file_r.text == LOAD_BMP)	{		char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH];		if (OpenParticleBMP(path, file))		{			ETHGlobal::CopyFileToProject(programPath, path, ETHDirectories::GetParticlesDirectory(), m_provider->GetFileManager());			m_system.bitmapFile = file;			m_provider->GetGraphicResourceManager()->ReleaseResource(m_system.bitmapFile);			m_manager = ETHParticleManagerPtr(				new ETHParticleManager(m_provider, m_system, m_v2Pos, Vector3(m_v2Pos, 0), m_systemAngle, 1.0f));		}	}	if (file_r.text == SAVE_SYSTEM)	{		if (m_untitled)			SaveAs();		else			Save();	}	if (file_r.text == SAVE_SYSTEM_AS)	{		SaveAs();	}	if (file_r.text == LOAD_BG)	{		char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH];		if (OpenParticleBMP(path, file))		{			m_backgroundSprite = video->CreateSprite(path);		}		}	if (file_r.text == OPEN_SYSTEM)	{		m_systemAngle = 0.0f;		char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH];		if (OpenSystem(path, file))		{			m_manager = ETHParticleManagerPtr(				new ETHParticleManager(m_provider, path, m_v2Pos, Vector3(m_v2Pos, 0), m_systemAngle));			m_manager->SetZPosition(0.0f);			m_manager->Kill(false);			m_system = *m_manager->GetSystem();			SetMenuConstants();			SetCurrentFile(path);			m_untitled = false;		}	}	if (file_r.text == _S_GOTO_PROJ)	{		m_projManagerRequested = true;	}	if (input->GetKeyState(GSK_K) == GSKS_HIT)		m_manager->Kill(!m_manager->Killed());		if (!m_fileMenu.IsActive())	{		Vector2 v2ScreenDim = video->GetScreenSizeF();		float menu = m_menuSize*m_menuScale+(m_menuSize*2);		// places the alpha mode menu		ShadowPrint(Vector2(v2ScreenDim.x-m_alphaModes.GetWidth(), menu), GS_L("Alpha mode:"), GS_L("Verdana14_shadow.fnt"), gs2d::constant::WHITE);		menu += m_menuSize;		m_alphaModes.PlaceMenu(Vector2(v2ScreenDim.x-m_alphaModes.GetWidth(), menu)); menu += m_alphaModes.GetNumButtons()*m_menuSize;		// sets the alpha mode according to the selected item		if (m_alphaModes.GetButtonStatus(ALPHA_MODE_PIXEL))			m_system.alphaMode = Video::AM_PIXEL;		if (m_alphaModes.GetButtonStatus(ALPHA_MODE_ADD))			m_system.alphaMode = Video::AM_ADD;		if (m_alphaModes.GetButtonStatus(ALPHA_MODE_MODULATE))			m_system.alphaMode = Video::AM_MODULATE;		// places the sprite cut fields to the right		menu += m_menuSize/2;		ShadowPrint(Vector2(v2ScreenDim.x-m_alphaModes.GetWidth(), menu), GS_L("Sprite cut:"), GS_L("Verdana14_shadow.fnt"), gs2d::constant::WHITE);		menu += m_menuSize;		m_system.spriteCut.x = Max(1, static_cast<int>(m_spriteCut[0].PlaceInput(Vector2(v2ScreenDim.x-m_alphaModes.GetWidth(),menu)))); menu += m_menuSize;		m_system.spriteCut.y = Max(1, static_cast<int>(m_spriteCut[1].PlaceInput(Vector2(v2ScreenDim.x-m_alphaModes.GetWidth(),menu)))); menu += m_menuSize;		// if there is sprite animation in the particle system, places the animation mode selector		if (m_system.spriteCut.x > 1 || m_system.spriteCut.y > 1)		{			menu += m_menuSize/2;			m_animationModes.PlaceMenu(Vector2(v2ScreenDim.x-m_animationModes.GetWidth(), menu)); menu += m_animationModes.GetNumButtons()*m_menuSize;			if (m_animationModes.GetButtonStatus(ANIMATION_MODE_ANIMATE))//.........这里部分代码省略.........
开发者ID:CeroOscura,项目名称:ethanon,代码行数:101,


示例24: alpha

void ParticleEditor::SetMenuConstants(){	m_particles.SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_particles.SetConstant(m_system.nParticles);	m_particles.SetScrollAdd(1);	m_particles.SetClamp(true, 0, 10000);	m_particles.SetText(GS_L("Ptcles:"));	m_repeats.SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_repeats.SetScrollAdd(1);	m_repeats.SetConstant(m_system.repeat);	m_repeats.SetClamp(true, 0, 9999999);	m_repeats.SetText(GS_L("Repeats:"));	m_gravity[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_gravity[0].SetConstant(m_system.gravityVector.x);	m_gravity[0].SetClamp(false, 0, 0);	m_gravity[0].SetText(GS_L("Grav X:"));	m_gravity[0].SetDescription(GS_L("Gravity vector"));	m_gravity[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_gravity[1].SetConstant(m_system.gravityVector.y);	m_gravity[1].SetClamp(false, 0, 0);	m_gravity[1].SetText(GS_L("Grav Y:"));	m_gravity[1].SetDescription(GS_L("Gravity vector"));	m_direction[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_direction[0].SetConstant(m_system.directionVector.x);	m_direction[0].SetClamp(false, 0, 0);	m_direction[0].SetText(GS_L("Dir X:"));	m_direction[0].SetDescription(GS_L("Particle direction"));	m_direction[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_direction[1].SetConstant(m_system.directionVector.y);	m_direction[1].SetClamp(false, 0, 0);	m_direction[1].SetText(GS_L("Dir Y:"));	m_direction[1].SetDescription(GS_L("Particle direction"));	m_randDir[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_randDir[0].SetConstant(m_system.randomizeDir.x);	m_randDir[0].SetClamp(false, 0, 0);	m_randDir[0].SetText(GS_L("R Dir X:"));	m_randDir[0].SetDescription(GS_L("Particle direction randomizer"));	m_randDir[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_randDir[1].SetConstant(m_system.randomizeDir.y);	m_randDir[1].SetClamp(false, 0, 0);	m_randDir[1].SetText(GS_L("R Dir Y:"));	m_randDir[1].SetDescription(GS_L("Particle direction randomizer"));	m_startPoint[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_startPoint[0].SetConstant(m_system.startPoint.x);	m_startPoint[0].SetClamp(false, 0, 0);	m_startPoint[0].SetText(GS_L("Start X:"));	m_startPoint[0].SetScrollAdd(1.0f);	m_startPoint[0].SetDescription(GS_L("Particle starting position"));	m_startPoint[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_startPoint[1].SetConstant(m_system.startPoint.y);	m_startPoint[1].SetClamp(false, 0, 0);	m_startPoint[1].SetText(GS_L("Start Y:"));	m_startPoint[1].SetScrollAdd(1.0f);	m_startPoint[1].SetDescription(GS_L("Particle starting position"));	m_randStart[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_randStart[0].SetConstant(m_system.randStartPoint.x);	m_randStart[0].SetClamp(false, 0, 0);	m_randStart[0].SetText(GS_L("R StartX:"));	m_randStart[0].SetScrollAdd(1.0f);	m_randStart[0].SetDescription(GS_L("Starting position randomizer"));	m_randStart[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_randStart[1].SetConstant(m_system.randStartPoint.y);	m_randStart[1].SetClamp(false, 0, 0);	m_randStart[1].SetText(GS_L("R StartY:"));	m_randStart[1].SetScrollAdd(1.0f);	m_randStart[1].SetDescription(GS_L("Starting position randomizer"));	m_color0[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_color0[0].SetConstant(m_system.color0.w);	m_color0[0].SetClamp(true, 0, 1);	m_color0[0].SetText(GS_L("Color0.A:"));	m_color0[0].SetDescription(GS_L("Starting color alpha (transparency from 0.0 to 1.0)"));	m_color0[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_color0[1].SetConstant(m_system.color0.x);	m_color0[1].SetClamp(true, 0, 8);	m_color0[1].SetText(GS_L("Color0.R:"));	m_color0[1].SetDescription(GS_L("Starting color red component (from 0.0 to 1.0)"));	m_color0[2].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_color0[2].SetConstant(m_system.color0.y);	m_color0[2].SetClamp(true, 0, 8);	m_color0[2].SetText(GS_L("Color0.G:"));	m_color0[2].SetDescription(GS_L("Starting color green component (from 0.0 to 1.0)"));	m_color0[3].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_color0[3].SetConstant(m_system.color0.z);	m_color0[3].SetClamp(true, 0, 8);	m_color0[3].SetText(GS_L("Color0.B:"));	m_color0[3].SetDescription(GS_L("Starting color blue component (from 0.0 to 1.0)"));	m_color1[0].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);	m_color1[0].SetConstant(m_system.color1.w);	m_color1[0].SetClamp(true, 0, 1);	m_color1[0].SetText(GS_L("Color1.A:"));	m_color1[0].SetDescription(GS_L("Ending color alpha (transparency)"));	m_color1[1].SetupMenu(m_provider->GetVideo(), m_provider->GetInput(), m_menuSize, m_menuWidth, 9, false);//.........这里部分代码省略.........
开发者ID:CeroOscura,项目名称:ethanon,代码行数:101,


示例25: ETH_STREAM_DECL

ETHLightmapGen::ETHLightmapGen(ETHRenderEntity* entity,			   boost::shared_ptr<ETHShaderManager> shaderManager, std::list<ETHLight>::iterator iBegin, std::list<ETHLight>::iterator iEnd,			   ETHBucketManager& buckets, const Vector3& oldPos, const Vector3& newPos, const float minHeight, const float maxHeight,			   const ETHSceneProperties &sceneProps){	const SpritePtr& sprite = entity->m_pSprite;	const ETHEntityProperties& props = entity->m_properties;	if (!sprite || !props.staticEntity || !props.applyLight)	{		return;	}	const VideoPtr& video = entity->m_provider->GetVideo();	const Platform::FileLogger* logger = entity->m_provider->GetLogger();	if (video->Rendering())	{		ETH_STREAM_DECL(ss) << GS_L("Entity ID #") << entity->GetID() << GS_L(": lightmaps can't be generated during application render.");		logger->Log(ss.str(), Platform::FileLogger::ERROR);		return;	}	const Vector2 v2Size = (sprite->GetNumRects() <= 1) ? sprite->GetBitmapSizeF() : sprite->GetRect().size;	if (!(entity->m_pLightmap = video->CreateRenderTarget(static_cast<unsigned int>(v2Size.x), static_cast<unsigned int>(v2Size.y))))	{		ETH_STREAM_DECL(ss) << GS_L("ETHRenderEntity::GenerateLightmap: coudn't create the render target.");		logger->Log(ss.str(), Platform::FileLogger::ERROR);		entity->m_pLightmap.reset();		return;	}	// Paint it black	video->SetRenderTarget(entity->m_pLightmap);	if (!video->BeginTargetScene(GS_BLACK))	{		ETH_STREAM_DECL(ss) << GS_L("ETHRenderEntity::GenerateLightmap: coudn't render to target.");		logger->Log(ss.str(), Platform::FileLogger::ERROR);		entity->m_pLightmap.reset();		return;	}	video->EndTargetScene();	entity->m_controller->SetPos(newPos);	Vector2 v2CamPos = video->GetCameraPos();	video->SetCameraPos(Vector2(0,0));	for (std::list<ETHLight>::iterator iter = iBegin; iter != iEnd; iter++)	{		if (!iter->staticLight)			continue;		SpritePtr tempTarget;		if (!(tempTarget = video->CreateRenderTarget(static_cast<unsigned int>(v2Size.x), static_cast<unsigned int>(v2Size.y))))		{			ETH_STREAM_DECL(ss) << GS_L("ETHRenderEntity::GenerateLightmap: coudn't create temporary render target.");			logger->Log(ss.str(), Platform::FileLogger::ERROR);			entity->m_pLightmap.reset();			return;		}		if (!video->SetRenderTarget(tempTarget))		{			ETH_STREAM_DECL(ss) << GS_L("ETHRenderEntity::GenerateLightmap: coudn't set render target.");			logger->Log(ss.str(), Platform::FileLogger::ERROR);			entity->m_pLightmap.reset();			return;		}		if (!video->BeginTargetScene(GS_BLACK))		{			ETH_STREAM_DECL(ss) << GS_L("ETHRenderEntity::GenerateLightmap: coudn't render to temporary target.");			logger->Log(ss.str(), Platform::FileLogger::ERROR);			entity->m_pLightmap.reset();			return;		}		// draw light		if (shaderManager->BeginLightPass(entity, &(*iter), video->GetScreenSizeF().y, 0.0f, sceneProps.lightIntensity, 0, true))		{			entity->DrawLightPass(sceneProps.zAxisDirection, true);			shaderManager->EndLightPass();		}		// draw shadows		if (entity->GetType() != ETH_VERTICAL)		{			for (ETHBucketMap::iterator bucketIter = buckets.GetFirstBucket(); bucketIter != buckets.GetLastBucket(); bucketIter++)			{				for (ETHEntityList::iterator entityIter = bucketIter->second.begin();					entityIter != bucketIter->second.end(); entityIter++)				{					if (!(*entityIter)->IsStatic())						continue;					Vector3 oldPos2 = (*entityIter)->GetPosition();					Vector3 newPos2 = oldPos2-(oldPos-newPos);					(*entityIter)->SetOrphanPosition(newPos2);					if (shaderManager->BeginShadowPass((*entityIter), &(*iter), maxHeight, minHeight))					{						(*entityIter)->DrawShadow(maxHeight, minHeight, sceneProps, *iter, 0, true, true, entity->GetAngle(), entity->GetPosition());						shaderManager->EndShadowPass();//.........这里部分代码省略.........
开发者ID:andresan87,项目名称:Torch,代码行数:101,


示例26: TiXmlElement

bool ETHCustomDataManager::WriteDataToFile(TiXmlElement *pHeadRoot) const{	TiXmlElement *pCustomData = new TiXmlElement(GS_L("CustomData"));	pHeadRoot->LinkEndChild(pCustomData);	for (std::map<str_type::string, ETHCustomDataPtr>::const_iterator iter = m_data.begin();		iter != m_data.end(); iter++)	{		TiXmlElement *pVariableRoot = new TiXmlElement(GS_L("Variable"));		pCustomData->LinkEndChild(pVariableRoot); 		TiXmlElement *pElement;		pElement = new TiXmlElement(GS_L("Type"));		pElement->LinkEndChild(new TiXmlText(DATA_NAME[iter->second->GetType()] ));		pVariableRoot->LinkEndChild(pElement);		pElement = new TiXmlElement(GS_L("Name"));		pElement->LinkEndChild(new TiXmlText(iter->first));		pVariableRoot->LinkEndChild(pElement);		pElement = new TiXmlElement(GS_L("Value"));		str_type::stringstream ss;		switch (iter->second->GetType())		{		case ETHDT_FLOAT:			ss << iter->second->GetFloat();			break;		case ETHDT_INT:			ss << iter->second->GetInt();			break;		case ETHDT_UINT:			ss << iter->second->GetUInt();			break;		case ETHDT_STRING:			ss << iter->second->GetString();			break;		};		switch (iter->second->GetType())		{		case ETHDT_FLOAT:		case ETHDT_INT:		case ETHDT_UINT:		case ETHDT_STRING:			pElement->LinkEndChild(new TiXmlText(ss.str()));			break;		case ETHDT_VECTOR2:			pElement->SetDoubleAttribute(GS_L("x"), iter->second->GetVector2().x);			pElement->SetDoubleAttribute(GS_L("y"), iter->second->GetVector2().y);			break;		case ETHDT_VECTOR3:			pElement->SetDoubleAttribute(GS_L("x"), iter->second->GetVector3().x);			pElement->SetDoubleAttribute(GS_L("y"), iter->second->GetVector3().y);			pElement->SetDoubleAttribute(GS_L("z"), iter->second->GetVector3().z);			break;		};		pVariableRoot->LinkEndChild(pElement);	}	return true;}
开发者ID:andresan87,项目名称:Torch,代码行数:61,


示例27: value

bool ETHCustomDataManager::ReadDataFromXMLFile(TiXmlElement *pRoot){	TiXmlNode *pNode = pRoot->FirstChild(GS_L("CustomData"));	if (pNode)	{		TiXmlElement *pEntities = pNode->ToElement();		if (pEntities)		{			pNode = pEntities->FirstChild(GS_L("Variable"));			if (pNode)			{				TiXmlElement *pVarIter = pNode->ToElement();				if (pVarIter)				{					do					{						str_type::string type, name, value;						TiXmlElement *pElement;						// read the variable type (as a string)						pNode = pVarIter->FirstChild(GS_L("Type"));						if (pNode)						{							pElement = pNode->ToElement();							if (pElement)							{								type = pElement->GetText();							}						}						// read the variable name						pNode = pVarIter->FirstChild(GS_L("Name"));						if (pNode)						{							pElement = pNode->ToElement();							if (pElement)							{								name = pElement->GetText();							}						}						// read the variable value						if (type != GS_L("") && name != GS_L(""))						{							pNode = pVarIter->FirstChild(GS_L("Value"));							if (pNode)							{								pElement = pNode->ToElement();								if (pElement)								{									if (type == DATA_NAME[ETHDT_VECTOR2])									{										Vector2 value(0,0);										pElement->QueryFloatAttribute(GS_L("x"), &value.x);										pElement->QueryFloatAttribute(GS_L("y"), &value.y);										SetVector2(name, value);									}									else if (type == DATA_NAME[ETHDT_VECTOR3])									{										Vector3 value(0,0,0);										pElement->QueryFloatAttribute(GS_L("x"), &value.x);										pElement->QueryFloatAttribute(GS_L("y"), &value.y);										pElement->QueryFloatAttribute(GS_L("z"), &value.z);										SetVector3(name, value);									}									else									{										value = pElement->GetText();										// passing the variable to the map										if (type == DATA_NAME[ETHDT_FLOAT])										{											SetFloat(name, ETHGlobal::ParseFloat(value.c_str()));										} else										if (type == DATA_NAME[ETHDT_INT])										{											SetInt(name, ETHGlobal::ParseInt(value.c_str()));										} else										if (type == DATA_NAME[ETHDT_UINT])										{											SetUInt(name, ETHGlobal::ParseUInt(value.c_str()));										} else										if (type == DATA_NAME[ETHDT_STRING])										{											SetString(name, value);										}									}								}							}						}						pVarIter = pVarIter->NextSiblingElement();					} while (pVarIter);				}			}		}	}	return true;}
开发者ID:andresan87,项目名称:Torch,代码行数:99,


示例28: SetFloat

    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public    License along with Ethanon Engine. If not, see    <http://www.gnu.org/licenses/>.-----------------------------------------------------------------------*/#include "ETHCustomDataManager.h"#include <iostream>const str_type::string ETHCustomDataManager::DATA_NAME[ETH_CUSTOM_DATA_TYPE_COUNT] ={	(GS_L("")),	(GS_L("float")),	(GS_L("int")),	(GS_L("uint")),	(GS_L("string")),	(GS_L("vector2")),	(GS_L("vector3"))};const str_type::string &ETHCustomDataManager::GetDataName(const unsigned int n){	assert(n<ETH_CUSTOM_DATA_TYPE_COUNT);	return DATA_NAME[n];}void ETHCustomDataManager::SetFloat(const str_type::string &name, const float &value)
开发者ID:andresan87,项目名称:Torch,代码行数:31,


示例29: GS_L

str_type::string ETHEntity::GetString(const str_type::string &name) const{	str_type::string sOut = GS_L("");	m_properties.GetString(name, sOut);	return sOut;}
开发者ID:angeltown,项目名称:ethanon,代码行数:6,



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


C++ GS_MatchState函数代码示例
C++ GS_ASSERT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。