If your pages have always the format "page#.bmp", you can do it programmatically like this:
void loadPage (PANEL* p, int index)
{
if (p != NULL)
{
if (p->bmap != NULL) {
bmap_purge(p->bmap);
p->bmap = NULL;
}
char filename [256];
sprintf(filename, "page%d.bmp", index);
p->bmap = bmap_create(filename);
}
}
The interpretation of
BMAP* b = "helloworld.tga";
is a Lite-C custom feature and does not work for arrays. If you want to achieve that, you could do the following:
#define NUM_BMAPS 10
BMAP* bmapArray [NUM_BMAPS];
void bmapArray_startup ()
{
int i;
for (i = 0; i < NUM_BMAPS; i++)
{
char filename [256];
sprintf(filename, "page%d.bmp", i);
bmapArray[i] = bmap_create(filename);
}
}
to fill the array on game startup (_startup functions are always call on engine startup!).
If you want to have an array of strings, you could do the following with a TEXT object:
TEXT* pageFilenames = {
string ("page0.bmp", "page1.bmp", "page2.bmp", "page3.bmp");
}
and access it with e.g.
(pageFilenames->pstring)[1] ( == "page1.bmp")
I hope you get the idea
