mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-06 03:44:00 -04:00
support image filenames with embedded dots
This commit is contained in:
parent
18e0cff844
commit
07ab48032d
@ -193,15 +193,19 @@ void ImageFile::
|
|||||||
set_filename(const string &dirname, const string &basename) {
|
set_filename(const string &dirname, const string &basename) {
|
||||||
_filename = Filename(dirname, basename);
|
_filename = Filename(dirname, basename);
|
||||||
|
|
||||||
if (_properties._color_type != (PNMFileType *)NULL) {
|
if (_properties._alpha_type != (PNMFileType *)NULL) {
|
||||||
_filename.set_extension
|
_alpha_filename =
|
||||||
(_properties._color_type->get_suggested_extension());
|
_filename.get_fullpath() + "_a." +
|
||||||
|
_properties._alpha_type->get_suggested_extension();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_properties._alpha_type != (PNMFileType *)NULL) {
|
if (_properties._color_type != (PNMFileType *)NULL) {
|
||||||
_alpha_filename = _filename.get_fullpath_wo_extension() + "_a";
|
// We shouldn't use _filename.set_extension(), because that may
|
||||||
_alpha_filename.set_extension
|
// inadvertently truncate the filename if it already includes a
|
||||||
(_properties._alpha_type->get_suggested_extension());
|
// dot.
|
||||||
|
_filename =
|
||||||
|
_filename.get_fullpath() + "." +
|
||||||
|
_properties._color_type->get_suggested_extension();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user