mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
Implement NewClassPointer()
This commit is contained in:
parent
8fbb4b90fb
commit
aba691ad72
1 changed files with 19 additions and 0 deletions
|
@ -579,6 +579,25 @@ void PClassPointer::GetTypeIDs(intptr_t &id1, intptr_t &id2) const
|
||||||
id2 = (intptr_t)ClassRestriction;
|
id2 = (intptr_t)ClassRestriction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// NewClassPointer
|
||||||
|
//
|
||||||
|
// Returns a PClassPointer for the restricted type.
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
PClassPointer *NewClassPointer(PClass *restrict)
|
||||||
|
{
|
||||||
|
size_t bucket;
|
||||||
|
PType *ptype = TypeTable.FindType(RUNTIME_CLASS(PPointer), (intptr_t)RUNTIME_CLASS(PClass), (intptr_t)restrict, &bucket);
|
||||||
|
if (ptype == NULL)
|
||||||
|
{
|
||||||
|
ptype = new PClassPointer(restrict);
|
||||||
|
TypeTable.AddType(ptype, RUNTIME_CLASS(PPointer), (intptr_t)RUNTIME_CLASS(PClass), (intptr_t)restrict, bucket);
|
||||||
|
}
|
||||||
|
return static_cast<PClassPointer *>(ptype);
|
||||||
|
}
|
||||||
|
|
||||||
/* PEnum ******************************************************************/
|
/* PEnum ******************************************************************/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue