- Code: Select all • Expand view
array<TextureID> b;
TextureID t = TexMan.checkForTexture("titlepic", TexMan.Type_Any);
Straightforward attempt to populate the array won't succeed:
- Code: Select all • Expand view
b.push(t);
However, casting TextureID to int works:
- Code: Select all • Expand view
b.push(int(t));
So, it's possible to create an array of TextureIDs but it's impossible to fill it without type casting. This is inconvenient and looks hacky.
Questions:
1. Is a bug or ZScript limitation?
2. If it's a ZScript limitation, is it safe to cast TextureID to int? I see that C++ TextureID counterpart, FTextureID, consists of a single int, so for now type casting is probably safe. Will it remain so?
Runnable example: