mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Implementation of sRGB image support. Overhauls the linearization setup to utilize the sRGB image types, as well as refactors the use of ColorF and ColorI to be properly internally consistent. ColorIs are used only for front-facing/editing/UI settings, and ColorFs, now renamed to LinearColorF to reduce confusion of purpose, are used for color info in the engine itself. This avoids confusing and expensive conversions back and forth between types and avoids botches with linearity. Majority work done by @rextimmy
This commit is contained in:
parent
8780f83262
commit
25686ed4be
294 changed files with 3894 additions and 2813 deletions
|
|
@ -41,10 +41,10 @@ class GuiHealthTextHud : public GuiControl
|
|||
bool mShowEnergy;
|
||||
bool mShowTrueHealth;
|
||||
|
||||
ColorF mFillColor;
|
||||
ColorF mFrameColor;
|
||||
ColorF mTextColor;
|
||||
ColorF mWarnColor;
|
||||
LinearColorF mFillColor;
|
||||
LinearColorF mFrameColor;
|
||||
LinearColorF mTextColor;
|
||||
LinearColorF mWarnColor;
|
||||
|
||||
F32 mWarnLevel;
|
||||
F32 mPulseThreshold;
|
||||
|
|
@ -167,7 +167,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
|
||||
// If enabled draw background first
|
||||
if (mShowFill)
|
||||
drawUtil->drawRectFill(updateRect, mFillColor);
|
||||
drawUtil->drawRectFill(updateRect, mFillColor.toColorI());
|
||||
|
||||
// Prepare text and center it
|
||||
S32 val = (S32)mValue;
|
||||
|
|
@ -176,7 +176,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
offset.x += (getBounds().extent.x - mProfile->mFont->getStrWidth((const UTF8 *)buf)) / 2;
|
||||
offset.y += (getBounds().extent.y - mProfile->mFont->getHeight()) / 2;
|
||||
|
||||
ColorF tColor = mTextColor;
|
||||
LinearColorF tColor = mTextColor;
|
||||
|
||||
// If warning level is exceeded switch to warning color
|
||||
if(mValue < mWarnLevel)
|
||||
|
|
@ -192,11 +192,11 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
}
|
||||
}
|
||||
|
||||
drawUtil->setBitmapModulation(tColor);
|
||||
drawUtil->setBitmapModulation(tColor.toColorI());
|
||||
drawUtil->drawText(mProfile->mFont, offset, buf);
|
||||
drawUtil->clearBitmapModulation();
|
||||
|
||||
// If enabled draw the border last
|
||||
if (mShowFrame)
|
||||
drawUtil->drawRect(updateRect, mFrameColor);
|
||||
drawUtil->drawRect(updateRect, mFrameColor.toColorI());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue