This commit is contained in:
Chris Forbes
2011-12-27 18:13:04 +13:00
parent f8122047b6
commit d57dfd1997
10 changed files with 20 additions and 19 deletions

View File

@@ -99,11 +99,10 @@ namespace OpenRA.Renderer.SdlCommon
if (!IsPowerOf2(bitmap.Width) || !IsPowerOf2(bitmap.Height))
{
//throw new InvalidOperationException( "non-power-of-2-texture" );
bitmap = new Bitmap(bitmap, new Size(Exts.NextPowerOf2(bitmap.Width), Exts.NextPowerOf2(bitmap.Height)));
bitmap = new Bitmap(bitmap, bitmap.Size.NextPowerOf2());
}
var bits = bitmap.LockBits(
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
var bits = bitmap.LockBits(bitmap.Bounds(),
ImageLockMode.ReadOnly,
PixelFormat.Format32bppArgb);