Skip to content

Commit a150b17

Browse files
committed
Update version to v0.21.34
1 parent 88375d9 commit a150b17

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.25.2 FATAL_ERROR)
22

33
# ---- Project ----
4-
project(RAYX VERSION 0.21.33)
4+
project(RAYX VERSION 0.21.34)
55
set(CMAKE_CXX_STANDARD 23)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CUDA_STANDARD 20)

Intern/rayx-core/src/Data/Locate.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
namespace RAYX {
1616

1717
// Check if a file exists
18-
bool fileExists(const std::string& path) { return std::filesystem::exists(path); }
19-
bool fileExists(const std::filesystem::path& path) { return std::filesystem::exists(path); }
18+
bool ResourceFinder::fileExists(const std::string& path) { return std::filesystem::exists(path); }
19+
bool ResourceFinder::fileExists(const std::filesystem::path& path) { return std::filesystem::exists(path); }
2020

21-
std::filesystem::path getExecutablePath() {
21+
std::filesystem::path ResourceFinder::getExecutablePath() {
2222
#if defined(_WIN32)
2323
// Start with a reasonable buffer size
2424
std::vector<char> buffer(MAX_PATH);
@@ -59,7 +59,7 @@ std::filesystem::path getExecutablePath() {
5959
}
6060

6161
// General method to get the full path based on the base directory (e.g., data or font directory)
62-
std::filesystem::path getFullPath(const std::string& baseDir, const std::string& relativePath) {
62+
std::filesystem::path ResourceFinder::getFullPath(const std::string& baseDir, const std::string& relativePath) {
6363
#if defined(__linux__)
6464
// First, check in /usr (package install)
6565
std::string path = std::string("/usr/") + baseDir + "/" + relativePath;
@@ -89,9 +89,9 @@ std::filesystem::path getFullPath(const std::string& baseDir, const std::string&
8989
}
9090

9191
// Retrieve the full path of a resource based on the platform
92-
std::filesystem::path getResourcePath(const std::string& relativePath) { return getFullPath(RAYX_DATA_DIR, relativePath); }
92+
std::filesystem::path ResourceFinder::getResourcePath(const std::string& relativePath) { return getFullPath(RAYX_DATA_DIR, relativePath); }
9393

9494
// Retrieve the full path of a font based on the platform
95-
std::filesystem::path getFontPath(const std::string& relativePath) { return getFullPath(RAYX_FONTS_DIR, relativePath); }
95+
std::filesystem::path ResourceFinder::getFontPath(const std::string& relativePath) { return getFullPath(RAYX_FONTS_DIR, relativePath); }
9696

9797
} // namespace RAYX

Intern/rayx-core/src/Data/Locate.h

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,30 @@
77

88
namespace RAYX {
99

10-
// Platform-specific implementations for resource path search
11-
RAYX_API std::filesystem::path getExecutablePath();
10+
class RAYX_API ResourceFinder {
11+
public:
12+
// Platform-specific implementations for resource path search
13+
std::filesystem::path getExecutablePath();
1214

13-
// Retrieves a resource file's full path based on the relative path
14-
RAYX_API std::filesystem::path getResourcePath(const std::string& relativePath);
15+
// Retrieves a resource file's full path based on the relative path
16+
std::filesystem::path getResourcePath(const std::string& relativePath);
1517

16-
// Retrieves a font file's full path based on the relative path
17-
RAYX_API std::filesystem::path getFontPath(const std::string& relativePath);
18+
// Retrieves a font file's full path based on the relative path
19+
std::filesystem::path getFontPath(const std::string& relativePath);
20+
21+
private:
22+
bool fileExists(const std::string& path);
23+
bool fileExists(const std::filesystem::path& path);
24+
std::filesystem::path getFullPath(const std::string& baseDir, const std::string& relativePath);
25+
26+
std::vector<std::filesystem::path> lookUpPaths = {
27+
#if defined(__linux__)
28+
std::filesystem::path("/usr"), //
29+
std::filesystem::path("/usr/local"), //
30+
#elif defined(_WIN32)
31+
#elif defined(__APPLE__)
32+
#endif
33+
};
34+
};
1835

1936
} // namespace RAYX

Intern/rayx-core/src/Material/NffTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bool NffTable::load(const char* element, NffTable* out) {
1414

1515
std::transform(elementString.begin(), elementString.end(), elementString.begin(), [](unsigned char c) { return std::tolower(c); });
1616

17-
std::filesystem::path f = getResourcePath("nff/" + elementString + ".nff");
17+
std::filesystem::path f = getResourcePath("Data/nff/" + elementString + ".nff");
1818
RAYX_VERB << "Loading NffTable from " << f;
1919
std::ifstream s(f);
2020

Intern/rayx-core/src/Material/PalikTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bool PalikTable::load(const char* element, PalikTable* out) {
1212
std::string elementString = element;
1313
std::transform(elementString.begin(), elementString.end(), elementString.begin(), [](unsigned char c) { return std::toupper(c); });
1414

15-
std::filesystem::path f = getResourcePath("PALIK/" + elementString + ".NKP");
15+
std::filesystem::path f = getResourcePath("Data/PALIK/" + elementString + ".NKP");
1616
RAYX_VERB << "Loading PalikTable from " << f;
1717
std::ifstream s(f);
1818

0 commit comments

Comments
 (0)