1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00
This commit is contained in:
Brian Fiete 2021-10-26 06:16:13 -07:00
parent 71bc9077a1
commit 1a37f5e0ad

View file

@ -210,6 +210,25 @@ namespace Beefy.gfx
} }
} }
} }
public Image[] CreateImageCels(int32 cols, int32 rows)
{
int32 celW = mSrcWidth / cols;
int32 celH = mSrcHeight / rows;
Debug.Assert(celW * cols == mSrcWidth);
Debug.Assert(celH * rows == mSrcHeight);
Image[] celImages = new .[cols * rows];
for (int32 row = 0; row < rows; row++)
{
for (int32 col = 0; col < cols; col++)
{
celImages[row * cols + col] = CreateImageSegment(col * celW, row * celH, celW, celH);
}
}
return celImages;
}
} }
#else #else
public class Image : IDrawable public class Image : IDrawable