GUI: DirectX 11 render backend, part 7

now with texture workaround
This commit is contained in:
tildearrow 2023-06-13 05:45:36 -05:00
parent 1ffa80e845
commit 6933446d8a

View file

@ -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<sampleTexH; i++) {
memcpy(&dataT[destY],&data[srcY],sampleTexW*sizeof(unsigned int));
srcY+=sampleTexW;
destY+=pitch>>2;
}
}
rend->unlockTexture(sampleTex);
delete[] data;
}