| 277 | } |
| 278 | |
| 279 | void LoadAliases(int firsttileid, int maxarttile) |
| 280 | { |
| 281 | int lump, lastlump = 0; |
| 282 | while ((lump = fileSystem.FindLump("TEXNAMES", &lastlump, false)) != -1) |
| 283 | { |
| 284 | FScanner sc; |
| 285 | sc.OpenLumpNum(lump); |
| 286 | sc.SetCMode(true); |
| 287 | while (sc.GetNumber()) |
| 288 | { |
| 289 | int tile = sc.Number; |
| 290 | if (tile < 0 || tile > maxarttile) tile = maxarttile; |
| 291 | sc.MustGetStringName("="); |
| 292 | sc.MustGetString(); |
| 293 | TexMan.AddAlias(sc.String, FSetTextureID(firsttileid + tile)); |
| 294 | FString basename = sc.String; |
| 295 | if (sc.CheckString(",")) |
| 296 | { |
| 297 | sc.MustGetNumber(); |
| 298 | int numframes = sc.Number; |
| 299 | int numrotations = 1, order = 0; |
| 300 | if (sc.CheckString(",")) |
| 301 | { |
| 302 | sc.MustGetNumber(); |
| 303 | numrotations = sc.Number; |
| 304 | if (sc.CheckString(",")) |
| 305 | { |
| 306 | sc.MustGetNumber(); |
| 307 | order = sc.Number; |
| 308 | } |
| 309 | } |
| 310 | if (numframes <= 0 || numframes > 26) |
| 311 | { |
| 312 | sc.ScriptMessage("%d: Bad number of frames\n", numframes); |
| 313 | continue; |
| 314 | } |
| 315 | if (numrotations >= 16 || numrotations < 1) |
| 316 | { |
| 317 | sc.ScriptMessage("%d: Bad number of rotations\n", numrotations); |
| 318 | continue; |
| 319 | } |
| 320 | if (order < 0) |
| 321 | { |
| 322 | sc.ScriptMessage("%d: Bad order\n", order); |
| 323 | continue; |
| 324 | } |
| 325 | GenerateRotations(firsttileid, basename.GetChars(), tile, numframes, numrotations, order); |
| 326 | if (sc.CheckString(",")) |
| 327 | { |
| 328 | sc.MustGetString(); |
| 329 | if (sc.String[0] != '@') |
| 330 | { |
| 331 | CompleteRotations(firsttileid, basename.GetChars(), sc.String, numframes, numrotations); |
| 332 | } |
| 333 | else |
| 334 | { |
| 335 | sc.UnGet(); |
| 336 | do |
no test coverage detected