-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing own MVE library #289
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,63 @@ | |||
# Third party components | |||
|
|||
This file contains information about third party components, required for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move third parties to a separate directory ? It would make sense in terms of licensing. This way we could internalize again zlib and spdlog easily if we want to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a personal preference so feel free to ignore me; I like single-word names like externals
whenever possible. If not possible, underscores over spaces. +1 to separate directory for included externals like zlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about thirdparty/libmve
?
#define LNXSND_VOLUME_MIN -10000 | ||
#define LNXSND_PAN_LEFT -10000 | ||
#define LNXSND_VOLUME_MIN (-10000) | ||
#define LNXSND_PAN_LEFT (-10000) | ||
#define LNXSND_PAN_RIGHT 10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
()
mveasm.cpp | ||
mvelibl.cpp | ||
platform.cpp) | ||
# mveasm.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
@@ -596,7 +588,7 @@ int NextPow2(int n) { | |||
void BlitToMovieBitmap(unsigned char *buf, unsigned int bufw, unsigned int bufh, unsigned int hicolor, | |||
bool usePow2Texture, int &texW, int &texH) { | |||
// get some sizes | |||
int drawWidth = hicolor ? (bufw >> 1) : bufw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is hicolor doing ? l. 612/620 still tests for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hicolor is indicator that MVE is 16-bit color (there two types of MVEs - 8bit paletted - Dolby Sound intro, and hicolor/truecolor - other intros and videos).
Regarding to changes - there was unnecessary doubling and halving back size of width in old libmve and movie callbacks.
I think you're aware but video sound cuts on playback when I tested. |
Well, surprisingly, I don't have any issues with new mve playback. Maybe there sound buffer too short... |
Sound works for a couple seconds, stops and starts again 2 seconds later. I can provide a recording if needed |
Probably here issue:
Can you please try set size with 4096 or more on spec in mveplay.c for testing? |
It works without a problem with hardcoded size=4096 |
Probably I should move it out into configuration with default value 4096. |
3447263
to
ca2c4e9
Compare
I decided to make a hybrid build with SDL2 backend for MVE sound playback and DSound for the rest. Still, I need some testing on real Windows platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice, thank you for taking care of that. I'll test on Windows before merging. libmve
should go in the thirdparty dir that did not exist when you first started this, but it can be moved later.
And you have some conflict resolution to do :) |
Windows sound is not working yet. You approved before testing. |
162a065
to
ee18505
Compare
Added D2X implementation licensed under GPLv3 terms. Cut from https://github.com/btb/d2x/tree/c030c4531ad19f1658ea9635ff4ee6861e1d15e0
Adapting movie and mve interfaces each other. Converted open() to fopen() et al. calls. movie expected image as RGB565 from old mve, but now it's RGB555, so there no need additional conversion. Fixed hicolor related conversion of width in movie's callbacks. Headers cleanup in both subsystems. Sound and frame callbacks are still unavailable.
Merge libmve.h into mvelib.h
Reorganized MVE to use own MVESTREAM pointer for each opened MVE file.
Sound supported by SDL backend.
Replaced SDL 1.2 legacy calls to SDL2 equivalents. Changed spec.size to fixed value 4096 as values obtained from file can produce sound stuttering.
Replacing circular ring implementation with queue that keeps decoded data between SDL audio callbacks.
Implemented abstraction layer and SDL backend.
I've reimplemented initial DSound support on Windows, but unfortunately there some regressions: sound crackling and stutters on playback in Windows. There need some synchronization between frames and audio playback. |
Pull Request Type
Description
Implementing own MVE library under GPLv3+ license based on D2X work. Currently works video with audio and framed playback (for main menu) on Linux and probably macOS. Windows build is expected to fail as need to adapt DirectSound PCM playback, and there I can use some help with experience of DirectX 6 programming.
Old MVE implementation still here in codebase, we need to decide what to do with it.
Related Issues
Fixes #253.
Screenshots (if applicable)
Checklist
Additional Comments