Project

General

Profile

Feature #371 ยป texture-colordiffuse.patch

antonic901, 13/02/2023 08:43 PM

View differences:

xbmc/guilib/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;
xbmc/guilib/GUITexture.cpp (working copy)
#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;
if (m_alpha != 0xFF) color = MIX_ALPHA(m_alpha, color);
color = g_graphicsContext.MergeAlpha(color);
Draw(x, y, z, texture, diffuse, color, orientation);
......
void CGUITextureBase::SetDiffuseColor(color_t color)
{
m_diffuseColor = color;
m_info.diffuseColor.Update();
}
bool CGUITextureBase::ReadyToRender() const
xbmc/guilib/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
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
CGUIInfoColor diffuseColor; // diffuse color
CStdString filename; // main texture file
};
class CGUITextureBase
    (1-1/1)