summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/customsmiley.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-03-01 16:45:43 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-03-01 16:45:43 +0000
commitd5675b1834031fd7c99baa6d948fb550594fcd3a (patch)
tree1977ac3eb1162f8db55c2a7d74981cca39187a83 /plugins/SmileyAdd/src/customsmiley.cpp
parent88167d8a0f7f0e3b8fbad7c8204732995bd265be (diff)
- smileys rewritten to support true frame delays;
- code cleaning; - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@16383 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src/customsmiley.cpp')
-rw-r--r--plugins/SmileyAdd/src/customsmiley.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp
index 32a6f7ff25..3e1413509e 100644
--- a/plugins/SmileyAdd/src/customsmiley.cpp
+++ b/plugins/SmileyAdd/src/customsmiley.cpp
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
SmileyPackCListType g_SmileyPackCStore;
-
bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR* dir)
{
bool res = true;
@@ -37,11 +36,10 @@ bool SmileyPackCListType::AddSmileyPack(MCONTACT hContact, TCHAR* dir)
return res;
}
-
bool SmileyPackCListType::AddSmiley(MCONTACT hContact, TCHAR* path)
{
SmileyPackCType *smpack = GetSmileyPack(hContact);
- if (smpack == NULL) {
+ if (smpack == NULL) {
smpack = new SmileyPackCType;
smpack->SetId(hContact);
@@ -63,7 +61,7 @@ SmileyPackCType* SmileyPackCListType::GetSmileyPack(MCONTACT id)
SmileyCType::SmileyCType(const CMString& fullpath, const TCHAR* filepath)
{
- LoadFromResource(fullpath, 0);
+ LoadFromResource(fullpath, 0);
CreateTriggerText(T2A_SM(filepath));
}
@@ -91,7 +89,6 @@ bool SmileyCType::CreateTriggerText(char* text)
return true;
}
-
//
// SmileyPackCType
//
@@ -118,45 +115,42 @@ bool SmileyPackCType::LoadSmileyDir(TCHAR* dir)
m_SmileyList.insert(smlc);
}
}
- }
- while( _tfindnext( hFile, &c_file ) == 0 );
- _findclose( hFile );
+ } while (_tfindnext(hFile, &c_file) == 0);
+ _findclose(hFile);
AddTriggersToSmileyLookup();
return true;
}
return false;
}
-
bool SmileyPackCType::LoadSmiley(TCHAR* path)
{
CMString dirs = path;
int slash = dirs.ReverseFind('\\');
int dot = dirs.ReverseFind('.');
- CMString name = dirs.Mid(slash+1, dot - slash - 1);
+ CMString name = dirs.Mid(slash + 1, dot - slash - 1);
- for (int i=0; i < m_SmileyList.getCount(); i++)
+ for (int i = 0; i < m_SmileyList.getCount(); i++)
if (m_SmileyList[i].GetTriggerText() == name) {
m_SmileyList[i].LoadFromResource(dirs, 0);
- return true;
+ return true;
}
m_SmileyList.insert(new SmileyCType(dirs, (TCHAR*)name.c_str()));
CMString empty;
m_SmileyLookup.insert(new SmileyLookup(
- m_SmileyList[m_SmileyList.getCount()-1].GetTriggerText(), false, m_SmileyList.getCount()-1, empty));
+ m_SmileyList[m_SmileyList.getCount() - 1].GetTriggerText(), false, m_SmileyList.getCount() - 1, empty));
return true;
}
-
void SmileyPackCType::AddTriggersToSmileyLookup(void)
{
CMString empty;
- for (int dist=0; dist<m_SmileyList.getCount(); dist++) {
- SmileyLookup *dats = new SmileyLookup(m_SmileyList[dist].GetTriggerText(), false, dist, empty);
+ for (int dist = 0; dist < m_SmileyList.getCount(); dist++) {
+ SmileyLookup *dats = new SmileyLookup(m_SmileyList[dist].GetTriggerText(), false, dist, empty);
m_SmileyLookup.insert(dats);
}
}