MCPcopy Create free account
hub / github.com/axmolengine/axmol / initWithImageFile

Method initWithImageFile

core/platform/Image.cpp:650–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648}
649
650bool Image::initWithImageFile(std::string_view path)
651{
652 bool ret = false;
653 _filePath = FileUtils::getInstance()->fullPathForFilename(path);
654
655 Data data = FileUtils::getInstance()->getDataFromFile(_filePath);
656
657 if (!data.isNull())
658 {
659 ssize_t n = 0;
660 auto buf = data.takeBuffer(&n);
661 ret = initWithImageData(buf, n, true);
662 }
663
664 return ret;
665}
666
667bool Image::initWithImageFileThreadSafe(std::string_view fullpath)
668{

Callers 14

AutoPolygonMethod · 0.80
addImageMethod · 0.80
reloadTextureMethod · 0.80
renameTextureWithKeyMethod · 0.80
reloadAllTexturesMethod · 0.80
createImageFunction · 0.80
setLightMapMethod · 0.80
initHeightMapMethod · 0.80
setDetailMapMethod · 0.80
initTexturesMethod · 0.80
setIconMethod · 0.80

Calls 5

getInstanceFunction · 0.85
fullPathForFilenameMethod · 0.80
getDataFromFileMethod · 0.80
isNullMethod · 0.80
takeBufferMethod · 0.80

Tested by 1