diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2022-01-20 23:47:57 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-20 21:47:57 -0500 |
| commit | 119a6883e6f795815744b9afd6a79084c619ddb6 (patch) | |
| tree | a8c34608bd215d56564ad46f03e235ddb9ed12e8 /ZAPD/ZFile.cpp | |
| parent | be71e26d9afc470a9293e74a6f56ca87f7412be0 (diff) | |
Automatic limbs enum generation (#221)
* proof of concept
* SetLimbIndex
* LIMB_DONE
* use proper enum name in limbs
* fix naming
* add ifdefs
* fix me being dumb
* format
* Add EnumPrefix
* EnumName
* Remove autogenerator stuff
* Add warnings
* format
* Use HANDLE_WARNING_RESOURCE for warning
* object_box special case
* whoops
* Remove overloaded bitconverter methods and use boundary-checker .at method when possible
* Fix warning
* Fix warning
* format
* Hopefully fix every warning now
* docs
* Review
* typo
* Update jenkinsfile for MM
* format
* Force functionpreamble printing in development mode
* Use ARRAY_COUNT on SkeletonHeaders
* Simplify endif in header guards
* fix limbs using the wrong enum value
* use hex in enum comments
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 22a6a45..d9733f3 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -406,7 +406,7 @@ void ZFile::AddResource(ZResource* res) resources.push_back(res); } -ZResource* ZFile::FindResource(uint32_t rawDataIndex) +ZResource* ZFile::FindResource(offset_t rawDataIndex) { for (ZResource* res : resources) { @@ -776,6 +776,11 @@ void ZFile::GenerateSourceHeaderFiles() { OutputFormatter formatter; + std::string objectNameUpper = StringHelper::ToUpper(GetName()); + + formatter.Write(StringHelper::Sprintf("#ifndef %s_H\n#define %s_H 1\n\n", + objectNameUpper.c_str(), objectNameUpper.c_str())); + for (ZResource* res : resources) { std::string resSrc = res->GetSourceOutputHeader(""); @@ -792,6 +797,8 @@ void ZFile::GenerateSourceHeaderFiles() formatter.Write(ProcessExterns()); + formatter.Write("#endif\n"); + fs::path headerFilename = GetSourceOutputFolderPath() / outName.stem().concat(".h"); if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) |
