From ea222f8ec23e8f20346462989e12bfb7d1aaf1dd Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 25 Mar 2024 01:13:36 +0100 Subject: [PATCH] Locate resources automatically if the map file is in a maps folder inside the resources folder --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 84f8632..3327999 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,6 +57,7 @@ #include "framework/zdray.h" #include "framework/filesystem.h" +#include "framework/file.h" #include "wad/wad.h" #include "level/level.h" #include "commandline/getopt.h" @@ -234,7 +235,10 @@ int main(int argc, char **argv) fixSame = true; } - // fileSystem.AddFolderSource("C:\\Development\\VkDoom\\build\\RelWithDebInfo\\ElderJamReignited"); + // Search for texture resources with the assumption that the map is in a maps folder and the textures folder is next to it. + // To do: allow specifying the path via commandline + FString inResourceFolder = FilePath::combine(FilePath::remove_last_component(InName), "..").c_str(); + fileSystem.AddFolderSource(inResourceFolder); { FWadReader inwad(InName);