Commit Graph

54 Commits

Author SHA1 Message Date
Azamat H. Hackimov
32df86203a Cleanup d3movie.cpp
Remove unused variables, minor fixes.
2024-07-09 03:42:52 +03:00
Azamat H. Hackimov
c6eb9a8908 MVE: rename lnx_sound to sdl_sound
Now this is cross-platform playback.
2024-07-09 03:42:52 +03:00
Azamat H. Hackimov
4f0e0f87a5 Cleanup MVE library
Remove old implementation, cleanup unused code.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
9672475f70 Update MVE playback on Windows
There only one problem still persist on playback - slow filling sound buffer from std::deque on MSVC Debug mode due extremely slow performance of STL containers on that mode. On Release and RelWithDebInfo playback is fine.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
8fd119bd3d MVE: Make timer code crossplatform 2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
a39ccfc3ca MVE: Implementing class for sound playback
Implemented abstraction layer and SDL backend.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
2f288f6dc9 MVE: use deque for FIFO buffer
Replacing circular ring implementation with queue that keeps decoded data between SDL audio callbacks.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
8d56e1c1ff MVE: Migrate to SDL2 functions
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.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
96c240a4c0 MVE: Add support for big-endian systems 2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
afd7c1a636 MVE: Initial sound support
Sound supported by SDL backend.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
a8784ee524 MVE: Implementing frame playing (main menu)
Reorganized MVE to use own MVESTREAM pointer for each opened MVE file.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
99ec2e3a5e MVE: Refactoring code
Merge libmve.h into mvelib.h
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
b94458f561 MVE: Switch to D2X implementation (first run)
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.
2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
a5b86bd0fb MVE: convert libmve files to C++ 2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
ce74c43b44 MVE: add copyright headers, clang-format 2024-07-09 03:40:49 +03:00
Azamat H. Hackimov
ef60434f72 Add D2X implementation of MVE
Added D2X implementation licensed under GPLv3 terms.
Cut from c030c4531a
2024-07-09 03:40:49 +03:00
Louis Gombert
91c18fefc5 Windows SDL2 compilation 2024-06-29 18:21:37 +02:00
GravisZro
f7ae658fe2 Modernize struct/enum/unions type declarations 2024-05-30 03:35:17 -04:00
GravisZro
5e5e0c99c3 Replace "short" with "int16_t" and fix missing headers 2024-05-23 23:49:31 -04:00
GravisZro
fe855cf85e Fix missing header includes/restore third-party files 2024-05-23 23:14:40 -04:00
GravisZro
cc67b9230a Replace "signed short" with "int16_t" 2024-05-23 23:04:15 -04:00
GravisZro
3dcd21b717 Replace "unsigned short" with "uint16_t" 2024-05-23 23:03:29 -04:00
GravisZro
a00639be24 Replace "signed char" with "int8_t" 2024-05-23 22:59:50 -04:00
GravisZro
1618040db5 Replace "unsigned char" with "uint8_t" 2024-05-23 22:58:46 -04:00
GravisZro
0556786c12 Replace "signed int" with "int32_t" 2024-05-23 22:55:41 -04:00
GravisZro
2147cfa68b Replace "unsigned int" with "uint32_t" 2024-05-23 22:51:16 -04:00
GravisZro
dec9de7456 64-bit fixes
Switch all the (u)long types to (u)int32_t where appropriate.
2024-05-22 18:14:45 -04:00
Thomas Roß
0c09eed1b7 [Win,x64] Replaced inline assembly for int3 with debug_break() to fix compile errors in x64 builds. 2024-05-15 19:55:45 +02:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
Edu García
3440667e93 remove unused code (mainly windows.h) 2024-05-07 23:45:33 +01:00
Louis Gombert
0e69bf465f
Merge pull request #241 from icculus/ryan-sdl2-port
Initial SDL2 port
2024-05-06 08:57:20 +00:00
Ryan C. Gordon
65b1a7dc3b
sdl2: Fix broken audio in MVE playback.
This doesn't fix the audio gaps, just the static introduced in the SDL2 port.

