MCPcopy Create free account
hub / github.com/ZDoom/Raze / ParsePatch

Method ParsePatch

source/common/textures/multipatchtexturebuilder.cpp:423–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421//==========================================================================
422
423void 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"))

Callers

nothing calls this directly

Calls 15

clampFunction · 0.85
AddSpecialColormapFunction · 0.85
V_GetColorFunction · 0.85
MustGetStringMethod · 0.80
MustGetStringNameMethod · 0.80
MustGetNumberMethod · 0.80
UnGetMethod · 0.80
AddToTranslationMethod · 0.80
ScriptMessageMethod · 0.80
MustGetFloatMethod · 0.80
MustMatchStringMethod · 0.80
CheckStringMethod · 0.45

Tested by

no test coverage detected