mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-30 19:40:31 -07:00
* Add scene command parsers * Move logging & add logging cvar * Use new CVAR_DEVELOPER_TOOLS macro * Update soh/soh/resource/logging/SceneCommandLoggers.h --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
38 lines
1.5 KiB
C++
38 lines
1.5 KiB
C++
#include "soh/resource/importer/scenecommand/SetWindSettingsFactory.h"
|
|
#include "soh/resource/type/scenecommand/SetWindSettings.h"
|
|
#include "soh/resource/logging/SceneCommandLoggers.h"
|
|
#include "spdlog/spdlog.h"
|
|
|
|
namespace SOH {
|
|
std::shared_ptr<LUS::IResource>
|
|
SetWindSettingsFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) {
|
|
auto setWind = std::make_shared<SetWindSettings>(initData);
|
|
|
|
ReadCommandId(setWind, reader);
|
|
|
|
setWind->settings.windWest = reader->ReadInt8();
|
|
setWind->settings.windVertical = reader->ReadInt8();
|
|
setWind->settings.windSouth = reader->ReadInt8();
|
|
setWind->settings.windSpeed = reader->ReadUByte();
|
|
|
|
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) {
|
|
LogWindSettingsAsXML(setWind);
|
|
}
|
|
|
|
return setWind;
|
|
}
|
|
|
|
std::shared_ptr<LUS::IResource> SetWindSettingsFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData,
|
|
tinyxml2::XMLElement* reader) {
|
|
auto setWind = std::make_shared<SetWindSettings>(initData);
|
|
|
|
setWind->cmdId = SceneCommandID::SetWind;
|
|
|
|
setWind->settings.windWest = reader->IntAttribute("WindWest");
|
|
setWind->settings.windVertical = reader->IntAttribute("WindVertical");
|
|
setWind->settings.windSouth = reader->IntAttribute("WindSouth");
|
|
setWind->settings.windSpeed = reader->IntAttribute("WindSpeed");
|
|
|
|
return setWind;
|
|
}
|
|
} // namespace SOH
|