SDL2 does not initialize the audio callback's buffer, unlike SDL 1.2, under
the assumption the callback is going to fully write it anyhow. But since
the movie player wants to mix against the current contents of the buffer,
we need to explicitly initialize it to silence first.
2024-05-05 10:14:50 -04:00
Jacob Coby
b64f17fb17 Merge branch '64bit-fixes' of github.com:jcoby/Descent3 into jcoby-64bit-fixes 2024-05-03 16:46:11 -04:00
Ryan C. Gordon
f8a4cb3cc0
More X11 removal.
This is all unused stuff, just doing a more-complete purge.
2024-04-30 13:04:15 -04:00
Jacob Coby
a6a6869a7e 64 Bit-Safe Updates
Imported Icculus' 64-bit changes.

Changes `[un]signed long` data types to `[un]signed int`.
2024-04-29 14:10:09 -04:00
Ryan C. Gordon
6c8977caf0
Heavy patching for compiler warnings.
The vast majority of this is fixing up `char *` that should be `const char *`
but a handful of other fixes, like potential buffer overflows that GCC
noticed, etc, were applied as well.

This removes `-Wno-write-strings` from CMakeLists.txt, as it is no longer
necessary, as there is no longer a flood of compiler warning spam when
building.

This does not fix all compiler warnings; there are still a handful, and they
are legitimate, but they can be dealt with in a future commit.
2024-04-29 00:18:56 -04:00
Thomas Otto
00389c50ea Some more CMake white space formatting
- tabs to spaces
 - use Unix line endings everywhere
 - newline at end of file
 - remove trailing white space
 - no space between keywords and opening parenthesis
 - use 2 spaces to indent
2024-04-21 11:46:32 +02:00
Kevin Bentley
44c4f867e8 Removed extraneous license 2024-04-20 10:15:38 -06:00
Kevin Bentley
d819437f58 Removed extraneous license text. 2024-04-20 10:15:08 -06:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Louis Gombert
c2b71b8147 Standardize CMake formatting
lowercase function names, blocks indent
2024-04-20 14:45:49 +02:00
C.W. Betts
7d7f5bf896 Quiet Clang Static Analyzer warnings.
Most of the warnings were caused by uninitialized values. Some were in plug-ins that didn't have a break in a switch, causing the memory to be deleted twice.
2024-04-19 17:42:17 -06:00
Kevin Bentley
98ed4599a5
Merge pull request #84 from midnite8177/fix-libmve
Fix libmve so movies rendering correctly
2024-04-18 22:25:31 -06:00
Jeff Slutter
2c4c3b339b Fixing an accidental change back 2024-04-18 22:52:05 -05:00
Jeff Slutter
6fc71b1e13 Enable all codec opcodes. We had disabled some when trying to debug the code years ago and not all got re-enabled. 2024-04-18 22:43:04 -05:00
Matt Stephenson
e1af942a13 Use __aarch64__ instead of __arm64__ for Linux builds
Signed-off-by: Matt Stephenson <mstephenson6@users.noreply.github.com>
2024-04-18 01:34:24 -04:00
Azamat H. Hackimov
9e6ebbc8fb Remove dublicate byteswap.h
Linux-specific byteswap.h just includes BYTESWAP.H, so there no need platform-specific header.

Fixes "non-portable path to file" ([-Wnonportable-include-path]) warnings.
2024-04-18 03:20:36 +03:00
Louis Gombert
4247f30c3d
Merge pull request #21 from th1000s/misc_linux
Linux build fixes: remove unused osMutex code and typedefs
2024-04-17 18:46:42 +00:00
Jacob Coby
531e528c61 Apple M-Series Fixes
* Adds portable debug_break (https://github.com/scottt/debugbreak/)
 * Adds Brewfile for Homebrew deps
 * use isfinite() instead of finite()
 * Stub int3 code in mveasm
2024-04-17 09:09:22 -04:00
Thomas Otto
7d2e1b5cba gcc: disable -Wnarrowing via pragma in snd8to16.h 2024-04-17 01:20:51 +02:00