Revision | 3e1bda965d9b4ce972dcb4cf1a8449619cf8c0ed (tree) |
---|---|
Time | 2017-01-31 02:07:31 |
Author | Raffaele Bratta <r.bratta@vaev...> |
Commiter | Raffaele Bratta |
Add human-readable name to workspace definitions.
@@ -194,7 +194,7 @@ | ||
194 | 194 | Setting workspace def's connections must be done *after* all node |
195 | 195 | definitions have been created |
196 | 196 | */ |
197 | - CompositorWorkspaceDef* addWorkspaceDefinition( IdString name ); | |
197 | + CompositorWorkspaceDef* addWorkspaceDefinition( const String& name ); | |
198 | 198 | |
199 | 199 | /// Returns how many times _update has been called. |
200 | 200 | size_t getFrameCount(void) const { return mFrameCount; } |
@@ -371,7 +371,7 @@ | ||
371 | 371 | Name of the shadow node. Leave blank if no shadows. |
372 | 372 | Caller is supposed to have set the shadow node correctly |
373 | 373 | */ |
374 | - void createBasicWorkspaceDef( const IdString &workspaceDefName, | |
374 | + void createBasicWorkspaceDef( const String &workspaceDefName, | |
375 | 375 | const ColourValue &backgroundColour, |
376 | 376 | IdString shadowNodeName=IdString() ); |
377 | 377 |
@@ -72,6 +72,7 @@ | ||
72 | 72 | protected: |
73 | 73 | |
74 | 74 | IdString mName; |
75 | + String mNameStr; | |
75 | 76 | NodeAliasMap mAliasedNodes; |
76 | 77 | ChannelRouteList mChannelRoutes; |
77 | 78 | ChannelRouteList mBufferChannelRoutes; |
@@ -122,10 +123,11 @@ | ||
122 | 123 | uint32 outChannel ) const; |
123 | 124 | |
124 | 125 | public: |
125 | - CompositorWorkspaceDef( IdString name, CompositorManager2 *compositorManager ); | |
126 | + CompositorWorkspaceDef( const String& name, CompositorManager2 *compositorManager ); | |
126 | 127 | virtual ~CompositorWorkspaceDef() {} |
127 | 128 | |
128 | 129 | IdString getName(void) const { return mName; } |
130 | + String getNameStr(void) const { return mNameStr; } | |
129 | 131 | |
130 | 132 | /** Connects outNode's output channel to inNode's input channel. |
131 | 133 | @remarks |
@@ -311,7 +311,7 @@ | ||
311 | 311 | return retVal; |
312 | 312 | } |
313 | 313 | //----------------------------------------------------------------------------------- |
314 | - CompositorWorkspaceDef* CompositorManager2::addWorkspaceDefinition( IdString name ) | |
314 | + CompositorWorkspaceDef* CompositorManager2::addWorkspaceDefinition( const String& name ) | |
315 | 315 | { |
316 | 316 | CompositorWorkspaceDef *retVal = 0; |
317 | 317 |
@@ -323,7 +323,7 @@ | ||
323 | 323 | else |
324 | 324 | { |
325 | 325 | OGRE_EXCEPT( Exception::ERR_DUPLICATE_ITEM, "A workspace with name '" + |
326 | - name.getFriendlyText() + "' already exists", | |
326 | + name + "' already exists", | |
327 | 327 | "CompositorManager2::addWorkspaceDefinition" ); |
328 | 328 | } |
329 | 329 |
@@ -655,12 +655,12 @@ | ||
655 | 655 | mRenderSystem->_endFrameOnce(); |
656 | 656 | } |
657 | 657 | //----------------------------------------------------------------------------------- |
658 | - void CompositorManager2::createBasicWorkspaceDef( const IdString &workspaceDefName, | |
658 | + void CompositorManager2::createBasicWorkspaceDef( const String &workspaceDefName, | |
659 | 659 | const ColourValue &backgroundColour, |
660 | 660 | IdString shadowNodeName ) |
661 | 661 | { |
662 | - CompositorNodeDef *nodeDef = this->addNodeDefinition( "AutoGen " + (workspaceDefName + | |
663 | - IdString("/Node")).getReleaseText() ); | |
662 | + CompositorNodeDef *nodeDef = this->addNodeDefinition( "AutoGen " + IdString(workspaceDefName + | |
663 | + "/Node").getReleaseText() ); | |
664 | 664 | |
665 | 665 | //Input texture |
666 | 666 | nodeDef->addTextureSourceName( "WindowRT", 0, TextureDefinitionBase::TEXTURE_INPUT ); |
@@ -36,10 +36,11 @@ | ||
36 | 36 | |
37 | 37 | namespace Ogre |
38 | 38 | { |
39 | - CompositorWorkspaceDef::CompositorWorkspaceDef( IdString name, | |
39 | + CompositorWorkspaceDef::CompositorWorkspaceDef( const String& name, | |
40 | 40 | CompositorManager2 *compositorManager ) : |
41 | 41 | TextureDefinitionBase( TEXTURE_GLOBAL ), |
42 | 42 | mName( name ), |
43 | + mNameStr( name ), | |
43 | 44 | mCompositorManager( compositorManager ) |
44 | 45 | { |
45 | 46 | } |
@@ -542,7 +542,7 @@ | ||
542 | 542 | { |
543 | 543 | Ogre::CompositorManager2 *compositorManager = mRoot->getCompositorManager2(); |
544 | 544 | |
545 | - const Ogre::IdString workspaceName( "Demo Workspace" ); | |
545 | + const Ogre::String workspaceName( "Demo Workspace" ); | |
546 | 546 | if( !compositorManager->hasWorkspaceDefinition( workspaceName ) ) |
547 | 547 | { |
548 | 548 | compositorManager->createBasicWorkspaceDef( workspaceName, mBackgroundColour, |
@@ -83,7 +83,7 @@ | ||
83 | 83 | cubemapExternalChannels[0].target = mDynamicCubemap->getBuffer(0)->getRenderTarget(); |
84 | 84 | cubemapExternalChannels[0].textures.push_back( mDynamicCubemap ); |
85 | 85 | |
86 | - const Ogre::IdString workspaceName( "Tutorial_DynamicCubemap_cubemap" ); | |
86 | + const Ogre::String workspaceName( "Tutorial_DynamicCubemap_cubemap" ); | |
87 | 87 | if( !compositorManager->hasWorkspaceDefinition( workspaceName ) ) |
88 | 88 | { |
89 | 89 | CompositorWorkspaceDef *workspaceDef = compositorManager->addWorkspaceDefinition( |