| 418 | } |
| 419 | |
| 420 | size_t SourceModBase::BuildPath(PathType type, char *buffer, size_t maxlength, const char *format, ...) |
| 421 | { |
| 422 | char _buffer[PLATFORM_MAX_PATH]; |
| 423 | va_list ap; |
| 424 | |
| 425 | va_start(ap, format); |
| 426 | vsnprintf(_buffer, PLATFORM_MAX_PATH, format, ap); |
| 427 | va_end(ap); |
| 428 | |
| 429 | /* If we get a "file://" notation, strip off the file:// part so we're left |
| 430 | * with an absolute path. Note that the absolute path gets returned, so |
| 431 | * usage with relative paths here is completely invalid. |
| 432 | */ |
| 433 | if (type != Path_SM_Rel && strncmp(_buffer, "file://", 7) == 0) |
| 434 | { |
| 435 | return ke::path::Format(buffer, maxlength, "%s", &_buffer[7]); |
| 436 | } |
| 437 | |
| 438 | const char *base = NULL; |
| 439 | if (type == Path_Game) |
| 440 | { |
| 441 | base = GetGamePath(); |
| 442 | } |
| 443 | else if (type == Path_SM) |
| 444 | { |
| 445 | base = GetSourceModPath(); |
| 446 | } |
| 447 | else if (type == Path_SM_Rel) |
| 448 | { |
| 449 | base = m_SMRelDir; |
| 450 | } |
| 451 | |
| 452 | if (base) |
| 453 | { |
| 454 | return ke::path::Format(buffer, maxlength, "%s/%s", base, _buffer); |
| 455 | } |
| 456 | else |
| 457 | { |
| 458 | return ke::path::Format(buffer, maxlength, "%s", _buffer); |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | void SourceModBase::CloseSourceMod() |
| 463 | { |
no outgoing calls
no test coverage detected