Fix TV and splash on res change

This commit is contained in:
elasota
2020-04-04 18:50:29 -04:00
parent 59e9a9480e
commit 805638f2c9
5 changed files with 31 additions and 20 deletions

View File

@@ -706,13 +706,3 @@ short AddDynamicObject (short what, Rect *where, objectType *who,
return dynIndex; return dynIndex;
} }
void OffsetDynamics(SInt16 h, SInt16 v)
{
for (int i = 0; i < numDynamics; i++)
{
dynaType &dinah = dinahs[i];
//QOffsetRect(&dinah.dest, h, v);
//QOffsetRect(&dinah.whole, h, v);
}
}

View File

@@ -426,6 +426,25 @@ void HandleHighLevelEvent (EventRecord *theEvent)
} }
#endif #endif
//-------------------------------------------------------------- HandleSplashResolutionChange
void HandleSplashResolutionChange(void)
{
FlushResolutionChange();
RecomputeInterfaceRects();
RecreateOffscreens();
CloseMainWindow();
OpenMainWindow();
UpdateMainWindow();
//ResetLocale(true);
//InitScoreboardMap();
//RefreshScoreboard(wasScoreboardTitleMode);
//DumpScreenOn(&justRoomsRect);
}
//-------------------------------------------------------------- HandleIdleTask //-------------------------------------------------------------- HandleIdleTask
// Handle some processing during event lulls. // Handle some processing during event lulls.
@@ -443,6 +462,14 @@ void HandleIdleTask (void)
newRoomNow = false; newRoomNow = false;
} }
} }
if (theMode == kSplashMode)
{
if (thisMac.isResolutionDirty)
{
HandleSplashResolutionChange();
}
}
} }
//-------------------------------------------------------------- HandleEvent //-------------------------------------------------------------- HandleEvent

View File

@@ -76,7 +76,6 @@ void ZeroDinahs (void);
void ZeroDinahsNotInRoom (SInt16); void ZeroDinahsNotInRoom (SInt16);
SInt16 AddDynamicObject(SInt16 what, Rect *where, objectType *who, SInt16 room, SInt16 index, Boolean isOn, Boolean keepExisting); SInt16 AddDynamicObject(SInt16 what, Rect *where, objectType *who, SInt16 room, SInt16 index, Boolean isOn, Boolean keepExisting);
void OffsetDynamics(SInt16 h, SInt16 v);
void DoGameOver (void); // --- GameOver.c void DoGameOver (void); // --- GameOver.c
void FlagGameOver (void); void FlagGameOver (void);

View File

@@ -698,8 +698,7 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
if (SectRect(&itsRect, &testRect, &whoCares)) if (SectRect(&itsRect, &testRect, &whoCares))
{ {
#ifdef COMPILEQT #ifdef COMPILEQT
if ((thisMac.hasQT) && (hasMovie) && (neighbor == kCentralRoom) && if ((thisMac.hasQT) && (hasMovie) && (neighbor == kCentralRoom))
(!tvInRoom))
{ {
whoCares = tvScreen1; whoCares = tvScreen1;
ZeroRectCorner(&whoCares); ZeroRectCorner(&whoCares);
@@ -708,6 +707,8 @@ void DrawARoomsObjects (short neighbor, Boolean redraw)
CenterRectInRect(&movieRect, &whoCares); CenterRectInRect(&movieRect, &whoCares);
theMovie.m_renderRect = movieRect; theMovie.m_renderRect = movieRect;
theMovie.m_constrainRect = whoCares; theMovie.m_constrainRect = whoCares;
if (!tvInRoom)
tvOn = thisObject.data.g.state; tvOn = thisObject.data.g.state;
} }
#endif #endif

View File

@@ -366,12 +366,8 @@ void SetHouseToSavedRoom (void)
//-------------------------------------------------------------- HandleGameResolutionChange //-------------------------------------------------------------- HandleGameResolutionChange
extern DrawSurface *backSrcMap;
void HandleGameResolutionChange(void) void HandleGameResolutionChange(void)
{ {
short prevPlayOriginH = playOriginH;
short prevPlayOriginV = playOriginV;
FlushResolutionChange(); FlushResolutionChange();
RecomputeInterfaceRects(); RecomputeInterfaceRects();
@@ -382,8 +378,6 @@ void HandleGameResolutionChange(void)
if (hasMovie) if (hasMovie)
theMovie.m_surface = &mainWindow->m_surface; theMovie.m_surface = &mainWindow->m_surface;
OffsetDynamics(playOriginH - prevPlayOriginH, playOriginV - prevPlayOriginV);
ResetLocale(true); ResetLocale(true);
InitScoreboardMap(); InitScoreboardMap();
RefreshScoreboard(wasScoreboardTitleMode); RefreshScoreboard(wasScoreboardTitleMode);