Skip to content

Commit

Permalink
separate defines like `HAVE_SDL_GFX_PRIMITIVES´ for all SDL::GFX::* [#73
Browse files Browse the repository at this point in the history
]
  • Loading branch information
Tobias Leich committed Dec 8, 2009
1 parent e2ef2b9 commit a4193cb
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 30 deletions.
35 changes: 25 additions & 10 deletions Build.PL
Expand Up @@ -70,42 +70,42 @@ my %subsystems =
from => 'src/GFX/BlitFunc.xs',
to => 'lib/SDL/GFX/BlitFunc.xs',
},
libraries => [qw( SDL SDL_gfx_blit )],
libraries => [qw( SDL SDL_gfx_blitfunc )],
},
Framerate => {
file => {
from => 'src/GFX/Framerate.xs',
to => 'lib/SDL/GFX/Framerate.xs',
},
libraries => [qw( SDL SDL_gfx )],
libraries => [qw( SDL SDL_gfx_framerate )],
},
FPSManager => {
file => {
from => 'src/GFX/FPSManager.xs',
to => 'lib/SDL/GFX/FPSManager.xs',
},
libraries => [qw( SDL SDL_gfx )],
libraries => [qw( SDL SDL_gfx_framerate )],
},
ImageFilter => {
file => {
from => 'src/GFX/ImageFilter.xs',
to => 'lib/SDL/GFX/ImageFilter.xs',
},
libraries => [qw( SDL SDL_gfx )],
libraries => [qw( SDL SDL_gfx_imagefilter )],
},
Primitives => {
file => {
from => 'src/GFX/Primitives.xs',
to => 'lib/SDL/GFX/Primitives.xs',
},
libraries => [qw( SDL SDL_gfx )],
libraries => [qw( SDL SDL_gfx_primitives )],
},
Rotozoom => {
file => {
from => 'src/GFX/Rotozoom.xs',
to => 'lib/SDL/GFX/Rotozoom.xs',
},
libraries => [qw( SDL SDL_gfx )],
libraries => [qw( SDL SDL_gfx_rotozoom )],
},
MultiThread => {
file => {
Expand Down Expand Up @@ -319,10 +319,25 @@ my %libraries = (
define => 'HAVE_SDL_GFX',
header => 'SDL_gfxPrimitives.h'
},
SDL_gfx_blit => {
define => 'HAVE_SDL_GFX_BLIT',
header => 'SDL_gfxBlitFunc.h',
library => 'SDL_gfx'
SDL_gfx_blitfunc => {
define => 'HAVE_SDL_GFX_BLITFUNC',
header => 'SDL_gfxBlitFunc.h'
},
SDL_gfx_framerate => {
define => 'HAVE_SDL_GFX_FRAMERATE',
header => 'SDL_framerate.h'
},
SDL_gfx_imagefilter => {
define => 'HAVE_SDL_GFX_IMAGEFILTER',
header => 'SDL_imageFilter.h'
},
SDL_gfx_primitives => {
define => 'HAVE_SDL_GFX_PRIMITIVES',
header => 'SDL_gfxPrimitives.h'
},
SDL_gfx_rotozoom => {
define => 'HAVE_SDL_GFX_ROTOZOOM',
header => 'SDL_rotozoom.h'
},
png => {
define => 'HAVE_PNG',
Expand Down
6 changes: 5 additions & 1 deletion make/lib/SDL/Build.pm
Expand Up @@ -141,7 +141,11 @@ sub build_links

my %links;
my %replace = (
'SDL_gfx_blit' => 'SDL_gfx',
'SDL_gfx_blitfunc' => 'SDL_gfx',
'SDL_gfx_framerate' => 'SDL_gfx',
'SDL_gfx_imagefilter' => 'SDL_gfx',
'SDL_gfx_primitives' => 'SDL_gfx',
'SDL_gfx_rotozoom' => 'SDL_gfx',
);

while (my ($subsystem, $buildable) = each %$build_systems)
Expand Down
10 changes: 7 additions & 3 deletions make/lib/SDL/Build/MSWin32.pm
Expand Up @@ -75,9 +75,13 @@ sub build_links

my %links;
my %replace = (
'GL' => 'opengl32',
'GLU' => 'glu32',
'SDL_gfx_blit' => 'SDL_gfx',
'GL' => 'opengl32',
'GLU' => 'glu32',
'SDL_gfx_blitfunc' => 'SDL_gfx',
'SDL_gfx_framerate' => 'SDL_gfx',
'SDL_gfx_imagefilter' => 'SDL_gfx',
'SDL_gfx_primitives' => 'SDL_gfx',
'SDL_gfx_rotozoom' => 'SDL_gfx',
);

while (my ($subsystem, $buildable) = each %$build_systems)
Expand Down
4 changes: 2 additions & 2 deletions src/GFX/BlitFunc.xs
Expand Up @@ -8,7 +8,7 @@

#include <SDL.h>

#ifdef HAVE_SDL_GFX_BLIT
#ifdef HAVE_SDL_GFX_BLITFUNC
#include <SDL_gfxBlitFunc.h>
#endif

Expand All @@ -24,6 +24,6 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX_BLIT
#ifdef HAVE_SDL_GFX_BLITFUNC

#endif
4 changes: 2 additions & 2 deletions src/GFX/FPSManager.xs
Expand Up @@ -8,7 +8,7 @@

#include <SDL.h>

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_FRAMERATE
#include <SDL_framerate.h>
#endif

Expand All @@ -31,7 +31,7 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_FRAMERATE

FPSmanager *
gfx_fps_new (CLASS, framecount, rateticks, lastticks, rate)
Expand Down
4 changes: 2 additions & 2 deletions src/GFX/Framerate.xs
Expand Up @@ -8,7 +8,7 @@

#include <SDL.h>

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_FRAMERATE
#include <SDL_framerate.h>
#endif

Expand All @@ -24,7 +24,7 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_FRAMERATE

void
gfx_frame_init(manager)
Expand Down
4 changes: 2 additions & 2 deletions src/GFX/ImageFilter.xs
Expand Up @@ -8,7 +8,7 @@

#include <SDL.h>

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_IMAGEFILTER
#include <SDL_imageFilter.h>
#endif

Expand All @@ -24,7 +24,7 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_IMAGEFILTER

int
gfx_image_MMX_detect()
Expand Down
4 changes: 2 additions & 2 deletions src/GFX/Primitives.xs
Expand Up @@ -7,7 +7,7 @@
#endif

#include <SDL.h>
#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_PRIMITIVES
#include <SDL_gfxPrimitives.h>
#endif

Expand Down Expand Up @@ -47,7 +47,7 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_PRIMITIVES

int
gfx_prim_pixel_color(dst, x, y, color)
Expand Down
4 changes: 2 additions & 2 deletions src/GFX/Rotozoom.xs
Expand Up @@ -7,7 +7,7 @@
#endif

#include <SDL.h>
#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_ROTOZOOM
#include <SDL_rotozoom.h>
#endif

Expand All @@ -23,7 +23,7 @@ See: L<http://www.ferzkopp.net/joomla/content/view/19/14/>

=cut

#ifdef HAVE_SDL_GFX
#ifdef HAVE_SDL_GFX_ROTOZOOM

SDL_Surface *
gfx_roto_surface(src, angle, zoom, smooth)
Expand Down
4 changes: 2 additions & 2 deletions t/gfx_fpsmanager.t
Expand Up @@ -14,9 +14,9 @@ if( !SDL::TestTool->init(SDL_INIT_VIDEO) )
{
plan( skip_all => 'Failed to init video' );
}
elsif( !SDL::Config->has('SDL_gfx') )
elsif( !SDL::Config->has('SDL_gfx_framerate') )
{
plan( skip_all => 'SDL_gfx support not compiled' );
plan( skip_all => 'SDL_gfx_framerate support not compiled' );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions t/gfx_primitives.t
Expand Up @@ -16,9 +16,9 @@ if( !SDL::TestTool->init(SDL_INIT_VIDEO) )
{
plan( skip_all => 'Failed to init video' );
}
elsif( !SDL::Config->has('SDL_gfx') )
elsif( !SDL::Config->has('SDL_gfx_primitives') )
{
plan( skip_all => 'SDL_gfx support not compiled' );
plan( skip_all => 'SDL_gfx_primitives support not compiled' );
}
else
{
Expand Down

0 comments on commit a4193cb

Please sign in to comment.