mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Factor out back color
This commit is contained in:
@@ -59,13 +59,13 @@ void ColorOval (DrawSurface *surface, const Rect &theRect, long color)
|
||||
surface->SetForeColor(wasColor);
|
||||
}
|
||||
|
||||
void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color, bool isMask, const uint8_t *pattern)
|
||||
void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color, const uint8_t *pattern)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[color];
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillEllipseWithPattern(theRect, isMask, pattern);
|
||||
surface->FillEllipseWithMaskPattern(theRect, pattern);
|
||||
surface->SetForeColor(wasColor);
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ void ColorOvalMaskPattern(DrawSurface *surface, const Rect &theRect, long color,
|
||||
// Given a region and color index, this function draws a solid<69>
|
||||
// region in that color. Current port, pen mode, etc. assumed.
|
||||
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, bool isMask, const uint8_t *pattern)
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, const uint8_t *pattern)
|
||||
{
|
||||
const PortabilityLayer::RGBAColor &rgbaColor = PortabilityLayer::StandardPalette::GetInstance()->GetColors()[colorIndex];
|
||||
|
||||
const PortabilityLayer::RGBAColor wasColor = surface->GetForeColor();
|
||||
surface->SetForeColor(rgbaColor);
|
||||
surface->FillScanlineMaskWithPattern(scanlineMask, isMask, pattern);
|
||||
surface->FillScanlineMaskWithMaskPattern(scanlineMask, pattern);
|
||||
surface->SetForeColor(wasColor);
|
||||
}
|
||||
|
||||
|
@@ -719,7 +719,7 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(rect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRectWithPattern8x8(rect, true, pattern);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
@@ -735,7 +735,7 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(rect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRectWithPattern8x8(rect, true, pattern);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
@@ -751,7 +751,7 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(rect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRectWithPattern8x8(rect, true, pattern);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
@@ -767,7 +767,7 @@ void BorderDialogItem(Dialog *theDialog, short item, short sides, short thicknes
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(rect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->FillRectWithPattern8x8(rect, true, pattern);
|
||||
surface->FillRectWithMaskPattern8x8(rect, pattern);
|
||||
}
|
||||
else
|
||||
surface->FillRect(rect);
|
||||
|
@@ -136,8 +136,8 @@ void BackSpinCursor (short);
|
||||
void ColorText (DrawSurface *surface, const Point &, StringPtr, long); // --- ColorUtils.c
|
||||
void ColorRect (DrawSurface *surface, const Rect &, long);
|
||||
void ColorOval (DrawSurface *surface, const Rect &, long);
|
||||
void ColorOvalMaskPattern (DrawSurface *surface, const Rect &, long, bool, const uint8_t *);
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, bool isMask, const uint8_t *pattern);
|
||||
void ColorOvalMaskPattern (DrawSurface *surface, const Rect &, long, const uint8_t *);
|
||||
void ColorRegionMaskPattern (DrawSurface *surface, PortabilityLayer::ScanlineMask *scanlineMask, long colorIndex, const uint8_t *pattern);
|
||||
void ColorLine (DrawSurface *surface, short, short, short, short, long);
|
||||
void HiliteRect (DrawSurface *surface, const Rect &rect, short, short);
|
||||
void ColorFrameRect (DrawSurface *surface, const Rect &theRect, long colorIndex);
|
||||
|
@@ -202,7 +202,6 @@ void OpenMainWindow (void)
|
||||
|
||||
mainWindowSurface->SetClipRect(mainWindowRect);
|
||||
mainWindowSurface->SetForeColor(StdColors::Black());
|
||||
mainWindowSurface->SetBackColor(StdColors::White());
|
||||
|
||||
whichRoom = GetFirstRoomNumber();
|
||||
CopyRoomToThisRoom(whichRoom);
|
||||
@@ -252,7 +251,6 @@ void OpenMainWindow (void)
|
||||
mainWindowSurface->SetClipRect(mainWindowRect);
|
||||
// CopyRgn(mainWindow->clipRgn, mainWindow->visRgn);
|
||||
mainWindowSurface->SetForeColor(StdColors::Black());
|
||||
mainWindowSurface->SetBackColor(StdColors::White());
|
||||
mainWindowSurface->FillRect(mainWindowRect);
|
||||
|
||||
splashOriginH = ((thisMac.constrainedScreen.right - thisMac.constrainedScreen.left) - 640) / 2;
|
||||
|
@@ -258,7 +258,7 @@ void RedrawMapContents (void)
|
||||
surface->SetForeColor(StdColors::Blue());
|
||||
|
||||
Pattern dummyPat;
|
||||
surface->FillRectWithPattern8x8(aRoom, true, *GetQDGlobalsGray(&dummyPat));
|
||||
surface->FillRectWithMaskPattern8x8(aRoom, *GetQDGlobalsGray(&dummyPat));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -164,9 +164,9 @@ void DrawTable (Rect *tableTop, short down)
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, 15, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, 15, dummyPattern);
|
||||
else
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, k8DkstGrayColor, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, k8DkstGrayColor, dummyPattern);
|
||||
|
||||
InsetRect(tableTop, 0, 1);
|
||||
ColorRect(backSrcMap, *tableTop, brownC);
|
||||
@@ -279,9 +279,9 @@ void DrawShelf (Rect *shelfTop)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, k8DkstGrayColor, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, k8DkstGrayColor, dummyPattern);
|
||||
mask->Destroy();
|
||||
}
|
||||
|
||||
@@ -367,9 +367,9 @@ void DrawCabinet (Rect *cabinet)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, dummyPattern);
|
||||
|
||||
mask->Destroy();
|
||||
}
|
||||
@@ -504,9 +504,9 @@ void DrawCounter(Rect *counter)
|
||||
{
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
if (thisMac.isDepth == 4)
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, 15, dummyPattern);
|
||||
else
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, true, dummyPattern);
|
||||
ColorRegionMaskPattern(backSrcMap, mask, dkGrayC, dummyPattern);
|
||||
|
||||
mask->Destroy();
|
||||
}
|
||||
@@ -747,7 +747,7 @@ void DrawDeckTable (Rect *tableTop, short down)
|
||||
-HalfRectTall(&tempRect) + kTableShadowTop + down);
|
||||
QOffsetRect(&tempRect, kTableShadowOffset, -kTableShadowOffset);
|
||||
GetQDGlobalsGray(&dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, dkGrayC, true, dummyPattern);
|
||||
ColorOvalMaskPattern(backSrcMap, tempRect, dkGrayC, dummyPattern);
|
||||
|
||||
InsetRect(tableTop, 0, 1);
|
||||
ColorRect(backSrcMap, *tableTop, kGoldColor);
|
||||
|
@@ -2251,7 +2251,7 @@ void DrawThisRoomsObjects (void)
|
||||
{
|
||||
if (GetNumberOfLights(thisRoomNumber) <= 0)
|
||||
{
|
||||
surface->FillRectWithPattern8x8(backSrcRect, true, *GetQDGlobalsGray(&dummyPattern));
|
||||
surface->FillRectWithMaskPattern8x8(backSrcRect, *GetQDGlobalsGray(&dummyPattern));
|
||||
}
|
||||
|
||||
for (i = 0; i < kMaxRoomObs; i++)
|
||||
|
@@ -127,7 +127,6 @@ void OpenMessageWindow (const PLPasStr &title)
|
||||
|
||||
surface->SetClipRect(mssgWindowRect);
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->SetBackColor(StdColors::White());
|
||||
|
||||
surface->SetSystemFont(12, 0);
|
||||
}
|
||||
|
@@ -828,7 +828,7 @@ void DrawSurface::FillRect(const Rect &rect)
|
||||
m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
}
|
||||
|
||||
void DrawSurface::FillRectWithPattern8x8(const Rect &rect, bool isMask, const uint8_t *pattern)
|
||||
void DrawSurface::FillRectWithMaskPattern8x8(const Rect &rect, const uint8_t *pattern)
|
||||
{
|
||||
if (!rect.IsValid())
|
||||
return;
|
||||
@@ -866,9 +866,6 @@ void DrawSurface::FillRectWithPattern8x8(const Rect &rect, bool isMask, const ui
|
||||
const uint8_t color = qdState->ResolveForeColor8(nullptr, 0);
|
||||
uint8_t backColor = 0;
|
||||
|
||||
if (!isMask)
|
||||
backColor = qdState->ResolveBackColor8(nullptr, 0);
|
||||
|
||||
size_t scanlineIndex = 0;
|
||||
for (size_t ln = 0; ln < numLines; ln++)
|
||||
{
|
||||
@@ -880,8 +877,6 @@ void DrawSurface::FillRectWithPattern8x8(const Rect &rect, bool isMask, const ui
|
||||
const int patternCol = static_cast<int>((patternFirstCol + col) & 7);
|
||||
if ((pattern[patternRow] >> patternCol) & 1)
|
||||
pixData[firstLineIndex + col] = color;
|
||||
else if (!isMask)
|
||||
pixData[firstLineIndex + col] = backColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -939,21 +934,21 @@ void DrawSurface::FillEllipse(const Rect &rect)
|
||||
}
|
||||
}
|
||||
|
||||
void DrawSurface::FillEllipseWithPattern(const Rect &rect, bool isMask, const uint8_t *pattern)
|
||||
void DrawSurface::FillEllipseWithMaskPattern(const Rect &rect, const uint8_t *pattern)
|
||||
{
|
||||
if (!rect.IsValid() || rect.Width() < 1 || rect.Height() < 1)
|
||||
return;
|
||||
|
||||
if (rect.Width() <= 2 || rect.Height() <= 2)
|
||||
{
|
||||
FillRectWithPattern8x8(rect, isMask, pattern);
|
||||
FillRectWithMaskPattern8x8(rect, pattern);
|
||||
return;
|
||||
}
|
||||
|
||||
PortabilityLayer::ScanlineMask *mask = PortabilityLayer::ScanlineMaskConverter::CompileEllipse(PortabilityLayer::Rect2i(rect.top, rect.left, rect.bottom, rect.right));
|
||||
if (mask)
|
||||
{
|
||||
FillScanlineMaskWithPattern(mask, isMask, pattern);
|
||||
FillScanlineMaskWithMaskPattern(mask, pattern);
|
||||
mask->Destroy();
|
||||
}
|
||||
}
|
||||
@@ -1025,7 +1020,7 @@ void DrawSurface::FrameEllipse(const Rect &rect)
|
||||
m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||
}
|
||||
|
||||
static void FillScanlineSpan(uint8_t *rowStart, size_t startCol, size_t endCol, uint8_t patternByte, uint8_t foreColor, uint8_t bgColor, bool mask)
|
||||
static void FillScanlineSpan(uint8_t *rowStart, size_t startCol, size_t endCol, uint8_t patternByte, uint8_t foreColor)
|
||||
{
|
||||
if (patternByte == 0xff)
|
||||
{
|
||||
@@ -1034,33 +1029,20 @@ static void FillScanlineSpan(uint8_t *rowStart, size_t startCol, size_t endCol,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mask)
|
||||
for (size_t col = startCol; col < endCol; col++)
|
||||
{
|
||||
for (size_t col = startCol; col < endCol; col++)
|
||||
{
|
||||
if (patternByte & (0x80 >> (col & 7)))
|
||||
rowStart[col] = foreColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t col = startCol; col < endCol; col++)
|
||||
{
|
||||
if (patternByte & (0x80 >> (col & 7)))
|
||||
rowStart[col] = foreColor;
|
||||
else
|
||||
rowStart[col] = bgColor;
|
||||
}
|
||||
if (patternByte & (0x80 >> (col & 7)))
|
||||
rowStart[col] = foreColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawSurface::FillScanlineMask(const PortabilityLayer::ScanlineMask *scanlineMask)
|
||||
{
|
||||
FillScanlineMaskWithPattern(scanlineMask, false, nullptr);
|
||||
FillScanlineMaskWithMaskPattern(scanlineMask, nullptr);
|
||||
}
|
||||
|
||||
void DrawSurface::FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMask *scanlineMask, bool isMask, const uint8_t *pattern)
|
||||
void DrawSurface::FillScanlineMaskWithMaskPattern(const PortabilityLayer::ScanlineMask *scanlineMask, const uint8_t *pattern)
|
||||
{
|
||||
if (!scanlineMask)
|
||||
return;
|
||||
@@ -1093,7 +1075,6 @@ void DrawSurface::FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMa
|
||||
}
|
||||
|
||||
uint8_t foreColor8 = 0;
|
||||
uint8_t backColor8 = 0;
|
||||
|
||||
const GpPixelFormat_t pixelFormat = pixMap->m_pixelFormat;
|
||||
|
||||
@@ -1102,7 +1083,6 @@ void DrawSurface::FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMa
|
||||
{
|
||||
case GpPixelFormats::k8BitStandard:
|
||||
foreColor8 = qdState->ResolveForeColor8(nullptr, 256);
|
||||
backColor8 = qdState->ResolveBackColor8(nullptr, 256);
|
||||
break;
|
||||
default:
|
||||
PL_NotYetImplemented();
|
||||
@@ -1172,7 +1152,7 @@ void DrawSurface::FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMa
|
||||
{
|
||||
const size_t spanEndCol = spanStartCol + currentSpan;
|
||||
if (spanState)
|
||||
FillScanlineSpan(thisRowStart, spanStartCol, spanEndCol, thisRowPatternRow, foreColor8, backColor8, isMask);
|
||||
FillScanlineSpan(thisRowStart, spanStartCol, spanEndCol, thisRowPatternRow, foreColor8);
|
||||
|
||||
spanStartCol = spanEndCol;
|
||||
paintColsRemaining -= currentSpan;
|
||||
@@ -1185,7 +1165,7 @@ void DrawSurface::FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMa
|
||||
if (spanState)
|
||||
{
|
||||
const size_t spanEndCol = firstPortCol + constrainedRectWidth;
|
||||
FillScanlineSpan(thisRowStart, spanStartCol, spanEndCol, thisRowPatternRow, foreColor8, backColor8, isMask);
|
||||
FillScanlineSpan(thisRowStart, spanStartCol, spanEndCol, thisRowPatternRow, foreColor8);
|
||||
}
|
||||
|
||||
if (row != numRows - 1)
|
||||
@@ -1360,16 +1340,6 @@ const PortabilityLayer::RGBAColor &DrawSurface::GetForeColor() const
|
||||
return m_port.GetState()->GetForeColor();
|
||||
}
|
||||
|
||||
void DrawSurface::SetBackColor(const PortabilityLayer::RGBAColor &color)
|
||||
{
|
||||
m_port.GetState()->SetBackColor(color);
|
||||
}
|
||||
|
||||
const PortabilityLayer::RGBAColor &DrawSurface::GetBackColor() const
|
||||
{
|
||||
return m_port.GetState()->GetBackColor();
|
||||
}
|
||||
|
||||
void PenSize(int w, int h)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
|
@@ -229,6 +229,7 @@
|
||||
<ClInclude Include="PLScrollBarWidget.h" />
|
||||
<ClInclude Include="PLUnalignedPtr.h" />
|
||||
<ClInclude Include="PLWidgets.h" />
|
||||
<ClInclude Include="ResolveCachingColor.h" />
|
||||
<ClInclude Include="TextPlacer.h" />
|
||||
<ClInclude Include="UTF16.h" />
|
||||
<ClInclude Include="UTF8.h" />
|
||||
|
@@ -483,6 +483,9 @@
|
||||
<ClInclude Include="PLRegions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ResolveCachingColor.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CFileStream.cpp">
|
||||
|
@@ -60,27 +60,24 @@ struct DrawSurface
|
||||
void PushToDDSurface(IGpDisplayDriver *displayDriver);
|
||||
|
||||
void FillRect(const Rect &rect);
|
||||
void FillRectWithPattern8x8(const Rect &rect, bool isMask, const uint8_t *pattern);
|
||||
void FillRectWithMaskPattern8x8(const Rect &rect, const uint8_t *pattern);
|
||||
void FrameRect(const Rect &rect);
|
||||
void FrameRoundRect(const Rect &rect, int quadrantWidth, int quadrantHeight);
|
||||
void InvertFrameRect(const Rect &rect, const uint8_t *pattern);
|
||||
void InvertFillRect(const Rect &rect, const uint8_t *pattern);
|
||||
|
||||
void FillEllipse(const Rect &rect);
|
||||
void FillEllipseWithPattern(const Rect &rect, bool isMask, const uint8_t *pattern);
|
||||
void FillEllipseWithMaskPattern(const Rect &rect, const uint8_t *pattern);
|
||||
void FrameEllipse(const Rect &rect);
|
||||
|
||||
void FillScanlineMask(const PortabilityLayer::ScanlineMask *scanlineMask);
|
||||
void FillScanlineMaskWithPattern(const PortabilityLayer::ScanlineMask *scanlineMask, bool isMask, const uint8_t *pattern);
|
||||
void FillScanlineMaskWithMaskPattern(const PortabilityLayer::ScanlineMask *scanlineMask, const uint8_t *pattern);
|
||||
|
||||
void DrawLine(const Point &a, const Point &b);
|
||||
|
||||
void SetForeColor(const PortabilityLayer::RGBAColor &color);
|
||||
const PortabilityLayer::RGBAColor &GetForeColor() const;
|
||||
|
||||
void SetBackColor(const PortabilityLayer::RGBAColor &color);
|
||||
const PortabilityLayer::RGBAColor &GetBackColor() const;
|
||||
|
||||
void SetApplicationFont(int size, int variationFlags);
|
||||
void SetSystemFont(int size, int variationFlags);
|
||||
void DrawString(const Point &point, const PLPasStr &str, bool aa);
|
||||
|
@@ -32,33 +32,16 @@ namespace PortabilityLayer
|
||||
m_isForeResolved8 = false;
|
||||
}
|
||||
|
||||
void QDState::SetBackColor(const RGBAColor &color)
|
||||
{
|
||||
m_backUnresolvedColor = color;
|
||||
m_isBackResolved16 = false;
|
||||
m_isBackResolved8 = false;
|
||||
}
|
||||
|
||||
const RGBAColor &QDState::GetForeColor() const
|
||||
{
|
||||
return m_foreUnresolvedColor;
|
||||
}
|
||||
|
||||
const RGBAColor &QDState::GetBackColor() const
|
||||
{
|
||||
return m_backUnresolvedColor;
|
||||
}
|
||||
|
||||
uint8_t QDState::ResolveForeColor8(const RGBAColor *palette, unsigned int numColors)
|
||||
{
|
||||
return ResolveColor8(m_foreUnresolvedColor, m_foreResolvedColor8, m_isForeResolved8, palette, numColors);
|
||||
}
|
||||
|
||||
uint8_t QDState::ResolveBackColor8(const RGBAColor *palette, unsigned int numColors)
|
||||
{
|
||||
return ResolveColor8(m_backUnresolvedColor, m_backResolvedColor8, m_isBackResolved8, palette, numColors);
|
||||
}
|
||||
|
||||
uint8_t QDState::ResolveColor8(const RGBAColor &color, uint8_t &cached, bool &isCached, const RGBAColor *palette, unsigned int numColors)
|
||||
{
|
||||
if (isCached)
|
||||
|
@@ -18,13 +18,10 @@ namespace PortabilityLayer
|
||||
Point m_penPos;
|
||||
|
||||
void SetForeColor(const RGBAColor &color);
|
||||
void SetBackColor(const RGBAColor &color);
|
||||
|
||||
const RGBAColor &GetForeColor() const;
|
||||
const RGBAColor &GetBackColor() const;
|
||||
|
||||
uint8_t ResolveForeColor8(const RGBAColor *palette, unsigned int numColors);
|
||||
uint8_t ResolveBackColor8(const RGBAColor *palette, unsigned int numColors);
|
||||
|
||||
private:
|
||||
static uint8_t ResolveColor8(const RGBAColor &color, uint8_t &cached, bool &isCached, const RGBAColor *palette, unsigned int numColors);
|
||||
|
24
PortabilityLayer/ResolveCachingColor.h
Normal file
24
PortabilityLayer/ResolveCachingColor.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "RGBAColor.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ResolveCachingColor
|
||||
{
|
||||
public:
|
||||
ResolveCachingColor(const RGBAColor &color);
|
||||
ResolveCachingColor(const ResolveCachingColor &color);
|
||||
|
||||
uint8_t Resolve8(const RGBAColor *palette, unsigned int numColors);
|
||||
|
||||
private:
|
||||
RGBAColor m_rgbaColor;
|
||||
|
||||
uint16_t m_resolved16;
|
||||
uint8_t m_resolved8;
|
||||
|
||||
bool m_isResolved16;
|
||||
bool m_isResolved8;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user