API refactoring

This commit is contained in:
elasota
2020-06-01 00:33:50 -04:00
parent a4abb0d95f
commit 6fe0f2d964
9 changed files with 13 additions and 20 deletions

View File

@@ -163,7 +163,7 @@ void DoGameOverStarAnimation (void)
nextLoop = TickCount() + 2; nextLoop = TickCount() + 2;
count = 0; count = 0;
pass = 0; pass = 0;
FlushEvents(everyEvent, 0); FlushEvents();
if (workSrcRect.bottom - angelDest.bottom > kMaxFramesAlive * starFallSpeed) if (workSrcRect.bottom - angelDest.bottom > kMaxFramesAlive * starFallSpeed)
starFallSpeed = (workSrcRect.bottom - angelDest.bottom + kMaxFramesAlive - 1) / kMaxFramesAlive; starFallSpeed = (workSrcRect.bottom - angelDest.bottom + kMaxFramesAlive - 1) / kMaxFramesAlive;
@@ -465,7 +465,7 @@ void DoDiedGameOver (void)
InitDiedGameOver(); InitDiedGameOver();
CopyRectMainToWork(&workSrcRect); CopyRectMainToWork(&workSrcRect);
CopyRectMainToBack(&workSrcRect); CopyRectMainToBack(&workSrcRect);
FlushEvents(everyEvent, 0); FlushEvents();
nextLoop = TickCount() + 2; nextLoop = TickCount() + 2;
while (pagesStuck < 8) while (pagesStuck < 8)

View File

@@ -397,7 +397,7 @@ Boolean TestHighScore (void)
else if (scoreTimestamp > 0xffffffff) else if (scoreTimestamp > 0xffffffff)
scoreTimestamp = 0xffffffff; scoreTimestamp = 0xffffffff;
FlushEvents(everyEvent, 0); FlushEvents();
GetHighScoreName(placing + 1); GetHighScoreName(placing + 1);
PasStringCopy(highName, thisHousePtr->highScores.names[kMaxScores - 1]); PasStringCopy(highName, thisHousePtr->highScores.names[kMaxScores - 1]);
if (placing == 0) if (placing == 0)
@@ -503,7 +503,7 @@ void GetHighScoreName (short place)
PlayPrioritySound(kEnergizeSound, kEnergizePriority); PlayPrioritySound(kEnergizeSound, kEnergizePriority);
BringUpDialog(&theDial, kHighNameDialogID, &substitutions); BringUpDialog(&theDial, kHighNameDialogID, &substitutions);
FlushEvents(everyEvent, 0); FlushEvents();
SetDialogString(theDial, kHighNameItem, highName); SetDialogString(theDial, kHighNameItem, highName);
SelectDialogItemText(theDial, kHighNameItem, 0, 1024); SelectDialogItemText(theDial, kHighNameItem, 0, 1024);
leaving = false; leaving = false;

View File

@@ -468,7 +468,7 @@ Boolean QuerySaveGame (void)
short hitWhat; short hitWhat;
InitCursor(); InitCursor();
FlushEvents(everyEvent, 0); FlushEvents();
// CenterAlert(kSaveGameAlert); // CenterAlert(kSaveGameAlert);
hitWhat = PortabilityLayer::DialogManager::GetInstance()->DisplayAlert(kSaveGameAlert, nullptr); hitWhat = PortabilityLayer::DialogManager::GetInstance()->DisplayAlert(kSaveGameAlert, nullptr);
if (hitWhat == kYesSaveGameButton) if (hitWhat == kYesSaveGameButton)

View File

@@ -396,7 +396,7 @@ int gpAppMain()
} }
WriteOutPrefs(); WriteOutPrefs();
RestoreColorDepth(); RestoreColorDepth();
PL_DEAD(FlushEvents(everyEvent, 0)); PL_DEAD(FlushEvents());
// theErr = LoadScrap(); // theErr = LoadScrap();
return 0; return 0;

View File

@@ -54,7 +54,7 @@ void SaveGame2 (void)
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance(); PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
PortabilityLayer::FileManager *fm = PortabilityLayer::FileManager::GetInstance(); PortabilityLayer::FileManager *fm = PortabilityLayer::FileManager::GetInstance();
FlushEvents(everyEvent, 0); FlushEvents();
thisHousePtr = *thisHouse; thisHousePtr = *thisHouse;

View File

@@ -1270,7 +1270,7 @@ void DoSettingsMain (void)
FlashSettingsButton(surface, 1); FlashSettingsButton(surface, 1);
DoSoundPrefs(); DoSoundPrefs();
SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface()); SetGraphicsPort(prefDlg->GetWindow()->GetDrawSurface());
FlushEvents(everyEvent, 0); FlushEvents();
break; break;
case kControlsButton: case kControlsButton:

View File

@@ -424,7 +424,7 @@ Boolean WaitForInputEvent (short seconds)
Boolean waiting, didResume; Boolean waiting, didResume;
timeToBail = TickCount() + 60L * (long)seconds; timeToBail = TickCount() + 60L * (long)seconds;
FlushEvents(everyEvent, 0); FlushEvents();
waiting = true; waiting = true;
didResume = false; didResume = false;
@@ -446,7 +446,7 @@ Boolean WaitForInputEvent (short seconds)
Delay(1, nullptr); Delay(1, nullptr);
} }
FlushEvents(everyEvent, 0); FlushEvents();
return (didResume); return (didResume);
} }
@@ -469,7 +469,7 @@ void WaitCommandQReleased (void)
Delay(1, nullptr); Delay(1, nullptr);
} }
FlushEvents(everyEvent, 0); FlushEvents();
} }
//-------------------------------------------------------------- KeyMapOffsetFromRawKey //-------------------------------------------------------------- KeyMapOffsetFromRawKey

View File

@@ -547,7 +547,7 @@ void GetTime(DateTimeRec *dateTime)
dateTime->minute = minute; dateTime->minute = minute;
} }
void FlushEvents(int mask, int unknown) void FlushEvents()
{ {
PortabilityLayer::EventQueue *queue = PortabilityLayer::EventQueue::GetInstance(); PortabilityLayer::EventQueue *queue = PortabilityLayer::EventQueue::GetInstance();

View File

@@ -204,11 +204,6 @@ typedef WindowPtr WindowRef; // wtf?
struct KeyDownStates; struct KeyDownStates;
static const int everyEvent = -1;
static const int iBeamCursor = 1;
static const int watchCursor = 4;
static const Boolean TRUE = 1; static const Boolean TRUE = 1;
static const Boolean FALSE = 0; static const Boolean FALSE = 0;
@@ -216,8 +211,6 @@ static const Boolean FALSE = 0;
static const int nullEvent = 0; static const int nullEvent = 0;
//void FlushEvents(int eventMask, int stopMask);
void InitCursor(); void InitCursor();
void HideCursor(); void HideCursor();
@@ -261,7 +254,7 @@ Boolean WaitMouseUp();
short Random(); short Random();
void GetTime(DateTimeRec *dateTime); void GetTime(DateTimeRec *dateTime);
void FlushEvents(int mask, int unknown); void FlushEvents();
Handle NewHandle(Size size); Handle NewHandle(Size size);
long GetHandleSize(Handle handle); long GetHandleSize(Handle handle);