-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I believe this is only ever used for MQO.
- Loading branch information
Showing
4 changed files
with
109 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* This file is part of HSPlasma. | ||
* | ||
* HSPlasma is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* HSPlasma is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with HSPlasma. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "plCloneSpawnModifier.h" | ||
|
||
void plCloneSpawnModifier::read(hsStream* S, plResManager* mgr) | ||
{ | ||
if (S->getVer().isMoul()) { | ||
plSingleModifier::read(S, mgr); | ||
fTemplateName = S->readSafeStr(); | ||
fUserData = S->readInt(); | ||
} else { | ||
// This is bad, but also never used in earlier Plasma versions | ||
fTemplateName = S->readSafeStr(); | ||
plSingleModifier::read(S, mgr); | ||
} | ||
} | ||
|
||
void plCloneSpawnModifier::write(hsStream* S, plResManager* mgr) | ||
{ | ||
if (S->getVer().isMoul()) { | ||
plSingleModifier::write(S, mgr); | ||
S->writeSafeStr(fTemplateName); | ||
S->writeInt(fUserData); | ||
} else { | ||
// This is bad, but also never used in earlier Plasma versions | ||
S->writeSafeStr(fTemplateName); | ||
plSingleModifier::write(S, mgr); | ||
} | ||
} | ||
|
||
void plCloneSpawnModifier::IPrcWrite(pfPrcHelper* prc) | ||
{ | ||
plSingleModifier::IPrcWrite(prc); | ||
|
||
prc->startTag("SpawnParams"); | ||
prc->writeParam("TemplateName", fTemplateName); | ||
prc->writeParam("UserData", fUserData); | ||
prc->endTag(true); | ||
} | ||
|
||
void plCloneSpawnModifier::IPrcParse(const pfPrcTag* tag, plResManager* mgr) | ||
{ | ||
if (tag->getName() == "SpawnParams") { | ||
fTemplateName = tag->getParam("TemplateName", ""); | ||
fUserData = tag->getParam("UserData", "0").to_uint(); | ||
} else { | ||
plSingleModifier::IPrcParse(tag, mgr); | ||
} | ||
} | ||
|
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,41 @@ | ||
/* This file is part of HSPlasma. | ||
* | ||
* HSPlasma is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* HSPlasma is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with HSPlasma. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef _PLCLONESPAWNMODIFIER_H | ||
#define _PLCLONESPAWNMODIFIER_H | ||
|
||
#include "plModifier.h" | ||
|
||
class HSPLASMA_EXPORT plCloneSpawnModifier : public plSingleModifier | ||
{ | ||
CREATABLE(plCloneSpawnModifier, kCloneSpawnModifier, plSingleModifier) | ||
|
||
protected: | ||
ST::string fTemplateName; | ||
uint32_t fUserData; | ||
|
||
public: | ||
plCloneSpawnModifier() : fUserData() { } | ||
|
||
void read(hsStream* S, plResManager* mgr) HS_OVERRIDE; | ||
void write(hsStream* S, plResManager* mgr) HS_OVERRIDE; | ||
|
||
protected: | ||
void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; | ||
void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; | ||
}; | ||
|
||
#endif |
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