Squashed 'deps/nostalgia/' changes from e7a66390..a0c81463
a0c81463 [nostalgia/core/studio] East const some function args d5b232f5 [olympic/studio] Fix array bounds issue c79fe3be [buildcore] Make CMake configure failure trigger failed return code 1df4e780 [olympic/studio] Add new project menu, make file creation open file ffbdb09c [olympic/turbine/glfw] Add shift key support b35a956e [olympic/studio] Cleanup unused expression d3847caa [olympic/studio] Make Project::writeObj only write descriptor if it does not already exist or if debug build ae066a91 [olympic/studio] Fix Project::writeObj to ensure parent directory of file exists 67543af8 [ox/oc] Remove some unnecessary code 6b774ec2 [ox/oc] Fix array writing to write all values 4b9758f4 [nostalgia/core] Move most TileSheet member functions out of class bf12b15f [nostalgia/sample_project] Update some tilesheets to version 4 format a7328eb5 [nostalgia/core/studio] Reduce indent for Subsheet editor b52124a0 [nostalgia/core/studio] Revert new subsheet index increment to happen after index assignment eae9972f [nostalgia/sample_project] Add missing type descriptors d83e3929 [nostalgia/core] Cleanup, revert CompactTileSheet version to 1 e2d0a784 [olympic/keel] Cleanup f0882142 [nostalgia/core/studio] Change TileSheets to back to MC 6a2954f8 [nostalgia/core] Remove id from TileSheetV3::Subsheet, add TileSheetV4 9c19655c [nostalgia/core] Fix build, add SubSheet ID to SubSheet Editor view 087c834b [nostalgia/core/studio] Fix Add SubSheet to increment idIt before using it 79bdbf2e [nostalgia/core] Add id to TileSheetV3::SubSheet model 2bdc3def [nostalgia/core/opengl] Implement flip X and flip Y for BG tiles git-subtree-dir: deps/nostalgia git-subtree-split: a0c8146396a9e9c0dc48a2564f4e9870a212ed59
This commit is contained in:
30
deps/ox/src/ox/oc/write.hpp
vendored
30
deps/ox/src/ox/oc/write.hpp
vendored
@ -37,7 +37,7 @@ class OrganicClawWriter {
|
||||
explicit OrganicClawWriter(Json::Value json, int unionIdx = -1) noexcept;
|
||||
|
||||
Error field(const char *key, const int8_t *val) noexcept {
|
||||
if (*val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -45,7 +45,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const int16_t *val) noexcept {
|
||||
if (*val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -53,7 +53,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const int32_t *val) noexcept {
|
||||
if (*val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -61,7 +61,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const int64_t *val) noexcept {
|
||||
if (*val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -70,7 +70,7 @@ class OrganicClawWriter {
|
||||
|
||||
|
||||
Error field(const char *key, const uint8_t *val) noexcept {
|
||||
if (*val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -78,7 +78,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const uint16_t *val) noexcept {
|
||||
if (targetValid() && *val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -86,7 +86,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const uint32_t *val) noexcept {
|
||||
if (targetValid() && *val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -94,15 +94,15 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
Error field(const char *key, const uint64_t *val) noexcept {
|
||||
if (targetValid() && *val) {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
Error field(const char *key, const bool *val) noexcept {
|
||||
if (targetValid() && *val) {
|
||||
Error field(char const*key, bool const*val) noexcept {
|
||||
if (targetValid() && (*val || m_json.isArray())) {
|
||||
value(key) = *val;
|
||||
}
|
||||
++m_fieldIt;
|
||||
@ -110,10 +110,10 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
template<typename U, bool force = true>
|
||||
Error field(const char*, UnionView<U, force> val) noexcept;
|
||||
Error field(char const*, UnionView<U, force> val) noexcept;
|
||||
|
||||
template<typename T>
|
||||
Error field(const char *key, const HashMap<String, T> *val) noexcept {
|
||||
Error field(char const*key, HashMap<String, T> const*val) noexcept {
|
||||
if (targetValid()) {
|
||||
const auto &keys = val->keys();
|
||||
OrganicClawWriter w;
|
||||
@ -132,7 +132,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
template<std::size_t L>
|
||||
Error field(const char *key, const BString<L> *val) noexcept {
|
||||
Error field(char const*key, BString<L> const*val) noexcept {
|
||||
if (targetValid() && val->len()) {
|
||||
value(key) = val->c_str();
|
||||
}
|
||||
@ -141,7 +141,7 @@ class OrganicClawWriter {
|
||||
}
|
||||
|
||||
template<std::size_t L>
|
||||
Error field(const char *key, const BasicString<L> *val) noexcept {
|
||||
Error field(char const*key, BasicString<L> const*val) noexcept {
|
||||
if (targetValid() && val->len()) {
|
||||
value(key) = val->c_str();
|
||||
}
|
||||
@ -199,7 +199,7 @@ Error OrganicClawWriter::field(const char *key, const T *val, std::size_t len) n
|
||||
OrganicClawWriter w((Json::Value(Json::arrayValue)));
|
||||
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
|
||||
for (std::size_t i = 0; i < len; ++i) {
|
||||
oxReturnError(handler.field("", &val[i]));
|
||||
oxReturnError(handler.field({}, &val[i]));
|
||||
}
|
||||
value(key) = w.m_json;
|
||||
}
|
||||
|
Reference in New Issue
Block a user