Skip to content

Commit 5aeb479

Browse files
committed
moved some code out of "sanity.hpp" so filepaths would work properly, lmfao
1 parent 56b29f6 commit 5aeb479

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/r_renderer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ void W_SwapAndClear(GLFWwindow *w_window, glm::vec3 w_clear_color)
5656

5757
graphx::gMeshData M_LoadModelFile(std::string file_path, std::string file_extension)
5858
{
59+
// Last minute realization that I had to move this out of the header file "sanity.hpp"
60+
std::string binary_path = BINARY_PATH;
61+
5962
// If the file path is relative, it should be relative to the program's location.
6063
std::string file_path_checked = std::string(binary_path + file_path);
6164

src/sanity.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ inline std::string getBinaryPath()
4444
#define EXTERNAL_THEATRES_DIRECTORY std::string("theatres")
4545
#endif
4646

47-
static std::string binary_path = BINARY_PATH;
48-
static std::string theatres_directory = std::string(BINARY_PATH) + EXTERNAL_THEATRES_DIRECTORY;
49-
5047
#include <images.h>
5148
#include <shaders.hpp>
5249

src/t_interpreter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ void loadChildTheatre(long theatre_uid, Theatre *parent_theatre)
650650

651651
bool checkForExternalTheatres()
652652
{
653+
// Last minute realization that I had to move these out of the header file "sanity.hpp"
654+
std::string binary_path = BINARY_PATH;
655+
std::string theatres_directory = std::string(BINARY_PATH) + EXTERNAL_THEATRES_DIRECTORY;
656+
653657
if(std::filesystem::is_directory(std::filesystem::path(theatres_directory)))
654658
for(const auto &entry : std::filesystem::directory_iterator(std::filesystem::path(theatres_directory)))
655659
if(entry.path().extension().string().compare(GRAPHXTHEATRE_EXTENSION) == 0)
@@ -707,6 +711,10 @@ bool checkForAndLoadExternalTheatres()
707711

708712
bool has_theatre_file = false;
709713

714+
// Last minute realization that I had to move these out of the header file "sanity.hpp"
715+
std::string binary_path = BINARY_PATH;
716+
std::string theatres_directory = std::string(BINARY_PATH) + EXTERNAL_THEATRES_DIRECTORY;
717+
710718
for(const auto &entry : std::filesystem::directory_iterator(std::filesystem::path(theatres_directory)))
711719
{
712720
if(entry.path().extension().string().compare(GRAPHXTHEATRE_EXTENSION) == 0)

0 commit comments

Comments
 (0)