本文整理汇总了C++中NamedProperties类的典型用法代码示例。如果您正苦于以下问题:C++ NamedProperties类的具体用法?C++ NamedProperties怎么用?C++ NamedProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NamedProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FireEventForEachFileFound
///---------------------------------------------------------------------------------
///
///---------------------------------------------------------------------------------
void FireEventForEachFileFound( const std::string& eventToFire, const std::string& directory, const std::string& searchPattern, bool recurseSubfolders )
{
Strings files;
EnumerateFiles( directory, searchPattern, files, recurseSubfolders );
for (std::string& file : files)
{
std::string fileWithoutPath = ExtractFileNameFromPath( file );
std::string fileName = RemoveFileExtension( fileWithoutPath );
Strings fileNameTokens;
Tokenize( fileWithoutPath, fileNameTokens, "." );
std::string fileExtension = "." + fileNameTokens[1];
std::string relativePath = ConvertBackSlashesToForwardSlashes( file );
char fullPath[_MAX_PATH];
_fullpath( fullPath, relativePath.c_str(), _MAX_PATH );
std::string fullFilePath = ConvertBackSlashesToForwardSlashes( std::string( fullPath ) );
ConsolePrintf( "File without path: %s\n File Name: %s\n File Extension: %s\n File Relative: %s\n File Absolute: %s\n", fileWithoutPath.c_str(), fileName.c_str(), fileExtension.c_str(), relativePath.c_str(), fullFilePath.c_str() );
NamedProperties props;
props.Set( "FileName", fileWithoutPath );
props.Set( "FileExtension", fileExtension );
props.Set( "FileNameWithoutExtension", fileName );
props.Set( "FileRelativePath", relativePath );
props.Set( "FileAbsolutePath", fullFilePath );
FireEvent( eventToFire, props );
}
}
示例2: ReportXMLDocumentUsage
///-----------------------------------------------------------------------
///
///-----------------------------------------------------------------------
void ReportXMLDocumentUsage( XMLNode& xmlDocumentToReport, const ResourceStream& resourceStream, bool reportUsed )
{
UNUSED( reportUsed );
std::vector< XMLNode > unusedElements ;
GetUnusedElements( xmlDocumentToReport, unusedElements );
if ( !unusedElements.empty() )
{
std::string warningMessage = Stringf( "Unused elements in file: %s\n", resourceStream.GetJazzPath().c_str() );
for ( std::vector< XMLNode >::iterator xmlNodeIter = unusedElements.begin(); xmlNodeIter != unusedElements.end(); ++xmlNodeIter )
{
XMLNode& unusedNode = (*xmlNodeIter);
int stringSize = 0 ;
char* nodeString = unusedNode.createXMLString( 1, &stringSize );
if ( nodeString )
{
if ( stringSize > 2048 )
{
nodeString[ 2040 ] = '.' ;
nodeString[ 2041 ] = '.' ;
nodeString[ 2042 ] = '.' ;
nodeString[ 2043 ] = 0 ;
}
delete nodeString ;
}
}
NamedProperties warningProperties ;
warningProperties.Set( "Warning", warningMessage );
// FireEvent( "SystemWarningEvent", warningProperties );
}
}
示例3: GetCurrentStateProperties
void BaseWidget::Update(double deltaSeconds) {
//consider, not updating at all if hidden
WidgetStateProperties& currentStateProperties = GetCurrentStateProperties();
//calls this widget's update event
std::string updateEventNameStr = "";
currentStateProperties.GetProperty("updateEvent", updateEventNameStr);
if (updateEventNameStr != "") {
NamedProperties updateEventParams;
updateEventParams.Set("widgetInstance", this);
updateEventParams.Set("deltaSeconds", deltaSeconds);
EventSystem::GetInstance().FireEvent(updateEventNameStr, updateEventParams);
}
ProcessInput(deltaSeconds);
currentStateProperties.Update(deltaSeconds);
//optimize: only update if it is rendering, or if it is dirty
if (!m_isHidden) {
UpdateRenderComponent(deltaSeconds);
SetUICollider2DComponent();
}
}
示例4: generateVertices
void Font::renderText( const std::string& text, const mat4f& transformation, float fontHeight, const Color4f& color, const vec2f& relPos, bool drawWithShadow, bool fixedWidth )
{
Mesh* sMesh = nullptr;
if( drawWithShadow )
{
sMesh = generateVertices( text, vec3f( -1.0f, -1.0f, -0.001f ), fontHeight, vec3f( 1.0f, 0.0f, 0.0f ),
vec3f( 0.0f, 1.0f, 0.0f ), color::FADEDBLACK, relPos, fixedWidth );
}
Mesh* mesh = generateVertices( text, vec3f(), fontHeight, vec3f( 1.0f, 0.0f, 0.0f ),
vec3f( 0.0f, 1.0f, 0.0f ), color, relPos, fixedWidth );
Material* material = Material::getMaterial( mesh->getMaterial( 0 ) );
material->updateUniform( "uFontHeight", fontHeight );
//matStackf modelStack;
//modelStack.translate( pos );
NamedProperties params;
params.set( "modelMatrix", transformation );
params.set( "sMesh", sMesh );
if( sMesh )
fireEvent( "renderMesh", params );
params.set( "mesh", mesh );
fireEvent( "renderMesh", params );
SAFE_DELETE( sMesh );
SAFE_DELETE( mesh );
}
示例5: setRotation
//-------------------------------------------------------------------
void Object::setRotation( const mat3f& rot, int frame )
{
Node::setRotation( rot, frame );
NamedProperties params;
params.set( "orientation", rot );
params.set( "name", m_occlusionGeometryName );
fireEvent( "setOrientationOfASGeometry", params );
}
示例6: setScale
//-------------------------------------------------------------------
void Object::setScale( const vec3f& scale, int frame )
{
Node::setScale( scale, frame );
NamedProperties params;
params.set( "scale", scale );
params.set( "name", m_occlusionGeometryName );
fireEvent( "setScaleOfASGeometry", params );
}
示例7: setPosition
//-------------------------------------------------------------------
void Object::setPosition( const vec3f& pos, int frame )
{
Node::setPosition( pos, frame );
NamedProperties params;
params.set( "pos", pos );
params.set( "name", m_occlusionGeometryName );
fireEvent( "setPosOfASGeometry", params );
}
示例8: NamedProperties
void ReverseBufferJob::callback()
{
std::string eventName = "HashBufferJob Complete";
NamedProperties data = NamedProperties();
NamedProperties::NamedHelper<char*> bufferData;
bufferData.val = &m_destinationBuffer;
data.addProperty(eventName, &bufferData);
fireEventGlobal(eventName);
}
示例9: getWorldTransformation
//-------------------------------------------------------------------
void Object::render()
{
matStackf modelStack;
modelStack.applyMatrix( getWorldTransformation() );
NamedProperties params;
params.set( "modelMatrix", modelStack.top() );
params.set( "mesh", m_mesh );
fireEvent( "renderMesh", params );
}
示例10: NamedProperties
void HashBufferJob::callback()
{
std::string eventName = "HashBufferJob Complete";
NamedProperties data = NamedProperties();
NamedProperties::NamedHelper<int> bufferData;
bufferData.val = &m_hash;
data.addProperty(eventName, &bufferData);
fireEventGlobal(eventName);
}
示例11: Render
void Button::Render()
{
NamedProperties params;
matStackf modelStack;
modelStack.loadIdentity();
modelStack.translate( m_boundingBox.getCenter() );
params.set( "modelMatrix", modelStack.top() );
params.set( "mesh", m_mesh );
fireEvent( "renderMesh", params );
//consolePrintf( "Button box: %s", m_boundingBox.toString().c_str() );
}
示例12: fireBullet
//----------------------------------------------------------------------
void Spaceship::fireBullet()
{
if( m_weaponTimer->isTimeUp() )
{
NamedProperties params;
params.set( "pos", getPosition() );
params.set( "rotation", m_rotation );
params.set( "teamNumber", m_teamNumber );
fireEvent( "SpawnBullet", params );
m_weaponTimer->start();
}
}
示例13: renderOrders
//----------------------------------------------------------------
void Entity::renderOrders()
{
vec2f currentPos = m_position;
for( size_t i = 0; i < m_orders.size(); ++i )
{
Mesh* line = MeshFactory::generateLine( currentPos, m_orders[i]->getTargetLocation() );
NamedProperties params;
params.set( "mesh", line );
fireEvent( "renderMesh", params );
currentPos = m_orders[i]->getTargetLocation();
SAFE_DELETE( line );
}
}
示例14: GroupWidget
UISystem::UISystem()
{
//Read all styles and widgets
s_rootWidget = new GroupWidget();
std::vector<std::string> out_styles;
FindAllFilesOfType("Data/Styles/", "*", out_styles);
for (auto it = out_styles.begin(); it != out_styles.end(); ++it) {
std::string filePath = *it;
ReadStyleFile(filePath);
}
std::vector<std::string> out_widgets;
FindAllFilesOfType("Data/Widgets/", "*", out_widgets);
for (auto it = out_widgets.begin(); it != out_widgets.end(); ++it) {
std::string filePath = *it;
ReadWidgetFile(filePath);
}
WidgetStyle wid;
NamedProperties defaultProps;
NamedProperties allProps;
KeyFrameAnimation<RGBA> animColor;
animColor.AddAnimationFrameAtParameter(RGBA(50, 255, 50, 255), 0.f);
//defaultProps.Set("color", animColor);
KeyFrameAnimation<Vec2> offsetAnim;
offsetAnim.AddAnimationFrameAtParameter(Vec2(100.f, 500.f), 0.f);
allProps.Set("offset", offsetAnim);
KeyFrameAnimation<RGBA> animColor2;
animColor2.AddAnimationFrameAtParameter(RGBA(255, 0, 0, 255), 0.f);
allProps.Set("color", animColor2);
wid.AddProperty(UI_STATE_DEFAULT, defaultProps);
wid.AddGeneralProperty(allProps);
WidgetBase* widget = AddStyledWidgetExplicitly("Button", "Default", wid, s_rootWidget);
std::string name;
widget->GetPropertyForCurrentState("name", name);
//ToggleWidgetVisibility(name);
ToggleWidgetEnabled(name);
}
示例15: Render
void MSMap::Render()
{
NamedProperties params;
matStackf matStack;
params.set( "mesh", m_platformMesh );
for( int i = 0; i < m_platformRenderLocations.size(); ++i )
{
matStack.loadIdentity();
m_platformRenderLocations[i].y = m_mapYPos;
matStack.translate( m_platformRenderLocations[i] );
params.set( "modelMatrix", matStack.top() );
fireEvent( "renderMesh", params );
}
}