From 093b07b81c682f7c6fa10cd8302be109443f036f Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Tue, 13 Dec 2005 19:29:45 +0000 Subject: [PATCH] Fix function d3d_surface_to_texture. The 16-bit color source to 24-bit color copy was incorrect. See difference. --- panda/src/dxgsg9/dxTextureContext9.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panda/src/dxgsg9/dxTextureContext9.cxx b/panda/src/dxgsg9/dxTextureContext9.cxx index 38b03eee3c..f41ebfb71d 100755 --- a/panda/src/dxgsg9/dxTextureContext9.cxx +++ b/panda/src/dxgsg9/dxTextureContext9.cxx @@ -943,9 +943,10 @@ d3d_surface_to_texture(RECT &source_rect, IDirect3DSurface9 *d3d_surface, g = (pixel & greenmask) >> greenshift; r = (pixel & redmask) >> redshift; - *dest_byte += b; - *dest_byte += g; - *dest_byte += r; + *dest_byte++ = b; + *dest_byte++ = g; + *dest_byte++ = r; + source_word++; } surface_bytes += byte_pitch;