[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] [PATCH] Smooth Scaling v2 (pygame.transform.smoothscale)



After much searching, I found the 'magic' preprocessor definitions to
determine compiler and CPU architecture.  They are "__GNUC__",
"__i386__", and "__x86_64__".  This should work under Linux, mingw, OSX,
etc; basically any platform with GCC and an MMX-capable CPU.  I have
tested and verified that it works under Gentoo/x86_64 and Ubuntu7.04/i686.

The attached zip contains a 'transform.c' which is based on v1.7.1 and
includes the new smoothscale function with compile-time checks to
include the MMX routines for compilation and a run-time check via
SDL_cpuinfo.  The modified 'config.py' is no longer needed.

Regards,
Richard


Laura Creighton wrote:
> In a message of Thu, 21 Jun 2007 09:18:41 +0200, mva@xxxxxxxxxxxx writes:
>> Laura Creighton <lac@xxxxxxxxxx>:
>>
>>> If you are on a BSD or linux system you will have a file
>>> /proc/cpuinfo which can tell you what sort of CPU you have and
>> FreeBSD does not use /proc anymore and has it disabled by default.
>>
>>> whether it has MMX support or not.  I don't know where Windows
>>> keeps such information.  (And really old unix-and-unix-like
>>> systems don't have this file, but they don't have MMX either,
>>> so you are all set.)
>> For !Win32 systems we could rely on the -march settings of the processor.
>> According to the manual, the GCC specifies MMX and SSE/SSE2/SSE3 for
>> several archs, so we just have to test on them. For Win32 I just know abo
>> ut
>> the CPUID hacks, but that's only interesting for runtime checks.
>>
>> Regards
>> Marcus
> 
> Aha, I did not know that.  Thank you. According to:
> http://lists.freebsd.org/pipermail/freebsd-questions/2006-March/117134.html
> 
> sysctl -a 
> 
> will give you the same information on Freebsd systems.  Just in case
> anybody cares because setting the -march settings looks to accomplish
> the same thing, and is a lot easier.
> 
> Laura
> 
> 
> 
> 

Attachment: SmoothScale-1.7.1.tar.gz
Description: GNU Zip compressed data