[A5] al_save_bitmap can't pass a variable for the filename?
Werwolf696

I'm trying to save a bitmap using a name specified elsewhere in the program using a variable. I've tried a bunch of different ways but maybe I'm missing something here?

"fileName" is a const char* in the (relevant) code below:

#SelectExpand
1ALLEGRO_BITMAP *newSheet = CreateBlankSheet(gridColor, backColor, cellWidth, cellHeight, gridRows, gridColumns, true); 2if (al_save_bitmap(fileName, newSheet)) 3{ 4 soundBank.PlayInstance("Done"); 5 LoadEntries(); 6 cursorPos = entries[0].inputPosition.x; 7 currentItemSelection = 0; 8 maxItemSelection = entries.size(); 9}

Maybe I just need more sleep...

SiegeLord

Do you get some error? Does the fileName have an extension and if so what is it?

Werwolf696

Yeah, it just returns false... the filename comes from the following:

fileName = al_cstr(entries[i].value);

Where entries[i].value is an ALLEGRO_USTR

The filename example value is "test.png"

WAIT!

I see it now... it was "TEST.PNG" and I suppose the function only can determine file type with a lowercase name... odd!

Thanks for letting me think out loud man... appreciate your time.

Thread #613242. Printed from Allegro.cc