@@ -49,6 +49,7 @@ import_pygame_surface(void)
49
49
{
50
50
}
51
51
52
+
52
53
void
53
54
import_pygame_window (void )
54
55
{
@@ -74,6 +75,7 @@ import_pygame_freetype(void)
74
75
{
75
76
}
76
77
78
+
77
79
void
78
80
import_pygame_bufferproxy (void )
79
81
{
@@ -113,6 +115,8 @@ import_pygame_pixelarray(void)
113
115
{
114
116
}
115
117
118
+
119
+
116
120
PyMODINIT_FUNC
117
121
PyInit_base (void );
118
122
PyMODINIT_FUNC
@@ -228,24 +232,20 @@ load_submodule(const char *parent, PyObject *mod, const char *alias)
228
232
{
229
233
char fqn [1024 ];
230
234
if (!mod ) {
231
- snprintf (fqn , sizeof (fqn ), "ERROR: PyInit_%s failed for %s.%s" , alias ,
232
- parent , alias );
235
+ snprintf (fqn , sizeof (fqn ), "ERROR: PyInit_%s failed for %s.%s" , alias , parent , alias );
233
236
puts (fqn );
234
237
PyErr_Print ();
235
238
PyErr_Clear ();
236
239
}
237
240
else {
238
241
snprintf (fqn , sizeof (fqn ), "%s.%s" , parent , alias );
239
- puts (fqn );
240
242
PyObject * modules = PyImport_GetModuleDict ();
241
243
242
244
PyObject * pmod = PyDict_GetItemString (modules , parent );
243
245
if (!pmod ) {
244
- snprintf (fqn , sizeof (fqn ), "ERROR: Parent %s not found for %s.%s" ,
245
- parent , parent , alias );
246
+ snprintf (fqn , sizeof (fqn ), "ERROR: Parent %s not found for %s.%s" , parent , parent , alias );
246
247
puts (fqn );
247
- }
248
- else {
248
+ } else {
249
249
PyDict_SetItemString (modules , fqn , mod );
250
250
PyDict_SetItemString (PyModule_GetDict (mod ), "__name__" ,
251
251
PyUnicode_FromString (fqn ));
@@ -261,7 +261,7 @@ load_submodule_mphase(const char *parent, PyObject *mdef, PyObject *spec,
261
261
{
262
262
char fqn [1024 ];
263
263
snprintf (fqn , sizeof (fqn ), "%s.%s" , parent , alias );
264
- puts ( fqn );
264
+
265
265
PyObject * modules = PyImport_GetModuleDict ();
266
266
267
267
Py_DECREF (PyObject_GetAttrString (spec , "name" ));
@@ -292,8 +292,6 @@ load_submodule_mphase(const char *parent, PyObject *mdef, PyObject *spec,
292
292
static PyObject *
293
293
mod_pygame_import_cython (PyObject * self , PyObject * spec )
294
294
{
295
- #if 1 // PY_VERSION_HEX <= 0x030C0000
296
-
297
295
load_submodule_mphase ("pygame._sdl2" , PyInit_sdl2 (), spec , "sdl2" );
298
296
299
297
load_submodule_mphase ("pygame._sdl2" , PyInit_mixer (), spec , "mixer" );
@@ -305,7 +303,7 @@ mod_pygame_import_cython(PyObject *self, PyObject *spec)
305
303
#endif
306
304
load_submodule_mphase ("pygame._sdl2" , PyInit_audio (), spec , "audio" );
307
305
load_submodule_mphase ("pygame._sdl2" , PyInit_video (), spec , "video" );
308
- #endif
306
+
309
307
Py_RETURN_NONE ;
310
308
}
311
309
@@ -371,12 +369,14 @@ PyInit_pygame_static()
371
369
// base, event
372
370
load_submodule ("pygame" , PyInit_pg_time (), "time" );
373
371
372
+
374
373
load_submodule ("pygame" , PyInit_transform (), "transform" );
375
374
load_submodule ("pygame" , PyInit_draw (), "draw" );
376
375
377
376
load_submodule ("pygame" , PyInit_mask (), "mask" );
378
377
load_submodule ("pygame" , PyInit_mouse (), "mouse" );
379
378
379
+
380
380
load_submodule ("pygame" , PyInit_pg_mixer (), "mixer" );
381
381
load_submodule ("pygame.mixer" , PyInit_mixer_music (), "music" );
382
382
@@ -392,7 +392,7 @@ PyInit_pygame_static()
392
392
// base, color, rect, bufferproxy, surflock, surface
393
393
load_submodule ("pygame" , PyInit_gfxdraw (), "gfxdraw" );
394
394
395
- // load_submodule("pygame", PyInit_system(), "system");
395
+ load_submodule ("pygame" , PyInit_system (), "system" );
396
396
397
397
return PyModule_Create (& mod_pygame_static );
398
398
}
0 commit comments