| 405 | } |
| 406 | |
| 407 | static void parseTextureSpecialBlock(FScanner& sc, int tile, int pal) |
| 408 | { |
| 409 | FScanner::SavedPos blockend; |
| 410 | FScriptPosition pos = sc; |
| 411 | |
| 412 | FString fn; |
| 413 | float xscale = 1.0, yscale = 1.0, specpower = 1.0, specfactor = 1.0; |
| 414 | |
| 415 | if (sc.StartBraces(&blockend)) return; |
| 416 | while (!sc.FoundEndBrace(blockend)) |
| 417 | { |
| 418 | sc.GetString(); |
| 419 | if (sc.Compare("file")) sc.GetString(fn); |
| 420 | else if (sc.Compare({ "xscale", "scale", "intensity", "detailscale" })) sc.GetFloat(xscale, true); // what's the point of all of these names? |
| 421 | else if (sc.Compare("yscale")) sc.GetFloat(yscale, true); |
| 422 | else if (sc.Compare({ "specpower", "specularpower", "parallaxscale" })) sc.GetFloat(specpower, true); |
| 423 | else if (sc.Compare({ "specfactor", "specularfactor", "parallaxbias" })) sc.GetFloat(specfactor, true); |
| 424 | }; |
| 425 | |
| 426 | if ((unsigned)tile < MAXUSERTILES) |
| 427 | { |
| 428 | if (fn.IsEmpty()) pos.Message(MSG_ERROR, "texture (%d): missing file name for layer definition", tile); |
| 429 | else if (!fileSystem.FileExists(fn.GetChars())) pos.Message(MSG_ERROR, "texture (%d): file '%s' not found in layer definition", tile, fn.GetChars()); |
| 430 | else |
| 431 | { |
| 432 | if (pal == DETAILPAL) |
| 433 | { |
| 434 | xscale = 1.0f / xscale; |
| 435 | yscale = 1.0f / yscale; |
| 436 | } |
| 437 | |
| 438 | tileSetHightileReplacement(sc, tile, pal, fn.GetChars(), -1.f, xscale, yscale, specpower, specfactor); |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | static void parseTexture(FScanner& sc, FScriptPosition& pos) |
| 444 | { |
no test coverage detected