| 439 | COMMANDF(texturereset, "", () { if(execcontext==IEXC_MAPCFG) slots.setsize(0); }); |
| 440 | |
| 441 | void _texture(Slot &s, float *scale, char *name) |
| 442 | { |
| 443 | if(name) |
| 444 | { |
| 445 | filtertext(s.name, parentdir(name), FTXT__MEDIAFILEPATH); // filter parts separately, because filename may (legally) contain "<decal>" |
| 446 | if(s.name[0] == '.' && s.name[1] == '/') memmove(s.name, s.name + 2, sizeof(s.name) - 2); |
| 447 | if(*s.name) concatstring(s.name, "/"); |
| 448 | name = (char *)behindpath(name); |
| 449 | if(*name == '<') |
| 450 | { |
| 451 | char *endcmd = strchr(name, '>'); |
| 452 | if(endcmd) |
| 453 | { |
| 454 | *endcmd = '\0'; |
| 455 | concatstring(s.name, name); |
| 456 | concatstring(s.name, ">"); |
| 457 | name = endcmd + 1; |
| 458 | } |
| 459 | } |
| 460 | filtertext(name, name, FTXT__MEDIAFILENAME); |
| 461 | concatstring(s.name, name); |
| 462 | } |
| 463 | s.tex = NULL; |
| 464 | s.loaded = false; |
| 465 | if(scale) |
| 466 | { |
| 467 | s.orgscale = *scale; |
| 468 | s.scale = (*scale > 0 && *scale <= 4.0f) ? *scale : 1.0f; |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | void checktexturefilename(const char *name) |
| 473 | { |
no test coverage detected