Skip to content

Commit

Permalink
Cleanup PR
Browse files Browse the repository at this point in the history
  • Loading branch information
MBeijer authored May 15, 2021
1 parent ce14716 commit 065b715
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 68 deletions.
2 changes: 1 addition & 1 deletion include/SDL_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "SDL_config_os2.h"
#elif defined(__amigaos4__)
#include "SDL_config_amigaos4.h"
#elif defined(__AMIGA__) && !defined(__amigaos4__)
#elif defined(__amigaos3__)
#include "SDL_config_amiga.h"
#else
#include "SDL_config_minimal.h"
Expand Down
2 changes: 1 addition & 1 deletion src/audio/SDL_sysaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "SDL_mutex.h"
#include "SDL_thread.h"

#if defined(__AMIGA__) && !defined(__amigaos4__)
#if defined(__amigaos3__)
#include <exec/exec.h>
#include <dos/dos.h>
#if defined(__SASC) || defined(WARPOS)
Expand Down
2 changes: 1 addition & 1 deletion src/timer/SDL_systimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ extern int SDL_SYS_StartTimer(void);
/* Stop a previously started timer */
extern void SDL_SYS_StopTimer(void);

#if defined(__AMIGA__) && !defined(__amigaos4__)
#if defined(__amigaos3__)
extern void amiga_quit_timer(void);
#endif
8 changes: 2 additions & 6 deletions src/video/SDL_RLEaccel.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Original version by Sam Lantinga
*
* Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and
* Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and
* decoder. Added per-surface alpha blitter. Added per-pixel alpha
* format, encoder and blitter.
*
Expand Down Expand Up @@ -1645,9 +1645,8 @@ static int RLEColorkeySurface(SDL_Surface *surface)
Uint8 *rlebuf, *dst;
int maxn;
int y;
Uint8 *srcbuf, *curbuf, *lastline;
Uint8 *srcbuf, *lastline;
int maxsize = 0;
int skip, run;
int bpp = surface->format->BytesPerPixel;
getpix_func getpix;
Uint32 ckey, rgbmask;
Expand Down Expand Up @@ -1681,9 +1680,7 @@ static int RLEColorkeySurface(SDL_Surface *surface)

/* Set up the conversion */
srcbuf = (Uint8 *)surface->pixels;
curbuf = srcbuf;
maxn = bpp == 4 ? 65535 : 255;
skip = run = 0;
dst = rlebuf;
rgbmask = ~surface->format->Amask;
ckey = surface->format->colorkey & rgbmask;
Expand Down Expand Up @@ -1941,4 +1938,3 @@ void SDL_UnRLESurface(SDL_Surface *surface, int recode)
}
}


5 changes: 2 additions & 3 deletions src/video/SDL_blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "mmx.h"
#endif

#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
#include "blitapollo.h"
#endif

Expand Down Expand Up @@ -158,7 +158,7 @@ static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len)

static void SDL_BlitCopy(SDL_BlitInfo *info)
{
#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
ApolloCopyRect( info->s_pixels, info->d_pixels,
info->s_skip, info->d_skip,
info->d_width*info->dst->BytesPerPixel,
Expand Down Expand Up @@ -368,4 +368,3 @@ int SDL_CalculateBlit(SDL_Surface *surface)
}
return(0);
}

3 changes: 1 addition & 2 deletions src/video/SDL_blit_A.c
Original file line number Diff line number Diff line change
Expand Up @@ -2785,7 +2785,7 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index)
SDL_PixelFormat *sf = surface->format;
SDL_PixelFormat *df = surface->map->dst->format;

#if defined(APOLLO_BLITDBG)
#if defined(__amigaos3__) && defined(APOLLO_BLITDBG)
printf("SDL_CalculateAlphaBlit amask %d sBPP %d dBPP %d\n",sf->Amask,sf->BytesPerPixel,df->BytesPerPixel);
#endif

Expand Down Expand Up @@ -2958,4 +2958,3 @@ SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index)
}
}
}

14 changes: 7 additions & 7 deletions src/video/SDL_blit_N.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum blit_features {
BLIT_FEATURE_HAS_ARM_SIMD = 8
};

