| 650 | } |
| 651 | |
| 652 | bool Tr2HostBitmap::SetPixel( int x, int y, const void* data ) |
| 653 | { |
| 654 | if( !IsValid() || GetBytesPerPixel( m_format ) != 4 || IsCompressed() ) |
| 655 | { |
| 656 | return false; |
| 657 | } |
| 658 | if( x < 0 || (unsigned)x > m_width || |
| 659 | y < 0 || (unsigned)y > m_height ) |
| 660 | { |
| 661 | return false; |
| 662 | } |
| 663 | |
| 664 | char* dest = m_data.get() + y * m_width * 4 + x * 4; |
| 665 | memcpy( dest, data, 4 ); |
| 666 | return true; |
| 667 | } |
| 668 | |
| 669 | bool Tr2HostBitmap::GetPixel( int x, int y, void* data ) const |
| 670 | { |