From 2062499f0c17e7564e30b4a9c7ae96a32491c5c1 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Fri, 13 May 2022 18:44:14 +0300 Subject: Initial version of enum extractor script --- tools/src/preproc/asm_file.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools/src/preproc/asm_file.cpp') diff --git a/tools/src/preproc/asm_file.cpp b/tools/src/preproc/asm_file.cpp index 30d6758f..283fed68 100644 --- a/tools/src/preproc/asm_file.cpp +++ b/tools/src/preproc/asm_file.cpp @@ -30,14 +30,13 @@ AsmFile::AsmFile(std::string filename) : m_filename(filename) { FILE* fp = std::fopen(filename.c_str(), "rb"); - if (fp == NULL) { - // The include might be an asset. - fp = std::fopen(("build/" + g_buildName + "/assets/" + filename).c_str(), "rb"); - - if (fp == NULL) - FATAL_ERROR("Failed to open \"%s\" for reading.\n", filename.c_str()); + for (int i = 0; fp == NULL && i < g_incPaths.size(); i++) { + fp = std::fopen((g_incPaths[i] + "/" + filename).c_str(), "rb"); } + if (fp == NULL) + FATAL_ERROR("Failed to open \"%s\" for reading.\n", filename.c_str()); + std::fseek(fp, 0, SEEK_END); m_size = std::ftell(fp); -- cgit v1.2.3