mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-04 10:51:39 -04:00
fixed "GetUnitPictureFilename" logic to support both SHP turret buildings and normal unit with Image= assigning .
This commit is contained in:
parent
9e3c3e2700
commit
7d9d27c3a3
1 changed files with 16 additions and 12 deletions
|
@ -54,6 +54,14 @@ inline CString GetUnitPictureFilename(const CString& lpUnitName, DWORD dwPicInde
|
|||
{
|
||||
CIniFile& ini = Map->GetIniFile();
|
||||
|
||||
char n[50];
|
||||
_itoa_s(dwPicIndex, n, 10);
|
||||
// store differently for each type even they shares same image,
|
||||
// because they can have different components, e.g. turret image
|
||||
if (pics.find(lpUnitName + n) != pics.end()) {
|
||||
return lpUnitName + n;
|
||||
}
|
||||
|
||||
auto artname = rules.GetStringOr(lpUnitName, "Image", lpUnitName);
|
||||
artname = ini.GetStringOr(lpUnitName, "Image", artname);
|
||||
|
||||
|
@ -71,19 +79,15 @@ inline CString GetUnitPictureFilename(const CString& lpUnitName, DWORD dwPicInde
|
|||
filename.SetAt(1, 'T');
|
||||
}
|
||||
|
||||
char n[50];
|
||||
_itoa_s(dwPicIndex, n, 10);
|
||||
// store differently for each type even they shares same image,
|
||||
// because they can have different components, e.g. turret image
|
||||
if (pics.find((lpUnitName + n)) != pics.end()) {
|
||||
filename = lpUnitName; // yes, found
|
||||
filename += n;
|
||||
} else if (pics.find(artname + ".bmp") != pics.end()) { // since June, 15th (Matze): Only use BMP if no SHP/VXL exists
|
||||
filename = (CString)artname + ".bmp";
|
||||
} else {
|
||||
filename = "";
|
||||
if (pics.find(artname + n) != pics.end()) {
|
||||
return artname + n;
|
||||
}
|
||||
return filename;
|
||||
|
||||
if (pics.find(artname + ".bmp") != pics.end()) { // since June, 15th (Matze): Only use BMP if no SHP/VXL exists
|
||||
return artname + ".bmp";
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
inline CString GetParam(const CString& data, const int param)
|
||||
|
|
Loading…
Add table
Reference in a new issue