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

Function ConvertTile

Source/HLEGraphics/ConvertTile.cpp:574–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572};
573
574bool ConvertTile(const TextureInfo & ti,
575 void * texels,
576 NativePf8888 * palette,
577 ETextureFormat texture_format,
578 u32 pitch)
579{
580 DAEDALUS_ASSERT(texture_format == TexFmt_8888, "OSX should only use RGBA 8888 textures");
581
582 TileDestInfo dsti( texture_format );
583 dsti.Data = texels;
584 dsti.Width = ti.GetWidth();
585 dsti.Height = ti.GetHeight();
586 dsti.Pitch = pitch;
587 //dsti.Palette = palette;
588
589 DAEDALUS_ASSERT(ti.GetLine() != 0, "No line");
590
591 const ConvertFunction fn = gConvertFunctions[ (ti.GetFormat() << 2) | ti.GetSize() ];
592 if( fn )
593 {
594 fn( dsti, ti );
595 return true;
596 }
597
598 DAEDALUS_ERROR("Unhandled format %d/%d", ti.GetFormat(), ti.GetSize());
599 return false;
600}
601#endif //DAEDALUS_ACCURATE_TMEM

Callers 1

GenerateTexelsFunction · 0.85

Calls 5

GetLineMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetFormatMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected