mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-30 20:41:00 +00:00
- fixing.
This commit is contained in:
parent
718614a820
commit
967ed48fd3
2 changed files with 9 additions and 6 deletions
|
@ -220,7 +220,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, subsector_t *&ss, subs
|
||||||
{
|
{
|
||||||
if (hasglnodes)
|
if (hasglnodes)
|
||||||
{
|
{
|
||||||
TArray<char> encoded((numsubsectors + 5) / 6);
|
TArray<char> encoded(1 + (numsubsectors + 5) / 6);
|
||||||
int p = 0;
|
int p = 0;
|
||||||
for (int i = 0; i < numsubsectors; i += 6)
|
for (int i = 0; i < numsubsectors; i += 6)
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,9 +71,12 @@ struct FWriter
|
||||||
TArray<DObject *> mDObjects;
|
TArray<DObject *> mDObjects;
|
||||||
TMap<DObject *, int> mObjectMap;
|
TMap<DObject *, int> mObjectMap;
|
||||||
|
|
||||||
|
FWriter() : mWriter(mOutString)
|
||||||
|
{}
|
||||||
|
|
||||||
bool inObject() const
|
bool inObject() const
|
||||||
{
|
{
|
||||||
return mInObject.Size() > 0 && inObject();
|
return mInObject.Size() > 0 && mInObject.Last();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,7 +130,7 @@ struct FReader
|
||||||
|
|
||||||
bool FSerializer::OpenWriter()
|
bool FSerializer::OpenWriter()
|
||||||
{
|
{
|
||||||
if (w != nullptr || r == nullptr) return false;
|
if (w != nullptr || r != nullptr) return false;
|
||||||
w = new FWriter;
|
w = new FWriter;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -141,7 +144,7 @@ bool FSerializer::OpenWriter()
|
||||||
|
|
||||||
bool FSerializer::OpenReader(const char *buffer, size_t length)
|
bool FSerializer::OpenReader(const char *buffer, size_t length)
|
||||||
{
|
{
|
||||||
if (w != nullptr || r == nullptr) return false;
|
if (w != nullptr || r != nullptr) return false;
|
||||||
r = new FReader(buffer, length);
|
r = new FReader(buffer, length);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +324,7 @@ void FSerializer::EndArray()
|
||||||
{
|
{
|
||||||
if (isWriting())
|
if (isWriting())
|
||||||
{
|
{
|
||||||
if (w->inObject())
|
if (!w->inObject())
|
||||||
{
|
{
|
||||||
w->mWriter.EndArray();
|
w->mWriter.EndArray();
|
||||||
w->mInObject.Pop();
|
w->mInObject.Pop();
|
||||||
|
@ -859,7 +862,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, FTextureID &value, FTe
|
||||||
arc.w->mWriter.StartArray();
|
arc.w->mWriter.StartArray();
|
||||||
arc.w->mWriter.String(name);
|
arc.w->mWriter.String(name);
|
||||||
arc.w->mWriter.Int(pic->UseType);
|
arc.w->mWriter.Int(pic->UseType);
|
||||||
arc.w->mWriter.EndObject();
|
arc.w->mWriter.EndArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue