Skip to content

Commit

Permalink
Fix FF8 Steam movies aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Apr 7, 2020
1 parent cdc9929 commit 2dd3a10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
9 changes: 6 additions & 3 deletions src/gl/gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void gl_draw_movie_quad_common(uint width, uint height)
{
struct game_obj *game_object = common_externals.get_game_object();
float ratio = game_width / (float)width;
float movieHeight = ratio * height;
float movieWidth = ratio * width;
float movieOffsetY = ff8 ? (game_height - movieHeight) / 2.0f : 0.0f;

/* y0 y2
x0 +-----+ x2
Expand All @@ -68,16 +71,16 @@ void gl_draw_movie_quad_common(uint width, uint height)

// 0
float x0 = 0.0f;
float y0 = 0.0f;
float y0 = movieOffsetY;
float u0 = 0.0f;
float v0 = 0.0f;
// 1
float x1 = x0;
float y1 = ratio * height;
float y1 = movieHeight + movieOffsetY;
float u1 = u0;
float v1 = 1.0f;
// 2
float x2 = ratio * width;
float x2 = movieWidth;
float y2 = y0;
float u2 = 1.0f;
float v2 = v0;
Expand Down
13 changes: 0 additions & 13 deletions src/movies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@
#include "cfg.h"
#include "ffmpeg_movies/ffmpeg_movies.h"

void addMovieBlackBars()
{
newRenderer.setBackgroundColor();
newRenderer.setScissor(0, 16, 640, 448);

newRenderer.setClearFlags(true, true);
newRenderer.doScissorTest(true);
}

void movie_init()
{
if(!ff8)
Expand Down Expand Up @@ -152,8 +143,6 @@ void draw_current_frame()
{
if (trace_all || trace_movies) trace("draw_current_frame\n");

addMovieBlackBars();

ffmpeg_draw_current_frame();

// FF8 on Steam sometimes forgets to release the movie objects, so we do ensure it's done anyway
Expand Down Expand Up @@ -266,8 +255,6 @@ void ff8_update_movie_sample()
{
if(trace_all || trace_movies) trace("update_movie_sample\n");

addMovieBlackBars();

if(!ffmpeg_update_movie_sample())
{
if(ff8_externals.movie_object->movie_intro_pak) ff8_stop_movie();
Expand Down

0 comments on commit 2dd3a10

Please sign in to comment.