teletext: fixes #13515 transparent background issue on Windows systems #1906

Merged
merged 1 commit into from Dec 9, 2012

Conversation

Projects
None yet
3 participants
Contributor

margro commented Dec 8, 2012

@opdenkamp: This pull request fixes

http://trac.xbmc.org/ticket/13515

This regression was introduced in commit 424a4d9: the removal of SDL for Windows.
This removed the HAS_SDL define and it turns out that the replacement SDL_memset4 define behaves different than the one from the SDL_stdinc.h header
This change implements the SDL_memset4 replacement to match the SDL original.

Member

elupus commented Dec 9, 2012

Ok.. That is weird code. If that compiles I'd be very surprised and quite
intrigued.. You run a while loop crossing several case statements but not
the switch part...

Contributor

davilla commented Dec 9, 2012

Comes direct from SDL source, http://www.libsdl.org/tmp/SDL-1.3-docs/SDL__stdinc_8h-source.html

Yes, very strange but valid code (except for the SDL_memcpy4 changes) :)

@margro margro teletext: fixes #13515 transparent background issue on Windows systems
This regression was introduced in commit 424a4d9: the removal of SDL for Windows.
This removed the HAS_SDL define and it turns out that the replacement SDL_memset4 define behaves different than the one from the SDL_stdinc.h header
This change implements the SDL_memset4 replacement to match the SDL original.
54dbf34
Contributor

margro commented Dec 9, 2012

Oops.. fixed the << 4 part. A strange manual copy-code action from my side.

@elupus The weird while in switch code is called "duff's device". See wikipedia for the explanation.
It looks indeed strange. As davilla already indicated it comes directly from the original SDL header. That was the only difference I could find between Linux and Windows with respect to the teletext display.

I still don't know why the old SDL_memset4() implementation for Windows resulted in the transparent background as it looked like a valid implementation given how the SDL_memcpy4 is implemented.

Contributor

davilla commented Dec 9, 2012

wow, it even has a name :)

davilla merged commit 7f49891 into xbmc:master Dec 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment