MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / ConvertRow

Method ConvertRow

Source/HLEGraphics/ConvertImage.cpp:315–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313
314 template < typename OutT, u32 F >
315 static inline void ConvertRow( OutT * dst, const u8 * src, u32 src_offset, u32 width )
316 {
317 // Do two pixels at a time
318 for (u32 x {}; x < width; x+=2)
319 {
320 u8 b = src[src_offset ^ F];
321
322 // Even
323 dst[x + 0] = OutT( ThreeToEight[(b & 0xE0) >> 5],
324 ThreeToEight[(b & 0xE0) >> 5],
325 ThreeToEight[(b & 0xE0) >> 5],
326 OneToEight[(b & 0x10) >> 4]);
327 // Odd
328 dst[x + 1] = OutT( ThreeToEight[(b & 0x0E) >> 1],
329 ThreeToEight[(b & 0x0E) >> 1],
330 ThreeToEight[(b & 0x0E) >> 1],
331 OneToEight[(b & 0x01) ] );
332 src_offset++;
333 }
334
335 if(width & 1)
336 {
337 u8 b {src[src_offset ^ F]};
338
339 // Even
340 dst[width-1] = OutT( ThreeToEight[(b & 0xE0) >> 5],
341 ThreeToEight[(b & 0xE0) >> 5],
342 ThreeToEight[(b & 0xE0) >> 5],
343 OneToEight[(b & 0x10) >> 4]);
344 }
345 }
346
347 template < typename OutT >
348 static inline void ConvertTextureT( const TextureDestInfo & dsti, const TextureInfo & ti )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected