mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- added Get/SetValue functions to PBool.
This commit is contained in:
parent
62fbb00bc9
commit
04c2565d7f
2 changed files with 30 additions and 0 deletions
|
@ -711,6 +711,32 @@ double PInt::GetValueFloat(void *addr) const
|
|||
|
||||
IMPLEMENT_CLASS(PBool, false, false)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PInt :: SetValue
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void PBool::SetValue(void *addr, int val)
|
||||
{
|
||||
*(bool*)addr = !!val;
|
||||
}
|
||||
|
||||
void PBool::SetValue(void *addr, double val)
|
||||
{
|
||||
*(bool*)addr = val != 0.;
|
||||
}
|
||||
|
||||
int PBool::GetValueInt(void *addr) const
|
||||
{
|
||||
return *(bool *)addr;
|
||||
}
|
||||
|
||||
double PBool::GetValueFloat(void *addr) const
|
||||
{
|
||||
return *(bool *)addr;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PBool Default Constructor
|
||||
|
|
|
@ -263,6 +263,10 @@ class PBool : public PInt
|
|||
DECLARE_CLASS(PBool, PInt);
|
||||
public:
|
||||
PBool();
|
||||
virtual void SetValue(void *addr, int val);
|
||||
virtual void SetValue(void *addr, double val);
|
||||
virtual int GetValueInt(void *addr) const;
|
||||
virtual double GetValueFloat(void *addr) const;
|
||||
};
|
||||
|
||||
class PFloat : public PBasicType
|
||||
|
|
Loading…
Reference in a new issue