| 421 | //========================================================================== |
| 422 | |
| 423 | void FMultipatchTextureBuilder::ParsePatch(FScanner &sc, BuildInfo &info, TexPartBuild & part, TexInit &init) |
| 424 | { |
| 425 | FString patchname; |
| 426 | int Mirror = 0; |
| 427 | sc.MustGetString(); |
| 428 | |
| 429 | init.TexName = sc.String; |
| 430 | sc.MustGetStringName(","); |
| 431 | sc.MustGetNumber(); |
| 432 | part.OriginX = sc.Number; |
| 433 | sc.MustGetStringName(","); |
| 434 | sc.MustGetNumber(); |
| 435 | part.OriginY = sc.Number; |
| 436 | |
| 437 | if (sc.CheckString("{")) |
| 438 | { |
| 439 | while (!sc.CheckString("}")) |
| 440 | { |
| 441 | sc.MustGetString(); |
| 442 | if (sc.Compare("flipx")) |
| 443 | { |
| 444 | Mirror |= 1; |
| 445 | } |
| 446 | else if (sc.Compare("flipy")) |
| 447 | { |
| 448 | Mirror |= 2; |
| 449 | } |
| 450 | else if (sc.Compare("rotate")) |
| 451 | { |
| 452 | sc.MustGetNumber(); |
| 453 | sc.Number = (((sc.Number + 90) % 360) - 90); |
| 454 | if (sc.Number != 0 && sc.Number != 90 && sc.Number != 180 && sc.Number != -90) |
| 455 | { |
| 456 | sc.ScriptError("Rotation must be a multiple of 90 degrees."); |
| 457 | } |
| 458 | part.Rotate = (sc.Number / 90) & 3; |
| 459 | } |
| 460 | else if (sc.Compare("Translation")) |
| 461 | { |
| 462 | int match; |
| 463 | |
| 464 | info.bComplex = true; |
| 465 | if (part.Translation != NULL) delete part.Translation; |
| 466 | part.Translation = NULL; |
| 467 | part.Blend = 0; |
| 468 | static const char *maps[] = { "gold", "red", "green", "blue", "inverse", NULL }; |
| 469 | sc.MustGetString(); |
| 470 | |
| 471 | match = sc.MatchString(maps); |
| 472 | if (match >= 0) |
| 473 | { |
| 474 | part.Blend = BLEND_SPECIALCOLORMAP1 + match + 1; |
| 475 | } |
| 476 | else if (sc.Compare("ICE")) |
| 477 | { |
| 478 | part.Blend = BLEND_ICEMAP; |
| 479 | } |
| 480 | else if (sc.Compare("DESATURATE")) |
nothing calls this directly
no test coverage detected