#include "global_params.h"

#include <SDL3/SDL.h>

#include <string>
#include <cstring>
#include <filesystem>


std::string GlobalParams::assetPath() {
    const char* platformName = SDL_GetPlatform();
   
    if (strcmp(platformName, "Android") == 0) {
        return "";
    }
    if (strcmp(platformName, "Windows") == 0) {
       return "assets/";
    }
    if (strcmp(platformName, "Linux") == 0) {
        if (std::filesystem::is_directory(std::filesystem::path("assets"))) {
            return "assets/";
        }
        if (std::filesystem::is_directory(std::filesystem::path("/usr/share/puzzle15/assets/"))) {
            return "/usr/share/puzzle15/assets/";
        }
        
        return "/usr/share/dansoft.puzzle15/assets/";
    }

    return "";
}