MCPcopy Create free account
hub / github.com/carbonengine/trinity / IsValidForBitmap

Method IsValidForBitmap

trinityal/Tr2HalHelperStructures.cpp:131–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131bool Tr2TextureSubresource::IsValidForBitmap( const Tr2BitmapDimensions& bitmap ) const
132{
133 if( m_endFace > bitmap.GetArraySize() )
134 {
135 return false;
136 }
137 if( m_endMipLevel > bitmap.GetTrueMipCount() )
138 {
139 return false;
140 }
141 if( HasBox() )
142 {
143 if( m_box.right > bitmap.GetMipWidth( m_startMipLevel ) )
144 {
145 return false;
146 }
147 if( m_box.bottom > bitmap.GetMipHeight( m_startMipLevel ) )
148 {
149 return false;
150 }
151 if( bitmap.GetType() == TEX_TYPE_3D && m_box.back > bitmap.GetMipDepth( m_startMipLevel ) )
152 {
153 return false;
154 }
155 }
156 return true;
157}
158
159bool Tr2TextureSubresource::HasBox() const
160{

Callers 8

MapForWritingMethod · 0.80
UpdateSubresourceMethod · 0.80
MapForReadingMethod · 0.80
MapForWritingMethod · 0.80
UpdateSubresourceMethod · 0.80
MapForReadingMethod · 0.80
MapForWritingMethod · 0.80
UpdateSubresourceMethod · 0.80

Calls 3

GetTrueMipCountMethod · 0.80
GetArraySizeMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected