MXVK Vulkan Framework 0.33.1
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" ||
40 token == "-clamp" || token == "-imfchan" || token == "-type") {
41 stream >> token;
42 } else if (token == "-mm") {
43 stream >> token;
44 stream >> token;
45 } else if (token == "-o" || token == "-s" || token == "-t") {
46 stream >> token;
47 stream >> token;
48 stream >> token;
49 } else if (token == "-bm" || token == "-boost" || token == "-texres") {
50 stream >> token;
51 }
52 continue;
53 }
54
55 if (!texturePath.empty()) {
56 texturePath += ' ';
57 }
58 texturePath += token;
59 }
60 return texturePath;
61 }

◆ resolveTexturePath()

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

Definition at line 63 of file mxvk_abstract_model.cpp.

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