Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The giant SDL2_patches merging PR. #482

Merged
merged 117 commits into from Aug 2, 2018

Conversation

Projects
None yet
4 participants
@illume
Copy link
Member

illume commented Aug 2, 2018

馃帀 馃巿 馃巶

Works for me. There's a few comments for later. I'll perhaps start adding issues for missing functionality in the SDL2 build and mark them with the pygame 2 milestone.

re: #174

llindstrom added some commits Apr 4, 2017

Disable automatic builds
Hopefully renaming appveyor.yml and .travis.yml will keep them from building this branch until it is ready.
Disable building of SDL2_patches branch
Try again to keep appveyor and travis from building this branch for now.
SDL2 patches become conditionally compiled code
The SDL2 changes are available by defining the SDL2 C macro. Otherwise the original SDL1 code is compiled. All SDL2 build changes in config.py, setup.py, and Setup.in were removed for now. Pygame compiles strictly for SDL1, and the unit tests pass. This is to confirm the integrity of the unpatched code and to also add an SDL1/SDL2 switch for the unix build chain before continuing with the SDL2 specific changes.
Refactor condictional code for Visual C
Visual C does not like a #if-#else-#endif block within C macro argument, so moved the SDL2 conditional blocks outside of macro LOOP_UNROLLED4 in alphablit.c.

llindstrom and others added some commits May 25, 2018

Update src/overlay.c
Do a PEP 7 update of external pygame api identifiers.
Update src/mask.c
Do a PEP 7 update of external pygame api identifiers. Use new IS_SDLvl/IS_SDLv2 macros.
Update src/fastevent.c
Do a PEP 7 update of external pygame api identifiers.
Update src/draw.c
Do a PEP 7 update of external pygame api identifiers.
Remove src/api_transition.h and SDL2 C macro
Remove pygame C api transition files. Update missed api in src/rect.c and src/rwobject.c. Update src/_pygame.h to not define or use SDL2.
Start a pygame C API doc
Add documents for base, Surface, and Rect. No specific html styling added yet.
Only include pygame Python api documents in document header quick index
Leave out pygame C API documents from the header on each html document page. This means only including reST files found in docs/reST/ref.

@illume illume requested a review from llindstrom Aug 2, 2018

static PyObject*
_color_long (PyColor *color)
static PyObject *
_color_long(pgColorObject *color)

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

I guess we should prefix all functions with something. So this could be something like _pg_color_long ?

};
#endif

MODINIT_DEFINE (display)

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

I guess MODINIT_DEFINE should be prefixed somehow to show that it's a pg macro?

@@ -421,12 +422,20 @@ SDL_Surface *_PGFT_Render_NewSurface(FreeTypeInstance *ft,
FT_UInt32 bmask = 0x00ff0000;
FT_UInt32 amask = 0xff000000;
#endif
#else /* IS_SDLv2 */
FT_UInt32 rmask = 0;

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

I don't understand why for SDL2 these are all 0?

This comment has been minimized.

Copy link
@lukevp

lukevp Aug 2, 2018

Maybe freetype is using pallette rendering in sdl2?
A pixel format has either a palette or masks. If a palette is used Rmask, Gmask, Bmask, and Amask will be 0.

}
#else /* IS_SDLv2 */
if (surface->format->format == SDL_PIXELFORMAT_RGB24) {
/*

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

Looks like this needs to be implemented.

}

static PyObject*
surf_set_palette (PyObject *self, PyObject *args)
{
SDL_Surface *surf = PySurface_AsSurface (self);
#if IS_SDLv2

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

Interesting.

pixels = (Uint8 *) surface->pixels + surface->offset +
#else /* IS_SDLv2 */
pixels = (Uint8 *) surface->pixels +

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

Perhaps we can have a get_pixels macro for this.

@@ -0,0 +1,2 @@
# Overlay support was removed in SDL 2

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

Interesting.

@@ -1,4 +1,5 @@
__tags__ = []
# For now the scrap module has not been updated for SDL 2

This comment has been minimized.

Copy link
@illume

illume Aug 2, 2018

Author Member

interesting

@illume illume added this to the 2.0 milestone Aug 2, 2018

@illume illume merged commit 1304ffe into master Aug 2, 2018

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@illume illume deleted the SDL2_merging branch Aug 2, 2018

@illume illume referenced this pull request Oct 16, 2018

Closed

1.9.5 release notes. #561

4 of 4 tasks complete

@dlon dlon added the 2.0 label Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.