Fix up some level editor dialog behavior

This commit is contained in:
elasota
2020-02-26 12:17:04 -05:00
parent d617795591
commit cc17911776
23 changed files with 224 additions and 201 deletions

View File

@@ -31,6 +31,11 @@
#include <algorithm>
#include <assert.h>
static inline void InvertPixel8(uint8_t &pixel)
{
pixel = 255 ^ pixel;
}
void GetPort(GrafPtr *graf)
{
@@ -1362,7 +1367,7 @@ void DrawSurface::InvertFrameRect(const Rect &rect, const uint8_t *pattern)
{
InvertFillRect(Rect::Create(rect.top, rect.left, rect.top + 1, rect.right), pattern);
InvertFillRect(Rect::Create(rect.top + 1, rect.left, rect.bottom - 1, rect.left + 1), pattern);
InvertFillRect(Rect::Create(rect.bottom - 1, rect.left, rect.bottom + 1, rect.right), pattern);
InvertFillRect(Rect::Create(rect.bottom - 1, rect.left, rect.bottom, rect.right), pattern);
InvertFillRect(Rect::Create(rect.top + 1, rect.right - 1, rect.bottom - 1, rect.right), pattern);
}
}
@@ -1414,7 +1419,7 @@ void DrawSurface::InvertFillRect(const Rect &rect, const uint8_t *pattern)
{
const int patternCol = static_cast<int>((patternFirstCol + col) & 7);
if ((pattern[patternRow] >> patternCol) & 1)
pixData[firstLineIndex + col] = 255 - pixData[firstLineIndex + col];
InvertPixel8(pixData[firstLineIndex + col]);
}
}
}
@@ -1477,11 +1482,6 @@ void PenNormal()
qdState->m_penMask = false;
}
void InvertRect(const Rect *rect)
{
PL_NotYetImplemented();
}
void InsetRect(Rect *rect, int x, int y)
{
rect->left += x;
@@ -1783,7 +1783,7 @@ void ImageInvert(const PixMap *invertMask, PixMap *targetBitmap, const Rect &src
const int32_t srcCol = c + firstSrcCol;
const int32_t destCol = c + firstDestCol;
if (invertRowStart[srcCol] != 0)
targetRowStart[destCol] = 255 - targetRowStart[destCol];
InvertPixel8(targetRowStart[destCol]);
}
break;
default:
@@ -1814,14 +1814,6 @@ DrawSurface *GetWindowPort(WindowPtr window)
return &window->m_surface;
}
Int32 DeltaPoint(Point pointA, Point pointB)
{
PL_NotYetImplemented();
return 0;
}
void SubPt(Point srcPoint, Point *destPoint)
{
PL_NotYetImplemented();