#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
#include "blitapollo.h"
#include "colorkeyapollo.h"
#endif
Expand Down Expand Up @@ -2469,7 +2469,7 @@ static void BlitNto1Key(SDL_BlitInfo *info)

static void Blit2to2Key(SDL_BlitInfo *info)
{
#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
ApolloKeyRGB565toRGB565( // works with 555, too (unless 1 bit is defined as alpha, ofc)
(Uint8 *)info->s_pixels,
(Uint8 *)info->d_pixels,
Expand Down Expand Up @@ -2879,7 +2879,7 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
}
}

#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)

#define APOLLOCONVERT( __a__ ) \
static void Convert##__a__ (SDL_BlitInfo *info);\
Expand Down Expand Up @@ -3132,7 +3132,7 @@ static const struct blit_table normal_blit_2[] = {
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
};
static const struct blit_table normal_blit_3[] = {
#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, (void*)(1), ConvertApolloRGBtoRGB565, NO_ALPHA },
{ 0x000000FF,0x0000FF00,0x00FF0000, 2, 0x0000F800,0x000007E0,0x0000001F,
Expand Down Expand Up @@ -3220,7 +3220,7 @@ static const struct blit_table normal_blit_4[] = {
{ 0x000000FF,0x0000FF00,0x00FF0000, 4, 0x00FF0000,0x0000FF00,0x000000FF,
BLIT_FEATURE_HAS_ARM_SIMD, NULL, Blit_BGR888_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA },
#endif
#if defined(APOLLO_BLIT)
#if defined(__amigaos3__) && defined(APOLLO_BLIT)
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
0, (void*)(1), ConvertApolloARGBtoRGB565, NO_ALPHA },
{ 0x0000FF00,0x00FF0000,0xFF000000, 2, 0x0000001F,0x000007E0,0x0000F800,
Expand Down Expand Up @@ -3287,7 +3287,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
srcfmt = surface->format;
dstfmt = surface->map->dst->format;

#if defined(APOLLO_BLITDBG)
#if defined(__amigaos3__) && defined(APOLLO_BLITDBG)
printf("SDL_CalculateBlitN from BPP %d to BPP %d blit_index %d AMask %x ",srcfmt->BytesPerPixel,dstfmt->BytesPerPixel,blit_index,srcfmt->Amask);
printf("Src %x %x %x Dst %x %x %x\n",
srcfmt->Rmask,
Expand Down Expand Up @@ -3395,7 +3395,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
}
}

#if defined(APOLLO_BLITDBG)
#if defined(__amigaos3__) && defined(APOLLO_BLITDBG)
if( sdata->aux_data == (void*)(1) )
{
printf("AMMX blit ");
Expand Down
7 changes: 3 additions & 4 deletions src/video/SDL_surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
} else {
screen = NULL;
}

if ( screen && ((screen->flags&SDL_HWSURFACE) == SDL_HWSURFACE) ) {
if ( (flags&(SDL_SRCCOLORKEY|SDL_SRCALPHA)) != 0 ) {
flags |= SDL_HWSURFACE;
Expand Down Expand Up @@ -425,7 +424,7 @@ int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect,
SDL_blit do_blit;
SDL_Rect hw_srcrect;
SDL_Rect hw_dstrect;
#if defined(__AMIGA__) && !defined(__amigaos4__)
#if defined(__amigaos3__)
int skipflag = 0;

/* applies to software blitting only */
Expand All @@ -450,7 +449,7 @@ int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect,
return(-1);
}
}
#if defined(__AMIGA__) && !defined(__amigaos4__)
#if defined(__amigaos3__)
}
#endif

Expand Down Expand Up @@ -481,7 +480,7 @@ int SDL_UpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
{
SDL_Rect fulldst;
int srcx, srcy, w, h;
#if defined(__AMIGA__) && !defined(__amigaos4__)
#if defined(__amigaos3__)
extern int toggle,skipframe;
#endif
/* Make sure the surfaces aren't locked */
Expand Down
Loading

0 comments on commit 065b715

Please sign in to comment.