Apply clang-modernize -use-nullptr
parent
ba3284b8b8
commit
a63a959dbe
|
@ -3196,7 +3196,7 @@ CBotInstr* CBotExprVar::CompileMethode(CBotToken* &p, CBotCStack* pStack)
|
|||
{
|
||||
CBotToken pthis("this");
|
||||
CBotVar* var = pStk->FindVar(pthis);
|
||||
if (var == 0) return pStack->Return(nullptr, pStk);
|
||||
if (var == nullptr) return pStack->Return(nullptr, pStk);
|
||||
|
||||
CBotInstr* inst = new CBotExprVar();
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ void CBotClass::Unlock()
|
|||
{
|
||||
m_ProgInLock[j] = m_ProgInLock[j+1];
|
||||
}
|
||||
m_ProgInLock[i] = 0;
|
||||
m_ProgInLock[i] = nullptr;
|
||||
}
|
||||
|
||||
void CBotClass::FreeLock(CBotProgram* p)
|
||||
|
|
|
@ -96,7 +96,7 @@ struct ApplicationPrivate
|
|||
SDL_memset(&lastMouseMotionEvent, 0, sizeof(SDL_Event));
|
||||
surface = nullptr;
|
||||
joystick = nullptr;
|
||||
joystickTimer = 0;
|
||||
joystickTimer = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ std::string TimeFormat(float time)
|
|||
|
||||
void AddExt(char* filename, const char* ext)
|
||||
{
|
||||
if ( strchr(filename, '.') != 0 ) return; // already an extension?
|
||||
if ( strchr(filename, '.') != nullptr ) return; // already an extension?
|
||||
strcat(filename, ext);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ CCamera::CCamera()
|
|||
|
||||
m_type = CAM_TYPE_FREE;
|
||||
m_smooth = CAM_SMOOTH_NORM;
|
||||
m_cameraObj = 0;
|
||||
m_cameraObj = nullptr;
|
||||
|
||||
m_eyeDistance = 10.0f;
|
||||
m_initDelay = 0.0f;
|
||||
|
@ -350,7 +350,7 @@ void CCamera::SetType(CameraType type)
|
|||
m_addDirectionV = -Math::PI*0.05f;
|
||||
|
||||
ObjectType oType;
|
||||
if ( m_cameraObj == 0 ) oType = OBJECT_NULL;
|
||||
if ( m_cameraObj == nullptr ) oType = OBJECT_NULL;
|
||||
else oType = m_cameraObj->GetType();
|
||||
|
||||
m_backDist = 30.0f;
|
||||
|
|
|
@ -318,7 +318,7 @@ CObject* CLightning::SearchObject(Math::Vector pos)
|
|||
paraObjPos.reserve(100);
|
||||
|
||||
// Seeking the object closest to the point of impact of lightning.
|
||||
CObject* bestObj = 0;
|
||||
CObject* bestObj = nullptr;
|
||||
float min = 100000.0f;
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
|
|
@ -314,8 +314,8 @@ int CParticle::CreateParticle(Math::Vector pos, Math::Vector speed, Math::Point
|
|||
m_particle[i].time = 0.0f;
|
||||
m_particle[i].phaseTime = 0.0f;
|
||||
m_particle[i].testTime = 0.0f;
|
||||
m_particle[i].objLink = 0;
|
||||
m_particle[i].objFather = 0;
|
||||
m_particle[i].objLink = nullptr;
|
||||
m_particle[i].objFather = nullptr;
|
||||
m_particle[i].trackRank = -1;
|
||||
|
||||
m_totalInterface[t][sheet] ++;
|
||||
|
@ -388,8 +388,8 @@ int CParticle::CreateFrag(Math::Vector pos, Math::Vector speed,
|
|||
m_particle[i].time = 0.0f;
|
||||
m_particle[i].phaseTime = 0.0f;
|
||||
m_particle[i].testTime = 0.0f;
|
||||
m_particle[i].objLink = 0;
|
||||
m_particle[i].objFather = 0;
|
||||
m_particle[i].objLink = nullptr;
|
||||
m_particle[i].objFather = nullptr;
|
||||
m_particle[i].trackRank = -1;
|
||||
m_triangle[i] = *triangle;
|
||||
|
||||
|
@ -549,8 +549,8 @@ int CParticle::CreateRay(Math::Vector pos, Math::Vector goal,
|
|||
m_particle[i].time = 0.0f;
|
||||
m_particle[i].phaseTime = 0.0f;
|
||||
m_particle[i].testTime = 0.0f;
|
||||
m_particle[i].objLink = 0;
|
||||
m_particle[i].objFather = 0;
|
||||
m_particle[i].objLink = nullptr;
|
||||
m_particle[i].objFather = nullptr;
|
||||
m_particle[i].trackRank = -1;
|
||||
|
||||
m_totalInterface[t][sheet] ++;
|
||||
|
@ -3578,7 +3578,7 @@ CObject* CParticle::SearchObjectGun(Math::Vector old, Math::Vector pos,
|
|||
box2.y += min;
|
||||
box2.z += min;
|
||||
|
||||
CObject* best = 0;
|
||||
CObject* best = nullptr;
|
||||
bool shield = false;
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
|
|
@ -2313,7 +2313,7 @@ void CPyro::FallProgress(float rTime)
|
|||
|
||||
Error CPyro::FallIsEnded()
|
||||
{
|
||||
if (m_fallEnding || m_object == 0) return ERR_STOP;
|
||||
if (m_fallEnding || m_object == nullptr) return ERR_STOP;
|
||||
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
if (pos.y > m_fallFloor) return ERR_CONTINUE;
|
||||
|
|
|
@ -171,15 +171,15 @@ CRobotMain::CRobotMain()
|
|||
m_phase = PHASE_PLAYER_SELECT;
|
||||
m_cameraRank = -1;
|
||||
m_visitLast = EVENT_NULL;
|
||||
m_visitObject = 0;
|
||||
m_visitArrow = 0;
|
||||
m_visitObject = nullptr;
|
||||
m_visitArrow = nullptr;
|
||||
m_audioTrack = "";
|
||||
m_audioRepeat = true;
|
||||
m_satcomTrack = "";
|
||||
m_satcomRepeat = true;
|
||||
m_editorTrack = "";
|
||||
m_editorRepeat = true;
|
||||
m_selectObject = 0;
|
||||
m_selectObject = nullptr;
|
||||
m_infoUsed = 0;
|
||||
|
||||
m_controller = nullptr;
|
||||
|
@ -249,7 +249,7 @@ CRobotMain::CRobotMain()
|
|||
{
|
||||
m_showLimit[i].used = false;
|
||||
m_showLimit[i].total = 0;
|
||||
m_showLimit[i].link = 0;
|
||||
m_showLimit[i].link = nullptr;
|
||||
}
|
||||
|
||||
m_engine->SetTerrain(m_terrain.get());
|
||||
|
@ -391,7 +391,7 @@ void CRobotMain::ChangePhase(Phase phase)
|
|||
{
|
||||
SaveAllScript();
|
||||
m_sound->StopMusic(0.0f);
|
||||
m_camera->SetControllingObject(0);
|
||||
m_camera->SetControllingObject(nullptr);
|
||||
|
||||
if (m_gameTime > 10.0f) // did you play at least 10 seconds?
|
||||
{
|
||||
|
@ -1579,7 +1579,7 @@ void CRobotMain::StartDisplayVisit(EventType event)
|
|||
}
|
||||
|
||||
// Creates the "continue" button.
|
||||
if (m_interface->SearchControl(EVENT_DT_END) == 0)
|
||||
if (m_interface->SearchControl(EVENT_DT_END) == nullptr)
|
||||
{
|
||||
Math::Point pos, dim;
|
||||
pos.x = 10.0f/640.0f;
|
||||
|
@ -1590,7 +1590,7 @@ void CRobotMain::StartDisplayVisit(EventType event)
|
|||
}
|
||||
|
||||
// Creates the arrow to show the place.
|
||||
if (m_visitArrow != 0)
|
||||
if (m_visitArrow != nullptr)
|
||||
{
|
||||
CObjectManager::GetInstancePointer()->DeleteObject(m_visitArrow);
|
||||
m_visitArrow = nullptr;
|
||||
|
@ -1621,7 +1621,7 @@ void CRobotMain::StartDisplayVisit(EventType event)
|
|||
//! Move the arrow to visit
|
||||
void CRobotMain::FrameVisit(float rTime)
|
||||
{
|
||||
if (m_visitArrow == 0) return;
|
||||
if (m_visitArrow == nullptr) return;
|
||||
|
||||
// Moves the arrow.
|
||||
m_visitTime += rTime;
|
||||
|
@ -1669,10 +1669,10 @@ void CRobotMain::StopDisplayVisit()
|
|||
m_camera->StopVisit();
|
||||
m_displayText->ClearVisit();
|
||||
ChangePause(PAUSE_NONE);
|
||||
if (m_visitObject != 0)
|
||||
if (m_visitObject != nullptr)
|
||||
{
|
||||
SelectObject(m_visitObject, false); // gives the command buttons
|
||||
m_visitObject = 0;
|
||||
m_visitObject = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1837,7 +1837,7 @@ CObject* CRobotMain::SearchToto()
|
|||
CObject* CRobotMain::SearchNearest(Math::Vector pos, CObject* exclu)
|
||||
{
|
||||
float min = 100000.0f;
|
||||
CObject* best = 0;
|
||||
CObject* best = nullptr;
|
||||
for (CObject* obj : m_objMan->GetAllObjects())
|
||||
{
|
||||
if (obj == exclu) continue;
|
||||
|
@ -1907,7 +1907,7 @@ CObject* CRobotMain::DetectObject(Math::Point pos)
|
|||
return target;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//! Indicates whether an object is selectable
|
||||
|
@ -1968,8 +1968,8 @@ void CRobotMain::HiliteClear()
|
|||
if (!obj->Implements(ObjectInterfaceType::Controllable)) continue;
|
||||
dynamic_cast<CControllableObject*>(obj)->SetHighlight(false);
|
||||
}
|
||||
m_map->SetHighlight(0);
|
||||
m_short->SetHighlight(0);
|
||||
m_map->SetHighlight(nullptr);
|
||||
m_short->SetHighlight(nullptr);
|
||||
|
||||
m_hilite = false;
|
||||
}
|
||||
|
@ -2274,7 +2274,7 @@ void CRobotMain::AbortMovie()
|
|||
if (obj->Implements(ObjectInterfaceType::Old))
|
||||
{
|
||||
CAuto* automat = obj->GetAuto();
|
||||
if (automat != 0)
|
||||
if (automat != nullptr)
|
||||
automat->Abort();
|
||||
}
|
||||
}
|
||||
|
@ -2783,7 +2783,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
m_ui->GetLoadingScreen()->SetProgress(0.1f, RT_LOADING_LEVEL_SETTINGS);
|
||||
|
||||
int rankObj = 0;
|
||||
CObject* sel = 0;
|
||||
CObject* sel = nullptr;
|
||||
|
||||
/*
|
||||
* NOTE: Moving frequently used lines to the top
|
||||
|
@ -3659,7 +3659,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
if (m_fixScene)
|
||||
m_camera->SetType(Gfx::CAM_TYPE_SCRIPT);
|
||||
|
||||
if (!m_sceneReadPath.empty() && sel != 0) // loading file?
|
||||
if (!m_sceneReadPath.empty() && sel != nullptr) // loading file?
|
||||
{
|
||||
Math::Vector pos = sel->GetPosition();
|
||||
m_camera->Init(pos, pos, 0.0f);
|
||||
|
@ -3845,13 +3845,13 @@ void CRobotMain::ChangeColor()
|
|||
std::string teamStr = StrUtils::ToString<int>(team);
|
||||
if(team == 0) teamStr = "";
|
||||
|
||||
m_engine->ChangeTextureColor("textures/objects/base1.png"+teamStr, "textures/objects/base1.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/convert.png"+teamStr, "textures/objects/convert.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/derrick.png"+teamStr, "textures/objects/derrick.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/factory.png"+teamStr, "textures/objects/factory.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/lemt.png"+teamStr, "textures/objects/lemt.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/roller.png"+teamStr, "textures/objects/roller.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/search.png"+teamStr, "textures/objects/search.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/base1.png"+teamStr, "textures/objects/base1.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/convert.png"+teamStr, "textures/objects/convert.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/derrick.png"+teamStr, "textures/objects/derrick.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/factory.png"+teamStr, "textures/objects/factory.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/lemt.png"+teamStr, "textures/objects/lemt.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/roller.png"+teamStr, "textures/objects/roller.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
m_engine->ChangeTextureColor("textures/objects/search.png"+teamStr, "textures/objects/search.png", m_colorRefBot, newColor, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, nullptr, 0, true);
|
||||
|
||||
exclu[0] = Math::Point( 0.0f/256.0f, 160.0f/256.0f);
|
||||
exclu[1] = Math::Point(256.0f/256.0f, 256.0f/256.0f); // pencils
|
||||
|
@ -3885,12 +3885,12 @@ void CRobotMain::ChangeColor()
|
|||
// PARTIPLOUF0 and PARTIDROP :
|
||||
ts = Math::Point(0.500f, 0.500f);
|
||||
ti = Math::Point(0.875f, 0.750f);
|
||||
m_engine->ChangeTextureColor("textures/effect00.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
|
||||
m_engine->ChangeTextureColor("textures/effect00.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, nullptr, m_colorShiftWater, true);
|
||||
|
||||
// PARTIFLIC :
|
||||
ts = Math::Point(0.00f, 0.75f);
|
||||
ti = Math::Point(0.25f, 1.00f);
|
||||
m_engine->ChangeTextureColor("textures/effect02.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
|
||||
m_engine->ChangeTextureColor("textures/effect02.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, nullptr, m_colorShiftWater, true);
|
||||
|
||||
// This loads the newly recolored textures to objects
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -4198,7 +4198,7 @@ void CRobotMain::FlushShowLimit(int i)
|
|||
}
|
||||
|
||||
m_showLimit[i].total = 0;
|
||||
m_showLimit[i].link = 0;
|
||||
m_showLimit[i].link = nullptr;
|
||||
m_showLimit[i].used = false;
|
||||
}
|
||||
|
||||
|
@ -5873,7 +5873,7 @@ void CRobotMain::StartDetectEffect(COldObject* object, CObject* target)
|
|||
mat = object->GetWorldMatrix(0);
|
||||
pos = Math::Transform(*mat, Math::Vector(2.0f, 3.0f, 0.0f));
|
||||
|
||||
if ( target == 0 )
|
||||
if ( target == nullptr )
|
||||
{
|
||||
goal = Math::Transform(*mat, Math::Vector(50.0f, 3.0f, 0.0f));
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ bool CAuto::CreateInterface(bool bSelect)
|
|||
dim.y = 86.0f/480.0f;
|
||||
m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0);
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
pos.x = 0.0f;
|
||||
pos.y = 64.0f/480.0f;
|
||||
|
|
|
@ -138,7 +138,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
if ( m_progress >= 1.0f )
|
||||
{
|
||||
cargo = SearchStone(OBJECT_STONE); // Has stone transformed?
|
||||
if ( cargo == 0 || SearchVehicle() )
|
||||
if ( cargo == nullptr || SearchVehicle() )
|
||||
{
|
||||
m_phase = ACP_WAIT; // still waiting ...
|
||||
m_progress = 0.0f;
|
||||
|
|
|
@ -327,7 +327,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
|
||||
cargo = SearchCargo();
|
||||
|
||||
if ( cargo != 0 &&
|
||||
if ( cargo != nullptr &&
|
||||
m_progress <= 0.5f &&
|
||||
m_lastParticle+m_engine->ParticleAdapt(0.1f) <= m_time )
|
||||
{
|
||||
|
@ -359,7 +359,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
pos = cargo->GetPosition();
|
||||
pos.y -= event.rTime*20.0f; // grave
|
||||
|
@ -410,7 +410,7 @@ bool CAutoDerrick::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
|
|
@ -162,11 +162,11 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
if (m_main->GetSelect() == m_object)
|
||||
{
|
||||
scrap = SearchPlastic();
|
||||
if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != 0));
|
||||
if ( pw != nullptr ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != nullptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( pw != 0 ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false);
|
||||
else if ( pw != nullptr ) EnableInterface(pw, EVENT_OBJECT_BDESTROY, false);
|
||||
|
||||
if ( m_phase == ADEP_DOWN )
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ bool CAutoDestroyer::CreateInterface(bool bSelect)
|
|||
pw->CreateButton(pos, ddim, 12, EVENT_OBJECT_BDESTROY);
|
||||
|
||||
scrap = SearchPlastic();
|
||||
EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != 0));
|
||||
EnableInterface(pw, EVENT_OBJECT_BDESTROY, (scrap != nullptr));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ void CAutoDestroyer::EnableInterface(Ui::CWindow *pw, EventType event, bool bSta
|
|||
Ui::CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(Ui::STATE_ENABLE, bState);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ void CAutoEgg::Init()
|
|||
CObject* alien;
|
||||
|
||||
alien = SearchAlien();
|
||||
if ( alien == 0 )
|
||||
if ( alien == nullptr )
|
||||
{
|
||||
m_phase = AEP_NULL;
|
||||
m_progress = 0.0f;
|
||||
|
@ -234,7 +234,7 @@ Error CAutoEgg::IsEnded()
|
|||
}
|
||||
|
||||
alien = SearchAlien();
|
||||
if ( alien == 0 ) return ERR_STOP;
|
||||
if ( alien == nullptr ) return ERR_STOP;
|
||||
|
||||
if ( m_phase == AEP_INCUB )
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ Error CAutoFactory::StartAction(int param)
|
|||
m_type = type;
|
||||
|
||||
cargo = SearchCargo(); // transform metal?
|
||||
if ( cargo == 0 )
|
||||
if ( cargo == nullptr )
|
||||
{
|
||||
return ERR_FACTORY_NULL;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
if ( !CreateVehicle() )
|
||||
{
|
||||
cargo = SearchCargo(); // transform metal?
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
cargo->SetLock(false); // metal usable again
|
||||
}
|
||||
|
@ -346,14 +346,14 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
angle = powf(prog*10.0f, 2.0f)+m_object->GetRotationY();
|
||||
|
||||
vehicle = SearchVehicle();
|
||||
if ( vehicle != 0 )
|
||||
if ( vehicle != nullptr )
|
||||
{
|
||||
vehicle->SetRotationY(angle+Math::PI);
|
||||
vehicle->SetScale(m_progress);
|
||||
}
|
||||
|
||||
cargo = SearchCargo(); // transform metal?
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
cargo->SetScale(1.0f-m_progress);
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ CObject* CAutoFactory::SearchCargo()
|
|||
if ( dist < 8.0f ) return obj;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Search if a vehicle is too close.
|
||||
|
|
|
@ -303,7 +303,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
if ( m_progress < 1.0f )
|
||||
{
|
||||
power = m_object->GetPower();
|
||||
if ( power != 0 )
|
||||
if ( power != nullptr )
|
||||
{
|
||||
power->SetScale(1.0f-m_progress);
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ bool CAutoLabo::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
dim.x = 33.0f/640.0f;
|
||||
dim.y = 33.0f/480.0f;
|
||||
|
@ -512,7 +512,7 @@ void CAutoLabo::UpdateInterface()
|
|||
CAuto::UpdateInterface();
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
DeadInterface(pw, EVENT_OBJECT_RiPAW, m_main->IsResearchEnabled(RESEARCH_iPAW));
|
||||
DeadInterface(pw, EVENT_OBJECT_RiGUN, m_main->IsResearchEnabled(RESEARCH_iGUN));
|
||||
|
@ -531,7 +531,7 @@ void CAutoLabo::OkayButton(Ui::CWindow *pw, EventType event)
|
|||
Ui::CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(Ui::STATE_OKAY, TestResearch(event));
|
||||
}
|
||||
|
|
|
@ -120,14 +120,14 @@ bool CAutoNest::EventProcess(const Event &event)
|
|||
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
cargo->SetScale(m_progress);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
cargo->SetScale(1.0f);
|
||||
cargo->SetLock(false);
|
||||
|
|
|
@ -143,7 +143,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
if ( m_progress >= 1.0f )
|
||||
{
|
||||
cargo = SearchUranium(); // transform uranium?
|
||||
if ( cargo == 0 || SearchVehicle() )
|
||||
if ( cargo == nullptr || SearchVehicle() )
|
||||
{
|
||||
m_phase = ANUP_WAIT; // still waiting ...
|
||||
m_progress = 0.0f;
|
||||
|
@ -306,7 +306,7 @@ bool CAutoNuclearPlant::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
|
|
@ -208,7 +208,7 @@ bool CAutoPowerCaptor::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
|
|
@ -171,7 +171,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
{
|
||||
bGO = false;
|
||||
cargo = SearchMetal(); // transform metal?
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
if ( cargo->GetType() == OBJECT_METAL )
|
||||
{
|
||||
|
@ -254,7 +254,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
if ( m_progress < 1.0f )
|
||||
{
|
||||
cargo = SearchMetal();
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
if ( cargo->GetType() == OBJECT_METAL )
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
cargo = SearchPower();
|
||||
if ( cargo != 0 )
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
cargo->SetScale(m_progress);
|
||||
}
|
||||
|
@ -527,7 +527,7 @@ bool CAutoPowerPlant::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
@ -565,10 +565,10 @@ void CAutoPowerPlant::UpdateInterface(float rTime)
|
|||
if ( !m_object->GetSelect() ) return;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
pg->SetLevel(m_object->GetEnergy());
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ CObject* CAutoPowerStation::SearchVehicle()
|
|||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,7 +316,7 @@ bool CAutoPowerStation::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
@ -354,10 +354,10 @@ void CAutoPowerStation::UpdateInterface(float rTime)
|
|||
if ( !m_object->GetSelect() ) return;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
pg->SetLevel(m_object->GetEnergy());
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ bool CAutoRadar::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
@ -250,10 +250,10 @@ void CAutoRadar::UpdateInterface()
|
|||
CAuto::UpdateInterface();
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GRADAR));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
level = static_cast< float >(m_totalDetect*(1.0f/8.0f));
|
||||
if ( level > 1.0f ) level = 1.0f;
|
||||
|
|
|
@ -106,7 +106,7 @@ bool CAutoRepair::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress >= 1.0f )
|
||||
{
|
||||
if ( SearchVehicle() == 0 )
|
||||
if ( SearchVehicle() == nullptr )
|
||||
{
|
||||
m_phase = ARP_WAIT; // still waiting ...
|
||||
m_progress = 0.0f;
|
||||
|
@ -216,7 +216,7 @@ bool CAutoRepair::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
|
|
@ -329,7 +329,7 @@ bool CAutoResearch::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
dim.x = 33.0f/640.0f;
|
||||
dim.y = 33.0f/480.0f;
|
||||
|
@ -398,7 +398,7 @@ void CAutoResearch::UpdateInterface()
|
|||
CAuto::UpdateInterface();
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
DeadInterface(pw, EVENT_OBJECT_RTANK, m_main->IsResearchEnabled(RESEARCH_TANK));
|
||||
DeadInterface(pw, EVENT_OBJECT_RFLY, m_main->IsResearchEnabled(RESEARCH_FLY));
|
||||
|
@ -458,7 +458,7 @@ void CAutoResearch::OkayButton(Ui::CWindow *pw, EventType event)
|
|||
Ui::CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(Ui::STATE_OKAY, TestResearch(event));
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
{
|
||||
m_main->DisplayError(ERR_TOWER_ENERGY, m_object);
|
||||
}
|
||||
if ( target == 0 || energy < ENERGY_FIRE )
|
||||
if ( target == nullptr || energy < ENERGY_FIRE )
|
||||
{
|
||||
m_phase = ATP_ZERO;
|
||||
m_progress = 0.0f;
|
||||
|
@ -409,7 +409,7 @@ bool CAutoTower::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
@ -450,10 +450,10 @@ void CAutoTower::UpdateInterface(float rTime)
|
|||
if ( !m_object->GetSelect() ) return;
|
||||
|
||||
Ui::CWindow* pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
Ui::CGauge* pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
float energy = GetObjectEnergy(m_object);
|
||||
pg->SetLevel(energy);
|
||||
|
|
|
@ -136,7 +136,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
if ( !m_bLock && CRobotMain::GetInstancePointer()->GetGameTime() < 1.0f )
|
||||
{
|
||||
pObj = SearchVehicle();
|
||||
if ( pObj != 0 )
|
||||
if ( pObj != nullptr )
|
||||
{
|
||||
pObj->SetLock(true); // object not yet usable
|
||||
m_main->CreateShortcuts();
|
||||
|
@ -234,7 +234,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
DeleteKeys();
|
||||
|
||||
pObj = SearchVehicle();
|
||||
if ( pObj != 0 )
|
||||
if ( pObj != nullptr )
|
||||
{
|
||||
pObj->SetLock(false); // object usable
|
||||
m_main->CreateShortcuts();
|
||||
|
@ -320,7 +320,7 @@ bool CAutoVault::CreateInterface(bool bSelect)
|
|||
if ( !bSelect ) return true;
|
||||
|
||||
pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
ox = 3.0f/640.0f;
|
||||
oy = 3.0f/480.0f;
|
||||
|
|
|
@ -51,7 +51,7 @@ CMotion::CMotion(COldObject* object)
|
|||
m_camera = m_main->GetCamera();
|
||||
|
||||
m_object = object;
|
||||
m_physics = 0;
|
||||
m_physics = nullptr;
|
||||
|
||||
m_actionType = -1;
|
||||
m_actionTime = 0.0f;
|
||||
|
|
|
@ -120,9 +120,9 @@ COldObject::COldObject(int id)
|
|||
m_cirVibration = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
m_tilt = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
|
||||
m_power = 0;
|
||||
m_cargo = 0;
|
||||
m_transporter = 0;
|
||||
m_power = nullptr;
|
||||
m_cargo = nullptr;
|
||||
m_transporter = nullptr;
|
||||
m_transporterLink = 0;
|
||||
m_shield = 1.0f;
|
||||
m_range = 30.0f;
|
||||
|
@ -200,7 +200,7 @@ void COldObject::DeleteObject(bool bAll)
|
|||
|
||||
if ( m_camera->GetControllingObject() == this )
|
||||
{
|
||||
m_camera->SetControllingObject(0);
|
||||
m_camera->SetControllingObject(nullptr);
|
||||
}
|
||||
m_main->RemoveFromSelectionHistory(this);
|
||||
|
||||
|
@ -1573,7 +1573,7 @@ void COldObject::SetTransporter(CObject* transporter)
|
|||
m_transporter = transporter;
|
||||
|
||||
// Invisible shadow if the object is transported.
|
||||
m_engine->SetObjectShadowSpotHide(m_objectPart[0].object, (m_transporter != 0));
|
||||
m_engine->SetObjectShadowSpotHide(m_objectPart[0].object, (m_transporter != nullptr));
|
||||
}
|
||||
|
||||
CObject* COldObject::GetTransporter()
|
||||
|
@ -1729,7 +1729,7 @@ bool COldObject::UpdateTransformObject(int part, bool bForceUpdate)
|
|||
bool bModif = false;
|
||||
int parent;
|
||||
|
||||
if ( m_transporter != 0 ) // transported by transporter?
|
||||
if ( m_transporter != nullptr ) // transported by transporter?
|
||||
{
|
||||
m_objectPart[part].bTranslate = true;
|
||||
m_objectPart[part].bRotate = true;
|
||||
|
@ -1788,7 +1788,7 @@ bool COldObject::UpdateTransformObject(int part, bool bForceUpdate)
|
|||
{
|
||||
parent = m_objectPart[part].parentPart;
|
||||
|
||||
if ( part == 0 && m_transporter != 0 ) // transported by a transporter?
|
||||
if ( part == 0 && m_transporter != nullptr ) // transported by a transporter?
|
||||
{
|
||||
Math::Matrix* matWorldTransporter;
|
||||
matWorldTransporter = m_transporter->GetWorldMatrix(m_transporterLink);
|
||||
|
|
|
@ -395,7 +395,7 @@ Error CTaskBuild::Start(ObjectType type)
|
|||
if (IsObjectCarryingCargo(m_object)) return ERR_MANIP_BUSY;
|
||||
|
||||
m_metal = SearchMetalObject(oAngle, 2.0f, 100.0f, Math::PI*0.25f, err);
|
||||
if ( err == ERR_BUILD_METALNEAR && m_metal != 0 )
|
||||
if ( err == ERR_BUILD_METALNEAR && m_metal != nullptr )
|
||||
{
|
||||
err = FlatFloor();
|
||||
if ( err != ERR_OK ) return err;
|
||||
|
@ -534,7 +534,7 @@ Error CTaskBuild::IsEnded()
|
|||
m_main->DisplayError(INFO_BUILD, m_buildingPos, 10.0f, 50.0f);
|
||||
|
||||
automat = m_building->GetAuto();
|
||||
if ( automat != 0 )
|
||||
if ( automat != nullptr )
|
||||
{
|
||||
automat->Init();
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
|
|||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
pBest = nullptr;
|
||||
bMetal = false;
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -817,7 +817,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
|
|||
}
|
||||
}
|
||||
|
||||
if ( pBest == 0 )
|
||||
if ( pBest == nullptr )
|
||||
{
|
||||
if ( bMetal ) err = ERR_BUILD_METALAWAY; // too far
|
||||
else err = ERR_BUILD_METALINEX; // non-existent
|
||||
|
|
|
@ -106,7 +106,7 @@ bool CTaskFire::EventProcess(const Event &event)
|
|||
speed = Math::Vector(200.0f, 0.0f, 0.0f);
|
||||
|
||||
physics = m_object->GetPhysics();
|
||||
if ( physics != 0 )
|
||||
if ( physics != nullptr )
|
||||
{
|
||||
speed += physics->GetLinMotion(MO_REASPEED);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ bool CTaskFire::EventProcess(const Event &event)
|
|||
speed = Math::Vector(200.0f, 0.0f, 0.0f);
|
||||
|
||||
physics = m_object->GetPhysics();
|
||||
if ( physics != 0 )
|
||||
if ( physics != nullptr )
|
||||
{
|
||||
speed += physics->GetLinMotion(MO_REASPEED);
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ Error CTaskFlag::DeleteFlag()
|
|||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
pObj = SearchNearest(iPos, OBJECT_NULL);
|
||||
if ( pObj == 0 )
|
||||
if ( pObj == nullptr )
|
||||
{
|
||||
return ERR_FLAG_DELETE;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ const float SAFETY_MARGIN = 0.5f; // Smallest distance between two objects
|
|||
|
||||
CTaskGoto::CTaskGoto(COldObject* object) : CForegroundTask(object)
|
||||
{
|
||||
m_bmArray = 0;
|
||||
m_bmArray = nullptr;
|
||||
}
|
||||
|
||||
// Object's destructor.
|
||||
|
@ -150,7 +150,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
if ( m_bmCargoObject == 0 )
|
||||
if ( m_bmCargoObject == nullptr )
|
||||
{
|
||||
goal = m_goal;
|
||||
dist = 0.0f;
|
||||
|
@ -571,7 +571,7 @@ void CTaskGoto::WormFrame(float rTime)
|
|||
m_wormLastTime = 0.0f;
|
||||
|
||||
pObj = WormSearch(impact);
|
||||
if ( pObj != 0 )
|
||||
if ( pObj != nullptr )
|
||||
{
|
||||
pos = m_object->GetPosition();
|
||||
dist = Math::Distance(pos, impact);
|
||||
|
@ -635,7 +635,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
m_phase = TGP_ADVANCE;
|
||||
m_error = ERR_OK;
|
||||
m_try = 0;
|
||||
m_bmCargoObject = 0;
|
||||
m_bmCargoObject = nullptr;
|
||||
m_bmFinalMove = 0.0f;
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
|
@ -671,7 +671,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
if ( !m_bApprox && m_crashMode != TGC_BEAM )
|
||||
{
|
||||
target = SearchTarget(goal, 1.0f);
|
||||
if ( target != 0 )
|
||||
if ( target != nullptr )
|
||||
{
|
||||
m_goal = target->GetPosition();
|
||||
dist = 0.0f;
|
||||
|
@ -690,7 +690,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
if ( m_crashMode == TGC_BEAM ) // with the algorithm of rays?
|
||||
{
|
||||
target = SearchTarget(goal, 1.0f);
|
||||
if ( target != 0 )
|
||||
if ( target != nullptr )
|
||||
{
|
||||
m_goal = target->GetPosition();
|
||||
dist = 4.0f;
|
||||
|
@ -725,7 +725,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
|
||||
BeamStart();
|
||||
|
||||
if ( m_bmCargoObject == 0 )
|
||||
if ( m_bmCargoObject == nullptr )
|
||||
{
|
||||
x = static_cast<int>((m_goal.x+1600.0f)/BM_DIM_STEP);
|
||||
y = static_cast<int>((m_goal.z+1600.0f)/BM_DIM_STEP);
|
||||
|
@ -1721,7 +1721,7 @@ bool CTaskGoto::BitmapTestLine(const Math::Vector &start, const Math::Vector &go
|
|||
float distNoB2;
|
||||
int i, max, x, y;
|
||||
|
||||
if ( m_bmArray == 0 ) return true;
|
||||
if ( m_bmArray == nullptr ) return true;
|
||||
|
||||
dist = Math::DistanceProjected(start, goal);
|
||||
if ( dist == 0.0f ) return true;
|
||||
|
|
|
@ -415,13 +415,13 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
front = SearchTakeFrontObject(true, fPos, fDist, fAngle);
|
||||
other = SearchOtherObject(true, oPos, oDist, oAngle, oHeight);
|
||||
|
||||
if ( front != 0 && fDist < oDist )
|
||||
if ( front != nullptr && fDist < oDist )
|
||||
{
|
||||
m_targetPos = fPos;
|
||||
m_angle = fAngle;
|
||||
m_move = 1.0f; // advance required
|
||||
}
|
||||
else if ( other != 0 && oDist < fDist )
|
||||
else if ( other != nullptr && oDist < fDist )
|
||||
{
|
||||
if (! ObjectHasPowerCell(other)) return ERR_MANIP_NIL;
|
||||
m_targetPos = oPos;
|
||||
|
@ -438,7 +438,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
}
|
||||
if ( m_arm == TMA_FBACK )
|
||||
{
|
||||
if ( SearchTakeBackObject(true, m_targetPos, fDist, m_angle) == 0 )
|
||||
if ( SearchTakeBackObject(true, m_targetPos, fDist, m_angle) == nullptr )
|
||||
{
|
||||
return ERR_MANIP_NIL;
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ CObject* CTaskManip::SearchTakeUnderObject(Math::Vector &pos, float dLimit)
|
|||
iPos = m_object->GetPosition();
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
pBest = nullptr;
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
if ( !pObj->Implements(ObjectInterfaceType::Transportable) ) continue;
|
||||
|
@ -744,7 +744,7 @@ CObject* CTaskManip::SearchTakeUnderObject(Math::Vector &pos, float dLimit)
|
|||
pBest = pObj;
|
||||
}
|
||||
}
|
||||
if ( pBest != 0 )
|
||||
if ( pBest != nullptr )
|
||||
{
|
||||
pos = pBest->GetPosition();
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, Math::Vector &pos,
|
|||
}
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
pBest = nullptr;
|
||||
bAngle = 0.0f;
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -805,7 +805,7 @@ CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, Math::Vector &pos,
|
|||
bAngle = angle;
|
||||
}
|
||||
}
|
||||
if ( pBest == 0 )
|
||||
if ( pBest == nullptr )
|
||||
{
|
||||
distance = 1000000.0f;
|
||||
angle = 0.0f;
|
||||
|
@ -844,7 +844,7 @@ CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, Math::Vector &pos,
|
|||
}
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
pBest = nullptr;
|
||||
bAngle = 0.0f;
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -872,7 +872,7 @@ CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, Math::Vector &pos,
|
|||
bAngle = angle;
|
||||
}
|
||||
}
|
||||
if ( pBest == 0 )
|
||||
if ( pBest == nullptr )
|
||||
{
|
||||
distance = 1000000.0f;
|
||||
angle = 0.0f;
|
||||
|
@ -898,9 +898,9 @@ CObject* CTaskManip::SearchOtherObject(bool bAdvance, Math::Vector &pos,
|
|||
distance = 1000000.0f;
|
||||
angle = 0.0f;
|
||||
|
||||
if ( m_bSubm ) return 0; // impossible with the submarine
|
||||
if ( m_bSubm ) return nullptr; // impossible with the submarine
|
||||
|
||||
if (m_object->GetCrashSphereCount() == 0) return 0;
|
||||
if (m_object->GetCrashSphereCount() == 0) return nullptr;
|
||||
|
||||
Math::Vector iPos = m_object->GetFirstCrashSphere().sphere.pos;
|
||||
|
||||
|
@ -983,7 +983,7 @@ CObject* CTaskManip::SearchOtherObject(bool bAdvance, Math::Vector &pos,
|
|||
|
||||
distance = 1000000.0f;
|
||||
angle = 0.0f;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Takes the object placed in front.
|
||||
|
@ -1164,7 +1164,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
cargo->SetRotationZ(0.0f);
|
||||
cargo->FloorAdjust(); // plate well on the ground
|
||||
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(nullptr);
|
||||
m_object->SetCargo(nullptr); // deposit
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
cargo->SetRotationX(0.0f);
|
||||
cargo->SetRotationZ(0.0f);
|
||||
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(0);
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(nullptr);
|
||||
m_object->SetCargo(nullptr); // deposit
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ const float RECOVER_DIST = 11.8f;
|
|||
|
||||
CTaskRecover::CTaskRecover(COldObject* object) : CForegroundTask(object)
|
||||
{
|
||||
m_ruin = 0;
|
||||
m_ruin = nullptr;
|
||||
m_soundChannel = -1;
|
||||
}
|
||||
|
||||
|
@ -201,14 +201,14 @@ Error CTaskRecover::Start()
|
|||
m_recoverPos = pos;
|
||||
|
||||
m_ruin = SearchRuin();
|
||||
if ( m_ruin == 0 ) return ERR_RECOVER_NULL;
|
||||
if ( m_ruin == nullptr ) return ERR_RECOVER_NULL;
|
||||
m_ruin->SetLock(true); // ruin no longer usable
|
||||
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
Math::Vector oPos = m_ruin->GetPosition();
|
||||
m_angle = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW !
|
||||
|
||||
m_metal = 0;
|
||||
m_metal = nullptr;
|
||||
|
||||
m_phase = TRP_TURN;
|
||||
m_progress = 0.0f;
|
||||
|
|
|
@ -309,7 +309,7 @@ CObject* CTaskTake::SearchTakeObject(float &angle,
|
|||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
pBest = nullptr;
|
||||
bAngle = 0.0f;
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -361,7 +361,7 @@ CObject* CTaskTake::SearchTakeObject(float &angle,
|
|||
CObject* CTaskTake::SearchFriendObject(float &angle,
|
||||
float dLimit, float aLimit)
|
||||
{
|
||||
if (m_object->GetCrashSphereCount() == 0) return 0;
|
||||
if (m_object->GetCrashSphereCount() == 0) return nullptr;
|
||||
|
||||
auto crashSphere = m_object->GetFirstCrashSphere();
|
||||
Math::Vector iPos = crashSphere.sphere.pos;
|
||||
|
@ -436,7 +436,7 @@ CObject* CTaskTake::SearchFriendObject(float &angle,
|
|||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Takes the object in front.
|
||||
|
|
|
@ -180,7 +180,7 @@ bool CScript::CheckToken()
|
|||
|
||||
allBt = CBotToken::CompileTokens(m_script.get(), error);
|
||||
bt = allBt;
|
||||
while ( bt != 0 )
|
||||
while ( bt != nullptr )
|
||||
{
|
||||
bs = bt->GetString();
|
||||
token = bs;
|
||||
|
@ -529,7 +529,7 @@ void PutList(const char *baseName, bool bArray, CBotVar *var, Ui::CList *list, i
|
|||
const char *p;
|
||||
int index, type;
|
||||
|
||||
if ( var == 0 && baseName[0] != 0 )
|
||||
if ( var == nullptr && baseName[0] != 0 )
|
||||
{
|
||||
sprintf(buffer, "%s = null;", baseName);
|
||||
list->SetItemName(rankList++, buffer);
|
||||
|
@ -537,7 +537,7 @@ void PutList(const char *baseName, bool bArray, CBotVar *var, Ui::CList *list, i
|
|||
}
|
||||
|
||||
index = 0;
|
||||
while ( var != 0 )
|
||||
while ( var != nullptr )
|
||||
{
|
||||
var->Maj(nullptr, false);
|
||||
pStatic = var->GetStaticVar(); // finds the static element
|
||||
|
@ -621,7 +621,7 @@ void CScript::UpdateList(Ui::CList* list)
|
|||
|
||||
list->Flush(); // empty list
|
||||
m_botProg->GetRunPos(progName, cursor1, cursor2);
|
||||
if ( progName == 0 ) return;
|
||||
if ( progName == nullptr ) return;
|
||||
|
||||
level = 0;
|
||||
rank = 0;
|
||||
|
@ -656,7 +656,7 @@ void CScript::ColorizeScript(Ui::CEdit* edit)
|
|||
edit->ClearFormat();
|
||||
|
||||
bt = CBotToken::CompileTokens(edit->GetText(), error);
|
||||
while ( bt != 0 )
|
||||
while ( bt != nullptr )
|
||||
{
|
||||
bs = bt->GetString();
|
||||
token = bs;
|
||||
|
@ -721,7 +721,7 @@ int SearchToken(char* script, const char* token)
|
|||
for ( i=0 ; i<lScript-lToken ; i++ )
|
||||
{
|
||||
p = strstr(script+i, token);
|
||||
if ( p != 0 )
|
||||
if ( p != nullptr )
|
||||
{
|
||||
found[iFound++] = p-script;
|
||||
if ( iFound >= 100 ) break;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -275,7 +275,7 @@ void CEditValue::SetValue(float value, bool bSendMessage)
|
|||
{
|
||||
char text[100];
|
||||
|
||||
if ( m_edit == 0 ) return;
|
||||
if ( m_edit == nullptr ) return;
|
||||
|
||||
text[0] = 0;
|
||||
|
||||
|
@ -309,7 +309,7 @@ float CEditValue::GetValue()
|
|||
char text[100];
|
||||
float value = 0.0f;
|
||||
|
||||
if ( m_edit != 0 )
|
||||
if ( m_edit != nullptr )
|
||||
{
|
||||
m_edit->GetText(text, 100);
|
||||
sscanf(text, "%f", &value);
|
||||
|
|
|
@ -464,7 +464,7 @@ void CList::Draw()
|
|||
for (int j = 0; j < 10; j++)
|
||||
{
|
||||
pe = strchr(pb, '\t');
|
||||
if ( pe == 0 )
|
||||
if ( pe == nullptr )
|
||||
strcpy(text, pb);
|
||||
else
|
||||
{
|
||||
|
@ -473,7 +473,7 @@ void CList::Draw()
|
|||
}
|
||||
DrawCase(text, ppos, m_tabs[j], m_justifs[j]);
|
||||
|
||||
if ( pe == 0 )
|
||||
if ( pe == nullptr )
|
||||
break;
|
||||
ppos.x += m_tabs[j];
|
||||
pb = pe + 1;
|
||||
|
@ -675,7 +675,7 @@ void CList::SetItemName(int i, const char* name)
|
|||
char* CList::GetItemName(int i)
|
||||
{
|
||||
if ( i < 0 || i >= m_totalLine )
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
return m_items[i].text;
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ CObject* CMap::DetectObject(Math::Point pos, bool &bInMap)
|
|||
pos.y < m_pos.y ||
|
||||
pos.x > m_pos.x + m_dim.x ||
|
||||
pos.y > m_pos.y + m_dim.y )
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
bInMap = true;
|
||||
|
||||
|
@ -304,7 +304,7 @@ CObject* CMap::DetectObject(Math::Point pos, bool &bInMap)
|
|||
}
|
||||
}
|
||||
if ( best == -1 )
|
||||
return 0;
|
||||
return nullptr;
|
||||
return m_map[best].object;
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ void CMap::SelectObject(Math::Point pos)
|
|||
bool bInMap;
|
||||
|
||||
pObj = DetectObject(pos, bInMap);
|
||||
if ( pObj != 0 )
|
||||
if ( pObj != nullptr )
|
||||
m_main->SelectObject(pObj);
|
||||
}
|
||||
|
||||
|
|
|
@ -150,8 +150,8 @@ bool CScroll::SetState(int state, bool bState)
|
|||
{
|
||||
if ( state & STATE_ENABLE )
|
||||
{
|
||||
if ( m_buttonUp != 0 ) m_buttonUp->SetState(state, bState);
|
||||
if ( m_buttonDown != 0 ) m_buttonDown->SetState(state, bState);
|
||||
if ( m_buttonUp != nullptr ) m_buttonUp->SetState(state, bState);
|
||||
if ( m_buttonDown != nullptr ) m_buttonDown->SetState(state, bState);
|
||||
}
|
||||
|
||||
return CControl::SetState(state, bState);
|
||||
|
@ -161,8 +161,8 @@ bool CScroll::SetState(int state)
|
|||
{
|
||||
if ( state & STATE_ENABLE )
|
||||
{
|
||||
if ( m_buttonUp != 0 ) m_buttonUp->SetState(state);
|
||||
if ( m_buttonDown != 0 ) m_buttonDown->SetState(state);
|
||||
if ( m_buttonUp != nullptr ) m_buttonUp->SetState(state);
|
||||
if ( m_buttonDown != nullptr ) m_buttonDown->SetState(state);
|
||||
}
|
||||
|
||||
return CControl::SetState(state);
|
||||
|
@ -172,8 +172,8 @@ bool CScroll::ClearState(int state)
|
|||
{
|
||||
if ( state & STATE_ENABLE )
|
||||
{
|
||||
if ( m_buttonUp != 0 ) m_buttonUp->ClearState(state);
|
||||
if ( m_buttonDown != 0 ) m_buttonDown->ClearState(state);
|
||||
if ( m_buttonUp != nullptr ) m_buttonUp->ClearState(state);
|
||||
if ( m_buttonDown != nullptr ) m_buttonDown->ClearState(state);
|
||||
}
|
||||
|
||||
return CControl::ClearState(state);
|
||||
|
|
|
@ -71,7 +71,7 @@ bool CTarget::EventProcess(const Event &event)
|
|||
if ( CControl::Detect(event.mousePos) )
|
||||
{
|
||||
pObj = DetectFriendObject(event.mousePos);
|
||||
if ( pObj == 0 )
|
||||
if ( pObj == nullptr )
|
||||
{
|
||||
m_engine->SetMouseType(Gfx::ENG_MOUSE_TARGET);
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
if ( event.type == pw->GetEventTypeClose() )
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
event.type == EVENT_HYPER_NEXT )
|
||||
{
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
edit->HyperGo(event.type);
|
||||
HyperUpdate();
|
||||
|
@ -166,35 +166,35 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
{
|
||||
CSettings::GetInstancePointer()->SetFontSize(9.0f);
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
if ( slider != nullptr ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
ViewDisplayInfo();
|
||||
}
|
||||
if ( event.type == EVENT_HYPER_SIZE2 ) // size 2?
|
||||
{
|
||||
CSettings::GetInstancePointer()->SetFontSize(14.0f);
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
if ( slider != nullptr ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
ViewDisplayInfo();
|
||||
}
|
||||
if ( event.type == EVENT_HYPER_SIZE3 ) // size 3?
|
||||
{
|
||||
CSettings::GetInstancePointer()->SetFontSize(19.0f);
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
if ( slider != nullptr ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
ViewDisplayInfo();
|
||||
}
|
||||
if ( event.type == EVENT_HYPER_SIZE4 ) // size 4?
|
||||
{
|
||||
CSettings::GetInstancePointer()->SetFontSize(24.0f);
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
if ( slider != nullptr ) slider->SetVisibleValue((CSettings::GetInstancePointer()->GetFontSize()-9.0f)/15.0f);
|
||||
ViewDisplayInfo();
|
||||
}
|
||||
|
||||
if ( event.type == EVENT_STUDIO_SIZE ) // size?
|
||||
{
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider == 0 ) return false;
|
||||
if ( slider == nullptr ) return false;
|
||||
CSettings::GetInstancePointer()->SetFontSize(9.0f+slider->GetVisibleValue()*15.0f);
|
||||
ViewDisplayInfo();
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
if ( event.type == EVENT_HYPER_COPY ) // copy ?
|
||||
{
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
edit->Copy();
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
}
|
||||
//? m_main->SetEditFull(m_bInfoMaximized);
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->SetMaximized(m_bInfoMaximized);
|
||||
pw->SetMinimized(m_bInfoMinimized);
|
||||
|
@ -266,7 +266,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
|
|||
}
|
||||
//? m_main->SetEditFull(m_bInfoMaximized);
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->SetMaximized(m_bInfoMaximized);
|
||||
pw->SetMinimized(m_bInfoMinimized);
|
||||
|
@ -310,26 +310,26 @@ void CDisplayInfo::HyperUpdate()
|
|||
bool bEnable;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_HOME));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
bEnable = edit->HyperTest(EVENT_HYPER_HOME);
|
||||
button->SetState(STATE_ENABLE, bEnable);
|
||||
}
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_PREV));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
bEnable = edit->HyperTest(EVENT_HYPER_PREV);
|
||||
button->SetState(STATE_ENABLE, bEnable);
|
||||
}
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_NEXT));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
bEnable = edit->HyperTest(EVENT_HYPER_NEXT);
|
||||
button->SetState(STATE_ENABLE, bEnable);
|
||||
|
@ -355,7 +355,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
if ( m_bEditLock ) // edition running program?
|
||||
{
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW3));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->ClearState(STATE_ENABLE); // CStudio inactive
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
pos = m_infoActualPos = m_infoFinalPos;
|
||||
dim = m_infoActualDim = m_infoFinalDim;
|
||||
pw = m_interface->CreateWindows(pos, dim, 4, EVENT_WINDOW4);
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
//? pw->SetClosable(true);
|
||||
//? GetResource(RES_TEXT, RT_DISINFO_TITLE, res);
|
||||
//? pw->SetName(res);
|
||||
|
@ -381,7 +381,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
//? m_main->SetEditFull(m_bInfoMaximized);
|
||||
|
||||
edit = pw->CreateEdit(pos, dim, 0, EVENT_EDIT1);
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
edit->SetState(STATE_SHADOW);
|
||||
edit->SetMultiFont(true);
|
||||
edit->SetMaxChar(10000);
|
||||
|
@ -483,7 +483,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
wdim.y = 420.0f / 480.0f;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->SetPos(wpos);
|
||||
pw->SetDim(wdim);
|
||||
|
@ -495,14 +495,14 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = 48.0f / 640.0f;
|
||||
dim.y = 48.0f / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_HUSTON));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.y -= (48.0f + 4.0f) / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SAT));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -516,21 +516,21 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
//? }
|
||||
pos.y -= (48.0f + 4.0f) / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_LOADING));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.y -= (48.0f + 4.0f) / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_PROG));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.y -= (48.0f + 4.0f) / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SOLUCE));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -541,7 +541,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = (48.0f - 10.0f) / 640.0f;
|
||||
dim.y = 24.0f / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_OBJECT_INFOOK));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -552,7 +552,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = 462.0f / 640.0f;
|
||||
dim.y = 358.0f / 480.0f;
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
edit->SetPos(pos);
|
||||
edit->SetDim(dim);
|
||||
|
@ -563,21 +563,21 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = 32.0f / 640.0f;
|
||||
dim.y = 32.0f / 480.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_PREV));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x += 35.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_NEXT));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x += 35.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_HOME));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -585,28 +585,28 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
|
||||
pos.x += 50.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE1));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x += 35.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE2));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x += 35.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE3));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
}
|
||||
pos.x += 35.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_SIZE4));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -614,7 +614,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
pos.x += 35.0f / 640.0f;
|
||||
dim.x = 18.0f / 640.0f;
|
||||
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
|
||||
if ( slider != 0 )
|
||||
if ( slider != nullptr )
|
||||
{
|
||||
slider->SetPos(pos);
|
||||
slider->SetDim(dim);
|
||||
|
@ -622,7 +622,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
pos.x += 50.0f / 640.0f;
|
||||
dim.x = 32.0f / 640.0f;
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_COPY));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetPos(pos);
|
||||
button->SetDim(dim);
|
||||
|
@ -633,7 +633,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = 48.0f / 640.0f;
|
||||
dim.y = 40.0f / 480.0f;
|
||||
group = static_cast<Ui::CGroup*>(pw->SearchControl(EVENT_LABEL2)); // symbol SatCom
|
||||
if ( group != 0 )
|
||||
if ( group != nullptr )
|
||||
{
|
||||
group->SetPos(pos);
|
||||
group->SetDim(dim);
|
||||
|
@ -644,7 +644,7 @@ void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
|
|||
dim.x = 20.0f / 640.0f;
|
||||
dim.y = 20.0f / 480.0f;
|
||||
group = static_cast<Ui::CGroup*>(pw->SearchControl(EVENT_LABEL3)); // symbol stand-by
|
||||
if ( group != 0 )
|
||||
if ( group != nullptr )
|
||||
{
|
||||
group->SetPos(pos);
|
||||
group->SetDim(dim);
|
||||
|
@ -660,7 +660,7 @@ void CDisplayInfo::ChangeIndexButton(int index)
|
|||
char* filename;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
if ( m_index != -1 )
|
||||
{
|
||||
|
@ -669,7 +669,7 @@ void CDisplayInfo::ChangeIndexButton(int index)
|
|||
m_index = index;
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
filename = m_main->GetDisplayInfoName(m_index);
|
||||
edit->ReadText(filename);
|
||||
|
@ -702,10 +702,10 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
};
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_HUSTON));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetState(STATE_CHECK, m_index==SATCOM_HUSTON);
|
||||
filename = m_main->GetDisplayInfoName(SATCOM_HUSTON);
|
||||
|
@ -713,7 +713,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
}
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SAT));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetState(STATE_CHECK, m_index==SATCOM_SAT);
|
||||
filename = m_main->GetDisplayInfoName(SATCOM_SAT);
|
||||
|
@ -729,7 +729,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
//? }
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_LOADING));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetState(STATE_CHECK, m_index==SATCOM_LOADING);
|
||||
filename = m_main->GetDisplayInfoName(SATCOM_LOADING);
|
||||
|
@ -737,7 +737,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
}
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_PROG));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetState(STATE_CHECK, m_index==SATCOM_PROG);
|
||||
filename = m_main->GetDisplayInfoName(SATCOM_PROG);
|
||||
|
@ -745,7 +745,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
}
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_SATCOM_SOLUCE));
|
||||
if ( button != 0 )
|
||||
if ( button != nullptr )
|
||||
{
|
||||
button->SetState(STATE_CHECK, m_index==SATCOM_SOLUCE);
|
||||
filename = m_main->GetDisplayInfoName(SATCOM_SOLUCE);
|
||||
|
@ -753,7 +753,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
}
|
||||
|
||||
group = static_cast<Ui::CGroup*>(pw->SearchControl(EVENT_LABEL1));
|
||||
if ( group != 0 )
|
||||
if ( group != nullptr )
|
||||
{
|
||||
if ( m_index == -1 )
|
||||
{
|
||||
|
@ -774,7 +774,7 @@ void CDisplayInfo::UpdateIndexButton()
|
|||
}
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
//? edit->SetHiliteCap(m_index==SATCOM_LOADING);
|
||||
edit->SetHighlightCap(true);
|
||||
|
@ -795,13 +795,13 @@ void CDisplayInfo::UpdateCopyButton()
|
|||
//? if ( m_index != SATCOM_LOADING ) return;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
button = static_cast<Ui::CButton*>(pw->SearchControl(EVENT_HYPER_COPY));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
edit->GetCursor(c1, c2);
|
||||
button->SetState(STATE_ENABLE, c1!=c2);
|
||||
|
@ -815,14 +815,14 @@ void CDisplayInfo::StopDisplayInfo()
|
|||
Ui::CWindow* pw;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
m_interface->DeleteControl(EVENT_WINDOW4);
|
||||
|
||||
if ( m_bEditLock ) // editing running program?
|
||||
{
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW3));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->SetState(STATE_ENABLE); // CStudio operating
|
||||
}
|
||||
|
@ -861,10 +861,10 @@ void CDisplayInfo::SetPosition(int pos)
|
|||
Ui::CEdit* edit;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
edit->SetFirstLine(pos);
|
||||
}
|
||||
|
@ -877,10 +877,10 @@ int CDisplayInfo::GetPosition()
|
|||
Ui::CEdit* edit;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return 0;
|
||||
if ( pw == nullptr ) return 0;
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit == 0 ) return 0;
|
||||
if ( edit == nullptr ) return 0;
|
||||
|
||||
return edit->GetFirstLine();
|
||||
}
|
||||
|
@ -896,10 +896,10 @@ void CDisplayInfo::ViewDisplayInfo()
|
|||
Math::IntPoint dim;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
edit = static_cast<Ui::CEdit*>(pw->SearchControl(EVENT_EDIT1));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
dim = m_engine->GetWindowSize();
|
||||
edit->SetFontSize(CSettings::GetInstancePointer()->GetFontSize()/(dim.x / 640.0f));
|
||||
|
|
|
@ -188,7 +188,7 @@ void CDisplayText::DisplayText(const char *text, Math::Vector goal, float height
|
|||
if ( !m_bEnable ) return;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 )
|
||||
if ( pw == nullptr )
|
||||
{
|
||||
pos.x = 0.0f;
|
||||
pos.y = 0.0f;
|
||||
|
@ -204,7 +204,7 @@ void CDisplayText::DisplayText(const char *text, Math::Vector goal, float height
|
|||
for ( i=0 ; i<MAXDTLINE ; i++ )
|
||||
{
|
||||
group = static_cast<CGroup*>(pw->SearchControl(EventType(EVENT_DT_GROUP0+i)));
|
||||
if ( group == 0 ) break;
|
||||
if ( group == nullptr ) break;
|
||||
nLine ++;
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ void CDisplayText::DisplayText(const char *text, Math::Vector goal, float height
|
|||
ppos = pos;
|
||||
ppos.y -= hLine/2.0f;
|
||||
label = pw->CreateLabel(ppos, dim, -1, EventType(EVENT_DT_LABEL0+nLine), text);
|
||||
if ( label != 0 )
|
||||
if ( label != nullptr )
|
||||
{
|
||||
label->SetFontSize(FONTSIZE);
|
||||
}
|
||||
|
@ -330,24 +330,24 @@ void CDisplayText::HideText(bool bHide)
|
|||
m_bHide = bHide;
|
||||
|
||||
pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
for ( i=0 ; i<MAXDTLINE ; i++ )
|
||||
{
|
||||
pg = static_cast<Ui::CGroup*>(pw->SearchControl(EventType(EVENT_DT_GROUP0+i)));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
pg->SetState(STATE_VISIBLE, !bHide);
|
||||
}
|
||||
|
||||
pl = static_cast<Ui::CLabel*>(pw->SearchControl(EventType(EVENT_DT_LABEL0+i)));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
pl->SetState(STATE_VISIBLE, !bHide);
|
||||
}
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_VISIBLE, !bHide);
|
||||
}
|
||||
|
@ -365,14 +365,14 @@ bool CDisplayText::ClearLastText()
|
|||
int i;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
pb2 = static_cast<CButton*>(pw->SearchControl(EVENT_DT_VISIT0));
|
||||
if ( pb2 == 0 ) return false; // same not of first-line
|
||||
if ( pb2 == nullptr ) return false; // same not of first-line
|
||||
pg2 = static_cast<CGroup*>(pw->SearchControl(EVENT_DT_GROUP0));
|
||||
if ( pg2 == 0 ) return false;
|
||||
if ( pg2 == nullptr ) return false;
|
||||
pl2 = static_cast<CLabel*>(pw->SearchControl(EVENT_DT_LABEL0));
|
||||
if ( pl2 == 0 ) return false;
|
||||
if ( pl2 == nullptr ) return false;
|
||||
|
||||
for ( i=0 ; i<MAXDTLINE-1 ; i++ )
|
||||
{
|
||||
|
@ -381,13 +381,13 @@ bool CDisplayText::ClearLastText()
|
|||
pl1 = pl2;
|
||||
|
||||
pb2 = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i+1)));
|
||||
if ( pb2 == 0 ) break;
|
||||
if ( pb2 == nullptr ) break;
|
||||
|
||||
pg2 = static_cast<CGroup*>(pw->SearchControl(EventType(EVENT_DT_GROUP0+i+1)));
|
||||
if ( pg2 == 0 ) break;
|
||||
if ( pg2 == nullptr ) break;
|
||||
|
||||
pl2 = static_cast<CLabel*>(pw->SearchControl(EventType(EVENT_DT_LABEL0+i+1)));
|
||||
if ( pl2 == 0 ) break;
|
||||
if ( pl2 == nullptr ) break;
|
||||
|
||||
pb1->SetState(STATE_ENABLE, pb2->TestState(STATE_ENABLE));
|
||||
pg1->SetIcon(pg2->GetIcon());
|
||||
|
@ -454,7 +454,7 @@ float CDisplayText::GetIdealDist(CObject* pObj)
|
|||
{
|
||||
ObjectType type;
|
||||
|
||||
if ( pObj == 0 ) return 40.0f;
|
||||
if ( pObj == nullptr ) return 40.0f;
|
||||
|
||||
type = pObj->GetType();
|
||||
if ( type == OBJECT_PORTICO ) return 200.0f;
|
||||
|
@ -473,7 +473,7 @@ float CDisplayText::GetIdealHeight(CObject* pObj)
|
|||
{
|
||||
ObjectType type;
|
||||
|
||||
if ( pObj == 0 ) return 5.0f;
|
||||
if ( pObj == nullptr ) return 5.0f;
|
||||
|
||||
type = pObj->GetType();
|
||||
if ( type == OBJECT_DERRICK ) return 35.0f;
|
||||
|
@ -505,12 +505,12 @@ void CDisplayText::ClearVisit()
|
|||
int i;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
for ( i=0 ; i<MAXDTLINE ; i++ )
|
||||
{
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
pb->SetIcon(14); // eyes
|
||||
}
|
||||
}
|
||||
|
@ -527,9 +527,9 @@ void CDisplayText::SetVisit(EventType event)
|
|||
if ( i < 0 || i >= MAXDTLINE ) return;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
|
||||
if ( pb == 0 ) return;
|
||||
if ( pb == nullptr ) return;
|
||||
pb->SetIcon(48); // >
|
||||
}
|
||||
|
||||
|
@ -545,9 +545,9 @@ bool CDisplayText::IsVisit(EventType event)
|
|||
if ( i < 0 || i >= MAXDTLINE ) return false;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EventType(EVENT_DT_VISIT0+i)));
|
||||
if ( pb == 0 ) return false;
|
||||
if ( pb == nullptr ) return false;
|
||||
return (pb->GetIcon() == 48); // > ?
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ void CMainDialog::StartPauseMenu()
|
|||
m_dialogType = DialogType::PauseMenu;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pos.x = 0.35f;
|
||||
pos.y = 0.60f;
|
||||
|
@ -257,7 +257,7 @@ void CMainDialog::StartQuestion(const std::string& text, bool warningYes, bool w
|
|||
m_callbackNo = no;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pos.x = 0.00f;
|
||||
pos.y = 0.50f;
|
||||
|
@ -315,7 +315,7 @@ void CMainDialog::StartInformation(const std::string& title, const std::string&
|
|||
m_callbackYes = ok;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
if(!title.empty())
|
||||
pw->SetName(title);
|
||||
|
@ -355,31 +355,31 @@ void CMainDialog::StartDialog(Math::Point dim, bool fireParticles)
|
|||
m_main->StartSuspend();
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW3));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW8));
|
||||
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
m_dialogFireParticles = fireParticles;
|
||||
|
||||
|
@ -415,7 +415,7 @@ void CMainDialog::FrameDialog(float rTime)
|
|||
|
||||
m_dialogTime += rTime;
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
if ( m_dialogTime < 1.0f )
|
||||
{
|
||||
|
@ -510,31 +510,31 @@ void CMainDialog::StopDialog()
|
|||
CWindow* pw;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW3));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW4));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW8));
|
||||
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
m_main->StopSuspend();
|
||||
m_interface->DeleteControl(EVENT_WINDOW9);
|
||||
|
|
|
@ -362,12 +362,12 @@ CObject* CMainMap::DetectMap(Math::Point pos, bool &bInMap)
|
|||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW1));
|
||||
if (pw == nullptr)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
bInMap = false;
|
||||
pm = static_cast<CMap*>(pw->SearchControl(EVENT_OBJECT_MAP));
|
||||
if (pm == nullptr)
|
||||
return 0;
|
||||
return nullptr;
|
||||
return pm->DetectObject(pos, bInMap);
|
||||
}
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ CObject* CMainShort::DetectShort(Math::Point pos)
|
|||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Reports the object with the mouse hovers over.
|
||||
|
|
|
@ -273,12 +273,12 @@ void CMainUserInterface::GlintMove()
|
|||
if ( m_phase == PHASE_SIMUL ) return;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
if ( m_phase == PHASE_MAIN_MENU )
|
||||
{
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTl));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.23f);
|
||||
zoom.y = sinf(m_glintTime*0.37f);
|
||||
|
@ -292,7 +292,7 @@ void CMainUserInterface::GlintMove()
|
|||
}
|
||||
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTr));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.21f);
|
||||
zoom.y = sinf(m_glintTime*0.26f);
|
||||
|
@ -310,7 +310,7 @@ void CMainUserInterface::GlintMove()
|
|||
m_phase == PHASE_LEVEL_LIST )
|
||||
{
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTl));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.22f);
|
||||
zoom.y = sinf(m_glintTime*0.37f);
|
||||
|
@ -324,7 +324,7 @@ void CMainUserInterface::GlintMove()
|
|||
}
|
||||
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTr));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.19f);
|
||||
zoom.y = sinf(m_glintTime*0.28f);
|
||||
|
@ -350,7 +350,7 @@ void CMainUserInterface::GlintMove()
|
|||
m_phase == PHASE_SETUPss )
|
||||
{
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTu));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.y = sinf(m_glintTime*0.27f);
|
||||
pos.x = 0.10f;
|
||||
|
@ -363,7 +363,7 @@ void CMainUserInterface::GlintMove()
|
|||
}
|
||||
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTr));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.29f);
|
||||
zoom.y = sinf(m_glintTime*0.14f);
|
||||
|
@ -382,7 +382,7 @@ void CMainUserInterface::GlintMove()
|
|||
m_phase == PHASE_READs )
|
||||
{
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTl));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.22f);
|
||||
zoom.y = sinf(m_glintTime*0.37f);
|
||||
|
@ -396,7 +396,7 @@ void CMainUserInterface::GlintMove()
|
|||
}
|
||||
|
||||
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTr));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
zoom.x = sinf(m_glintTime*0.19f);
|
||||
zoom.y = sinf(m_glintTime*0.28f);
|
||||
|
|
|
@ -140,10 +140,10 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
if (isActionSlot)
|
||||
{
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pc = pw->SearchControl(m_defaultEnter);
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
if ( pc->TestState(STATE_ENABLE) )
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
if (data->slot == INPUT_SLOT_ACTION && alt)
|
||||
{
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
CButton* pb = static_cast< CButton* >(pw->SearchControl(EVENT_OBJECT_PROGRUN));
|
||||
if(pb != nullptr)
|
||||
|
@ -274,7 +274,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
|
||||
UpdateInterface();
|
||||
CWindow* pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -581,10 +581,10 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
if ( action == EVENT_OBJECT_DIMSHIELD )
|
||||
{
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
ps = static_cast< CSlider* >(pw->SearchControl(EVENT_OBJECT_DIMSHIELD));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
dynamic_cast<CShielder*>(m_object)->SetShieldRadius((ps->GetVisibleValue()-(RADIUS_SHIELD_MIN/g_unit))/((RADIUS_SHIELD_MAX-RADIUS_SHIELD_MIN)/g_unit));
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
}
|
||||
UpdateInterface();
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ bool CObjectInterface::EventProcess(const Event &event)
|
|||
}
|
||||
UpdateInterface();
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
UpdateScript(pw);
|
||||
}
|
||||
|
@ -796,7 +796,7 @@ bool CObjectInterface::CreateInterface(bool bSelect)
|
|||
float ox, oy, sx, sy;
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw != 0 )
|
||||
if ( pw != nullptr )
|
||||
{
|
||||
pw->Flush(); // destroys the window buttons
|
||||
m_interface->DeleteControl(EVENT_WINDOW0); // destroys the window
|
||||
|
@ -812,7 +812,7 @@ bool CObjectInterface::CreateInterface(bool bSelect)
|
|||
dim.y = 86.0f/480.0f;
|
||||
m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0);
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
pos.x = 0.0f;
|
||||
pos.y = 64.0f/480.0f;
|
||||
|
@ -1451,7 +1451,7 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
}
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
CGauge* pg = static_cast< CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY));
|
||||
if (pg != nullptr)
|
||||
|
@ -1489,14 +1489,14 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
}
|
||||
|
||||
pg = static_cast< CGauge* >(pw->SearchControl(EVENT_OBJECT_GSHIELD));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
assert(m_object->Implements(ObjectInterfaceType::Shielded));
|
||||
pg->SetLevel(dynamic_cast<CShieldedObject*>(m_object)->GetShield());
|
||||
}
|
||||
|
||||
pg = static_cast< CGauge* >(pw->SearchControl(EVENT_OBJECT_GRANGE));
|
||||
if ( pg != 0 )
|
||||
if ( pg != nullptr )
|
||||
{
|
||||
assert(m_object->Implements(ObjectInterfaceType::JetFlying));
|
||||
icon = 2; // blue/red
|
||||
|
@ -1531,7 +1531,7 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
}
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_OBJECT_REC));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
if ( m_programmable->IsTraceRecord() && Math::Mod(m_time, 0.4f) >= 0.2f )
|
||||
{
|
||||
|
@ -1546,7 +1546,7 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
bOnBoard = m_camera->GetType() == Gfx::CAM_TYPE_ONBOARD;
|
||||
|
||||
pgr = static_cast< CGroup* >(pw->SearchControl(EVENT_OBJECT_CROSSHAIR));
|
||||
if ( pgr != 0 )
|
||||
if ( pgr != nullptr )
|
||||
{
|
||||
if ( bOnBoard )
|
||||
{
|
||||
|
@ -1564,7 +1564,7 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
}
|
||||
|
||||
ptg = static_cast< CTarget* >(pw->SearchControl(EVENT_OBJECT_TARGET));
|
||||
if ( ptg != 0 )
|
||||
if ( ptg != nullptr )
|
||||
{
|
||||
if ( bOnBoard )
|
||||
{
|
||||
|
@ -1577,25 +1577,25 @@ void CObjectInterface::UpdateInterface(float rTime)
|
|||
}
|
||||
|
||||
pgr = static_cast< CGroup* >(pw->SearchControl(EVENT_OBJECT_CORNERul));
|
||||
if ( pgr != 0 )
|
||||
if ( pgr != nullptr )
|
||||
{
|
||||
pgr->SetState(STATE_VISIBLE, bOnBoard);
|
||||
}
|
||||
|
||||
pgr = static_cast< CGroup* >(pw->SearchControl(EVENT_OBJECT_CORNERur));
|
||||
if ( pgr != 0 )
|
||||
if ( pgr != nullptr )
|
||||
{
|
||||
pgr->SetState(STATE_VISIBLE, bOnBoard);
|
||||
}
|
||||
|
||||
pgr = static_cast< CGroup* >(pw->SearchControl(EVENT_OBJECT_CORNERdl));
|
||||
if ( pgr != 0 )
|
||||
if ( pgr != nullptr )
|
||||
{
|
||||
pgr->SetState(STATE_VISIBLE, bOnBoard);
|
||||
}
|
||||
|
||||
pgr = static_cast< CGroup* >(pw->SearchControl(EVENT_OBJECT_CORNERdr));
|
||||
if ( pgr != 0 )
|
||||
if ( pgr != nullptr )
|
||||
{
|
||||
pgr->SetState(STATE_VISIBLE, bOnBoard);
|
||||
}
|
||||
|
@ -1616,7 +1616,7 @@ void CObjectInterface::UpdateInterface()
|
|||
if ( !m_object->GetSelect() ) return;
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
type = m_object->GetType();
|
||||
|
||||
|
@ -1708,7 +1708,7 @@ void CObjectInterface::UpdateInterface()
|
|||
}
|
||||
|
||||
ps = static_cast< CSlider* >(pw->SearchControl(EVENT_OBJECT_DIMSHIELD));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
ps->SetVisibleValue((RADIUS_SHIELD_MIN/g_unit)+dynamic_cast<CShielder*>(m_object)->GetShieldRadius()*((RADIUS_SHIELD_MAX-RADIUS_SHIELD_MIN)/g_unit));
|
||||
}
|
||||
|
@ -1790,7 +1790,7 @@ void CObjectInterface::UpdateInterface()
|
|||
EnableInterface(pw, EVENT_OBJECT_PROGRUN, bRun && m_main->CanPlayerInteract());
|
||||
|
||||
pb = static_cast< CButton* >(pw->SearchControl(EVENT_OBJECT_PROGRUN));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetIcon(!m_programmable->IsProgram() ? 21 : 8); // run/stop
|
||||
}
|
||||
|
@ -1820,49 +1820,49 @@ void CObjectInterface::UpdateInterface()
|
|||
if (traceDrawing != nullptr && traceDrawing->GetTraceDown())
|
||||
{
|
||||
pb = static_cast< CButton* >(pw->SearchControl(EVENT_OBJECT_PEN0));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->ClearState(STATE_CHECK);
|
||||
}
|
||||
|
||||
TraceColor color = traceDrawing->GetTraceColor();
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN1));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Black);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN2));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Yellow);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN3));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Orange);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN4));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Red);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN5));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Purple);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN6));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Blue);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN7));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Green);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN8));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, color == TraceColor::Brown);
|
||||
}
|
||||
|
@ -1870,48 +1870,48 @@ void CObjectInterface::UpdateInterface()
|
|||
else
|
||||
{
|
||||
pb = static_cast< CButton* >(pw->SearchControl(EVENT_OBJECT_PEN0));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_CHECK);
|
||||
}
|
||||
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN1));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN2));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN3));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN4));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN5));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN6));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN7));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
pc = static_cast< CColor* >(pw->SearchControl(EVENT_OBJECT_PEN8));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->ClearState(STATE_CHECK);
|
||||
}
|
||||
|
@ -1927,7 +1927,7 @@ void CObjectInterface::UpdateScript(CWindow *pw)
|
|||
char title[100];
|
||||
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_OBJECT_PROGLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->Flush();
|
||||
for ( int i = 0 ; i < m_programStorage->GetProgramCount() ; i++ )
|
||||
|
@ -1962,10 +1962,10 @@ int CObjectInterface::GetSelScript()
|
|||
CList* pl;
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return -1;
|
||||
if ( pw == nullptr ) return -1;
|
||||
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_OBJECT_PROGLIST));
|
||||
if ( pl == 0 ) return -1;
|
||||
if ( pl == nullptr ) return -1;
|
||||
|
||||
return pl->GetSelect();
|
||||
}
|
||||
|
@ -1978,10 +1978,10 @@ void CObjectInterface::SetSelScript(int index)
|
|||
CList* pl;
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_OBJECT_PROGLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->SetSelect(index);
|
||||
pl->ShowSelect(true);
|
||||
|
@ -1997,10 +1997,10 @@ void CObjectInterface::BlinkScript(bool bEnable)
|
|||
if ( !m_object->GetSelect() ) return; // robot not selected?
|
||||
|
||||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW0));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_OBJECT_PROGLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->SetBlink(bEnable);
|
||||
}
|
||||
|
@ -2012,7 +2012,7 @@ void CObjectInterface::CheckInterface(CWindow *pw, EventType event, bool bState)
|
|||
CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(STATE_CHECK, bState);
|
||||
}
|
||||
|
@ -2024,7 +2024,7 @@ void CObjectInterface::EnableInterface(CWindow *pw, EventType event, bool bState
|
|||
CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(STATE_ENABLE, bState);
|
||||
}
|
||||
|
@ -2036,7 +2036,7 @@ void CObjectInterface::DeadInterface(CWindow *pw, EventType event, bool bState)
|
|||
CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
control->SetState(STATE_DEAD, !bState);
|
||||
}
|
||||
|
@ -2048,7 +2048,7 @@ void CObjectInterface::DefaultEnter(CWindow *pw, EventType event, bool bState)
|
|||
CControl* control;
|
||||
|
||||
control = pw->SearchControl(event);
|
||||
if ( control == 0 ) return;
|
||||
if ( control == nullptr ) return;
|
||||
|
||||
if ( bState )
|
||||
{
|
||||
|
|
|
@ -471,21 +471,21 @@ void CScreenApperance::UpdatePerso()
|
|||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PHEAD));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_CHECK, m_apperanceTab==0);
|
||||
}
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PBODY));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_CHECK, m_apperanceTab==1);
|
||||
}
|
||||
|
||||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL11));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
{
|
||||
|
@ -500,7 +500,7 @@ void CScreenApperance::UpdatePerso()
|
|||
}
|
||||
|
||||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL12));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
{
|
||||
|
@ -515,7 +515,7 @@ void CScreenApperance::UpdatePerso()
|
|||
}
|
||||
|
||||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL13));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 ) GetResource(RES_TEXT, RT_PERSO_HAIR, name);
|
||||
else GetResource(RES_TEXT, RT_PERSO_BAND, name);
|
||||
|
@ -523,7 +523,7 @@ void CScreenApperance::UpdatePerso()
|
|||
}
|
||||
|
||||
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL14));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
if ( m_apperanceTab == 0 )
|
||||
{
|
||||
|
@ -540,7 +540,7 @@ void CScreenApperance::UpdatePerso()
|
|||
for ( i=0 ; i<4 ; i++ )
|
||||
{
|
||||
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PFACE1+i)));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==apperance.face);
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ void CScreenApperance::UpdatePerso()
|
|||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PGLASS0+i)));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
|
||||
pb->SetState(STATE_CHECK, i==apperance.glasses);
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ void CScreenApperance::UpdatePerso()
|
|||
for ( i=0 ; i<3*3 ; i++ )
|
||||
{
|
||||
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0a+i)));
|
||||
if ( pc == 0 ) break;
|
||||
if ( pc == nullptr ) break;
|
||||
if ( m_apperanceTab == 0 )
|
||||
{
|
||||
pc->ClearState(STATE_VISIBLE);
|
||||
|
@ -573,7 +573,7 @@ void CScreenApperance::UpdatePerso()
|
|||
}
|
||||
|
||||
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0b+i)));
|
||||
if ( pc == 0 ) break;
|
||||
if ( pc == nullptr ) break;
|
||||
color.r = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+0]/255.0f;
|
||||
color.g = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+1]/255.0f;
|
||||
color.b = PERSO_COLOR[3*10*2*m_apperanceTab+3*i+2]/255.0f;
|
||||
|
@ -585,7 +585,7 @@ void CScreenApperance::UpdatePerso()
|
|||
for ( i=0 ; i<3 ; i++ )
|
||||
{
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PCRa+i)));
|
||||
if ( ps == 0 ) break;
|
||||
if ( ps == nullptr ) break;
|
||||
ps->SetState(STATE_VISIBLE, m_apperanceTab==1);
|
||||
}
|
||||
|
||||
|
@ -593,21 +593,21 @@ void CScreenApperance::UpdatePerso()
|
|||
{
|
||||
color = apperance.colorCombi;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRa));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.r*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGa));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.g*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.g*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBa));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.b*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.b*255.0f);
|
||||
}
|
||||
|
||||
if ( m_apperanceTab == 0 ) color = apperance.colorHair;
|
||||
else color = apperance.colorBand;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.r*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.r*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGb));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.g*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.g*255.0f);
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBb));
|
||||
if ( ps != 0 ) ps->SetVisibleValue(color.b*255.0f);
|
||||
if ( ps != nullptr ) ps->SetVisibleValue(color.b*255.0f);
|
||||
}
|
||||
|
||||
// Updates the camera for the character.
|
||||
|
@ -675,24 +675,24 @@ void CScreenApperance::ColorPerso()
|
|||
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
color.a = 0.0f;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRa));
|
||||
if ( ps != 0 ) color.r = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.r = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGa));
|
||||
if ( ps != 0 ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBa));
|
||||
if ( ps != 0 ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( m_apperanceTab == 1 ) apperance.colorCombi = color;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCRb));
|
||||
if ( ps != 0 ) color.r = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.r = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCGb));
|
||||
if ( ps != 0 ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.g = ps->GetVisibleValue()/255.0f;
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_PCBb));
|
||||
if ( ps != 0 ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( ps != nullptr ) color.b = ps->GetVisibleValue()/255.0f;
|
||||
if ( m_apperanceTab == 0 ) apperance.colorHair = color;
|
||||
else apperance.colorBand = color;
|
||||
}
|
||||
|
|
|
@ -174,9 +174,9 @@ void CScreenIO::IODeleteScene()
|
|||
CList* pl;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_IOLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
int sel = pl->GetSelect();
|
||||
if (sel < 0 || sel >= static_cast<int>(m_saveList.size())) return;
|
||||
|
|
|
@ -125,7 +125,7 @@ bool CScreenIORead::EventProcess(const Event &event)
|
|||
if (!m_inSimulation)
|
||||
{
|
||||
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
@ -138,7 +138,7 @@ bool CScreenIORead::EventProcess(const Event &event)
|
|||
else
|
||||
{
|
||||
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
|
|
@ -125,7 +125,7 @@ void CScreenIOWrite::CreateInterface()
|
|||
bool CScreenIOWrite::EventProcess(const Event &event)
|
||||
{
|
||||
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
|
|
@ -259,7 +259,7 @@ bool CScreenLevelList::EventProcess(const Event &event)
|
|||
CButton* pb;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
@ -273,7 +273,7 @@ bool CScreenLevelList::EventProcess(const Event &event)
|
|||
{
|
||||
case EVENT_INTERFACE_CHAP:
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_CHAP));
|
||||
if ( pl == 0 ) break;
|
||||
if ( pl == nullptr ) break;
|
||||
m_chap[m_category] = pl->GetSelect();
|
||||
m_main->GetPlayerProfile()->SetSelectedChap(m_category, m_chap[m_category]+1);
|
||||
UpdateSceneList(m_chap[m_category], m_sel[m_category]);
|
||||
|
@ -282,7 +282,7 @@ bool CScreenLevelList::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_LIST:
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_LIST));
|
||||
if ( pl == 0 ) break;
|
||||
if ( pl == nullptr ) break;
|
||||
m_sel[m_category] = pl->GetSelect();
|
||||
m_main->GetPlayerProfile()->SetSelectedRank(m_category, m_sel[m_category]+1);
|
||||
UpdateSceneResume(m_chap[m_category]+1, m_sel[m_category]+1);
|
||||
|
@ -290,7 +290,7 @@ bool CScreenLevelList::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_SOLUCE:
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_SOLUCE));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
m_sceneSoluce = !m_sceneSoluce;
|
||||
pb->SetState(STATE_CHECK, m_sceneSoluce);
|
||||
break;
|
||||
|
@ -343,9 +343,9 @@ void CScreenLevelList::UpdateSceneChap(int &chap)
|
|||
bool bPassed;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_CHAP));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->Flush();
|
||||
|
||||
|
@ -424,9 +424,9 @@ void CScreenLevelList::UpdateSceneList(int chap, int &sel)
|
|||
bool bPassed;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_LIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->Flush();
|
||||
|
||||
|
@ -491,11 +491,11 @@ void CScreenLevelList::ShowSoluceUpdate()
|
|||
m_sceneSoluce = false;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_RESUME));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SOLUCE));
|
||||
if ( pc == 0 ) return;
|
||||
if ( pc == nullptr ) return;
|
||||
|
||||
if ( m_main->GetShowSoluce() )
|
||||
{
|
||||
|
@ -523,12 +523,12 @@ void CScreenLevelList::UpdateSceneResume(int chap, int rank)
|
|||
bool bPassed, bVisible;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_RESUME));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SOLUCE));
|
||||
|
||||
if ( pc == 0 )
|
||||
if ( pc == nullptr )
|
||||
{
|
||||
m_sceneSoluce = false;
|
||||
}
|
||||
|
|
|
@ -173,9 +173,9 @@ bool CScreenPlayerSelect::EventProcess(const Event &event)
|
|||
if (data->key == KEY(ESCAPE))
|
||||
{
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) break;
|
||||
if ( pw == nullptr ) break;
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NCANCEL));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
if ( pb->TestState(STATE_ENABLE) )
|
||||
{
|
||||
m_main->ChangePhase(PHASE_MAIN_MENU);
|
||||
|
@ -208,9 +208,9 @@ bool CScreenPlayerSelect::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_NDELETE:
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) break;
|
||||
if ( pw == nullptr ) break;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
|
||||
if ( pl == 0 ) break;
|
||||
if ( pl == nullptr ) break;
|
||||
|
||||
GetResource(RES_TEXT, RT_DIALOG_DELGAME, name);
|
||||
gamer = pl->GetItemName(pl->GetSelect());
|
||||
|
@ -254,11 +254,11 @@ void CScreenPlayerSelect::UpdateNameControl()
|
|||
int total, sel;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
|
||||
std::string gamer = m_main->GetPlayerProfile()->GetName();
|
||||
total = pl->GetTotal();
|
||||
|
@ -266,25 +266,25 @@ void CScreenPlayerSelect::UpdateNameControl()
|
|||
pe->GetText(name, 100);
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NCANCEL));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_ENABLE, !gamer.empty());
|
||||
}
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NDELETE));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_ENABLE, total>0 && sel!=-1);
|
||||
}
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_NOK));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_ENABLE, name[0]!=0 || sel!=-1);
|
||||
}
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PERSO));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetState(STATE_ENABLE, name[0]!=0 || sel!=-1);
|
||||
}
|
||||
|
@ -301,11 +301,11 @@ void CScreenPlayerSelect::UpdateNameList()
|
|||
int total, i;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
|
||||
pe->GetText(name, 100);
|
||||
total = pl->GetTotal();
|
||||
|
@ -335,11 +335,11 @@ void CScreenPlayerSelect::UpdateNameEdit()
|
|||
int sel;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
|
||||
sel = pl->GetSelect();
|
||||
if ( sel == -1 )
|
||||
|
@ -368,11 +368,11 @@ void CScreenPlayerSelect::NameSelect()
|
|||
int sel;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_NLIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
|
||||
if ( pe == 0 ) return;
|
||||
if ( pe == nullptr ) return;
|
||||
|
||||
pe->GetText(name, 100);
|
||||
sel = pl->GetSelect();
|
||||
|
@ -401,9 +401,9 @@ bool CScreenPlayerSelect::NameCreate()
|
|||
|
||||
GetLogger()->Info("Creating new player\n");
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
|
||||
if ( pe == 0 ) return false;
|
||||
if ( pe == nullptr ) return false;
|
||||
|
||||
pe->GetText(name, 100);
|
||||
if ( name[0] == 0 )
|
||||
|
|
|
@ -148,7 +148,7 @@ bool CScreenSetup::EventProcess(const Event &event)
|
|||
if ( !m_simulationSetup )
|
||||
{
|
||||
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
@ -189,7 +189,7 @@ bool CScreenSetup::EventProcess(const Event &event)
|
|||
else
|
||||
{
|
||||
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return false;
|
||||
if ( pw == nullptr ) return false;
|
||||
|
||||
if ( event.type == pw->GetEventTypeClose() ||
|
||||
event.type == EVENT_INTERFACE_BACK ||
|
||||
|
|
|
@ -61,7 +61,7 @@ void CScreenSetupControls::CreateInterface()
|
|||
|
||||
CScreenSetup::CreateInterface();
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pos.x = ox+sx*3;
|
||||
pos.y = 320.0f/480.0f;
|
||||
|
@ -154,10 +154,10 @@ void CScreenSetupControls::UpdateSetupButtons()
|
|||
CCheck* pc;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_JOYSTICK));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_ENABLE, m_app->GetJoystick().index >= 0);
|
||||
pc->SetState(STATE_CHECK, m_app->GetJoystickEnabled());
|
||||
|
|
|
@ -61,7 +61,7 @@ void CScreenSetupDisplay::CreateInterface()
|
|||
|
||||
CScreenSetup::CreateInterface();
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
std::vector<Math::IntPoint> modes;
|
||||
m_app->GetVideoResolutionList(modes, true, true);
|
||||
|
@ -133,9 +133,9 @@ bool CScreenSetupDisplay::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_FULL:
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) break;
|
||||
if ( pw == nullptr ) break;
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FULL));
|
||||
if ( pc == 0 ) break;
|
||||
if ( pc == nullptr ) break;
|
||||
|
||||
if ( pc->TestState(STATE_CHECK) )
|
||||
{
|
||||
|
@ -151,9 +151,9 @@ bool CScreenSetupDisplay::EventProcess(const Event &event)
|
|||
|
||||
case EVENT_INTERFACE_APPLY:
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) break;
|
||||
if ( pw == nullptr ) break;
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_APPLY));
|
||||
if ( pb == 0 ) break;
|
||||
if ( pb == nullptr ) break;
|
||||
pb->ClearState(STATE_PRESS);
|
||||
pb->ClearState(STATE_HILIGHT);
|
||||
ChangeDisplay();
|
||||
|
@ -185,9 +185,9 @@ void CScreenSetupDisplay::UpdateDisplayMode()
|
|||
CList* pl;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST2));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pl->Flush();
|
||||
|
||||
std::vector<Math::IntPoint> modes;
|
||||
|
@ -216,14 +216,14 @@ void CScreenSetupDisplay::ChangeDisplay()
|
|||
bool bFull;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST2));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
m_setupSelMode = pl->GetSelect();
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FULL));
|
||||
if ( pc == 0 ) return;
|
||||
if ( pc == nullptr ) return;
|
||||
bFull = pc->TestState(STATE_CHECK);
|
||||
m_setupFull = bFull;
|
||||
|
||||
|
@ -259,12 +259,12 @@ void CScreenSetupDisplay::UpdateApply()
|
|||
bool bFull;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_APPLY));
|
||||
|
||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST2));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
sel2 = pl->GetSelect();
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FULL));
|
||||
|
|
|
@ -56,7 +56,7 @@ void CScreenSetupGame::CreateInterface()
|
|||
|
||||
CScreenSetup::CreateInterface();
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
ddim.x = dim.x*6;
|
||||
ddim.y = dim.y*0.5f;
|
||||
|
@ -261,94 +261,94 @@ void CScreenSetupGame::UpdateSetupButtons()
|
|||
CSlider* ps;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_TOOLTIP));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetTooltips());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_GLINT));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetInterfaceGlint());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_RAIN));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetInterfaceRain());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_MOUSE));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetSystemMouse());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EDITMODE));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_engine->GetEditIndentMode());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EDITVALUE));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_engine->GetEditIndentValue()>2);
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SOLUCE4));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetSoluce4());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_MOVIES));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetMovies());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SCROLL));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_camera->GetCameraScroll());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_INVERTX));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_camera->GetCameraInvertX());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_INVERTY));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_camera->GetCameraInvertY());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EFFECT));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_camera->GetEffect());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_BLOOD));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_camera->GetBlood());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_ENABLE));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_main->GetAutosave());
|
||||
}
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_INTERVAL));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
ps->SetState(STATE_ENABLE, m_main->GetAutosave());
|
||||
ps->SetVisibleValue(m_main->GetAutosaveInterval());
|
||||
|
@ -356,7 +356,7 @@ void CScreenSetupGame::UpdateSetupButtons()
|
|||
}
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_SLOTS));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
ps->SetState(STATE_ENABLE, m_main->GetAutosave());
|
||||
ps->SetVisibleValue(m_main->GetAutosaveSlots());
|
||||
|
@ -372,17 +372,17 @@ void CScreenSetupGame::ChangeSetupButtons()
|
|||
float value;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_INTERVAL));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = ps->GetVisibleValue();
|
||||
m_main->SetAutosaveInterval(static_cast<int>(round(value)));
|
||||
}
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_AUTOSAVE_SLOTS));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = ps->GetVisibleValue();
|
||||
m_main->SetAutosaveSlots(static_cast<int>(round(value)));
|
||||
|
|
|
@ -61,7 +61,7 @@ void CScreenSetupGraphics::CreateInterface()
|
|||
|
||||
CScreenSetup::CreateInterface();
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
|
||||
pos.x = ox+sx*3;
|
||||
|
@ -324,62 +324,62 @@ void CScreenSetupGraphics::UpdateSetupButtons()
|
|||
float value;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pv = static_cast<CEditValue*>(pw->SearchControl(EVENT_INTERFACE_PARTI));
|
||||
if ( pv != 0 )
|
||||
if ( pv != nullptr )
|
||||
{
|
||||
value = m_engine->GetParticleDensity();
|
||||
pv->SetValue(value);
|
||||
}
|
||||
|
||||
pv = static_cast<CEditValue*>(pw->SearchControl(EVENT_INTERFACE_CLIP));
|
||||
if ( pv != 0 )
|
||||
if ( pv != nullptr )
|
||||
{
|
||||
value = m_engine->GetClippingDistance();
|
||||
pv->SetValue(value);
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_DIRTY));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_engine->GetDirty());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FOG));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_engine->GetFog());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_LIGHT));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_engine->GetLightMode());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SHADOW_SPOTS));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, !m_engine->GetShadowMapping());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SHADOW_MAPPING));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_ENABLE, m_engine->IsShadowMappingSupported());
|
||||
pc->SetState(STATE_CHECK, m_engine->GetShadowMapping() && !m_engine->GetShadowMappingQuality());
|
||||
}
|
||||
|
||||
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SHADOW_MAPPING_QUALITY));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_ENABLE, m_engine->IsShadowMappingQualitySupported());
|
||||
pc->SetState(STATE_CHECK, m_engine->GetShadowMapping() && m_engine->GetShadowMappingQuality());
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_SHADOW_MAPPING_BUFFER));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
pes->SetState(STATE_ENABLE, m_engine->GetShadowMapping() && m_engine->GetDevice()->IsFramebufferSupported());
|
||||
if (!m_engine->GetShadowMappingOffscreen())
|
||||
|
@ -393,26 +393,26 @@ void CScreenSetupGraphics::UpdateSetupButtons()
|
|||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_FILTER));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
pes->SetVisibleValue(m_engine->GetTextureFilterMode());
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_MIPMAP));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
pes->SetState(STATE_ENABLE, m_engine->GetTextureFilterMode() == Gfx::TEX_FILTER_TRILINEAR);
|
||||
pes->SetVisibleValue(m_engine->GetTextureMipmapLevel());
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_ANISOTROPY));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
pes->SetVisibleValue(m_engine->GetTextureAnisotropyLevel());
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_MSAA));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
pes->SetVisibleValue(m_engine->GetMultiSample());
|
||||
}
|
||||
|
@ -428,52 +428,52 @@ void CScreenSetupGraphics::ChangeSetupButtons()
|
|||
float value;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pv = static_cast<CEditValue*>(pw->SearchControl(EVENT_INTERFACE_PARTI));
|
||||
if ( pv != 0 )
|
||||
if ( pv != nullptr )
|
||||
{
|
||||
value = pv->GetValue();
|
||||
m_engine->SetParticleDensity(value);
|
||||
}
|
||||
|
||||
pv = static_cast<CEditValue*>(pw->SearchControl(EVENT_INTERFACE_CLIP));
|
||||
if ( pv != 0 )
|
||||
if ( pv != nullptr )
|
||||
{
|
||||
value = pv->GetValue();
|
||||
m_engine->SetClippingDistance(value);
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_FILTER));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
int valueIndex = pes->GetVisibleValueIndex();
|
||||
m_engine->SetTextureFilterMode(static_cast<Gfx::TexFilter>(valueIndex));
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_MIPMAP));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
value = pes->GetVisibleValue();
|
||||
m_engine->SetTextureMipmapLevel(static_cast<int>(value));
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_TEXTURE_ANISOTROPY));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
value = pes->GetVisibleValue();
|
||||
m_engine->SetTextureAnisotropyLevel(static_cast<int>(value));
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_MSAA));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
value = pes->GetVisibleValue();
|
||||
m_engine->SetMultiSample(static_cast<int>(value));
|
||||
}
|
||||
|
||||
pes = static_cast<CEnumSlider*>(pw->SearchControl(EVENT_INTERFACE_SHADOW_MAPPING_BUFFER));
|
||||
if ( pes != 0 )
|
||||
if ( pes != nullptr )
|
||||
{
|
||||
value = pes->GetVisibleValue();
|
||||
if(value == 0)
|
||||
|
|
|
@ -55,7 +55,7 @@ void CScreenSetupSound::CreateInterface()
|
|||
|
||||
CScreenSetup::CreateInterface();
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
pos.x = ox+sx*3;
|
||||
pos.y = 0.55f;
|
||||
|
@ -133,17 +133,17 @@ void CScreenSetupSound::UpdateSetupButtons()
|
|||
float value;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLSOUND));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = static_cast<float>(m_sound->GetAudioVolume());
|
||||
ps->SetVisibleValue(value);
|
||||
}
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLMUSIC));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = static_cast<float>(m_sound->GetMusicVolume());
|
||||
ps->SetVisibleValue(value);
|
||||
|
@ -159,17 +159,17 @@ void CScreenSetupSound::ChangeSetupButtons()
|
|||
float value;
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||
if ( pw == 0 ) return;
|
||||
if ( pw == nullptr ) return;
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLSOUND));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = ps->GetVisibleValue();
|
||||
m_sound->SetAudioVolume(static_cast<int>(value));
|
||||
}
|
||||
|
||||
ps = static_cast<CSlider*>(pw->SearchControl(EVENT_INTERFACE_VOLMUSIC));
|
||||
if ( ps != 0 )
|
||||
if ( ps != nullptr )
|
||||
{
|
||||
value = ps->GetVisibleValue();
|
||||
m_sound->SetMusicVolume(static_cast<int>(value));
|
||||
|
|
|
@ -347,10 +347,10 @@ bool CStudio::EventFrame(const Event &event)
|
|||
if ( pw == nullptr ) return false;
|
||||
|
||||
edit = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit == 0 ) return false;
|
||||
if ( edit == nullptr ) return false;
|
||||
|
||||
list = static_cast< CList* >(pw->SearchControl(EVENT_STUDIO_LIST));
|
||||
if ( list == 0 ) return false;
|
||||
if ( list == nullptr ) return false;
|
||||
|
||||
if ( !m_script->IsRunning() && m_bRunning ) // stop?
|
||||
{
|
||||
|
@ -874,7 +874,7 @@ bool CStudio::StopEditScript(bool bCancel)
|
|||
if ( !bCancel && !m_script->IsRunning() )
|
||||
{
|
||||
edit = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit != 0 )
|
||||
if ( edit != nullptr )
|
||||
{
|
||||
if ( !m_script->GetScript(edit) ) // compile
|
||||
{
|
||||
|
@ -909,7 +909,7 @@ void CStudio::SetInfoText(std::string text, bool bClickable)
|
|||
if ( pw == nullptr ) return;
|
||||
|
||||
CList* list = static_cast< CList* >(pw->SearchControl(EVENT_STUDIO_LIST));
|
||||
if ( list == 0 ) return;
|
||||
if ( list == nullptr ) return;
|
||||
|
||||
list->Flush(); // just text
|
||||
list->SetItemName(0, text.c_str());
|
||||
|
@ -945,7 +945,7 @@ void CStudio::ViewEditScript()
|
|||
if ( pw == nullptr ) return;
|
||||
|
||||
edit = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
dim = m_engine->GetWindowSize();
|
||||
edit->SetFontSize(m_settings->GetFontSize()/(dim.x/640.0f));
|
||||
|
@ -997,7 +997,7 @@ void CStudio::UpdateButtons()
|
|||
if ( pw == nullptr ) return;
|
||||
|
||||
edit = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
|
||||
if ( edit == 0 ) return;
|
||||
if ( edit == nullptr ) return;
|
||||
|
||||
if ( m_bRunning )
|
||||
{
|
||||
|
@ -1014,47 +1014,47 @@ void CStudio::UpdateButtons()
|
|||
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_CLONE));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, m_program->runnable && !m_bRunning);
|
||||
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_COMPILE));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, m_program->runnable && !m_bRunning);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_RUN));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetIcon(m_bRunning?8:21); // stop/run
|
||||
button->SetState(STATE_ENABLE, m_program->runnable || m_bRunning);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_REALTIME));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetIcon(m_bRealTime?64+22:64+21);
|
||||
button->SetState(STATE_ENABLE, (!m_bRunning || !m_script->IsContinue()));
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_STEP));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, (m_bRunning && !m_bRealTime && !m_script->IsContinue()));
|
||||
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_NEW));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, !m_program->readOnly);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_OPEN));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, !m_program->readOnly);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_UNDO));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, !m_program->readOnly);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_CUT));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, !m_program->readOnly);
|
||||
|
||||
button = static_cast< CButton* >(pw->SearchControl(EVENT_STUDIO_PASTE));
|
||||
if ( button == 0 ) return;
|
||||
if ( button == nullptr ) return;
|
||||
button->SetState(STATE_ENABLE, !m_program->readOnly);
|
||||
}
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ void CStudio::AdjustDialog()
|
|||
ddim.x = wdim.x-20.0f/640.0f;
|
||||
ddim.y = 20.0f/480.0f;
|
||||
pla = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1));
|
||||
if ( pla != 0 )
|
||||
if ( pla != nullptr )
|
||||
{
|
||||
pla->SetPos(ppos);
|
||||
pla->SetDim(ddim);
|
||||
|
@ -1259,7 +1259,7 @@ void CStudio::AdjustDialog()
|
|||
ddim.y = nli*18.0f/480.0f+9.0f/480.0f;
|
||||
ppos.y = wpos.y+wdim.y-48.0f/480.0f-ddim.y;
|
||||
pli = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST));
|
||||
if ( pli != 0 )
|
||||
if ( pli != nullptr )
|
||||
{
|
||||
pli->SetPos(ppos);
|
||||
pli->SetDim(ddim);
|
||||
|
@ -1273,7 +1273,7 @@ void CStudio::AdjustDialog()
|
|||
ddim.x = 50.0f/640.0f;
|
||||
ddim.y = 20.0f/480.0f;
|
||||
pla = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL2));
|
||||
if ( pla != 0 )
|
||||
if ( pla != nullptr )
|
||||
{
|
||||
pla->SetPos(ppos);
|
||||
pla->SetDim(ddim);
|
||||
|
@ -1283,7 +1283,7 @@ void CStudio::AdjustDialog()
|
|||
ppos.y = wpos.y+36.0f/480.0f;
|
||||
ddim.x = wdim.x-170.0f/640.0f;
|
||||
pe = static_cast< CEdit* >(pw->SearchControl(EVENT_DIALOG_EDIT));
|
||||
if ( pe != 0 )
|
||||
if ( pe != nullptr )
|
||||
{
|
||||
pe->SetPos(ppos);
|
||||
pe->SetDim(ddim);
|
||||
|
@ -1300,7 +1300,7 @@ void CStudio::AdjustDialog()
|
|||
ddim.x = 50.0f/640.0f;
|
||||
ddim.y = 16.0f/480.0f;
|
||||
pla = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL3));
|
||||
if ( pla != 0 )
|
||||
if ( pla != nullptr )
|
||||
{
|
||||
pla->SetPos(ppos);
|
||||
pla->SetDim(ddim);
|
||||
|
@ -1310,7 +1310,7 @@ void CStudio::AdjustDialog()
|
|||
ppos.y = wpos.y+12.0f/480.0f;
|
||||
ddim.x = 70.0f/640.0f;
|
||||
pc = static_cast< CCheck* >(pw->SearchControl(EVENT_DIALOG_CHECK1));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetPos(ppos);
|
||||
pc->SetDim(ddim);
|
||||
|
@ -1318,7 +1318,7 @@ void CStudio::AdjustDialog()
|
|||
|
||||
ppos.x += 80.0f/640.0f;
|
||||
pc = static_cast< CCheck* >(pw->SearchControl(EVENT_DIALOG_CHECK2));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetPos(ppos);
|
||||
pc->SetDim(ddim);
|
||||
|
@ -1329,7 +1329,7 @@ void CStudio::AdjustDialog()
|
|||
ddim.x = 90.0f/640.0f;
|
||||
ddim.y = 23.0f/480.0f;
|
||||
pb = static_cast< CButton* >(pw->SearchControl(EVENT_DIALOG_OK));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetPos(ppos);
|
||||
pb->SetDim(ddim);
|
||||
|
@ -1337,7 +1337,7 @@ void CStudio::AdjustDialog()
|
|||
|
||||
ppos.y -= 26.0f/480.0f;
|
||||
pb = static_cast< CButton* >(pw->SearchControl(EVENT_DIALOG_CANCEL));
|
||||
if ( pb != 0 )
|
||||
if ( pb != nullptr )
|
||||
{
|
||||
pb->SetPos(ppos);
|
||||
pb->SetDim(ddim);
|
||||
|
@ -1428,7 +1428,7 @@ void CStudio::UpdateChangeList()
|
|||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
pe = static_cast< CEdit* >(pw->SearchControl(EVENT_DIALOG_EDIT));
|
||||
if ( pe == nullptr ) return;
|
||||
|
||||
|
@ -1467,7 +1467,7 @@ void CStudio::UpdateChangeEdit()
|
|||
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW9));
|
||||
if ( pw == nullptr ) return;
|
||||
pl = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST));
|
||||
if ( pl == 0 ) return;
|
||||
if ( pl == nullptr ) return;
|
||||
|
||||
pl->SetSelect(-1);
|
||||
|
||||
|
@ -1530,19 +1530,19 @@ void CStudio::UpdateDialogPublic()
|
|||
if ( pw == nullptr ) return;
|
||||
|
||||
pc = static_cast< CCheck* >(pw->SearchControl(EVENT_DIALOG_CHECK1));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, !m_settings->GetIOPublic());
|
||||
}
|
||||
|
||||
pc = static_cast< CCheck* >(pw->SearchControl(EVENT_DIALOG_CHECK2));
|
||||
if ( pc != 0 )
|
||||
if ( pc != nullptr )
|
||||
{
|
||||
pc->SetState(STATE_CHECK, m_settings->GetIOPublic());
|
||||
}
|
||||
|
||||
pl = static_cast< CLabel* >(pw->SearchControl(EVENT_DIALOG_LABEL1));
|
||||
if ( pl != 0 )
|
||||
if ( pl != nullptr )
|
||||
{
|
||||
// GetResource(RES_TEXT, RT_IO_LIST, name); // TODO: unused?
|
||||
pl->SetName(SearchDirectory(false).c_str(), false);
|
||||
|
@ -1618,7 +1618,7 @@ bool CStudio::ReadProgram()
|
|||
if ( filename[0] == 0 ) return false;
|
||||
|
||||
p = strstr(filename, ".txt");
|
||||
if ( p == 0 || p != filename+strlen(filename)-4 )
|
||||
if ( p == nullptr || p != filename+strlen(filename)-4 )
|
||||
{
|
||||
strcat(filename, ".txt");
|
||||
}
|
||||
|
@ -1656,7 +1656,7 @@ bool CStudio::WriteProgram()
|
|||
if ( filename[0] == 0 ) return false;
|
||||
|
||||
p = strstr(filename, ".txt");
|
||||
if ( p == 0 || p != filename+strlen(filename)-4 )
|
||||
if ( p == nullptr || p != filename+strlen(filename)-4 )
|
||||
{
|
||||
strcat(filename, ".txt");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue