本文整理汇总了C++中GS_L函数的典型用法代码示例。如果您正苦于以下问题:C++ GS_L函数的具体用法?C++ GS_L怎么用?C++ GS_L使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GS_L函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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")));
}
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
}
示例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;
}
示例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();
}
}
示例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;
}