From ea0615ee05b0812f2bb5d7d8b970b3f83999a319 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 8 Aug 2014 14:03:43 +0200 Subject: Fixed #315 --- src/ui/edit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index e2df62b..24d02e9 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -373,23 +373,23 @@ bool CEdit::EventProcess(const Event &event) MoveChar(1, bControl, bShift); return true; } - if ( event.key.key == KEY(UP) ) + if ( event.key.key == KEY(UP) && m_bMulti ) { MoveLine(-1, bControl, bShift); return true; } - if ( event.key.key == KEY(DOWN) ) + if ( event.key.key == KEY(DOWN) && m_bMulti ) { MoveLine(1, bControl, bShift); return true; } - if ( event.key.key == KEY(PAGEUP) ) // PageUp ? + if ( event.key.key == KEY(PAGEUP) && m_bMulti ) // PageUp ? { MoveLine(-(m_lineVisible-1), bControl, bShift); return true; } - if ( event.key.key == KEY(PAGEDOWN) ) // PageDown ? + if ( event.key.key == KEY(PAGEDOWN) && m_bMulti ) // PageDown ? { MoveLine(m_lineVisible-1, bControl, bShift); return true; -- cgit v1.2.3-1-g7c22 From ac019c263d7b41742934a9dafd58ac2e6171109c Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 9 Aug 2014 22:45:07 +0200 Subject: Remove unnecessary delete checks (#318) --- src/ui/interface.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/ui') diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index ab2c01b..4a0c221 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -49,11 +49,8 @@ void CInterface::Flush() { for (int i = 0; i < MAXCONTROL; i++) { - if (m_table[i] != nullptr) - { - delete m_table[i]; - m_table[i] = nullptr; - } + delete m_table[i]; + m_table[i] = nullptr; } } -- cgit v1.2.3-1-g7c22 From 9de086390bc925b6eb8cbfe332c1985e4b715d61 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 10 Aug 2014 17:51:47 +0200 Subject: Remove some more delete checks (#318) --- src/ui/edit.cpp | 17 +++++------------ src/ui/list.cpp | 6 ++---- src/ui/window.cpp | 53 +++++++++++++++-------------------------------------- 3 files changed, 22 insertions(+), 54 deletions(-) (limited to 'src/ui') diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 24d02e9..4132896 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -115,21 +115,16 @@ CEdit::CEdit () : CControl () CEdit::~CEdit() { - int i; - FreeImage(); - for ( i=0 ; i Date: Tue, 12 Aug 2014 21:24:33 +0200 Subject: CProfile refactoring --- src/ui/maindialog.cpp | 156 +++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'src/ui') diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index 39e7aa9..1b0facb 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -3541,7 +3541,7 @@ void CMainDialog::NameSelect() GetGamerFace(m_main->GetGamerName()); - GetProfile().SetLocalProfileString("Gamer", "LastName", m_main->GetGamerName()); + GetProfile().SetStringProperty("Gamer", "LastName", m_main->GetGamerName()); } // Creates a new player. @@ -5164,46 +5164,46 @@ void CMainDialog::ChangeSetupButtons() void CMainDialog::SetupMemorize() { - GetProfile().SetLocalProfileString("Directory", "scene", m_sceneDir); - GetProfile().SetLocalProfileString("Directory", "savegame", m_savegameDir); - GetProfile().SetLocalProfileString("Directory", "public", m_publicDir); - GetProfile().SetLocalProfileString("Directory", "user", m_userDir); - GetProfile().SetLocalProfileString("Directory", "files", m_filesDir); - GetProfile().SetLocalProfileInt("Setup", "Tooltips", m_bTooltip); - GetProfile().SetLocalProfileInt("Setup", "InterfaceGlint", m_bGlint); - GetProfile().SetLocalProfileInt("Setup", "InterfaceGlint", m_bRain); - GetProfile().SetLocalProfileInt("Setup", "Soluce4", m_bSoluce4); - GetProfile().SetLocalProfileInt("Setup", "Movies", m_bMovies); - GetProfile().SetLocalProfileInt("Setup", "NiceReset", m_bNiceReset); - GetProfile().SetLocalProfileInt("Setup", "HimselfDamage", m_bHimselfDamage); - GetProfile().SetLocalProfileInt("Setup", "CameraScroll", m_bCameraScroll); - GetProfile().SetLocalProfileInt("Setup", "CameraInvertX", m_bCameraInvertX); - GetProfile().SetLocalProfileInt("Setup", "CameraInvertY", m_bCameraInvertY); - GetProfile().SetLocalProfileInt("Setup", "InterfaceEffect", m_bEffect); - GetProfile().SetLocalProfileInt("Setup", "GroundShadow", m_engine->GetShadow()); - GetProfile().SetLocalProfileInt("Setup", "GroundSpot", m_engine->GetGroundSpot()); - GetProfile().SetLocalProfileInt("Setup", "ObjectDirty", m_engine->GetDirty()); - GetProfile().SetLocalProfileInt("Setup", "FogMode", m_engine->GetFog()); - GetProfile().SetLocalProfileInt("Setup", "LensMode", m_engine->GetLensMode()); - GetProfile().SetLocalProfileInt("Setup", "SkyMode", m_engine->GetSkyMode()); - GetProfile().SetLocalProfileInt("Setup", "PlanetMode", m_engine->GetPlanetMode()); - GetProfile().SetLocalProfileInt("Setup", "LightMode", m_engine->GetLightMode()); - GetProfile().SetLocalProfileFloat("Setup", "ParticleDensity", m_engine->GetParticleDensity()); - GetProfile().SetLocalProfileFloat("Setup", "ClippingDistance", m_engine->GetClippingDistance()); - GetProfile().SetLocalProfileFloat("Setup", "ObjectDetail", m_engine->GetObjectDetail()); - GetProfile().SetLocalProfileFloat("Setup", "GadgetQuantity", m_engine->GetGadgetQuantity()); - GetProfile().SetLocalProfileInt("Setup", "TextureQuality", m_engine->GetTextureQuality()); - GetProfile().SetLocalProfileInt("Setup", "TotoMode", m_engine->GetTotoMode()); - GetProfile().SetLocalProfileInt("Setup", "AudioVolume", m_sound->GetAudioVolume()); - GetProfile().SetLocalProfileInt("Setup", "MusicVolume", m_sound->GetMusicVolume()); - GetProfile().SetLocalProfileInt("Setup", "EditIndentMode", m_engine->GetEditIndentMode()); - GetProfile().SetLocalProfileInt("Setup", "EditIndentValue", m_engine->GetEditIndentValue()); + GetProfile().SetStringProperty("Directory", "scene", m_sceneDir); + GetProfile().SetStringProperty("Directory", "savegame", m_savegameDir); + GetProfile().SetStringProperty("Directory", "public", m_publicDir); + GetProfile().SetStringProperty("Directory", "user", m_userDir); + GetProfile().SetStringProperty("Directory", "files", m_filesDir); + GetProfile().SetIntProperty("Setup", "Tooltips", m_bTooltip); + GetProfile().SetIntProperty("Setup", "InterfaceGlint", m_bGlint); + GetProfile().SetIntProperty("Setup", "InterfaceGlint", m_bRain); + GetProfile().SetIntProperty("Setup", "Soluce4", m_bSoluce4); + GetProfile().SetIntProperty("Setup", "Movies", m_bMovies); + GetProfile().SetIntProperty("Setup", "NiceReset", m_bNiceReset); + GetProfile().SetIntProperty("Setup", "HimselfDamage", m_bHimselfDamage); + GetProfile().SetIntProperty("Setup", "CameraScroll", m_bCameraScroll); + GetProfile().SetIntProperty("Setup", "CameraInvertX", m_bCameraInvertX); + GetProfile().SetIntProperty("Setup", "CameraInvertY", m_bCameraInvertY); + GetProfile().SetIntProperty("Setup", "InterfaceEffect", m_bEffect); + GetProfile().SetIntProperty("Setup", "GroundShadow", m_engine->GetShadow()); + GetProfile().SetIntProperty("Setup", "GroundSpot", m_engine->GetGroundSpot()); + GetProfile().SetIntProperty("Setup", "ObjectDirty", m_engine->GetDirty()); + GetProfile().SetIntProperty("Setup", "FogMode", m_engine->GetFog()); + GetProfile().SetIntProperty("Setup", "LensMode", m_engine->GetLensMode()); + GetProfile().SetIntProperty("Setup", "SkyMode", m_engine->GetSkyMode()); + GetProfile().SetIntProperty("Setup", "PlanetMode", m_engine->GetPlanetMode()); + GetProfile().SetIntProperty("Setup", "LightMode", m_engine->GetLightMode()); + GetProfile().SetFloatProperty("Setup", "ParticleDensity", m_engine->GetParticleDensity()); + GetProfile().SetFloatProperty("Setup", "ClippingDistance", m_engine->GetClippingDistance()); + GetProfile().SetFloatProperty("Setup", "ObjectDetail", m_engine->GetObjectDetail()); + GetProfile().SetFloatProperty("Setup", "GadgetQuantity", m_engine->GetGadgetQuantity()); + GetProfile().SetIntProperty("Setup", "TextureQuality", m_engine->GetTextureQuality()); + GetProfile().SetIntProperty("Setup", "TotoMode", m_engine->GetTotoMode()); + GetProfile().SetIntProperty("Setup", "AudioVolume", m_sound->GetAudioVolume()); + GetProfile().SetIntProperty("Setup", "MusicVolume", m_sound->GetMusicVolume()); + GetProfile().SetIntProperty("Setup", "EditIndentMode", m_engine->GetEditIndentMode()); + GetProfile().SetIntProperty("Setup", "EditIndentValue", m_engine->GetEditIndentValue()); /* screen setup */ if (m_setupFull) - GetProfile().SetLocalProfileInt("Setup", "Fullscreen", 1); + GetProfile().SetIntProperty("Setup", "Fullscreen", 1); else - GetProfile().SetLocalProfileInt("Setup", "Fullscreen", 0); + GetProfile().SetIntProperty("Setup", "Fullscreen", 0); CList *pl; CWindow *pw; @@ -5213,7 +5213,7 @@ void CMainDialog::SetupMemorize() pl = static_cast(pw->SearchControl(EVENT_LIST2)); if ( pl != 0 ) { - GetProfile().SetLocalProfileInt("Setup", "Resolution", pl->GetSelect()); + GetProfile().SetIntProperty("Setup", "Resolution", pl->GetSelect()); } } else @@ -5230,9 +5230,9 @@ void CMainDialog::SetupMemorize() key << b.secondary << " "; } - GetProfile().SetLocalProfileString("Setup", "KeyMap", key.str()); + GetProfile().SetStringProperty("Setup", "KeyMap", key.str()); - GetProfile().SetLocalProfileInt("Setup", "DeleteGamer", m_bDeleteGamer); + GetProfile().SetIntProperty("Setup", "DeleteGamer", m_bDeleteGamer); } // Remember all the settings. @@ -5243,48 +5243,48 @@ void CMainDialog::SetupRecall() int iValue; std::string key; - if ( GetProfile().GetLocalProfileString("Directory", "scene", key) ) + if ( GetProfile().GetStringProperty("Directory", "scene", key) ) { m_sceneDir = key; } - if ( GetProfile().GetLocalProfileString("Directory", "savegame", key) ) + if ( GetProfile().GetStringProperty("Directory", "savegame", key) ) { m_savegameDir = key; } - if ( GetProfile().GetLocalProfileString("Directory", "public", key) ) + if ( GetProfile().GetStringProperty("Directory", "public", key) ) { m_publicDir = key; } - if ( GetProfile().GetLocalProfileString("Directory", "user", key) ) + if ( GetProfile().GetStringProperty("Directory", "user", key) ) { m_userDir = key; } - if ( GetProfile().GetLocalProfileString("Directory", "files", key) ) + if ( GetProfile().GetStringProperty("Directory", "files", key) ) { m_filesDir = key; } - if ( GetProfile().GetLocalProfileInt("Setup", "TotoMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "TotoMode", iValue) ) { m_engine->SetTotoMode(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "Tooltips", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "Tooltips", iValue) ) { m_bTooltip = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceGlint", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "InterfaceGlint", iValue) ) { m_bGlint = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceGlint", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "InterfaceGlint", iValue) ) { m_bRain = iValue; } @@ -5295,86 +5295,86 @@ void CMainDialog::SetupRecall() // m_engine->SetNiceMouse(iValue); // } - if ( GetProfile().GetLocalProfileInt("Setup", "Soluce4", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "Soluce4", iValue) ) { m_bSoluce4 = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "Movies", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "Movies", iValue) ) { m_bMovies = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "NiceReset", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "NiceReset", iValue) ) { m_bNiceReset = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "HimselfDamage", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "HimselfDamage", iValue) ) { m_bHimselfDamage = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "CameraScroll", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "CameraScroll", iValue) ) { m_bCameraScroll = iValue; m_camera->SetCameraScroll(m_bCameraScroll); } - if ( GetProfile().GetLocalProfileInt("Setup", "CameraInvertX", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "CameraInvertX", iValue) ) { m_bCameraInvertX = iValue; m_camera->SetCameraInvertX(m_bCameraInvertX); } - if ( GetProfile().GetLocalProfileInt("Setup", "CameraInvertY", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "CameraInvertY", iValue) ) { m_bCameraInvertY = iValue; m_camera->SetCameraInvertY(m_bCameraInvertY); } - if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceEffect", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "InterfaceEffect", iValue) ) { m_bEffect = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "GroundShadow", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "GroundShadow", iValue) ) { m_engine->SetShadow(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "GroundSpot", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "GroundSpot", iValue) ) { m_engine->SetGroundSpot(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "ObjectDirty", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "ObjectDirty", iValue) ) { m_engine->SetDirty(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "FogMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "FogMode", iValue) ) { m_engine->SetFog(iValue); m_camera->SetOverBaseColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)); // TODO: color ok? } - if ( GetProfile().GetLocalProfileInt("Setup", "LensMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "LensMode", iValue) ) { m_engine->SetLensMode(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "SkyMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "SkyMode", iValue) ) { m_engine->SetSkyMode(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "PlanetMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "PlanetMode", iValue) ) { m_engine->SetPlanetMode(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "LightMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "LightMode", iValue) ) { m_engine->SetLightMode(iValue); } @@ -5384,52 +5384,52 @@ void CMainDialog::SetupRecall() // m_engine->SetJoystick(iValue); // } - if ( GetProfile().GetLocalProfileFloat("Setup", "ParticleDensity", fValue) ) + if ( GetProfile().GetFloatProperty("Setup", "ParticleDensity", fValue) ) { m_engine->SetParticleDensity(fValue); } - if ( GetProfile().GetLocalProfileFloat("Setup", "ClippingDistance", fValue) ) + if ( GetProfile().GetFloatProperty("Setup", "ClippingDistance", fValue) ) { m_engine->SetClippingDistance(fValue); } - if ( GetProfile().GetLocalProfileFloat("Setup", "ObjectDetail", fValue) ) + if ( GetProfile().GetFloatProperty("Setup", "ObjectDetail", fValue) ) { m_engine->SetObjectDetail(fValue); } - if ( GetProfile().GetLocalProfileFloat("Setup", "GadgetQuantity", fValue) ) + if ( GetProfile().GetFloatProperty("Setup", "GadgetQuantity", fValue) ) { m_engine->SetGadgetQuantity(fValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "TextureQuality", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "TextureQuality", iValue) ) { m_engine->SetTextureQuality(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "AudioVolume", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "AudioVolume", iValue) ) { m_sound->SetAudioVolume(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "MusicVolume", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "MusicVolume", iValue) ) { m_sound->SetMusicVolume(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "EditIndentMode", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "EditIndentMode", iValue) ) { m_engine->SetEditIndentMode(iValue); } - if ( GetProfile().GetLocalProfileInt("Setup", "EditIndentValue", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "EditIndentValue", iValue) ) { m_engine->SetEditIndentValue(iValue); } - if (GetProfile().GetLocalProfileString("Setup", "KeyMap", key)) + if (GetProfile().GetStringProperty("Setup", "KeyMap", key)) { std::stringstream skey; skey.str(key); @@ -5442,17 +5442,17 @@ void CMainDialog::SetupRecall() } } - if ( GetProfile().GetLocalProfileInt("Setup", "DeleteGamer", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "DeleteGamer", iValue) ) { m_bDeleteGamer = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "Resolution", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "Resolution", iValue) ) { m_setupSelMode = iValue; } - if ( GetProfile().GetLocalProfileInt("Setup", "Fullscreen", iValue) ) + if ( GetProfile().GetIntProperty("Setup", "Fullscreen", iValue) ) { m_setupFull = (iValue == 1); } -- cgit v1.2.3-1-g7c22