Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Amiga/Graphics_Amiga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
14 changes: 14 additions & 0 deletions Source/Briefing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
}
14 changes: 10 additions & 4 deletions Source/PC/Graphics_PC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down