mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Remove regions, add framing (fixes mirrors)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "DialogUtils.h"
|
||||
#include "Environ.h"
|
||||
#include "Externs.h"
|
||||
#include "ScanlineMask.h"
|
||||
|
||||
|
||||
static void HiLiteOkayButton (void);
|
||||
@@ -21,7 +22,7 @@ static void UpdateMainPict (DialogPtr);
|
||||
static Boolean AboutFilter (DialogPtr, EventRecord *theEvent, short *hit);
|
||||
|
||||
|
||||
static RgnHandle okayButtRgn;
|
||||
static PortabilityLayer::ScanlineMask *okayButtScanlineMask;
|
||||
static Rect okayButtonBounds, mainPICTBounds;
|
||||
static Boolean okayButtIsHiLit, clickedDownInOkay;
|
||||
|
||||
@@ -63,6 +64,8 @@ void DoAbout (void)
|
||||
}
|
||||
|
||||
GetDialogItem(aboutDialog, kOkayButton, &itemType, &itemHandle, &okayButtonBounds);
|
||||
#if 0
|
||||
PL_NotYetImplemented_TODO("Misc");
|
||||
okayButtRgn = NewRgn(); // Create diagonal button region
|
||||
OpenRgn();
|
||||
MoveTo(okayButtonBounds.left + 1, okayButtonBounds.top + 45);
|
||||
@@ -71,6 +74,7 @@ void DoAbout (void)
|
||||
Line(-44, 44);
|
||||
Line(-16, -16);
|
||||
CloseRgn(okayButtRgn);
|
||||
#endif
|
||||
okayButtIsHiLit = false; // Initially, button is not hilit
|
||||
clickedDownInOkay = false; // Initially, didn't click in okay button
|
||||
GetDialogItem(aboutDialog, kPictItemMain, &itemType, &itemHandle, &mainPICTBounds);
|
||||
@@ -79,10 +83,10 @@ void DoAbout (void)
|
||||
{
|
||||
ModalDialog(aboutFilterUPP, &hit);
|
||||
}
|
||||
while ((hit != kOkayButton) && (okayButtRgn != nil));
|
||||
while ((hit != kOkayButton) && (okayButtScanlineMask != nil));
|
||||
|
||||
if (okayButtRgn != nil)
|
||||
DisposeRgn(okayButtRgn); // Clean up!
|
||||
if (okayButtScanlineMask != nil)
|
||||
okayButtScanlineMask->Destroy(); // Clean up!
|
||||
DisposeDialog(aboutDialog);
|
||||
DisposeModalFilterUPP(aboutFilterUPP);
|
||||
|
||||
@@ -175,7 +179,7 @@ static Boolean AboutFilter (DialogPtr theDial, EventRecord *theEvent, short *hit
|
||||
if (Button() && clickedDownInOkay)
|
||||
{
|
||||
GetMouse(&mousePt);
|
||||
if(PtInRgn(mousePt, okayButtRgn))
|
||||
if(PointInScanlineMask(mousePt, okayButtScanlineMask))
|
||||
HiLiteOkayButton();
|
||||
else
|
||||
UnHiLiteOkayButton();
|
||||
@@ -203,7 +207,7 @@ static Boolean AboutFilter (DialogPtr theDial, EventRecord *theEvent, short *hit
|
||||
case mouseDown:
|
||||
mousePt = theEvent->where;
|
||||
GlobalToLocal(&mousePt);
|
||||
if(PtInRgn(mousePt, okayButtRgn))
|
||||
if(PointInScanlineMask(mousePt, okayButtScanlineMask))
|
||||
{
|
||||
clickedDownInOkay = true;
|
||||
handledIt = false;
|
||||
@@ -215,7 +219,7 @@ static Boolean AboutFilter (DialogPtr theDial, EventRecord *theEvent, short *hit
|
||||
case mouseUp:
|
||||
mousePt = theEvent->where;
|
||||
GlobalToLocal(&mousePt);
|
||||
if(PtInRgn(mousePt, okayButtRgn) && clickedDownInOkay)
|
||||
if(PointInScanlineMask(mousePt, okayButtScanlineMask) && clickedDownInOkay)
|
||||
{
|
||||
UnHiLiteOkayButton();
|
||||
*hit = kOkayButton;
|
||||
|
@@ -209,17 +209,3 @@ void DkGrayForeColor (void)
|
||||
|
||||
RGBForeColor(&color);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- RestoreColorsSlam
|
||||
|
||||
// This function forces the Macintosh to rebuild the palette. It is<69>
|
||||
// called to restore a sense or normality after some serious munging<6E>
|
||||
// with the palette.
|
||||
|
||||
void RestoreColorsSlam (void)
|
||||
{
|
||||
RestoreDeviceClut(nil);
|
||||
PaintBehind(nil, GetGrayRgn());
|
||||
DrawMenuBar();
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,6 @@
|
||||
void DrawOnSplash (void);
|
||||
void SetPaletteToGrays (void);
|
||||
void HardDrawMainWindow (void);
|
||||
void RestoreColorsSlam (void);
|
||||
|
||||
|
||||
CTabHandle theCTab;
|
||||
@@ -132,18 +131,15 @@ void RedrawSplashScreen (void)
|
||||
void UpdateMainWindow (void)
|
||||
{
|
||||
Rect tempRect;
|
||||
RgnHandle dummyRgn;
|
||||
|
||||
dummyRgn = NewRgn();
|
||||
GetPortVisibleRegion(GetWindowPort(mainWindow), dummyRgn);
|
||||
SetPortWindowPort(mainWindow);
|
||||
|
||||
if (theMode == kEditMode)
|
||||
{
|
||||
PauseMarquee();
|
||||
CopyBitsConstrained((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
&mainWindowRect, &mainWindowRect, srcCopy, &(*dummyRgn)->rect);
|
||||
&mainWindowRect, &mainWindowRect, srcCopy);
|
||||
ResumeMarquee();
|
||||
}
|
||||
else if ((theMode == kSplashMode) || (theMode == kPlayMode))
|
||||
@@ -153,15 +149,14 @@ void UpdateMainWindow (void)
|
||||
QSetRect(&tempRect, 0, 0, 640, 460);
|
||||
QOffsetRect(&tempRect, splashOriginH, splashOriginV);
|
||||
LoadScaledGraphic(kSplash8BitPICT, &tempRect);
|
||||
CopyBitsConstrained((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
&workSrcRect, &mainWindowRect, srcCopy, &(*dummyRgn)->rect);
|
||||
&workSrcRect, &mainWindowRect, srcCopy);
|
||||
SetPortWindowPort(mainWindow);
|
||||
|
||||
DrawOnSplash();
|
||||
}
|
||||
|
||||
DisposeRgn(dummyRgn);
|
||||
splashDrawn = true;
|
||||
}
|
||||
|
||||
|
@@ -181,7 +181,7 @@ void LoadGraphicPlus (short resID, Rect *theRect)
|
||||
void RedrawMapContents (void)
|
||||
{
|
||||
Rect newClip, aRoom, src;
|
||||
RgnHandle wasClip;
|
||||
Rect wasClip;
|
||||
short h, i, groundLevel;
|
||||
short floor, suite, whoCares, type;
|
||||
char wasState;
|
||||
@@ -199,12 +199,9 @@ void RedrawMapContents (void)
|
||||
newClip.bottom = mapWindowRect.bottom + 2 - kMapScrollBarWidth;
|
||||
|
||||
SetPort((GrafPtr)mapWindow);
|
||||
wasClip = NewRgn();
|
||||
if (wasClip != nil)
|
||||
{
|
||||
GetClip(wasClip);
|
||||
|
||||
GetClip(&wasClip);
|
||||
ClipRect(&newClip);
|
||||
}
|
||||
|
||||
for (i = 0; i < mapRoomsHigh; i++)
|
||||
{
|
||||
@@ -285,11 +282,7 @@ void RedrawMapContents (void)
|
||||
InsetRect(&activeRoomRect, -1, -1);
|
||||
}
|
||||
|
||||
if (wasClip != nil)
|
||||
{
|
||||
SetClip(wasClip);
|
||||
DisposeRgn(wasClip);
|
||||
}
|
||||
ClipRect(&wasClip);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -656,7 +656,6 @@ void DrawDresser(Rect *dresser)
|
||||
#define kDresserSideSpare 14
|
||||
Rect tempRect, dest;
|
||||
long yellowC, brownC, dkGrayC, ltTanC, dkstRedC;
|
||||
RgnHandle shadowRgn;
|
||||
short nRects, height, i;
|
||||
CGrafPtr wasCPort;
|
||||
Pattern dummyPattern;
|
||||
|
@@ -24,7 +24,6 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
{
|
||||
objectType thisObject;
|
||||
Rect whoCares, itsRect, rectA, rectB, testRect;
|
||||
RgnHandle theRgn;
|
||||
short i, legit, dynamicNum, n;
|
||||
short floor, suite, room, obj;
|
||||
char wasState;
|
||||
@@ -683,10 +682,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
|
||||
GetMovieBox(theMovie, &movieRect);
|
||||
CenterRectInRect(&movieRect, &whoCares);
|
||||
SetMovieBox(theMovie, &movieRect);
|
||||
theRgn = NewRgn();
|
||||
RectRgn(theRgn, &whoCares);
|
||||
SetMovieDisplayClipRgn(theMovie, theRgn);
|
||||
DisposeRgn(theRgn);
|
||||
SetMovieDisplayClipRgn(theMovie, &whoCares);
|
||||
tvOn = thisObject.data.g.state;
|
||||
}
|
||||
#endif
|
||||
|
@@ -135,7 +135,6 @@ void AddRectToWorkRectsWhole (Rect *theRect)
|
||||
|
||||
void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
|
||||
{
|
||||
RgnHandle wasClip;
|
||||
Rect src, dest;
|
||||
short which;
|
||||
|
||||
@@ -150,10 +149,6 @@ void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
|
||||
dest = thisGlider->dest;
|
||||
QOffsetRect(&dest, playOriginH - 20, playOriginV - 16);
|
||||
|
||||
wasClip = NewRgn();
|
||||
if (wasClip == nil)
|
||||
return;
|
||||
|
||||
SetPort((GrafPtr)workSrcMap);
|
||||
|
||||
long numMirrorRects = GetHandleSize(reinterpret_cast<Handle>(mirrorRects)) / sizeof(Rect);
|
||||
@@ -184,8 +179,6 @@ void DrawReflection (gliderPtr thisGlider, Boolean oneOrTwo)
|
||||
}
|
||||
}
|
||||
|
||||
DisposeRgn(wasClip);
|
||||
|
||||
src =thisGlider->whole;
|
||||
QOffsetRect(&src, playOriginH - 20, playOriginV - 16);
|
||||
AddRectToWorkRects(&src);
|
||||
|
@@ -76,7 +76,6 @@ void WipeScreenOn (short direction, Rect *theRect)
|
||||
{
|
||||
#define kWipeRectThick 4
|
||||
Rect wipeRect;
|
||||
RgnHandle dummyRgn;
|
||||
short hOffset, vOffset;
|
||||
short i, count;
|
||||
|
||||
@@ -112,14 +111,11 @@ void WipeScreenOn (short direction, Rect *theRect)
|
||||
break;
|
||||
}
|
||||
|
||||
dummyRgn = NewRgn();
|
||||
GetPortVisibleRegion(GetWindowPort(mainWindow), dummyRgn);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
CopyBitsConstrained((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||
GetPortBitMapForCopyBits(GetWindowPort(mainWindow)),
|
||||
&wipeRect, &wipeRect, srcCopy, &(*dummyRgn)->rect);
|
||||
&wipeRect, &wipeRect, srcCopy);
|
||||
|
||||
QOffsetRect(&wipeRect, hOffset, vOffset);
|
||||
|
||||
@@ -132,8 +128,6 @@ void WipeScreenOn (short direction, Rect *theRect)
|
||||
else if (wipeRect.bottom > theRect->bottom)
|
||||
wipeRect.bottom = theRect->bottom;
|
||||
}
|
||||
|
||||
DisposeRgn(dummyRgn);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------- DumpScreenOn
|
||||
|
@@ -17,7 +17,7 @@ namespace PortabilityLayer
|
||||
EllipsePlotter::EllipsePlotter()
|
||||
: m_2center(0, 0)
|
||||
, m_point(0, 0)
|
||||
#if PL_DEBUG_ELLIPSE_PLOTTER 1
|
||||
#if PL_DEBUG_ELLIPSE_PLOTTER
|
||||
, m_2offsetFromCenter(0, 0)
|
||||
#endif
|
||||
, m_quadrant(Quadrant_PxPy)
|
||||
|
@@ -55,7 +55,7 @@ namespace PortabilityLayer
|
||||
int32_t m_xChangeCostStaticFactor;
|
||||
int32_t m_yChangeCostStaticFactor;
|
||||
|
||||
#if PL_DEBUG_ELLIPSE_PLOTTER 1
|
||||
#if PL_DEBUG_ELLIPSE_PLOTTER
|
||||
Vec2i m_2offsetFromCenter;
|
||||
#endif
|
||||
};
|
||||
|
@@ -39,7 +39,6 @@ typedef unsigned char *StringPtr;
|
||||
|
||||
class PLPasStr;
|
||||
struct CGraf;
|
||||
struct Region;
|
||||
struct Menu;
|
||||
|
||||
typedef void *Ptr;
|
||||
@@ -169,14 +168,12 @@ typedef Cursor *CursPtr;
|
||||
typedef CCursor *CCrsrPtr;
|
||||
typedef FSSpec *FSSpecPtr;
|
||||
typedef Menu *MenuPtr;
|
||||
typedef Region *RgnPtr;
|
||||
typedef CInfoPBRec *CInfoPBPtr;
|
||||
typedef VersionRecord *VersRecPtr;
|
||||
|
||||
typedef CursPtr *CursHandle;
|
||||
typedef CCrsrPtr *CCrsrHandle;
|
||||
typedef MenuPtr *MenuHandle;
|
||||
typedef RgnPtr *RgnHandle;
|
||||
typedef VersRecPtr *VersRecHndl;
|
||||
|
||||
typedef WindowPtr WindowRef; // wtf?
|
||||
|
@@ -134,7 +134,7 @@ void SetMovieBox(Movie movie, const Rect *rect)
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
||||
void SetMovieDisplayClipRgn(Movie movie, RgnHandle region)
|
||||
void SetMovieDisplayClipRgn(Movie movie, const Rect *rect)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
@@ -59,6 +59,6 @@ void SetMovieActive(Movie movie, Boolean active);
|
||||
void StartMovie(Movie movie);
|
||||
void MoviesTask(Movie movie, int unknown);
|
||||
void SetMovieBox(Movie movie, const Rect *rect);
|
||||
void SetMovieDisplayClipRgn(Movie movie, RgnHandle region);
|
||||
void SetMovieDisplayClipRgn(Movie movie, const Rect *rect);
|
||||
|
||||
#endif
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include "WindowManager.h"
|
||||
#include "QDGraf.h"
|
||||
#include "QDPixMap.h"
|
||||
#include "QDUtils.h"
|
||||
#include "Vec2i.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -154,16 +153,7 @@ static void PlotLine(PortabilityLayer::QDState *qdState, PortabilityLayer::QDPor
|
||||
|
||||
Rect constrainedRect = qdPort->GetRect();
|
||||
|
||||
if (qdState->m_clipRegion)
|
||||
{
|
||||
const Region ®ion = **qdState->m_clipRegion;
|
||||
|
||||
if (region.size > sizeof(Region))
|
||||
PL_NotYetImplemented();
|
||||
|
||||
constrainedRect = constrainedRect.Intersect(region.rect);
|
||||
}
|
||||
|
||||
constrainedRect = constrainedRect.Intersect(qdState->m_clipRect);
|
||||
constrainedRect = constrainedRect.Intersect(lineRect);
|
||||
|
||||
if (!constrainedRect.IsValid())
|
||||
@@ -508,17 +498,7 @@ void PaintRectWithPCR(const Rect &rect, PaintColorResolution pcr)
|
||||
Rect constrainedRect = rect;
|
||||
|
||||
PortabilityLayer::QDState *qdState = qdPort->GetState();
|
||||
|
||||
if (qdState->m_clipRegion)
|
||||
{
|
||||
const Region ®ion = **qdState->m_clipRegion;
|
||||
|
||||
if (region.size > sizeof(Region))
|
||||
PL_NotYetImplemented();
|
||||
|
||||
constrainedRect = constrainedRect.Intersect(region.rect);
|
||||
}
|
||||
|
||||
constrainedRect = constrainedRect.Intersect(qdState->m_clipRect);
|
||||
constrainedRect = constrainedRect.Intersect(qdPort->GetRect());
|
||||
|
||||
if (!constrainedRect.IsValid())
|
||||
@@ -762,21 +742,52 @@ void FillScanlineMask(const PortabilityLayer::ScanlineMask *scanlineMask)
|
||||
}
|
||||
}
|
||||
|
||||
void GetClip(Rect *rect)
|
||||
{
|
||||
PortabilityLayer::QDState *qdState = PortabilityLayer::QDManager::GetInstance()->GetState();
|
||||
*rect = qdState->m_clipRect;
|
||||
}
|
||||
|
||||
void ClipRect(const Rect *rect)
|
||||
{
|
||||
if (!rect->IsValid())
|
||||
return;
|
||||
|
||||
PortabilityLayer::QDState *qdState = PortabilityLayer::QDManager::GetInstance()->GetState();
|
||||
if (!qdState->m_clipRegion)
|
||||
qdState->m_clipRegion = PortabilityLayer::QDUtils::CreateRegion(*rect);
|
||||
else
|
||||
PortabilityLayer::QDUtils::ResetRegionToRect(qdState->m_clipRegion, *rect);
|
||||
qdState->m_clipRect = *rect;
|
||||
}
|
||||
|
||||
void FrameRect(const Rect *rect)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Rects");
|
||||
if (!rect->IsValid())
|
||||
return;
|
||||
|
||||
uint16_t width = rect->right - rect->left;
|
||||
uint16_t height = rect->bottom - rect->top;
|
||||
|
||||
if (width <= 2 || height <= 2)
|
||||
PaintRect(rect);
|
||||
else
|
||||
{
|
||||
// This is stupid, especially in the vertical case, but oh well
|
||||
Rect edgeRect;
|
||||
|
||||
edgeRect = *rect;
|
||||
edgeRect.right = edgeRect.left + 1;
|
||||
PaintRect(&edgeRect);
|
||||
|
||||
edgeRect = *rect;
|
||||
edgeRect.left = edgeRect.right - 1;
|
||||
PaintRect(&edgeRect);
|
||||
|
||||
edgeRect = *rect;
|
||||
edgeRect.bottom = edgeRect.top + 1;
|
||||
PaintRect(&edgeRect);
|
||||
|
||||
edgeRect = *rect;
|
||||
edgeRect.top = edgeRect.bottom - 1;
|
||||
PaintRect(&edgeRect);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameOval(const Rect *rect)
|
||||
@@ -1097,79 +1108,18 @@ void CopyMaskConstrained(const BitMap *srcBitmap, const BitMap *maskBitmap, BitM
|
||||
CopyBitsComplete(srcBitmap, maskBitmap, destBitmap, srcRectBase, maskRectBase, destRectBase, constrainRect);
|
||||
}
|
||||
|
||||
void CopyMask(const BitMap *srcBitmap, const BitMap *maskBitmap, BitMap *destBitmap, const Rect *srcRectBase, const Rect *maskRectBase, const Rect *destRectBase)
|
||||
{
|
||||
CopyBitsComplete(srcBitmap, maskBitmap, destBitmap, srcRectBase, maskRectBase, destRectBase, nullptr);
|
||||
}
|
||||
|
||||
RgnHandle NewRgn()
|
||||
{
|
||||
PortabilityLayer::MMHandleBlock *handle = PortabilityLayer::MemoryManager::GetInstance()->AllocHandle(sizeof(Region));
|
||||
|
||||
Region *rgn = static_cast<Region*>(handle->m_contents);
|
||||
|
||||
rgn->size = sizeof(Region);
|
||||
rgn->rect = Rect::Create(0, 0, 0, 0);
|
||||
|
||||
return reinterpret_cast<Region**>(&handle->m_contents);
|
||||
}
|
||||
|
||||
void RectRgn(RgnHandle region, const Rect *rect)
|
||||
{
|
||||
Region *rgn = *region;
|
||||
|
||||
if (rgn->size != sizeof(Region))
|
||||
{
|
||||
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
|
||||
PortabilityLayer::MMHandleBlock *hdlBlock = reinterpret_cast<PortabilityLayer::MMHandleBlock*>(region);
|
||||
|
||||
// OK if this fails, I guess
|
||||
if (mm->ResizeHandle(hdlBlock, sizeof(Region)))
|
||||
rgn = static_cast<Region*>(hdlBlock->m_contents);
|
||||
|
||||
rgn->size = sizeof(Region);
|
||||
}
|
||||
|
||||
rgn->rect = *rect;
|
||||
}
|
||||
|
||||
void UnionRgn(RgnHandle regionA, RgnHandle regionB, RgnHandle regionC)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void DisposeRgn(RgnHandle rgn)
|
||||
{
|
||||
DisposeHandle(reinterpret_cast<Handle>(rgn));
|
||||
}
|
||||
|
||||
void OpenRgn()
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
void CloseRgn(RgnHandle rgn)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
Boolean PtInRgn(Point point, RgnHandle rgn)
|
||||
bool PointInScanlineMask(Point point, PortabilityLayer::ScanlineMask *scanlineMask)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
void GetClip(RgnHandle rgn)
|
||||
void CopyMask(const BitMap *srcBitmap, const BitMap *maskBitmap, BitMap *destBitmap, const Rect *srcRectBase, const Rect *maskRectBase, const Rect *destRectBase)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
CopyBitsComplete(srcBitmap, maskBitmap, destBitmap, srcRectBase, maskRectBase, destRectBase, nullptr);
|
||||
}
|
||||
|
||||
void SetClip(RgnHandle rgn)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("Polys");
|
||||
}
|
||||
|
||||
|
||||
BitMap *GetPortBitMapForCopyBits(CGrafPtr grafPtr)
|
||||
{
|
||||
return *grafPtr->m_port.GetPixMap();
|
||||
@@ -1180,14 +1130,6 @@ CGrafPtr GetWindowPort(WindowPtr window)
|
||||
return &window->m_graf;
|
||||
}
|
||||
|
||||
RgnHandle GetPortVisibleRegion(CGrafPtr port, RgnHandle region)
|
||||
{
|
||||
const Rect rect = port->m_port.GetRect();
|
||||
|
||||
RectRgn(region, &rect);
|
||||
return region;
|
||||
}
|
||||
|
||||
|
||||
Int32 DeltaPoint(Point pointA, Point pointB)
|
||||
{
|
||||
@@ -1222,17 +1164,6 @@ void RestoreDeviceClut(void *unknown)
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
||||
void PaintBehind(void *unknown, RgnHandle region)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
}
|
||||
|
||||
RgnHandle GetGrayRgn()
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BitMap::Init(const Rect &rect, GpPixelFormat_t pixelFormat, size_t pitch, void *dataPtr)
|
||||
{
|
||||
m_rect = rect;
|
||||
|
@@ -128,7 +128,9 @@ void PaintRect(const Rect *rect);
|
||||
void PaintOval(const Rect *rect);
|
||||
void FillScanlineMask(const PortabilityLayer::ScanlineMask *scanlineMask);
|
||||
|
||||
void ClipRect(const Rect *rect); // Sets the clipping area
|
||||
void ClipRect(const Rect *rect);
|
||||
void GetClip(Rect *rect);
|
||||
|
||||
void FrameRect(const Rect *rect);
|
||||
void FrameOval(const Rect *rect);
|
||||
void FrameRoundRect(const Rect *rect, int w, int h);
|
||||
@@ -140,7 +142,7 @@ void PenNormal();
|
||||
void EraseRect(const Rect *rect);
|
||||
void InvertRect(const Rect *rect);
|
||||
void InsetRect(Rect *rect, int x, int y);
|
||||
void Line(int x, int y); // FIXME: Is this relative or absolute?
|
||||
void Line(int x, int y);
|
||||
Pattern *GetQDGlobalsGray(Pattern *pattern);
|
||||
Pattern *GetQDGlobalsBlack(Pattern *pattern);
|
||||
|
||||
@@ -155,20 +157,10 @@ void CopyBitsConstrained(const BitMap *srcBitmap, BitMap *destBitmap, const Rect
|
||||
void CopyMask(const BitMap *srcBitmap, const BitMap *maskBitmap, BitMap *destBitmap, const Rect *srcRect, const Rect *maskRect, const Rect *destRect);
|
||||
void CopyMaskConstrained(const BitMap *srcBitmap, const BitMap *maskBitmap, BitMap *destBitmap, const Rect *srcRectBase, const Rect *maskRectBase, const Rect *destRectBase, const Rect *constraintRect);
|
||||
|
||||
RgnHandle NewRgn();
|
||||
void RectRgn(RgnHandle region, const Rect *rect);
|
||||
void UnionRgn(RgnHandle regionA, RgnHandle regionB, RgnHandle regionC);
|
||||
void DisposeRgn(RgnHandle rgn);
|
||||
void OpenRgn();
|
||||
void CloseRgn(RgnHandle rgn);
|
||||
Boolean PtInRgn(Point point, RgnHandle rgn);
|
||||
|
||||
void GetClip(RgnHandle rgn);
|
||||
void SetClip(RgnHandle rgn);
|
||||
bool PointInScanlineMask(Point point, PortabilityLayer::ScanlineMask *scanlineMask);
|
||||
|
||||
BitMap *GetPortBitMapForCopyBits(CGrafPtr grafPtr);
|
||||
CGrafPtr GetWindowPort(WindowPtr window);
|
||||
RgnHandle GetPortVisibleRegion(CGrafPtr port, RgnHandle region);
|
||||
|
||||
// Computes A - B and returns it packed?
|
||||
Int32 DeltaPoint(Point pointA, Point pointB);
|
||||
@@ -181,8 +173,5 @@ Boolean SectRect(const Rect *rectA, const Rect *rectB, Rect *outIntersection);
|
||||
Boolean PtInRect(Point point, const Rect *rect);
|
||||
|
||||
void RestoreDeviceClut(void *unknown);
|
||||
void PaintBehind(void *unknown, RgnHandle region);
|
||||
|
||||
RgnHandle GetGrayRgn(); // Returns the region not occupied by the menu bar
|
||||
|
||||
#endif
|
||||
|
@@ -214,7 +214,6 @@
|
||||
<ClInclude Include="QDRegion.h" />
|
||||
<ClInclude Include="QDStandardPalette.h" />
|
||||
<ClInclude Include="QDState.h" />
|
||||
<ClInclude Include="QDUtils.h" />
|
||||
<ClInclude Include="RandomNumberGenerator.h" />
|
||||
<ClInclude Include="Rect2i.h" />
|
||||
<ClInclude Include="RenderedFont.h" />
|
||||
@@ -315,7 +314,6 @@
|
||||
<ClCompile Include="QDPort.cpp" />
|
||||
<ClCompile Include="QDStandardPalette.cpp" />
|
||||
<ClCompile Include="QDState.cpp" />
|
||||
<ClCompile Include="QDUtils.cpp" />
|
||||
<ClCompile Include="RandomNumberGenerator.cpp" />
|
||||
<ClCompile Include="ResourceCompiledRef.cpp" />
|
||||
<ClCompile Include="ResourceFile.cpp" />
|
||||
|
@@ -291,9 +291,6 @@
|
||||
<ClInclude Include="WindowManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="QDUtils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="QDPort.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -536,9 +533,6 @@
|
||||
<ClCompile Include="WindowManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QDUtils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QDPort.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@@ -17,7 +17,7 @@ namespace PortabilityLayer
|
||||
, m_isBackResolved16(false)
|
||||
, m_isForeResolved8(false)
|
||||
, m_isBackResolved8(false)
|
||||
, m_clipRegion(nullptr)
|
||||
, m_clipRect(Rect::Create(INT16_MIN, INT16_MIN, INT16_MAX, INT16_MAX))
|
||||
, m_penInvert(false)
|
||||
, m_penMask(false)
|
||||
, m_havePattern8x8(false)
|
||||
|
@@ -3,8 +3,6 @@
|
||||
#include "RGBAColor.h"
|
||||
#include "SharedTypes.h"
|
||||
|
||||
struct Region;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
struct QDState
|
||||
@@ -14,7 +12,7 @@ namespace PortabilityLayer
|
||||
int m_fontID;
|
||||
int m_textFace;
|
||||
int m_textSize;
|
||||
Region **m_clipRegion;
|
||||
Rect m_clipRect;
|
||||
Point m_penPos;
|
||||
bool m_penInvert;
|
||||
bool m_penMask;
|
||||
|
@@ -1,31 +0,0 @@
|
||||
#include "QDUtils.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "SharedTypes.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
Region **QDUtils::CreateRegion(const Rect &rect)
|
||||
{
|
||||
PL_STATIC_ASSERT(sizeof(Region) == 10);
|
||||
|
||||
Region **rgnHandle = MemoryManager::GetInstance()->NewHandle<Region>();
|
||||
if (!rgnHandle)
|
||||
return nullptr;
|
||||
|
||||
Region ®ion = (**rgnHandle);
|
||||
region.rect = rect;
|
||||
region.size = sizeof(Region);
|
||||
|
||||
return rgnHandle;
|
||||
}
|
||||
|
||||
void QDUtils::ResetRegionToRect(Region **regionHdl, const Rect &rect)
|
||||
{
|
||||
if (MemoryManager::GetInstance()->ResizeHandle(reinterpret_cast<MMHandleBlock*>(regionHdl), sizeof(Region)))
|
||||
{
|
||||
Region ®ion = **regionHdl;
|
||||
region.size = sizeof(Region);
|
||||
region.rect = rect;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
struct Region;
|
||||
struct Rect;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class QDUtils
|
||||
{
|
||||
public:
|
||||
static Region **CreateRegion(const Rect &rect);
|
||||
static void ResetRegionToRect(Region **region, const Rect &rect);
|
||||
};
|
||||
}
|
@@ -24,13 +24,6 @@ struct Rect
|
||||
static Rect Create(int16_t top, int16_t left, int16_t bottom, int16_t right);
|
||||
};
|
||||
|
||||
struct Region
|
||||
{
|
||||
uint16_t size;
|
||||
Rect rect;
|
||||
};
|
||||
|
||||
|
||||
struct BERect
|
||||
{
|
||||
BEInt16_t top;
|
||||
|
Reference in New Issue
Block a user