From 013f833492980322d389109026d040655672724f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 10 Nov 2012 16:04:22 +0100 Subject: [PATCH] (XDK) Small optimization --- xdk/xdk_d3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdk/xdk_d3d.cpp b/xdk/xdk_d3d.cpp index 11a723ca2e..0ef26afb63 100644 --- a/xdk/xdk_d3d.cpp +++ b/xdk/xdk_d3d.cpp @@ -699,11 +699,11 @@ static bool xdk_d3d_frame(void *data, const void *frame, D3DLOCKED_RECT d3dlr; d3d->lpTexture->LockRect(0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK); + size_t size_screen = g_settings.video.color_format ? sizeof(uint32_t) : sizeof(uint16_t); for (unsigned y = 0; y < height; y++) { const uint8_t *in = (const uint8_t*)frame + y * pitch; uint8_t *out = (uint8_t*)d3dlr.pBits + y * d3dlr.Pitch; - size_t size_screen = g_settings.video.color_format ? sizeof(uint32_t) : sizeof(uint16_t); memcpy(out, in, width * size_screen); } d3d->lpTexture->UnlockRect(0);