| 123 | |
| 124 | |
| 125 | static void ConvertGeneric( const TextureDestInfo & dsti, |
| 126 | const TextureInfo & ti, |
| 127 | ConvertRowFunction swapped_fn, |
| 128 | ConvertRowFunction unswapped_fn ) |
| 129 | { |
| 130 | OutT * dst = reinterpret_cast< OutT * >( dsti.Data ); |
| 131 | const u8 * src {g_pu8RamBase}; |
| 132 | u32 src_offset {ti.GetLoadAddress()}; |
| 133 | u32 src_pitch {ti.GetPitch()}; |
| 134 | |
| 135 | if ( ti.IsSwapped()) |
| 136 | { |
| 137 | for (u32 y {}; y < ti.GetHeight(); y++) |
| 138 | { |
| 139 | if ((y&1) == 0) |
| 140 | { |
| 141 | unswapped_fn( dst, src, src_offset, ti.GetWidth() ); |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | swapped_fn( dst, src, src_offset, ti.GetWidth() ); |
| 146 | } |
| 147 | |
| 148 | src_offset += src_pitch; |
| 149 | dst = reinterpret_cast< OutT * >( (u8*)dst + dsti.Pitch ); |
| 150 | } |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | for (u32 y {}; y < ti.GetHeight(); y++) |
| 155 | { |
| 156 | unswapped_fn( dst, src, src_offset, ti.GetWidth() ); |
| 157 | |
| 158 | src_offset += src_pitch; |
| 159 | dst = reinterpret_cast< OutT * >( (u8*)dst + dsti.Pitch ); |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | }; |
| 165 |
nothing calls this directly
no test coverage detected