| 1218 | } |
| 1219 | |
| 1220 | u8 J2DPictureEx::getUsableTlut(u8 id) |
| 1221 | { |
| 1222 | u8 usedTexFlags = 0; |
| 1223 | u32 texNum = mMaterial->getTexGenBlock()->getTexGenNum(); |
| 1224 | for (u8 i = 0; i < texNum; i++) { |
| 1225 | JUTTexture* texture = mMaterial->getTevBlock()->getTexture(i); |
| 1226 | if (i != id && texture != nullptr) { |
| 1227 | const ResTIMG* img = texture->getTexInfo(); |
| 1228 | |
| 1229 | if (img != nullptr && img->mPaletteFormat != 0) { |
| 1230 | int name = texture->getTlutName(); |
| 1231 | int tlutID = name >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0; |
| 1232 | |
| 1233 | u8 diffID = name - tlutID; |
| 1234 | if (diffID < 8) { |
| 1235 | usedTexFlags |= (1 << diffID); |
| 1236 | } |
| 1237 | } |
| 1238 | } |
| 1239 | } |
| 1240 | |
| 1241 | for (u8 i = 0; i < 8; i++) { |
| 1242 | if (!(usedTexFlags & (1 << i))) { |
| 1243 | return i; |
| 1244 | } |
| 1245 | } |
| 1246 | |
| 1247 | return 0; |
| 1248 | } |
nothing calls this directly
no test coverage detected