@@ -26,7 +26,7 @@ Class Pixmap
Method New( width:Int,height:Int,format:PixelFormat=PixelFormat.RGBA32 )
Local depth:=PixelFormatDepth( format )
- Local pitch:=depth * height
+ Local pitch:=width*depth
Local data:=Cast<UByte Ptr>( libc.malloc( width*height*pitch ) )
_width=width
@@ -64,7 +64,7 @@ Function LoadPixmap:Pixmap( path:String,format:PixelFormat )
End
- Return New Pixmap( x,y,format,data,PixelFormatDepth( format )*y,Lambda( data:UByte Ptr )
+ Return New Pixmap( x,y,format,data,x*PixelFormatDepth( format ),Lambda( data:UByte Ptr )
stbi_image_free( data )
End )