| 129 | } |
| 130 | |
| 131 | bool 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 | |
| 159 | bool Tr2TextureSubresource::HasBox() const |
| 160 | { |
no test coverage detected