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

Function ConvertCI4

Source/HLEGraphics/ConvertImage.cpp:607–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607static void ConvertCI4(const TextureDestInfo & dsti, const TextureInfo & ti)
608{
609 #ifdef DAEDALUS_ENABLE_ASSERTS
610 DAEDALUS_ASSERT(ti.GetTlutAddress(), "No TLUT address");
611#endif
612 NativePf8888 temp_palette[16];
613
614 NativePf8888 * dst_palette = dsti.Palette ? reinterpret_cast< NativePf8888 * >( dsti.Palette ) : temp_palette;
615 const void * src_palette = reinterpret_cast< const void * >( ti.GetTlutAddress() );
616
617 ConvertPalette(ti.GetTLutFormat(), dst_palette, src_palette, 16);
618
619 switch( dsti.Format )
620 {
621 case TexFmt_8888:
622 ConvertPalettisedTo8888( dsti, ti, dst_palette,
623 ConvertCI4_Row_To_8888< 0x4 | 0x3 >,
624 ConvertCI4_Row_To_8888< 0x3 > );
625 break;
626
627 case TexFmt_CI4_8888:
628 ConvertPalettisedToCI( dsti, ti,
629 ConvertCI4_Row< 0x4 | 0x3 >,
630 ConvertCI4_Row< 0x3 > );
631 break;
632
633#ifdef DAEDALUS_DEBUG_CONSOLE
634 default:
635 DAEDALUS_ERROR( "Unhandled format for CI4 textures" );
636 break;
637 #endif
638 }
639}
640
641} // anonymous namespace
642

Callers

nothing calls this directly

Calls 5

ConvertPaletteFunction · 0.85
ConvertPalettisedTo8888Function · 0.85
ConvertPalettisedToCIFunction · 0.85
GetTlutAddressMethod · 0.80
GetTLutFormatMethod · 0.80

Tested by

no test coverage detected