Permalink
Browse files

CRITICAL: fixed two major bugs.

First the resize passed the destination size as source and destinatin size.
Second: the internal IntPtr was not synced to the new byte[]

Terrain example and everything depending on this could never have worked like that...
  • Loading branch information...
1 parent 6007b35 commit fc0e2bb8e1c2337bf30a0ba3f1816ec3ae7a68ce @WolfgangSt committed Jun 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 Projects/Axiom/Engine/Media/Image.cs
@@ -826,14 +826,14 @@ public void Resize( int width, int height, ImageFilter filter )
// reassign buffer to temp image, make sure auto-delete is true
Image temp = new Image();
- temp.FromDynamicImage( buffer, width, height, 1, format );
+ temp.FromDynamicImage( buffer, this.width, this.height, 1, format );
// do not delete[] m_pBuffer! temp will destroy it
// set new dimensions, allocate new buffer
this.width = width;
this.height = height;
size = PixelUtil.GetMemorySize( Width, Height, 1, Format );
- buffer = new byte[ size ];
+ SetBuffer( new byte[size] ); // AXIOM IMPORTANT: cant set buffer only as this wont sync the IntPtr!
numMipMaps = 0; // Loses precomputed mipmaps
// scale the image from temp into our resized buffer

0 comments on commit fc0e2bb

Please sign in to comment.