mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
Minor PField changes.
- Rename FieldOffset and FieldType so they no longer have the "Field" prefix - Add a Flags field.
This commit is contained in:
parent
e50c00c856
commit
4cf0ef7e3f
2 changed files with 8 additions and 6 deletions
|
@ -1099,10 +1099,10 @@ PField *PStruct::AddField(FName name, PType *type)
|
|||
PField *field = new PField(name, type);
|
||||
|
||||
// The new field is added to the end of this struct, alignment permitting.
|
||||
field->FieldOffset = (Size + (type->Align - 1)) & ~(type->Align - 1);
|
||||
field->Offset = (Size + (type->Align - 1)) & ~(type->Align - 1);
|
||||
|
||||
// Enlarge this struct to enclose the new field.
|
||||
Size = field->FieldOffset + type->Size;
|
||||
Size = field->Offset + type->Size;
|
||||
|
||||
// This struct's alignment is the same as the largest alignment of any of
|
||||
// its fields.
|
||||
|
@ -1161,7 +1161,7 @@ IMPLEMENT_CLASS(PField)
|
|||
//==========================================================================
|
||||
|
||||
PField::PField()
|
||||
: PSymbol(NAME_None)
|
||||
: PSymbol(NAME_None), Offset(0), Type(NULL), Flags(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -325,10 +325,12 @@ class PField : public PSymbol
|
|||
DECLARE_CLASS(PField, PSymbol);
|
||||
HAS_OBJECT_POINTERS
|
||||
public:
|
||||
PField(FName name, PType *type) : PSymbol(name), FieldOffset(0), FieldType(type) {}
|
||||
PField(FName name, PType *type) : PSymbol(name), Offset(0), Type(type), Flags(0) {}
|
||||
PField(FName name, PType *type, DWORD flags) : PSymbol(name), Offset(0), Type(type), Flags(flags) {}
|
||||
|
||||
unsigned int FieldOffset;
|
||||
PType *FieldType;
|
||||
unsigned int Offset;
|
||||
PType *Type;
|
||||
DWORD Flags;
|
||||
protected:
|
||||
PField();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue