summaryrefslogtreecommitdiff
path: root/tools/scaninc/source_file.cpp
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2020-06-27 17:52:35 +0100
committerGitHub <noreply@github.com>2020-06-27 17:52:35 +0100
commitc202e7568c660ce16853f6f21720240615b692f4 (patch)
tree0e6f9932e67d56a8d2342ee11f74e0ce1e6e44d7 /tools/scaninc/source_file.cpp
parent981bf953cbf711eca70d31ccec297ac38501ffd8 (diff)
parent51afc1756ecf096739b2b75806ed738bd7d56b18 (diff)
Merge pull request #191 from PikalaxALT/pikalax_work
Sound and script cleanup; fixrom + makerom
Diffstat (limited to 'tools/scaninc/source_file.cpp')
-rw-r--r--tools/scaninc/source_file.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp
index 5d0281a4..4f51cd48 100644
--- a/tools/scaninc/source_file.cpp
+++ b/tools/scaninc/source_file.cpp
@@ -39,8 +39,18 @@ SourceFileType GetFileType(std::string& path)
return SourceFileType::Header;
else if (extension == "inc")
return SourceFileType::Inc;
- else
- FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str());
+ else if (extension == "txt")
+ {
+ std::string trunc = path.substr(0, pos);
+ pos = trunc.find_last_of('.');
+ if (pos != std::string::npos)
+ {
+ std::string ext2 = trunc.substr(pos + 1);
+ if (ext2 == "json")
+ return SourceFileType::Cpp;
+ }
+ }
+ FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str());
// Unreachable
return SourceFileType::Cpp;