MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / FindPicture

Function FindPicture

engine/Poseidon/UI/OptionsUI.cpp:672–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670 return fullname;
671 }
672
673 Poseidon::Foundation::WarningMessage("Shape %s not found", (const char*)name);
674 return "";
675}
676
677RString FindPicture(RString name)
678{
679 // name "" used for nullptr texture
680 if (name.GetLength() == 0)
681 {
682 return name;
683 }
684
685 // ignore @ - not used now
686 if (name[0] == '@')
687 {
688 name = (const char*)name + 1;
689 }
690
691 name.Lower();
692
693 // find in mission
694 RString fullname = GetMissionDirectory() + name;
695 if (QIFStreamB::FileExist(fullname))
696 {
697 return fullname;
698 }
699
700 // find in campaign
701 fullname = BaseDirectory + RString("dtaExt\\") + name;
702 if (QIFStreamB::FileExist(fullname))
703 {
704 return fullname;
705 }
706
707 // find in root
708 fullname = RString("dtaExt\\") + name;
709 if (QIFStreamB::FileExist(fullname))
710 {
711 return fullname;
712 }
713
714 // find in bank
715 fullname = GetPictureName(name);
716 if (QIFStreamB::FileExist(fullname))
717 {
718 return fullname;
719 }
720
721 Poseidon::Foundation::WarningMessage("Picture %s not found", (const char*)name);

Callers 9

SetFlagTextureMethod · 0.85
OnCreateCtrlMethod · 0.85
CMPSideButtonMethod · 0.85
OnCreateCtrlMethod · 0.85
SetTextMethod · 0.85
AddImageMethod · 0.85
SetTextMethod · 0.85
ObjSetTextureFunction · 0.85
LBSetPictureFunction · 0.85

Calls 6

GetMissionDirectoryFunction · 0.85
GetPictureNameFunction · 0.85
WarningMessageFunction · 0.85
LowerMethod · 0.80
RStringClass · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected