Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawBytesToBuffer()

unsafe void Terraria.Graphics.Capture.CaptureCamera.DrawBytesToBuffer ( byte[] sourceBuffer,
byte[] destinationBuffer,
int sourceBufferWidth,
int destinationBufferWidth,
Microsoft::Xna::Framework::Rectangle area )
inlineprivate

Definition at line 209 of file CaptureCamera.cs.

210 {
211 fixed (byte* ptr3 = &destinationBuffer[0])
212 {
213 fixed (byte* ptr = &sourceBuffer[0])
214 {
215 byte* ptr2 = ptr;
216 byte* ptr4 = ptr3 + (destinationBufferWidth * area.Y + area.X << 2);
217 for (int i = 0; i < area.Height; i++)
218 {
219 for (int j = 0; j < area.Width; j++)
220 {
221 if (Program.IsXna)
222 {
223 ptr4[2] = *ptr2;
224 ptr4[1] = ptr2[1];
225 *ptr4 = ptr2[2];
226 ptr4[3] = ptr2[3];
227 }
228 else
229 {
230 *ptr4 = *ptr2;
231 ptr4[1] = ptr2[1];
232 ptr4[2] = ptr2[2];
233 ptr4[3] = ptr2[3];
234 }
235 ptr2 += 4;
236 ptr4 += 4;
237 }
238 ptr2 += sourceBufferWidth - area.Width << 2;
239 ptr4 += destinationBufferWidth - area.Width << 2;
240 }
241 }
242 }
243 }

References Terraria.Program.IsXna.

Referenced by Terraria.Graphics.Capture.CaptureCamera.DrawTick().