diff --git a/Source/Amiga/Graphics_Amiga.cpp b/Source/Amiga/Graphics_Amiga.cpp index 3b1795d3..9130afbc 100644 --- a/Source/Amiga/Graphics_Amiga.cpp +++ b/Source/Amiga/Graphics_Amiga.cpp @@ -1034,7 +1034,7 @@ void cGraphics_Amiga::Video_Draw_16_Offset(int16 pCx) { uint16 cx; SourceX = 0; - for (cx = ax; cx < (mSurface->GetWidth() - 32); cx++) { + for (cx = ax; cx < 320; cx++) { // Intro art is 320 wide; GetWidth() - 32 is only 320 at the default 352-wide surface. DrawPixel(pDs, di, SourceX, SourceY, cx, bx); diff --git a/Source/Briefing.cpp b/Source/Briefing.cpp index 17b30d62..66f639cf 100644 --- a/Source/Briefing.cpp +++ b/Source/Briefing.cpp @@ -479,6 +479,14 @@ void cFodder::Briefing_Intro_Helicopter_Play(const bool pShowHelicopter, eTileTy mSurface->clearBuffer(); mWindow->SetScreenSize(mVersionCurrent->GetScreenSize()); + // Shrink the SDL window to the original 320-wide frame for the + // duration of this intro. Gameplay windows are wider when + // --columns is raised, but this animation was authored for 320 + // pixels wide, so rendering it in a wide window stretches it. + // SetOriginalRes() resizes the SDL window (by the current scaler); + // SetScreenSize() alone only changes the cropped source rectangle. + mWindow->SetOriginalRes(mVersionCurrent->GetScreenSize()); + if (pTileset >= eTileTypes_Hid) pTileset = eTileTypes_Jungle; @@ -502,4 +510,10 @@ void cFodder::Briefing_Intro_Helicopter_Play(const bool pShowHelicopter, eTileTy mGraphics->Briefing_Intro_Helicopter_Play(ShowHelicopter, pTileset, Briefing_Get_Mission_Title(), Briefing_Get_Phase_Name()); mVersionPlatformSwitchDisabled = false; mWindow->ToggleVSync(false); + + // Restore the gameplay window (wide again if --columns was raised). + // Callers also restore it in Phase_Prepare, but doing it here means + // the window is back to gameplay size immediately after the intro, + // not only once the next phase starts. + Window_UpdateScreenSize(); } diff --git a/Source/PC/Graphics_PC.cpp b/Source/PC/Graphics_PC.cpp index f7c611f1..ebe73c52 100644 --- a/Source/PC/Graphics_PC.cpp +++ b/Source/PC/Graphics_PC.cpp @@ -748,7 +748,11 @@ void cGraphics_PC::HeliIntro_BlitMaskedAlignedX(tSharedBuffer pSource, int16 pCx const int planeShift = (pCx & 3); // <-- sub-pixel (0..3) // first 4-pixel group for pCx - uint8* base = mSurface->GetSurfaceBuffer() + mMission_Intro_DrawY + (dx * 4); + // mMission_Intro_DrawY is a byte offset into a 352-wide buffer + // (row * 352 + 16). Convert it to the current surface width so the + // layer starts on the same row/column when the surface is wider. + // At the default 352-wide surface this is identical to the old value. + uint8* base = mSurface->GetSurfaceBuffer() + ((mMission_Intro_DrawY / 352) * mSurface->GetWidth()) + 16 + (dx * 4); ++dx; @@ -778,7 +782,7 @@ void cGraphics_PC::HeliIntro_BlitMaskedAlignedX(tSharedBuffer pSource, int16 pCx di += 4; } - di -= mSurface->GetWidth() - 12 - 16; + di -= 324; // 81 groups * 4 bytes. The +GetWidth() below then makes the row advance exactly GetWidth(), instead of a fixed 352. --pDs; for (cx = dx; cx > 0; --cx) @@ -814,7 +818,9 @@ void cGraphics_PC::HeliIntroBlit_OpaqueAlignedX(tSharedBuffer pDsSi, int16 pCx) const int planeShift = (pCx & 3); // <-- the bit the old code discards // Base points at the first 4-pixel group for pCx, Y offset unchanged. - uint8* base = mSurface->GetSurfaceBuffer() + mMission_Intro_DrawY + (groupX * 4); + // See HeliIntro_BlitMaskedAlignedX: convert the 352-wide offset + // to the current surface width. Identical at the default width. + uint8* base = mSurface->GetSurfaceBuffer() + ((mMission_Intro_DrawY / 352) * mSurface->GetWidth()) + 16 + (groupX * 4); ++dx; @@ -855,7 +861,7 @@ void cGraphics_PC::HeliIntroBlit_OpaqueAlignedX(tSharedBuffer pDsSi, int16 pCx) cx = dx; - di -= mSurface->GetWidth() - 12 - 16; + di -= 324; // 81 groups * 4 bytes. The +GetWidth() below then makes the row advance exactly GetWidth(), instead of a fixed 352. --Ds; if (cx & 1)