r1sc / Open76

Interstate '76 engine reimplementation
GNU General Public License v3.0
52 stars 3 forks source link

Added Video Player Scene for Playing SMK Files #8

Closed JJJohan closed 5 years ago

JJJohan commented 5 years ago

Added a small wrapper around the libsmacker library (details here) which allows us to play the SMK cutscene files with full video and audio support.

Pull request includes the native source code, a 32-bit and 64-bit compiled binary, a Unity 'VideoPlayer' scene and some basic C# code to get it to work. It's setup similar to the SdfViewer scene - paste in your Interstate 76 root directory in the 'Game' object inspector and type in the name of an SMK file on the 'VideoPlayer' inspector. The SMK files are located in the CUTSCENE folder. Then simply hit play!

P.S. Great job on the port, I was immediately inspired to contribute! I may have been quite young when Interstate 76 came around but I did enjoy it a lot 😃.

r1sc commented 5 years ago

Thanks! Great job! I have some comments though, please challenge my opinion if you think otherwise.

I looked at this and I'm not particularly fond of using unsafe if it can be avoided. I used the same library in a Jedi Knight engine I'm working on, which avoids unsafe. I'll see if I can make some minor changes to your code to get rid of it before merging it.

JJJohan commented 5 years ago

Yeah absolutely, I had a plan to revert the unsafe lines back but completely forgot - will patch that now!

The only reason there are any at all is because I recall working on a project where there was a bug in the old Mono runtime Unity uses when targeting the .NET 3.5 profile when dealing with arrays resulting in a very bad delay. However there's no arrays being passed here so that shouldn't be an issue.