BC46 / freelancer-hd-edition

Freelancer: HD Edition is a mod that aims to improve every aspect of the game Freelancer (2003) while keeping the look and feel as close to vanilla as possible.
https://www.moddb.com/mods/freelancer-hd-edition
158 stars 14 forks source link

Reimplementation of `movie.dll` that supports MP4 files #212

Open BC46 opened 7 months ago

BC46 commented 7 months ago

Freelancer has a DLL named movie.dll which is responsible for playing the startup intros. Unfortunately the only format it supports is WMV. Our upscaled movie intros are MP4 files originally. In order for Freelancer to play these, we had to convert these to WMV first. It would be better if movie.dll could be reimplemented such that it supports both WMV and MP4.

I was able to build my own movie.dll using the following definitions:

#pragma once

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#define Export __declspec(dllexport)

namespace MediaPlayer
{
    typedef enum Approach {
        Default
    } Approach;

    Approach g_approach;

    HMODULE g_moduleHandle; 

    Export void __cdecl FreeMovie();
    Export long __cdecl PlayMovie(HWND windowHandle, bool unk, LPCSTR path);
    Export void __cdecl SetApproach(MediaPlayer::Approach approach);
    Export void __cdecl Shutdown();
    Export void __cdecl Startup();
    Export void __cdecl StopMovie();
    Export bool __cdecl UpdateMovie();
};

When replacing my DLL with FL's movie.dll, the game will load the DLL without issues, as a matter of fact. However, the new DLL obviously doesn't do anything since I didn't implement a movie playing functionality.

Useful sources: https://learn.microsoft.com/en-gb/windows/win32/directshow/directshow-samples https://github.com/roman380/gdcl.co.uk-mpeg4

Upscaled intros in MP4 format: https://drive.google.com/drive/folders/1W7p2ZcHgxH2XbQm_FU6znHUWtyFcOCWK?usp=sharing. These have a smaller file size and look better than the re-rendered WMV videos that we currently have.

FireFlyEx commented 7 months ago

Man.. when I add features that don't work people get mad at me. :P