Skip to content

Commit ee1d42d

Browse files
committed
add _sprite + _sdl2.video to inittab (former require latter)
1 parent 7171ceb commit ee1d42d

File tree

4 files changed

+51
-45
lines changed

4 files changed

+51
-45
lines changed

buildconfig/Setup.Emscripten.SDL2.in

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,64 @@
1111

1212
DEBUG =
1313

14-
15-
14+
# these can build alone and object files merged with ar
1615

1716
_sdl2.sdl2 src_c/_sdl2/sdl2.c $(SDL) $(DEBUG) -Isrc_c
17+
1818
_sdl2.audio src_c/_sdl2/audio.c $(SDL) $(DEBUG) -Isrc_c
19-
_sdl2.video src_c/_sdl2/video.c src_c/pgcompat.c $(SDL) $(DEBUG) -Isrc_c
20-
_sdl2.mixer src_c/_sdl2/mixer.c $(SDL) $(MIXER) $(DEBUG) -Isrc_c
21-
_sdl2.touch src_c/_sdl2/touch.c $(SDL) $(DEBUG) -Isrc_c
22-
#_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
23-
_sdl2.controller src_c/void.c
2419

25-
GFX = src_c/SDL_gfx/SDL_gfxPrimitives.c
26-
#GFX = src_c/SDL_gfx/SDL_gfxBlitFunc.c src_c/SDL_gfx/SDL_gfxPrimitives.c
27-
gfxdraw src_c/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
20+
pygame_sdl2_video src_c/_sdl2/video.c src_c/pgcompat.c $(SDL) $(DEBUG) -Isrc_c
21+
_sdl2.video = src_c/void.c
2822

2923

24+
_sdl2.mixer src_c/_sdl2/mixer.c $(SDL) $(MIXER) $(DEBUG) -Isrc_c
3025

26+
constants src_c/constants.c $(SDL) $(DEBUG)
27+
mask src_c/bitmask.c
28+
_sprite src_c/_sprite.c $(SDL) $(DEBUG)
29+
math src_c/math.c $(SDL) $(DEBUG)
30+
31+
#GFX = src_c/SDL_gfx/SDL_gfxBlitFunc.c src_c/SDL_gfx/SDL_gfxPrimitives.c
32+
GFX = src_c/SDL_gfx/SDL_gfxPrimitives.c
3133

3234

3335
static src_c/static.c $(SDL) $(FREETYPE) $(FONT) $(MIXER) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
3436

35-
36-
# these should not be altered
37-
rect src_c/void.c
38-
display src_c/void.c
39-
rwobject src_c/void.c
40-
event src_c/void.c
41-
mouse src_c/void.c
42-
key src_c/void.c
43-
joystick src_c/void.c
37+
# these should not be altered they already are in static.c merging file above
4438
time src_c/void.c
45-
4639
_freetype src_c/void.c
40+
imageext src_c/void.c
41+
image src_c/void.c
42+
base src_c/void.c
43+
bufferproxy src_c/void.c
44+
color src_c/void.c
45+
controller src_c/void.c
46+
display src_c/void.c
47+
draw src_c/void.c
48+
event src_c/void.c
4749
font src_c/void.c
48-
mixer src_c/void.c
50+
gfxdraw src_c/void.c
51+
joystick src_c/void.c
52+
key src_c/void.c
53+
newbuffer src_c/void.c
4954
mixer_music src_c/void.c
50-
51-
draw src_c/void.c
52-
controller src_c/void.c
53-
55+
mixer src_c/void.c
56+
mouse src_c/void.c
57+
pixelcopy src_c/void.c
58+
pixelarray src_c/void.c
5459
surface src_c/void.c
5560
surflock src_c/void.c
61+
rect src_c/void.c
62+
rwobject src_c/void.c
5663

57-
color src_c/void.c
58-
bufferproxy src_c/void.c
59-
60-
imageext src_c/void.c
61-
62-
image src_c/void.c
63-
64-
mask src_c/bitmask.c
6564

