////////////////////////////////////////////////////////////////////////// // drawPrimitives void RsContextNull::drawPrimitives( RsTopologyType PrimitiveType, BcU32 IndexOffset, BcU32 NoofIndices ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( PrimitiveType ); BcUnusedVar( IndexOffset ); BcUnusedVar( NoofIndices ); }
////////////////////////////////////////////////////////////////////////// // updateTexture bool RsContextNull::updateTexture( class RsTexture* Texture, const struct RsTextureSlice& Slice, RsResourceUpdateFlags Flags, RsTextureUpdateFunc UpdateFunc ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Texture ); BcUnusedVar( Slice ); BcUnusedVar( Flags ); BcUnusedVar( UpdateFunc ); const auto& TextureDesc = Texture->getDesc(); std::unique_ptr< BcU8[] > TempBuffer; BcU32 Width = BcMax( 1, TextureDesc.Width_ >> Slice.Level_ ); BcU32 Height = BcMax( 1, TextureDesc.Height_ >> Slice.Level_ ); BcU32 Depth = BcMax( 1, TextureDesc.Depth_ >> Slice.Level_ ); BcU32 DataSize = RsTextureFormatSize( TextureDesc.Format_, Width, Height, Depth, 1 ); TempBuffer.reset( new BcU8[ DataSize ] ); RsTextureLock Lock = { TempBuffer.get(), TextureDesc.Width_, TextureDesc.Width_ * TextureDesc.Height_ }; UpdateFunc( Texture, Lock ); return true; }
////////////////////////////////////////////////////////////////////////// // setUniformBuffer void RsContextNull::setUniformBuffer( BcU32 Handle, class RsBuffer* UniformBuffer ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Handle ); BcUnusedVar( UniformBuffer ); }
////////////////////////////////////////////////////////////////////////// // import //virtual BcBool CsResource::import( class CsPackageImporter& Importer, const Json::Value& Object ) { BcUnusedVar( Importer ); BcUnusedVar( Object ); // TODO: Generic property save out? return BcTrue; }
////////////////////////////////////////////////////////////////////////// // setVertexBuffer void RsContextNull::setVertexBuffer( BcU32 StreamIdx, class RsBuffer* VertexBuffer, BcU32 Stride ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( StreamIdx ); BcUnusedVar( VertexBuffer ); BcUnusedVar( Stride ); }
////////////////////////////////////////////////////////////////////////// // clear void RsContextNull::clear( const RsColour& Colour, BcBool EnableClearColour, BcBool EnableClearDepth, BcBool EnableClearStencil ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Colour ); BcUnusedVar( EnableClearColour ); BcUnusedVar( EnableClearDepth ); BcUnusedVar( EnableClearStencil ); }
////////////////////////////////////////////////////////////////////////// // destroySamplerState bool RsContextNull::destroySamplerState( RsSamplerState* SamplerState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( SamplerState ); return true; }
////////////////////////////////////////////////////////////////////////// // createRenderState bool RsContextNull::createRenderState( RsRenderState* RenderState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( RenderState ); return true; }
////////////////////////////////////////////////////////////////////////// // destroyBuffer bool RsContextNull::destroyBuffer( class RsBuffer* Buffer ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Buffer ); return true; }
////////////////////////////////////////////////////////////////////////// // destroyTexture bool RsContextNull::destroyTexture( class RsTexture* Texture ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Texture ); return true; }
////////////////////////////////////////////////////////////////////////// // processLoadedResource void CsCore::processLoadedResource() { BcScopedLock< BcMutex > Lock( ContainerLock_ ); static BcBool DumpResources = BcFalse; if( DumpResources ) { BcPrintf( "==========================================\n" ); BcPrintf( "CsCore: Dump Resource:\n" ); BcPrintf( "==========================================\n" ); } TResourceListIterator It( LoadedResources_.begin() ); while( It != LoadedResources_.end() ) { CsResource* pResource = (*It); BcUnusedVar( pResource ); // NOTE: Placeholder for doing stuff. Probably don't need to other // than for debug purposes. if( DumpResources ) { BcPrintf( "%s (%s)\n", (*pResource->getName()).c_str(), (*pResource->getType()).c_str() ); } ++It; } if( DumpResources ) { BcPrintf( "==========================================\n" ); DumpResources = BcFalse; } }
void ScnModel::StaticRegisterClass() { { ReField* Fields[] = { new ReField( "pHeader_", &ScnModel::pHeader_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pNodeTransformData_", &ScnModel::pNodeTransformData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pNodePropertyData_", &ScnModel::pNodePropertyData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pVertexBufferData_", &ScnModel::pVertexBufferData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pIndexBufferData_", &ScnModel::pIndexBufferData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA), new ReField( "pVertexElements_", &ScnModel::pVertexElements_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pMeshData_", &ScnModel::pMeshData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "MeshRuntimes_", &ScnModel::MeshRuntimes_, bcRFF_TRANSIENT ), }; auto& Class = ReRegisterClass< ScnModel, Super >( Fields ); BcUnusedVar( Class ); #ifdef PSY_IMPORT_PIPELINE // Add importer attribute to class for resource system to use. Class.addAttribute( new CsResourceImporterAttribute( ScnModelImport::StaticGetClass(), 0 ) ); #endif } }
////////////////////////////////////////////////////////////////////////// // updateBuffer bool RsContextNull::updateBuffer( class RsBuffer* Buffer, BcSize Offset, BcSize Size, RsResourceUpdateFlags Flags, RsBufferUpdateFunc UpdateFunc ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Buffer ); BcUnusedVar( Offset ); BcUnusedVar( Size ); BcUnusedVar( Flags ); BcUnusedVar( UpdateFunc ); std::unique_ptr< BcU8[] > TempBuffer; TempBuffer.reset( new BcU8[ Buffer->getDesc().SizeBytes_ ] ); RsBufferLock Lock = { TempBuffer.get() }; UpdateFunc( Buffer, Lock ); return true; }
void ScnSound::StaticRegisterClass() { ReField* Fields[] = { new ReField( "pFileData_", &ScnSound::pFileData_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ), new ReField( "pSource_", &ScnSound::pSource_, bcRFF_TRANSIENT ), }; auto& Class = ReRegisterClass< ScnSound, Super >( Fields ); BcUnusedVar( Class ); #ifdef PSY_IMPORT_PIPELINE // Add importer attribute to class for resource system to use. Class.addAttribute( new CsResourceImporterAttribute( ScnSoundImport::StaticGetClass(), 1 ) ); #endif }
void ScnComponent::StaticRegisterClass() { ReField* Fields[] = { new ReField( "ComponentFlags_", &ScnComponent::ComponentFlags_, bcRFF_TRANSIENT ), new ReField( "ParentEntity_", &ScnComponent::ParentEntity_, bcRFF_SHALLOW_COPY ), new ReField( "pJsonObject_", &ScnComponent::pJsonObject_, bcRFF_SHALLOW_COPY | bcRFF_CHUNK_DATA ) }; auto& Class = ReRegisterClass< ScnComponent, Super >( Fields ); BcUnusedVar( Class ); #ifdef PSY_IMPORT_PIPELINE // Add importer attribute to class for resource system to use. Class.addAttribute( new CsResourceImporterAttribute( ScnComponentImport::StaticGetClass(), 0, 100 ) ); #endif }
//////////////////////////////////////////////////////////////////////////////// // publishInternal BcBool EvtPublisher::publishInternal( EvtID ID, const EvtBaseEvent& EventBase, BcSize EventSize, BcBool AllowProxy ) { BcAssert( BcIsGameThread() ); BcUnusedVar( EventSize ); #if PSY_USE_PROFILER PSY_PROFILER_INSTANT_EVENT( boost::str( boost::format( "EvtPublisher::publishInternal( ID: %1%, Size: %2% )" ) % ID % EventSize ) ); #endif // Proxy event through all attached proxies if this event allows it. if( AllowProxy == BcTrue ) { for( TProxyListIterator It( Proxies_.begin() ); It != Proxies_.end(); ++It ) { EvtProxy* pProxy( *It ); eEvtReturn RetVal = pProxy->proxy( ID, EventBase, EventSize ); switch( RetVal ) { // Event passed. Publisher, or next proxy can deal with it. case evtRET_PASS: break; // Event blocked. If we are a parent, we want our child publisher to abort (normal behaviour). case evtRET_BLOCK: return BcFalse; break; // Unsupported enum value. default: BcBreakpoint; break; } } } // Update binding map before going ahead. updateBindingMap(); // If we have a parent, publish to them first. BcBool ShouldPublish = BcTrue; if( pParent_ != NULL ) { ShouldPublish = pParent_->publishInternal( ID, EventBase, EventSize ); } // Only publish if the previous call to our parent allows us to. if( ShouldPublish == BcTrue ) { // Find the appropriate binding list. TBindingListMapIterator BindingListMapIterator = BindingListMap_.find( ID ); // Add list if we need to, and grab iterator. if( BindingListMapIterator != BindingListMap_.end() ) { // Iterate over all bindings in list and call. TBindingList& BindingList = BindingListMapIterator->second; TBindingListIterator Iter = BindingList.begin(); while( Iter != BindingList.end() ) { EvtBinding& Binding = (*Iter); // Call binding and handle it's return. eEvtReturn RetVal = Binding( ID, EventBase ); switch( RetVal ) { case evtRET_PASS: ++Iter; break; case evtRET_BLOCK: return BcFalse; break; case evtRET_REMOVE: Iter = BindingList.erase( Iter ); break; default: BcBreakpoint; break; } } } } return BcTrue; }
////////////////////////////////////////////////////////////////////////// // getChildNode //virtual ScnAnimationTreeNode* ScnAnimationTreeTrackNode::getChildNode( BcU32 Idx ) { BcUnusedVar( Idx ); BcBreakpoint; return NULL; }
////////////////////////////////////////////////////////////////////////// // setChildNode //virtual void ScnAnimationTreeTrackNode::setChildNode( BcU32 Idx, ScnAnimationTreeNode* pNode ) { BcUnusedVar( Idx ); BcUnusedVar( pNode ); BcBreakpoint; }
//////////////////////////////////////////////////////////////////////////////// // publishInternal BcBool EvtPublisher::publishInternal( EvtID ID, const EvtBaseEvent& EventBase, BcSize EventSize ) { BcAssert( BcIsGameThread() ); BcUnusedVar( EventSize ); /* { BcChar PrefixA = ( ID >> 24 ) & 0xff; BcChar PrefixB = ( ID >> 16 ) & 0xff; BcU32 Group = ( ID >> 8 ) & 0xff; BcU32 Item = ( ID ) & 0xff; BcPrintf( "EvtPublish: %x, \"%c%c\": Group=%u Item=%u\n", ID, PrefixA, PrefixB, Group, Item ); } //*/ // Update binding map before going ahead. updateBindingMap(); // If we have a parent, publish to them first. BcBool ShouldPublish = BcTrue; if( pParent_ != NULL ) { ShouldPublish = pParent_->publishInternal( ID, EventBase, EventSize ); } // Only publish if the previous call to our parent allows us to. if( ShouldPublish == BcTrue ) { // Find the appropriate binding list. TBindingListMapIterator BindingListMapIterator = BindingListMap_.find( ID ); // Add list if we need to, and grab iterator. if( BindingListMapIterator != BindingListMap_.end() ) { // Iterate over all bindings in list and call. TBindingList& BindingList = BindingListMapIterator->second; TBindingListIterator Iter = BindingList.begin(); while( Iter != BindingList.end() ) { EvtBinding& Binding = (*Iter); // Call binding and handle it's return. eEvtReturn RetVal = Binding( ID, EventBase ); switch( RetVal ) { case evtRET_PASS: ++Iter; break; case evtRET_BLOCK: return BcFalse; break; case evtRET_REMOVE: Iter = BindingList.erase( Iter ); break; default: BcBreakpoint; break; } } } } return BcTrue; }
////////////////////////////////////////////////////////////////////////// // destroyProgram bool RsContextNull::destroyProgram( class RsProgram* Program ) { BcUnusedVar( Program ); return true; }
////////////////////////////////////////////////////////////////////////// // createProgram bool RsContextNull::createProgram( class RsProgram* Program ) { BcUnusedVar( Program ); return true; }
////////////////////////////////////////////////////////////////////////// // destroyShader bool RsContextNull::destroyShader( class RsShader* Shader ) { BcUnusedVar( Shader ); return true; }
////////////////////////////////////////////////////////////////////////// // createShader bool RsContextNull::createShader( class RsShader* Shader ) { BcUnusedVar( Shader ); return true; }
////////////////////////////////////////////////////////////////////////// // setVertexDeclaration void RsContextNull::setVertexDeclaration( class RsVertexDeclaration* VertexDeclaration ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( VertexDeclaration ); }
////////////////////////////////////////////////////////////////////////// // import //virtual BcBool CsResource::import( const Json::Value& Object, CsDependancyList& DependancyList ) { BcUnusedVar( Object ); return BcFalse; }