Fix grease on res change

This commit is contained in:
elasota
2020-04-01 23:35:10 -04:00
parent 793822fbb4
commit db89bf178c
3 changed files with 5 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ void FlagGameOver (void);
void DoDiedGameOver (void);
void HandleGrease (void); // --- Grease.c
SInt16 ReBackUpGrease (SInt16, SInt16);
SInt16 ReBackUpGrease (SInt16 where, SInt16 who, SInt16 h, SInt16 v);
SInt16 AddGrease (SInt16, SInt16, SInt16, SInt16, SInt16, Boolean);
void SpillGrease (SInt16, SInt16);
void RedrawAllGrease (void);

View File

@@ -167,7 +167,7 @@ void BackupGrease (Rect *src, short index, Boolean isRight)
// off or on the lights). It assumes certain data strucutures are<72>
// already declared from an earlier call to the above funciton.
short ReBackUpGrease (short where, short who)
short ReBackUpGrease (short where, short who, short h, short v)
{
Rect src;
short i;
@@ -178,6 +178,7 @@ short ReBackUpGrease (short where, short who)
{
if ((grease[i].mode == kGreaseIdle) || (grease[i].mode == kGreaseFalling))
{
QOffsetRect(&grease[i].dest, h - grease[i].dest.left, v - grease[i].dest.top);
src = grease[i].dest;
BackupGrease(&src, grease[i].mapNum, grease[i].isRight);
}

View File

@@ -369,7 +369,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
if (redraw)
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i);
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top);
else
dynamicNum = AddGrease(localNumbers[neighbor], i,
itsRect.left, itsRect.top,
@@ -390,7 +390,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares))
{
if (redraw)
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i);
dynamicNum = ReBackUpGrease(localNumbers[neighbor], i, itsRect.left, itsRect.top);
else
dynamicNum = AddGrease(localNumbers[neighbor], i,
itsRect.left, itsRect.top,