Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
UIControl::UIControl()
|
||||
{
|
||||
m_parentScene = NULL;
|
||||
m_parentScene = nullptr;
|
||||
m_lastOpacity = 1.0f;
|
||||
m_controlName = "";
|
||||
m_isVisible = true;
|
||||
@@ -31,15 +31,15 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
|
||||
m_nameVisible = registerFastName(L"visible");
|
||||
|
||||
F64 fx, fy, fwidth, fheight;
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &fheight );
|
||||
|
||||
m_x = (S32)fx;
|
||||
m_y = (S32)fy;
|
||||
m_width = (S32)Math::round(fwidth);
|
||||
m_height = (S32)Math::round(fheight);
|
||||
m_x = static_cast<S32>(fx);
|
||||
m_y = static_cast<S32>(fy);
|
||||
m_width = static_cast<S32>(Math::round(fwidth));
|
||||
m_height = static_cast<S32>(Math::round(fheight));
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -47,14 +47,14 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
|
||||
void UIControl::UpdateControl()
|
||||
{
|
||||
F64 fx, fy, fwidth, fheight;
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
|
||||
m_x = (S32)fx;
|
||||
m_y = (S32)fy;
|
||||
m_width = (S32)Math::round(fwidth);
|
||||
m_height = (S32)Math::round(fheight);
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
|
||||
IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &fheight );
|
||||
m_x = static_cast<S32>(fx);
|
||||
m_y = static_cast<S32>(fy);
|
||||
m_width = static_cast<S32>(Math::round(fwidth));
|
||||
m_height = static_cast<S32>(Math::round(fheight));
|
||||
}
|
||||
|
||||
void UIControl::ReInit()
|
||||
@@ -76,7 +76,7 @@ void UIControl::ReInit()
|
||||
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, m_parentScene->m_rootPath , m_funcSetAlpha , 2 , value );
|
||||
}
|
||||
|
||||
IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, m_isVisible );
|
||||
IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, m_isVisible );
|
||||
}
|
||||
|
||||
IggyValuePath *UIControl::getIggyValuePath()
|
||||
@@ -130,7 +130,7 @@ void UIControl::setVisible(bool visible)
|
||||
{
|
||||
if(visible != m_isVisible)
|
||||
{
|
||||
rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, visible );
|
||||
rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, visible );
|
||||
if(succ) m_isVisible = visible;
|
||||
else app.DebugPrintf("Failed to set visibility for control\n");
|
||||
}
|
||||
@@ -140,7 +140,7 @@ bool UIControl::getVisible()
|
||||
{
|
||||
rrbool bVisible = false;
|
||||
|
||||
IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, NULL, &bVisible );
|
||||
IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, nullptr, &bVisible );
|
||||
|
||||
m_isVisible = bVisible;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user