66-
_sprite src_c/_sprite.c $(SDL) $(DEBUG)
65+
#_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
66+
_sdl2.controller src_c/void.c
6767

68-
#base src_c/base.c $(SDL) $(DEBUG)
69-
base src_c/void.c
68+
#_sdl2.touch src_c/_sdl2/touch.c $(SDL) $(DEBUG) -Isrc_c
69+
_sdl2.touch src_c/void.c
7070

71-
constants src_c/constants.c $(SDL) $(DEBUG)
72-
transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c src_c/scale_mmx.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
71+
#transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c src_c/scale_mmx.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
72+
transform src_c/void.c
7373

7474

75-
pixelarray src_c/pixelarray.c $(SDL) $(DEBUG)
76-
math src_c/math.c $(SDL) $(DEBUG)
77-
pixelcopy src_c/pixelcopy.c $(SDL) $(DEBUG)
78-
newbuffer src_c/newbuffer.c $(SDL) $(DEBUG)

src_c/alphablit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ SoftBlitPyGame(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
285285
break;
286286
}
287287
case PYGAME_BLEND_RGBA_MULT: {
288+
#if !defined(__EMSCRIPTEN__)
288289
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
289290
if (src->format->BytesPerPixel == 4 &&
290291
dst->format->BytesPerPixel == 4 &&
@@ -321,6 +322,7 @@ SoftBlitPyGame(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
321322
}
322323
#endif /* PG_ENABLE_ARM_NEON */
323324
#endif /* SDL_BYTEORDER == SDL_LIL_ENDIAN */
325+
#endif /* __EMSCRIPTEN__ */
324326
/* if we call MULT_RGBA on a surface without alpha
325327
we will be forced down this slow non-SIMD path
326328
right now. When we upgrade RGB_MULT to SIMD

src_c/pixelarray.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include "doc/pixelarray_doc.h"
2828

2929
#include "surface.h"
30-
30+
#if !defined(BUILD_STATIC)
3131
static char FormatUint8[] = "B";
3232
static char FormatUint16[] = "=H";
3333
static char FormatUint24[] = "3x";
3434
static char FormatUint32[] = "=I";
35-
35+
#endif
3636
struct _pixelarray_t;
3737

3838
/* The array, like its surface, is in column-major (FORTRAN) order.

src_c/static.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define PYGAMEAPI_BASE_INTERNAL
77
#define PYGAMEAPI_SURFACE_INTERNAL
88

9-
#define pgSurface_New(surface) pgSurface_New2((surface), 1)
9+
#define pgSurface_New(surface) (pgSurfaceObject *)pgSurface_New2((surface), 1)
1010
#define pgSurface_NewNoOwn(surface) \
1111
(pgSurfaceObject *)pgSurface_New2((surface), 0)
1212

@@ -137,6 +137,12 @@ PyInit_controller(void);
137137
PyMODINIT_FUNC
138138
PyInit_transform(void);
139139

140+
PyMODINIT_FUNC
141+
PyInit_video(void);
142+
143+
PyMODINIT_FUNC
144+
PyInit__sprite(void);
145+
140146
void
141147
PyGame_static_init()
142148
{
@@ -164,6 +170,8 @@ PyGame_static_init()
164170
PyImport_AppendInittab("pygame_event", PyInit_event);
165171
PyImport_AppendInittab("pygame_joystick", PyInit_joystick);
166172
PyImport_AppendInittab("pygame_time", PyInit_pg_time);
173+
PyImport_AppendInittab("pygame_sdl2_video", PyInit_video);
174+
PyImport_AppendInittab("pygame_sprite", PyInit__sprite);
167175
PyImport_AppendInittab("pygame__sdl2_sdl2", PyInit_sdl2);
168176
PyImport_AppendInittab("pygame__sdl2_sdl2_mixer", PyInit_mixer);
169177
PyImport_AppendInittab("pygame__sdl2_controller", PyInit_controller);

0 commit comments

Comments
 (0)