mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-24 15:16:38 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ec275fcefd | ||
|
550465088e | ||
|
68444a7240 | ||
|
7db0f8d7eb | ||
|
1fc846f7d8 | ||
|
d978267c3e | ||
|
e05f37a28d |
@@ -668,7 +668,6 @@ Boolean ReadHouse (void)
|
|||||||
numberRooms = 0;
|
numberRooms = 0;
|
||||||
noRoomAtAll = true;
|
noRoomAtAll = true;
|
||||||
YellowAlert(kYellowNoRooms, 0);
|
YellowAlert(kYellowNoRooms, 0);
|
||||||
return(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wasHouseVersion = (*thisHouse)->version;
|
wasHouseVersion = (*thisHouse)->version;
|
||||||
|
@@ -83,19 +83,6 @@ void DrawOnSplash(DrawSurface *surface)
|
|||||||
else
|
else
|
||||||
ColorText(surface, textPoint, houseLoadedStr, 28L, appFont);
|
ColorText(surface, textPoint, houseLoadedStr, 28L, appFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(powerc) || defined(__powerc)
|
|
||||||
TextSize(12);
|
|
||||||
TextFace(0);
|
|
||||||
TextFont(systemFont);
|
|
||||||
ForeColor(blackColor);
|
|
||||||
MoveTo(splashOriginH + 5, splashOriginV + 457);
|
|
||||||
DrawString("\pPowerPC Native!");
|
|
||||||
ForeColor(whiteColor);
|
|
||||||
MoveTo(splashOriginH + 4, splashOriginV + 456);
|
|
||||||
DrawString("\pPowerPC Native!");
|
|
||||||
ForeColor(blackColor);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- RedrawSplashScreen
|
//-------------------------------------------------------------- RedrawSplashScreen
|
||||||
|
@@ -9,9 +9,15 @@
|
|||||||
#include "Externs.h"
|
#include "Externs.h"
|
||||||
#include "Environ.h"
|
#include "Environ.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
#include "MemoryManager.h"
|
||||||
#include "QDPixMap.h"
|
#include "QDPixMap.h"
|
||||||
#include "PLQDraw.h"
|
#include "PLQDraw.h"
|
||||||
#include "RectUtils.h"
|
#include "RectUtils.h"
|
||||||
|
#include "RandomNumberGenerator.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
extern Boolean quickerTransitions;
|
||||||
|
|
||||||
|
|
||||||
//============================================================== Functions
|
//============================================================== Functions
|
||||||
@@ -38,7 +44,10 @@ void PourScreenOn (Rect *theRect)
|
|||||||
QSetRect(&columnRects[i], 0, 0, kChipWide, kChipHigh);
|
QSetRect(&columnRects[i], 0, 0, kChipWide, kChipHigh);
|
||||||
QOffsetRect(&columnRects[i], (i * kChipWide) + theRect->left, theRect->top);
|
QOffsetRect(&columnRects[i], (i * kChipWide) + theRect->left, theRect->top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int kUnitsPerBlock = 128;
|
||||||
|
|
||||||
|
int unitsCommitted = 0;
|
||||||
while (working)
|
while (working)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -68,47 +77,73 @@ void PourScreenOn (Rect *theRect)
|
|||||||
if (colsComplete >= colWide)
|
if (colsComplete >= colWide)
|
||||||
working = false;
|
working = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unitsCommitted++;
|
||||||
|
|
||||||
|
if (unitsCommitted == kUnitsPerBlock)
|
||||||
|
{
|
||||||
|
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
Delay(1, nullptr);
|
||||||
|
|
||||||
|
unitsCommitted = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- WipeScreenOn
|
//-------------------------------------------------------------- WipeScreenOn
|
||||||
|
|
||||||
void WipeScreenOn (short direction, Rect *theRect)
|
void WipeScreenOn (short direction, Rect *theRect)
|
||||||
{
|
{
|
||||||
#define kWipeRectThick 4
|
if (quickerTransitions)
|
||||||
|
{
|
||||||
|
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||||
|
GetPortBitMapForCopyBits(mainWindow->GetDrawSurface()),
|
||||||
|
theRect, theRect, srcCopy);
|
||||||
|
|
||||||
|
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Rect wipeRect;
|
Rect wipeRect;
|
||||||
short hOffset, vOffset;
|
short hOffset, vOffset;
|
||||||
short i, count;
|
short i, count;
|
||||||
|
|
||||||
|
const int kWipeTransitionTime = 10;
|
||||||
|
|
||||||
|
const int wipeRectThick = (theRect->Width() + kWipeTransitionTime - 1) / kWipeTransitionTime;
|
||||||
|
|
||||||
wipeRect = *theRect;
|
wipeRect = *theRect;
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
case kAbove:
|
case kAbove:
|
||||||
wipeRect.bottom = wipeRect.top + kWipeRectThick;
|
wipeRect.bottom = wipeRect.top + wipeRectThick;
|
||||||
hOffset = 0;
|
hOffset = 0;
|
||||||
vOffset = kWipeRectThick;
|
vOffset = wipeRectThick;
|
||||||
count = ((theRect->bottom - theRect->top) / kWipeRectThick) + 1;
|
count = ((theRect->bottom - theRect->top) / wipeRectThick) + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kToRight:
|
case kToRight:
|
||||||
wipeRect.left = wipeRect.right - kWipeRectThick;
|
wipeRect.left = wipeRect.right - wipeRectThick;
|
||||||
hOffset = -kWipeRectThick;
|
hOffset = -wipeRectThick;
|
||||||
vOffset = 0;
|
vOffset = 0;
|
||||||
count = workSrcRect.right / kWipeRectThick;
|
count = workSrcRect.right / wipeRectThick;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kBelow:
|
case kBelow:
|
||||||
wipeRect.top = wipeRect.bottom - kWipeRectThick;
|
wipeRect.top = wipeRect.bottom - wipeRectThick;
|
||||||
hOffset = 0;
|
hOffset = 0;
|
||||||
vOffset = -kWipeRectThick;
|
vOffset = -wipeRectThick;
|
||||||
count = ((theRect->bottom - theRect->top) / kWipeRectThick) + 1;
|
count = ((theRect->bottom - theRect->top) / wipeRectThick) + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kToLeft:
|
case kToLeft:
|
||||||
wipeRect.right = wipeRect.left + kWipeRectThick;
|
wipeRect.right = wipeRect.left + wipeRectThick;
|
||||||
hOffset = kWipeRectThick;
|
hOffset = wipeRectThick;
|
||||||
vOffset = 0;
|
vOffset = 0;
|
||||||
count = workSrcRect.right / kWipeRectThick;
|
count = workSrcRect.right / wipeRectThick;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,19 +163,95 @@ void WipeScreenOn (short direction, Rect *theRect)
|
|||||||
wipeRect.bottom = theRect->top;
|
wipeRect.bottom = theRect->top;
|
||||||
else if (wipeRect.bottom > theRect->bottom)
|
else if (wipeRect.bottom > theRect->bottom)
|
||||||
wipeRect.bottom = theRect->bottom;
|
wipeRect.bottom = theRect->bottom;
|
||||||
|
|
||||||
|
mainWindow->GetDrawSurface()->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
|
||||||
|
Delay(1, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------- DumpScreenOn
|
//-------------------------------------------------------------- DumpScreenOn
|
||||||
|
|
||||||
void DumpScreenOn (Rect *theRect)
|
void DissolveScreenOn(Rect *theRect)
|
||||||
{
|
{
|
||||||
DrawSurface *graf = mainWindow->GetDrawSurface();
|
DrawSurface *graf = mainWindow->GetDrawSurface();
|
||||||
|
|
||||||
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
const int kChunkHeight = 15;
|
||||||
|
const int kChunkWidth = 20;
|
||||||
|
|
||||||
|
const int rows = (theRect->Height() + kChunkHeight - 1) / kChunkHeight;
|
||||||
|
const int cols = (theRect->Width() + kChunkWidth - 1) / kChunkWidth;
|
||||||
|
|
||||||
|
const int numCells = rows * cols;
|
||||||
|
|
||||||
|
const int targetTransitionTime = 30;
|
||||||
|
|
||||||
|
Point *points = static_cast<Point*>(PortabilityLayer::MemoryManager::GetInstance()->Alloc(sizeof(Point) * numCells));
|
||||||
|
|
||||||
|
int rectLeft = theRect->left;
|
||||||
|
int rectTop = theRect->top;
|
||||||
|
|
||||||
|
for (int row = 0; row < rows; row++)
|
||||||
|
{
|
||||||
|
for (int col = 0; col < cols; col++)
|
||||||
|
points[col + row * cols] = Point::Create(col * kChunkWidth + rectLeft, row * kChunkHeight + rectTop);
|
||||||
|
}
|
||||||
|
|
||||||
|
PortabilityLayer::RandomNumberGenerator *rng = PortabilityLayer::RandomNumberGenerator::GetInstance();
|
||||||
|
|
||||||
|
for (unsigned int shuffleIndex = 0; shuffleIndex < static_cast<unsigned int>(numCells - 1); shuffleIndex++)
|
||||||
|
{
|
||||||
|
unsigned int shuffleRange = static_cast<unsigned int>(numCells - 1) - shuffleIndex;
|
||||||
|
unsigned int shuffleTarget = (rng->GetNextAndAdvance() % shuffleRange) + shuffleIndex;
|
||||||
|
|
||||||
|
if (shuffleTarget != shuffleIndex)
|
||||||
|
std::swap(points[shuffleIndex], points[shuffleTarget]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const int numCellsAtOnce = numCells / targetTransitionTime;
|
||||||
|
|
||||||
|
const BitMap *srcBitmap = *GetGWorldPixMap(workSrcMap);
|
||||||
|
BitMap *destBitmap = GetPortBitMapForCopyBits(graf);
|
||||||
|
|
||||||
|
for (unsigned int firstCell = 0; firstCell < static_cast<unsigned int>(numCells); firstCell += numCellsAtOnce)
|
||||||
|
{
|
||||||
|
unsigned int lastCell = firstCell + numCellsAtOnce;
|
||||||
|
if (lastCell > static_cast<unsigned int>(numCells))
|
||||||
|
lastCell = numCells;
|
||||||
|
|
||||||
|
for (unsigned int i = firstCell; i < lastCell; i++)
|
||||||
|
{
|
||||||
|
const Point &point = points[i];
|
||||||
|
const Rect copyRect = Rect::Create(point.v, point.h, point.v + kChunkHeight, point.h + kChunkWidth);
|
||||||
|
|
||||||
|
CopyBits(srcBitmap, destBitmap, ©Rect, ©Rect, srcCopy);
|
||||||
|
}
|
||||||
|
|
||||||
|
graf->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
|
||||||
|
Delay(1, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
graf->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
|
||||||
|
PortabilityLayer::MemoryManager::GetInstance()->Release(points);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------- DumpScreenOn
|
||||||
|
|
||||||
|
void DumpScreenOn(Rect *theRect)
|
||||||
|
{
|
||||||
|
if (quickerTransitions)
|
||||||
|
{
|
||||||
|
DrawSurface *graf = mainWindow->GetDrawSurface();
|
||||||
|
|
||||||
|
CopyBits((BitMap *)*GetGWorldPixMap(workSrcMap),
|
||||||
GetPortBitMapForCopyBits(graf),
|
GetPortBitMapForCopyBits(graf),
|
||||||
theRect, theRect, srcCopy);
|
theRect, theRect, srcCopy);
|
||||||
|
|
||||||
graf->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
graf->m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DissolveScreenOn(theRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#define GP_BUILD_VERSION_MAJOR 1
|
#define GP_BUILD_VERSION_MAJOR 1
|
||||||
#define GP_BUILD_VERSION_MINOR 0
|
#define GP_BUILD_VERSION_MINOR 0
|
||||||
#define GP_BUILD_VERSION_UPDATE 4
|
#define GP_BUILD_VERSION_UPDATE 5
|
||||||
|
|
||||||
#define GP_APPLICATION_VERSION_STRING "1.0.4"
|
#define GP_APPLICATION_VERSION_STRING "1.0.5"
|
||||||
#define GP_APPLICATION_COPYRIGHT_STRING "2019-2020 Eric Lasota"
|
#define GP_APPLICATION_COPYRIGHT_STRING "2019-2020 Eric Lasota"
|
||||||
#define GP_APPLICATION_WEBSITE_STRING "https://github.com/elasota/Aerofoil"
|
#define GP_APPLICATION_WEBSITE_STRING "https://github.com/elasota/Aerofoil"
|
||||||
|
@@ -654,7 +654,7 @@ namespace PortabilityLayer
|
|||||||
|
|
||||||
for (size_t i = 0; i < numItems; i++)
|
for (size_t i = 0; i < numItems; i++)
|
||||||
{
|
{
|
||||||
if (items[i].key == shortcutChar)
|
if (items[i].key == shortcutChar && items[i].enabled)
|
||||||
{
|
{
|
||||||
menuID = menu->menuID;
|
menuID = menu->menuID;
|
||||||
itemID = static_cast<uint16_t>(i);
|
itemID = static_cast<uint16_t>(i);
|
||||||
|
@@ -31,7 +31,6 @@ namespace PortabilityLayer
|
|||||||
, m_caratScrollLocked(false)
|
, m_caratScrollLocked(false)
|
||||||
, m_hasFocus(false)
|
, m_hasFocus(false)
|
||||||
, m_caratTimer(0)
|
, m_caratTimer(0)
|
||||||
, m_selectionScrollTimer(0)
|
|
||||||
, m_isMultiLine(false)
|
, m_isMultiLine(false)
|
||||||
, m_isDraggingSelection(false)
|
, m_isDraggingSelection(false)
|
||||||
, m_dragSelectionStartChar(false)
|
, m_dragSelectionStartChar(false)
|
||||||
@@ -273,7 +272,6 @@ namespace PortabilityLayer
|
|||||||
{
|
{
|
||||||
m_window->FocusWidget(this);
|
m_window->FocusWidget(this);
|
||||||
m_isDraggingSelection = true;
|
m_isDraggingSelection = true;
|
||||||
m_selectionScrollTimer = kMouseScrollRate;
|
|
||||||
return HandleDragSelection(evt);
|
return HandleDragSelection(evt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -335,9 +333,6 @@ namespace PortabilityLayer
|
|||||||
Redraw();
|
Redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_isDraggingSelection)
|
|
||||||
m_selectionScrollTimer++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditboxWidget::HandleCharacter(uint8_t ch, const uint32_t numRepeatsRequested)
|
void EditboxWidget::HandleCharacter(uint8_t ch, const uint32_t numRepeatsRequested)
|
||||||
@@ -762,8 +757,7 @@ namespace PortabilityLayer
|
|||||||
m_selStartChar = m_dragSelectionStartChar;
|
m_selStartChar = m_dragSelectionStartChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_selectionScrollTimer >= kMouseScrollRate)
|
AdjustScrollToCarat();
|
||||||
AdjustScrollToCarat();
|
|
||||||
|
|
||||||
m_caratTimer = 0;
|
m_caratTimer = 0;
|
||||||
Redraw();
|
Redraw();
|
||||||
|
@@ -92,6 +92,5 @@ namespace PortabilityLayer
|
|||||||
size_t m_dragSelectionStartChar;
|
size_t m_dragSelectionStartChar;
|
||||||
|
|
||||||
uint16_t m_caratTimer;
|
uint16_t m_caratTimer;
|
||||||
uint16_t m_selectionScrollTimer;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1224,6 +1224,25 @@ void DrawSurface::FrameEllipse(const Rect &rect, PortabilityLayer::ResolveCachin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GpPixelFormats::kRGB32:
|
||||||
|
{
|
||||||
|
const uint32_t color32 = cacheColor.GetRGBAColor().AsUInt32();
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
const PortabilityLayer::Vec2i pt = plotter.GetPoint();
|
||||||
|
|
||||||
|
if (constraintRect32.Contains(pt))
|
||||||
|
{
|
||||||
|
const size_t pixelIndex = static_cast<size_t>(pt.m_y - portRect.top) * pitch + static_cast<size_t>(pt.m_x - portRect.left) * 4;
|
||||||
|
*reinterpret_cast<uint32_t*>(pixData + pixelIndex) = color32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plotter.PlotNext() == PortabilityLayer::PlotDirection_Exhausted)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PL_NotYetImplemented();
|
PL_NotYetImplemented();
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user