Skip to content

Commit 92bdd23

Browse files
authored
Merge branch 'scummvm:master' into staging_master
2 parents 8e61ef6 + 67d66f4 commit 92bdd23

File tree

1,356 files changed

+235425
-138013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,356 files changed

+235425
-138013
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
From ed3b6e4bca1fe5211e3d7ca06bbbf9b161c8bc19 Mon Sep 17 00:00:00 2001
2+
From: Michal Janiszewski <[email protected]>
3+
Date: Sat, 2 Nov 2019 14:50:53 -0700
4+
Subject: [PATCH] Add naive MSVC support to sources
5+
6+
---
7+
libmpeg2/convert/rgb.c | 2 +-
8+
libmpeg2/cpu_accel.c | 4 ++--
9+
libmpeg2/cpu_state.c | 4 ++--
10+
libmpeg2/idct.c | 2 +-
11+
libmpeg2/motion_comp.c | 2 +-
12+
libvo/video_out_dx.c | 6 +++---
13+
vc++/config.h | 2 ++
14+
7 files changed, 12 insertions(+), 10 deletions(-)
15+
16+
diff --git a/libmpeg2/convert/rgb.c b/libmpeg2/convert/rgb.c
17+
index 8863b0b..db6f4e3 100644
18+
--- a/libmpeg2/convert/rgb.c
19+
+++ b/libmpeg2/convert/rgb.c
20+
@@ -499,7 +499,7 @@ static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp,
21+
int convert420 = 0;
22+
int rgb_stride_min = ((bpp + 7) >> 3) * seq->width;
23+
24+
-#ifdef ARCH_X86
25+
+#if !defined(_MSC_VER) && defined(ARCH_X86)
26+
if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) {
27+
convert420 = 0;
28+
copy = mpeg2convert_rgb_mmxext (order, bpp, seq);
29+
diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c
30+
index 9b24610..a922df1 100644
31+
--- a/libmpeg2/cpu_accel.c
32+
+++ b/libmpeg2/cpu_accel.c
33+
@@ -29,7 +29,7 @@
34+
#include "attributes.h"
35+
#include "mpeg2_internal.h"
36+
37+
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
38+
+#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64))
39+
static inline uint32_t arch_accel (uint32_t accel)
40+
{
41+
if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT))
42+
@@ -253,7 +253,7 @@ static inline uint32_t arch_accel (uint32_t accel)
43+
44+
uint32_t mpeg2_detect_accel (uint32_t accel)
45+
{
46+
-#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
47+
+#if !defined(_MSC_VER) && (defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC))
48+
accel = arch_accel (accel);
49+
#endif
50+
return accel;
51+
diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c
52+
index 2f2f64a..f4966c1 100644
53+
--- a/libmpeg2/cpu_state.c
54+
+++ b/libmpeg2/cpu_state.c
55+
@@ -36,7 +36,7 @@
56+
void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
57+
void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
58+
59+
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
60+
+#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64))
61+
static void state_restore_mmx (cpu_state_t * state)
62+
{
63+
emms ();
64+
@@ -115,7 +115,7 @@ static void state_restore_altivec (cpu_state_t * state)
65+
66+
void mpeg2_cpu_state_init (uint32_t accel)
67+
{
68+
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
69+
+#if !defined(_MSC_VER) && (defined(ARCH_X86) || defined(ARCH_X86_64))
70+
if (accel & MPEG2_ACCEL_X86_MMX) {
71+
mpeg2_cpu_state_restore = state_restore_mmx;
72+
}
73+
diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c
74+
index 81c57e0..a057bf7 100644
75+
--- a/libmpeg2/idct.c
76+
+++ b/libmpeg2/idct.c
77+
@@ -235,7 +235,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block,
78+
79+
void mpeg2_idct_init (uint32_t accel)
80+
{
81+
-#ifdef ARCH_X86
82+
+#if !defined(_MSC_VER) && defined(ARCH_X86)
83+
if (accel & MPEG2_ACCEL_X86_SSE2) {
84+
mpeg2_idct_copy = mpeg2_idct_copy_sse2;
85+
mpeg2_idct_add = mpeg2_idct_add_sse2;
86+
diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c
87+
index 7aed113..b00a32d 100644
88+
--- a/libmpeg2/motion_comp.c
89+
+++ b/libmpeg2/motion_comp.c
90+
@@ -33,7 +33,7 @@ mpeg2_mc_t mpeg2_mc;
91+
92+
void mpeg2_mc_init (uint32_t accel)
93+
{
94+
-#ifdef ARCH_X86
95+
+#if !defined(_MSC_VER) && defined(ARCH_X86)
96+
if (accel & MPEG2_ACCEL_X86_MMXEXT)
97+
mpeg2_mc = mpeg2_mc_mmxext;
98+
else if (accel & MPEG2_ACCEL_X86_3DNOW)
99+
diff --git a/libvo/video_out_dx.c b/libvo/video_out_dx.c
100+
index 36de68a..0797cdc 100644
101+
--- a/libvo/video_out_dx.c
102+
+++ b/libvo/video_out_dx.c
103+
@@ -82,7 +82,7 @@ static void update_overlay (dx_instance_t * instance)
104+
dwFlags, &ddofx);
105+
}
106+
107+
-static long FAR PASCAL event_procedure (HWND hwnd, UINT message,
108+
+static LRESULT FAR PASCAL event_procedure (HWND hwnd, UINT message,
109+
WPARAM wParam, LPARAM lParam)
110+
{
111+
RECT rect_window;
112+
@@ -92,7 +92,7 @@ static long FAR PASCAL event_procedure (HWND hwnd, UINT message,
113+
switch (message) {
114+
115+
case WM_WINDOWPOSCHANGED:
116+
- instance = (dx_instance_t *) GetWindowLong (hwnd, GWL_USERDATA);
117+
+ instance = (dx_instance_t *) GetWindowLongPtr (hwnd, GWLP_USERDATA);
118+
119+
/* update the window position and size */
120+
point_window.x = 0;
121+
@@ -173,7 +173,7 @@ static int create_window (dx_instance_t * instance)
122+
/* store a directx_instance pointer into the window local storage
123+
* (for later use in event_handler).
124+
* We need to use SetWindowLongPtr when it is available in mingw */
125+
- SetWindowLong (instance->window, GWL_USERDATA, (LONG) instance);
126+
+ SetWindowLongPtr (instance->window, GWLP_USERDATA, (LONG_PTR) instance);
127+
128+
ShowWindow (instance->window, SW_SHOW);
129+
130+
diff --git a/vc++/config.h b/vc++/config.h
131+
index 93719f0..a03cce6 100644
132+
--- a/vc++/config.h
133+
+++ b/vc++/config.h
134+
@@ -16,7 +16,9 @@
135+
/* #undef ARCH_SPARC */
136+
137+
/* x86 architecture */
138+
+#if defined(_M_AMD64) || defined(_M_IX86)
139+
#define ARCH_X86
140+
+#endif
141+
142+
/* maximum supported data alignment */
143+
/* #undef ATTRIBUTE_ALIGNED_MAX */
144+
--
145+
2.25.0
146+
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
cmake_minimum_required(VERSION 3.2)
2+
project(libmpeg2)
3+
4+
option(TOOLS "Build libmpeg2 tools" OFF)
5+
6+
set(MPEG2_SOURCE_FILES
7+
libmpeg2/alloc.c
8+
libmpeg2/cpu_accel.c
9+
libmpeg2/cpu_state.c
10+
libmpeg2/decode.c
11+
libmpeg2/header.c
12+
libmpeg2/idct.c
13+
libmpeg2/idct_alpha.c
14+
libmpeg2/idct_altivec.c
15+
#libmpeg2/idct_mmx.c
16+
libmpeg2/motion_comp.c
17+
libmpeg2/motion_comp_alpha.c
18+
libmpeg2/motion_comp_altivec.c
19+
libmpeg2/motion_comp_arm.c
20+
#libmpeg2/motion_comp_mmx.c
21+
libmpeg2/motion_comp_vis.c
22+
libmpeg2/slice.c
23+
)
24+
set(VO_SOURCE_FILES
25+
libvo/video_out.c
26+
libvo/video_out_dx.c
27+
libvo/video_out_null.c
28+
libvo/video_out_pgm.c
29+
libvo/video_out_sdl.c
30+
libvo/video_out_x11.c
31+
)
32+
set(MPEG2_CONVERT_SOURCES
33+
libmpeg2/convert/rgb.c
34+
#libmpeg2/convert/rgb_mmx.c
35+
libmpeg2/convert/rgb_vis.c
36+
libmpeg2/convert/uyvy.c
37+
)
38+
set(GETOPT_FILES
39+
src/getopt.c
40+
)
41+
set(HEADERS
42+
include/mpeg2.h
43+
include/mpeg2convert.h
44+
)
45+
46+
add_library(mpeg2 ${MPEG2_SOURCE_FILES})
47+
add_library(mpeg2convert ${MPEG2_CONVERT_SOURCES})
48+
add_library(getopt STATIC ${GETOPT_FILES})
49+
add_library(vo STATIC ${VO_SOURCE_FILES})
50+
51+
target_include_directories(mpeg2convert PUBLIC
52+
"${CMAKE_SOURCE_DIR}/vc++"
53+
"${CMAKE_SOURCE_DIR}/include"
54+
)
55+
target_include_directories(getopt PUBLIC
56+
"${CMAKE_SOURCE_DIR}/vc++"
57+
"${CMAKE_SOURCE_DIR}/include"
58+
)
59+
target_include_directories(vo PUBLIC
60+
"${CMAKE_SOURCE_DIR}/vc++"
61+
"${CMAKE_SOURCE_DIR}/include"
62+
)
63+
target_include_directories(mpeg2 PUBLIC
64+
"${CMAKE_SOURCE_DIR}/vc++"
65+
"${CMAKE_SOURCE_DIR}/include"
66+
)
67+
target_include_directories(mpeg2 INTERFACE
68+
"${CMAKE_SOURCE_DIR}/include"
69+
)
70+
71+
target_compile_definitions(getopt PUBLIC HAVE_CONFIG_H)
72+
target_link_libraries(vo mpeg2convert)
73+
74+
if (TOOLS)
75+
add_executable(mpeg2dec src/mpeg2dec.c src/dump_state.c src/gettimeofday.c)
76+
add_executable(extract_mpeg2 src/extract_mpeg2.c)
77+
add_executable(corrupt_mpeg2 src/corrupt_mpeg2.c)
78+
79+
target_compile_definitions(extract_mpeg2 PUBLIC HAVE_CONFIG_H)
80+
target_compile_definitions(corrupt_mpeg2 PUBLIC HAVE_CONFIG_H)
81+
82+
target_link_libraries(mpeg2dec PRIVATE getopt vo mpeg2convert mpeg2 gdi32)
83+
target_link_libraries(extract_mpeg2 PRIVATE getopt)
84+
target_link_libraries(corrupt_mpeg2 PRIVATE getopt)
85+
86+
target_include_directories(mpeg2dec PUBLIC
87+
"${CMAKE_SOURCE_DIR}/vc++"
88+
"${CMAKE_SOURCE_DIR}/include"
89+
"${CMAKE_SOURCE_DIR}/src"
90+
)
91+
target_include_directories(extract_mpeg2 PUBLIC
92+
"${CMAKE_SOURCE_DIR}/vc++"
93+
"${CMAKE_SOURCE_DIR}/include"
94+
"${CMAKE_SOURCE_DIR}/src"
95+
)
96+
target_include_directories(corrupt_mpeg2 PUBLIC
97+
"${CMAKE_SOURCE_DIR}/vc++"
98+
"${CMAKE_SOURCE_DIR}/include"
99+
"${CMAKE_SOURCE_DIR}/src"
100+
)
101+
endif (TOOLS)
102+
103+
install(TARGETS mpeg2
104+
EXPORT libmpeg2
105+
LIBRARY DESTINATION lib
106+
)
107+
108+
install(FILES ${HEADERS} DESTINATION "include/mpeg2dec")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2+
3+
# There is archived version of releases available at https://github.com/janisozaur/libmpeg2
4+
vcpkg_from_git(
5+
OUT_SOURCE_PATH SOURCE_PATH
6+
URL https://code.videolan.org/videolan/libmpeg2.git
7+
REF 946bf4b518aacc224f845e73708f99e394744499 # Use a pinned commit hash
8+
PATCHES
9+
0001-Add-naive-MSVC-support-to-sources.patch
10+
)
11+
12+
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
13+
14+
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
15+
FEATURES
16+
tools TOOLS
17+
)
18+
19+
vcpkg_cmake_configure(
20+
SOURCE_PATH "${SOURCE_PATH}"
21+
OPTIONS ${FEATURE_OPTIONS}
22+
)
23+
24+
vcpkg_cmake_install()
25+
26+
# # Handle copyright
27+
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
28+
29+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
30+
31+
vcpkg_copy_pdbs()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "libmpeg2",
3+
"version": "0.5.1",
4+
"port-version": 3,
5+
"description": "a free MPEG-2 video stream decoder",
6+
"homepage": "http://libmpeg2.sourceforge.net/",
7+
"supports": "!(linux | osx | uwp)",
8+
"dependencies": [
9+
{
10+
"name": "vcpkg-cmake",
11+
"host": true
12+
}
13+
],
14+
"features": {
15+
"tools": {
16+
"description": "Build tools provided with libmpeg2"
17+
}
18+
}
19+
}

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
3434
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
3535
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
36-
GIT_VCPKG_COMMIT: b02e341c927f16d991edbd915d8ea43eac52096c
36+
VCPKG_OVERLAY_PORTS: ${{ github.workspace }}/.github/vcpkg-ports
37+
GIT_VCPKG_COMMIT: ef7dbf94b9198bc58f45951adcf1f041fcbc5ea0
3738
permissions:
3839
contents: write # For dependencygraph
3940
steps:
@@ -132,8 +133,8 @@ jobs:
132133
brewPackages: a52dec faad2 flac fluid-synth freetype fribidi giflib jpeg mad libmikmod libmpeg2 libogg libpng libvorbis libvpx sdl2 sdl2_net theora
133134
- platform: ios7
134135
buildFlags: -scheme ScummVM-iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO
135-
configFlags: --use-xcframework --enable-faad --enable-gif --enable-mikmod --enable-mpeg2 --enable-vpx --disable-nasm --disable-taskbar --disable-tts
136-
packagesUrl: https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v3.zip
136+
configFlags: --use-xcframework --enable-faad --enable-gif --enable-mikmod --enable-vpx --enable-mpc --disable-nasm --disable-taskbar --disable-tts
137+
packagesUrl: https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v4.zip
137138
defaults:
138139
run:
139140
# Must be explicit for proper pipefail support

AUTHORS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ ScummVM Team
104104
Peter Bozso
105105
Arnaud Boutonne
106106

107+
awe:
108+
Gregory Montoir
109+
Paul Gilbert
110+
107111
Bagel:
108112
Arnaud Boutonne
109113
Daniel Albano
@@ -242,6 +246,7 @@ ScummVM Team
242246
Got:
243247
Paul Gilbert
244248
Arnaud Boutonne
249+
Coen Rampen
245250

246251
Griffon:
247252
Eugene Sandulenko
@@ -316,6 +321,7 @@ ScummVM Team
316321
Eugene Sandulenko
317322

318323
Lastexpress:
324+
Andrea Boscarino - Engine rewrite
319325
Matthew Hoops - (retired)
320326
Jordi Vilalta Prat
321327
Julien Templier
@@ -949,6 +955,7 @@ Other contributions
949955
Game Translations
950956
-----------------
951957
CGE:
958+
Arnaud Boutonne - Soltys English translation
952959
Dan Serban - Soltys English translation
953960
Victor Gonzalez - Soltys Spanish translation
954961
Alejandro Gomez de la Munoza - Soltys Spanish translation
@@ -963,6 +970,8 @@ Other contributions
963970
Thierry Crozat - Improve French translation
964971

965972
Mortevielle:
973+
Arnaud Boutonne - First English translation, improve
974+
German translation
966975
Hugo Labrande - Improve English translation
967976
Thierry Crozat - Improve English translation
968977

@@ -1286,3 +1295,6 @@ Special thanks to
12861295
Fabrizio Lagorio from Trecision S.p.A., for finding and providing the
12871296
source code of many of their games.
12881297

1298+
Ron Davis for releasing the sources and generously giving away the three
1299+
chapters of God of Thunder.
1300+

0 commit comments

Comments
 (0)