forked from Phobos-developers/Phobos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Veinholes and Weeders (Phobos-developers#1163)
* Veinholes and Weeders Prettify Minor fixes Rewrote tiberium pip code Clean up some things Removed controversial stuff Removed leftovers, started work on docs Docs Requested changes Updated docs, added named constant Re-enabled oregath Apply suggestions from code review Co-authored-by: Kerbiter <[email protected]> Added braces around nested loops Teleporting weeders now work * Fix after rebase * Add changelog entries * Fix not enough pips being displayed. Fix compiler warnings * Fix spelling * Change docs * Remove duplicate string * Update docs * Use note syntax for compatibility notice * Fix spelling and formatting * Apply suggestions from code review Co-authored-by: Kerbiter <[email protected]> * More review suggestions * Add links to docs * Improve docs * Rename constant --------- Co-authored-by: Kerbiter <[email protected]>
- Loading branch information
1 parent
5a845b7
commit d9db475
Showing
16 changed files
with
915 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#include "Body.h" | ||
|
||
ParticleTypeExt::ExtContainer ParticleTypeExt::ExtMap; | ||
|
||
// ============================= | ||
// load / save | ||
|
||
template <typename T> | ||
void ParticleTypeExt::ExtData::Serialize(T& Stm) | ||
{ | ||
Stm | ||
.Process(this->Gas_MaxDriftSpeed) | ||
; | ||
} | ||
|
||
void ParticleTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) | ||
{ | ||
auto pThis = this->OwnerObject(); | ||
const char* pSection = pThis->ID; | ||
|
||
if (!pINI->GetSection(pSection)) | ||
return; | ||
|
||
INI_EX exINI(pINI); | ||
|
||
this->Gas_MaxDriftSpeed.Read(exINI, pSection, "Gas.MaxDriftSpeed"); | ||
} | ||
|
||
void ParticleTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) | ||
{ | ||
Extension<ParticleTypeClass>::LoadFromStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
void ParticleTypeExt::ExtData::SaveToStream(PhobosStreamWriter& Stm) | ||
{ | ||
Extension<ParticleTypeClass>::SaveToStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
bool ParticleTypeExt::LoadGlobals(PhobosStreamReader& Stm) | ||
{ | ||
return Stm | ||
.Success(); | ||
} | ||
|
||
bool ParticleTypeExt::SaveGlobals(PhobosStreamWriter& Stm) | ||
{ | ||
return Stm | ||
.Success(); | ||
} | ||
|
||
// ============================= | ||
// container | ||
|
||
ParticleTypeExt::ExtContainer::ExtContainer() : Container("ParticleTypeClass") { } | ||
ParticleTypeExt::ExtContainer::~ExtContainer() = default; | ||
|
||
// ============================= | ||
// container hooks | ||
|
||
DEFINE_HOOK(0x644DBB, ParticleTypeClass_CTOR, 0x5) | ||
{ | ||
GET(ParticleTypeClass*, pItem, ESI); | ||
|
||
ParticleTypeExt::ExtMap.TryAllocate(pItem); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x6457A0, ParticleTypeClass_SaveLoad_Prefix, 0x5) | ||
DEFINE_HOOK(0x645660, ParticleTypeClass_SaveLoad_Prefix, 0x7) | ||
{ | ||
GET_STACK(ParticleTypeClass*, pItem, 0x4); | ||
GET_STACK(IStream*, pStm, 0x8); | ||
|
||
ParticleTypeExt::ExtMap.PrepareStream(pItem, pStm); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x64578C, ParticleTypeClass_Load_Suffix, 0x5) | ||
{ | ||
ParticleTypeExt::ExtMap.LoadStatic(); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x64580A, ParticleTypeClass_Save_Suffix, 0x7) | ||
{ | ||
ParticleTypeExt::ExtMap.SaveStatic(); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x6453FF, ParticleTypeClass_LoadFromINI, 0x6) | ||
{ | ||
GET(ParticleTypeClass*, pItem, ESI); | ||
GET_STACK(CCINIClass*, pINI, STACK_OFFSET(0xDC, 0x4)); | ||
|
||
ParticleTypeExt::ExtMap.LoadFromINI(pItem, pINI); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.