瀏覽代碼

More fixes on image loader

nordsoft 3 年之前
父節點
當前提交
7bac01f10a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mapeditor/Animation.cpp

+ 2 - 2
mapeditor/Animation.cpp

@@ -450,10 +450,10 @@ void ImageLoader::init(QPoint SpriteSize, QPoint Margins, QPoint FullSize)
 	margins = Margins;
 	fullSize = FullSize;
 	
-	memset((void *)image->bits(), 0, fullSize.y() * fullSize.x());
+	memset((void *)image->bits(), 0, fullSize.y() * image->bytesPerLine());
 	
 	lineStart = image->bits();
-	lineStart += margins.y() * fullSize.x() + margins.x();
+	lineStart += margins.y() * image->bytesPerLine + margins.x();
 	position = lineStart;
 }