[C++] How to fix Icon / BigIcon glitch when save .png by Photoshop
if you no idea what i talking about.
when your create some icon from photoshop and save with .png to this file list
- Res-Tex/item.tex
- Res-Tex/bigitem.tex
you may get black glitch when it render by client.
there have 2 solution for you to fix.
1. save right setting when save file
2. fix by client source.
i will give some guide for icon only. if you want fix bigicon just try copy paste thing.
InterfaceLib\main\INFIcon.h (add some variable for check)
Code:
class CINFIcon : public CAtumNode {
protected:
BOOL m_IsSet; // Add this inside protected
InterfaceLib\main\INFIcon.cpp (set up variable for make it work)
Code:
CINFIcon::CINFIcon()
{
m_IsSet = FALSE; // Add this inside function
...
void CINFIcon::SetIcon(......)
{
m_IsSet = FALSE; // Add this inside function
...
void CINFIcon::Render()
{
// scroll down a bit
if(pImage) {
// Replace inside with this code
if (m_IsSet == FALSE)
{
m_IsSet = TRUE;
pImage->Move(m_nX, m_nY);
POINT temp = pImage->GetImgSize();
pImage->SetScale(m_fScale, m_fScale);
pImage->SetRect(0, 0, temp.x, temp.y);
// if you icon size is 28x28. you can put fixed number here and skip getimagesize().
//btw better ignore it if you dont know what i mean
}
pImage->Render();
}