Thats cool. I'll try to explain.
When you create a BMAP from a file, the name is lost. End of story.
So if you use a BMAP in a panel, there is NO way to get the original filename.
PANEL* mainpan = { ... bmap = testobjekt; ... }
But, if you use a image filename in the panel, like this
PANEL* mainpan = { ... bmap = "Mountainroad.png"; ... }
then the filename CAN be salvaged.
[in both these examples Ive used global panel definitions, this applies to pan_create()-created panels too]I wont explain the "how" of my piece of code, unless you ask, as it is pretty advanced struct and pointer stuff.
But basically the engine creates a temporary BMAP based on the filename, and my code just gets that temp name,
and turns it back into a filename as a string.