MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk::anonymous_namespace{mxvk_abstract_model.cpp} Namespace Reference

Classes

struct  ModelPushConstants

Functions

void logVKAbstractModelStep (const std::string &message, bool important=false)
std::string parseMTLTexturePath (std::istream &stream)
std::string resolveTexturePath (const std::string &textureBasePath, const std::string &texturePath)

Function Documentation

◆ logVKAbstractModelStep()

void mxvk::anonymous_namespace{mxvk_abstract_model.cpp}::logVKAbstractModelStep ( const std::string & message,
bool important = false )

Definition at line 28 of file mxvk_abstract_model.cpp.

28 {
29 if (important) {
30 std::cout << "mxvk_abstract_model: " << message << '\n';
31 }
32 }

◆ parseMTLTexturePath()

std::string mxvk::anonymous_namespace{mxvk_abstract_model.cpp}::parseMTLTexturePath ( std::istream & stream)
nodiscard

Definition at line 34 of file mxvk_abstract_model.cpp.

34 {
35 std::string texturePath{};
36 std::string token{};
37 while (stream >> token) {
38 if (!token.empty() && token[0] == '-') {
39 if (token == "-blendu" || token == "-blendv" || token == "-cc" || token == "-clamp" || token == "-imfchan" || token == "-type") {
40 stream >> token;
41 } else if (token == "-mm") {
42 stream >> token;
43 stream >> token;
44 } else if (token == "-o" || token == "-s" || token == "-t") {
45 stream >> token;
46 stream >> token;
47 stream >> token;
48 } else if (token == "-bm" || token == "-boost" || token == "-texres") {
49 stream >> token;
50 }
51 continue;
52 }
53
54 if (!texturePath.empty()) {
55 texturePath += ' ';
56 }
57 texturePath += token;
58 }
59 return texturePath;
60 }

◆ resolveTexturePath()

std::string mxvk::anonymous_namespace{mxvk_abstract_model.cpp}::resolveTexturePath ( const std::string & textureBasePath,
const std::string & texturePath )
nodiscard

Definition at line 62 of file mxvk_abstract_model.cpp.

62 {
63 if (texturePath.empty()) {
64 return {};
65 }
66
67 std::filesystem::path resolvedPath(texturePath);
68 if (resolvedPath.is_absolute()) {
69 resolvedPath = resolvedPath.filename();
70 }
71
72 if (textureBasePath.empty()) {
73 return resolvedPath.string();
74 }
75
76 return (std::filesystem::path(textureBasePath) / resolvedPath).string();
77 }