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

Method ConvertGeneric

Source/HLEGraphics/ConvertImage.cpp:125–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125static 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

Callers

nothing calls this directly

Calls 5

GetLoadAddressMethod · 0.80
IsSwappedMethod · 0.80
GetPitchMethod · 0.45
GetHeightMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected