Project

General

Profile

Feature #357 » colordiffuse.patch

PPlayerxx, 08/26/2020 08:42 AM

View differences:

GUIControlFactory.cpp (working copy)
const char *flipY = pNode->Attribute("flipy");
if (flipY && strcmpi(flipY, "true") == 0) image.orientation = 3 - image.orientation; // either 3 or 2
image.diffuse = pNode->Attribute("diffuse");
image.diffuseColor.Parse(pNode->Attribute("colordiffuse"), 0);
const char *background = pNode->Attribute("background");
if (background && strnicmp(background, "true", 4) == 0)
image.useLarge = true;
GUITexture.cpp (working copy)
using namespace std;
CGUITextureBase::CGUITextureBase(float posX, float posY, float width, float height, const CTextureInfo& texture)
{
m_posX = posX;
......
#define MIX_ALPHA(a,c) (((a * (c >> 24)) / 255) << 24) | (c & 0x00ffffff)
color_t color = m_diffuseColor;
if (m_alpha != 0xFF) color = MIX_ALPHA(m_alpha, m_diffuseColor);
// diffuse color
color_t color = (m_info.diffuseColor) ? m_info.diffuseColor : m_diffuseColor;
color = g_graphicsContext.MergeAlpha(color);
if (m_alpha != 0xFF)
color = MIX_ALPHA(m_alpha, color);
Draw(x, y, z, texture, diffuse, color, orientation);
}
......
}
void CGUITextureBase::SetDiffuseColor(color_t color)
{
m_diffuseColor = color;
{
m_diffuseColor = color;
changed |= m_info.diffuseColor.Update();
}
bool CGUITextureBase::ReadyToRender() const
GUITexture.h (working copy)
#include "TextureManager.h"
#include "Geometry.h"
#include "GUIInfoTypes.h"
typedef uint32_t color_t;
......
diffuse = right.diffuse;
filename = right.filename;
useLarge = right.useLarge;
diffuseColor = right.diffuseColor;
};
bool useLarge;
FRECT border; // scaled - unneeded if we get rid of scale on load
int orientation; // orientation of the texture (0 - 7 == EXIForientation - 1)
CStdString diffuse; // diffuse overlay texture
CStdString filename; // main texture file
int orientation; // orientation of the texture (0 - 7 == EXIForientation - 1)
CStdString diffuse; // diffuse overlay texture
CGUIInfoColor diffuseColor; // diffuse color
CStdString filename; // main texture file
};
class CGUITextureBase
(2-2/2)