From 6933446d8a5d69d6f2470b10798c71c568ca512f Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 13 Jun 2023 05:45:36 -0500 Subject: [PATCH] GUI: DirectX 11 render backend, part 7 now with texture workaround --- src/gui/sampleEdit.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 8f5a9843a..5d2e1d9f9 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -1231,7 +1231,17 @@ void FurnaceGUI::drawSampleEdit() { } } - memcpy(dataT,data,sampleTexW*sampleTexH*sizeof(unsigned int)); + if ((pitch>>2)==sampleTexW) { + memcpy(dataT,data,sampleTexW*sampleTexH*sizeof(unsigned int)); + } else { + int srcY=0; + int destY=0; + for (int i=0; i>2; + } + } rend->unlockTexture(sampleTex); delete[] data; }