const ImageFormat* ImageFormat::fromString(const std::string& s) { for (int i = 0; ! nameArray[i].empty(); ++i) { if (s == nameArray[i]) { return fromCode(ImageFormat::Code(i)); } } return NULL; }
const ImageFormat* ImageFormat::fromString(const std::string& s) { if (toLower(s) == "auto") { return NULL; } for (int i = 0; i < CODE_NUM; ++i) { if (s == nameArray[i]) { return fromCode(ImageFormat::Code(i)); } } return NULL; }
TextureFormat const * TextureFormat::fromString(std::string const & s) { for (int i = 0; i < Code::NUM; ++i) { if (s == TextureFormatInternal::nameArray[i]) { return fromCode(Code(i)); } } return NULL; }