use SDL_GetBasePath for zeml files
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
#include "app/gui/zeml.h"
|
#include "app/gui/zeml.h"
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -11,9 +9,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "app/core/platform/file_path.h"
|
||||||
#include "app/gui/canvas.h"
|
#include "app/gui/canvas.h"
|
||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
#include "app/core/platform/file_path.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
@@ -592,16 +591,17 @@ std::string LoadFile(const std::string& filename) {
|
|||||||
std::string fileContents;
|
std::string fileContents;
|
||||||
const std::string kPath = "assets/layouts/";
|
const std::string kPath = "assets/layouts/";
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#if TARGET_OS_IOS == 1
|
#if TARGET_OS_IOS == 1
|
||||||
const std::string kBundlePath = core::GetBundleResourcePath();
|
const std::string kBundlePath = core::GetBundleResourcePath();
|
||||||
std::ifstream file(kBundlePath + filename);
|
std::ifstream file(kBundlePath + filename);
|
||||||
#else
|
#else
|
||||||
std::ifstream file(kPath + filename);
|
const std::string kBundlePath = SDL_GetBasePath();
|
||||||
#endif
|
std::ifstream file(kPath + filename);
|
||||||
#else
|
#endif
|
||||||
std::ifstream file(kPath + filename);
|
#else
|
||||||
#endif
|
std::ifstream file(kPath + filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (file.is_open()) {
|
if (file.is_open()) {
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|||||||
Reference in New Issue
Block a user