| 170 | float HowMuchInteresting(AIUnit* unit, const Target* tgt); |
| 171 | |
| 172 | bool InGameUI::DrawTargetInfo(const Camera& camera, AIUnit* unit, Vector3Par dir, Texture* cursor, Texture* cursor2, |
| 173 | PackedColor color, float cursorA, float cursor2A, const Target* target, int housePos, |
| 174 | bool info, bool extended, bool td) |
| 175 | { |
| 176 | EntityAI* vehicle = unit->GetVehicle(); |
| 177 | |
| 178 | Matrix4Val camInvTransform = camera.GetInvTransform(); |
| 179 | |
| 180 | Vector3Val mDir = camInvTransform.Rotate(dir); |
| 181 | |
| 182 | // width/height assume fovLeft/fovTop = 1/0.75 |
| 183 | AspectSettings asp; |
| 184 | GEngine->GetAspectSettings(asp); |
| 185 | |
| 186 | const float mScrH = 32.0f / (800 * asp.topFOV); |
| 187 | const float mScrW = 32.0f / (800 * asp.leftFOV); |
| 188 | |
| 189 | float cx, cy; |
| 190 | { |
| 191 | Point3 pos = camInvTransform.Rotate(dir); |
| 192 | if (pos.Z() <= 0) |
| 193 | { |
| 194 | return false; |
| 195 | } |
| 196 | float invZ = 1.0 / pos.Z(); |
| 197 | cx = pos.X() * invZ * camera.InvLeft(); |
| 198 | cy = -pos.Y() * invZ * camera.InvTop(); |
| 199 | } |
| 200 | |
| 201 | float mScrX = cx * 0.5 + 0.5 - mScrW * 0.5; |
| 202 | float mScrY = cy * 0.5 + 0.5 - mScrH * 0.5; |
| 203 | const int w2d = GLOB_ENGINE->Width2D(); |
| 204 | const int h2d = GLOB_ENGINE->Height2D(); |
| 205 | |
| 206 | const int w3d = GLOB_ENGINE->Width(); |
| 207 | const int h3d = GLOB_ENGINE->Height(); |
| 208 | |
| 209 | int mx = toInt(mScrX * w3d); |
| 210 | int my = toInt(mScrY * h3d); |
| 211 | int mw = toInt(mScrW * w3d); |
| 212 | int mh = toInt(mScrH * h3d); |
| 213 | |
| 214 | float xAngle = atan2(mDir.X(), mDir.Z()); |
| 215 | float yAngle = atan2(mDir.Y(), mDir.SizeXZ()); |
| 216 | bool tactical = td && xAngle >= MIN_X && xAngle <= MAX_X && yAngle >= MIN_Y && yAngle <= MAX_Y; |
| 217 | |
| 218 | float xScreen = 0, yScreen = 0; |
| 219 | if (tactical) |
| 220 | { |
| 221 | xScreen = toInt((tdX + 0.5 * tdW + xAngle * tdW * INV_W - 0.5 * tdCurW) * w2d); |
| 222 | yScreen = toInt((tdY + 0.5 * tdH - yAngle * tdH * INV_H - 0.5 * tdCurH) * h2d); |
| 223 | } |
| 224 | |
| 225 | Texture* textureDef = GLOB_SCENE->Preloaded(TextureWhite); |
| 226 | Texture* texture; |
| 227 | MipInfo mip; |
| 228 | float size = 0.02; |
| 229 | AICenter* center = unit->GetGroup()->GetCenter(); |
nothing calls this directly
no test coverage detected