mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/graphicsdriver/directx: refactoring
This commit is contained in:
parent
0b0526a05b
commit
1017161c36
@ -116,7 +116,7 @@ func (i *image11) ReadPixels(buf []byte, x, y, width, height int) error {
|
|||||||
|
|
||||||
stride := int(mapped.RowPitch)
|
stride := int(mapped.RowPitch)
|
||||||
src := unsafe.Slice((*byte)(mapped.pData), stride*height)
|
src := unsafe.Slice((*byte)(mapped.pData), stride*height)
|
||||||
if mapped.RowPitch == uint32(4*width) {
|
if stride == 4*width {
|
||||||
copy(buf, src)
|
copy(buf, src)
|
||||||
} else {
|
} else {
|
||||||
for j := 0; j < height; j++ {
|
for j := 0; j < height; j++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user