Added fix for the camera during the credits

Fixes the flying-Balrog scene (and also the Flying Dragon one?)
This commit is contained in:
Clownacy 2019-03-07 18:59:23 +00:00
parent 2165a4ebb1
commit 07935c2e20

View file

@ -17,6 +17,27 @@ void MoveFrame3()
GetMapData(0, &map_w, &map_l); GetMapData(0, &map_w, &map_l);
#if WINDOW_WIDTH != 320 || WINDOW_HEIGHT != 240 // TODO - Really need to make this a compiler flag #if WINDOW_WIDTH != 320 || WINDOW_HEIGHT != 240 // TODO - Really need to make this a compiler flag
if (g_GameFlags & 8)
{
// Use the original camera boundaries during the credits
gFrame.x += (*gFrame.tgt_x - (320 * 0x100) - gFrame.x) / gFrame.wait;
gFrame.y += (*gFrame.tgt_y - (240 * 0x100) - gFrame.y) / gFrame.wait;
if (gFrame.x / 0x200 < 0)
gFrame.x = 0;
if (gFrame.y / 0x200 < 0)
gFrame.y = 0;
if (gFrame.x > ((map_w - 1) * 0x10 - 320) * 0x200)
gFrame.x = ((map_w - 1) * 0x10 - 320) * 0x200;
if (gFrame.y > ((map_l - 1) * 0x10 - 240) * 0x200)
gFrame.y = ((map_l - 1) * 0x10 - 240) * 0x200;
gFrame.x -= ((WINDOW_WIDTH - 320) / 2) * 0x200;
gFrame.y -= ((WINDOW_HEIGHT - 240) / 2) * 0x200;
}
else
{
// Widescreen/tallscreen-safe behaviour // Widescreen/tallscreen-safe behaviour
if (map_w * 0x10 < WINDOW_WIDTH) if (map_w * 0x10 < WINDOW_WIDTH)
{ {
@ -47,6 +68,7 @@ void MoveFrame3()
if (gFrame.y > ((map_l - 1) * 0x10 - WINDOW_HEIGHT) * 0x200) if (gFrame.y > ((map_l - 1) * 0x10 - WINDOW_HEIGHT) * 0x200)
gFrame.y = ((map_l - 1) * 0x10 - WINDOW_HEIGHT) * 0x200; gFrame.y = ((map_l - 1) * 0x10 - WINDOW_HEIGHT) * 0x200;
} }
}
#else #else
// Vanilla behaviour // Vanilla behaviour
gFrame.x += (*gFrame.tgt_x - (WINDOW_WIDTH * 0x100) - gFrame.x) / gFrame.wait; gFrame.x += (*gFrame.tgt_x - (WINDOW_WIDTH * 0x100) - gFrame.x) / gFrame.wait;