也许不是真的很大,而是一百帧的东西。是通过制作数组并逐个加载每个图像来加载它的唯一方法?有没有更好的方法来加载大动画?
load_image()是我制作的一个函数,它载入图像并转换它们的BPP。
expl[0] = load_image("explode1.gif");
expl[1] = load_image("explode2.gif");
expl[2] = load_image("explode3.gif");
expl[3] = load_image("explode4.gif");
...
expl[99] = load_image("explode100.gif");
看起来像他们应该是一个更好的方式..至少我希望。
LoadAnimation(char* isFileBase, int numFrames)
{
char szFileName[255];
for(int i = 0; i < numFrames; i++)
{
// append the frame number and .gif to the file base to get the filename
sprintf(szFileName, "%s%d.gif", isFileBase, i);
expl[i] = load_image(szFileName);
}
}
从长远来看,这可能是最好的方式,如果帧的数量相当大(比如超过15) – Skurmedel 2009-06-12 17:23:39