Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C++] How to fix Icon / BigIcon glitch when save .png by Photoshop

Newbie Spellweaver
Joined
Feb 2, 2015
Messages
77
Reaction score
54
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:

[B]BOOL        [/B][B]m_IsSet; [COLOR=#ff0000]// Add this inside protected[/COLOR][/B]


InterfaceLib\main\INFIcon.cpp (set up variable for make it work)
Code:
CINFIcon::CINFIcon()
{
[B]m_IsSet = FALSE; [COLOR=#FF0000]// Add this inside function

[/COLOR][/B]...

void CINFIcon::SetIcon(......)
{
[B]m_IsSet = FALSE; [COLOR=#FF0000]// Add this inside function

[/COLOR][/B]...[B][COLOR=#FF0000]
[/COLOR][/B]void CINFIcon::Render()
{
// scroll down a bit
if(pImage)    {
[COLOR=#ff0000]   [B]  // Replace inside with this code[/B][/COLOR]
[COLOR=#ff0000][B]     if (m_IsSet == FALSE)
     {
          m_IsSet = TRUE;            
[/B][/COLOR][COLOR=#ff0000][B]pImage->Move(m_nX, m_nY);
          POINT temp = pImage->GetImgSize();
          pImage->SetScale(m_fScale, m_fScale);
          pImage->SetRect(0, 0, temp.x, temp.y); 
[/B][/COLOR][COLOR=#ff0000][B]// if you icon size is 28x28. you can put fixed number here and skip getimagesize(). 
[/B][/COLOR][COLOR=#ff0000][B]//btw better ignore it if you dont know what i mean
     }[/B][/COLOR]
pImage->Render();
}
 
Last edited:
Back
Top