Skip to content

Commit

Permalink
update after SDL_Swap rename in SDL3
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Jun 12, 2024
1 parent 8eff782 commit bda40af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/IMG_lbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ SDL_Surface *IMG_LoadLBM_IO(SDL_IOStream *src )

bytesloaded = 0;

size = SDL_SwapBE32( size );
size = SDL_Swap32BE( size );

if ( !SDL_memcmp( id, "BMHD", 4 ) ) /* Bitmap header */
{
Expand All @@ -173,13 +173,13 @@ SDL_Surface *IMG_LoadLBM_IO(SDL_IOStream *src )

bytesloaded = sizeof( BMHD );

bmhd.w = SDL_SwapBE16( bmhd.w );
bmhd.h = SDL_SwapBE16( bmhd.h );
bmhd.x = SDL_SwapBE16( bmhd.x );
bmhd.y = SDL_SwapBE16( bmhd.y );
bmhd.tcolor = SDL_SwapBE16( bmhd.tcolor );
bmhd.Lpage = SDL_SwapBE16( bmhd.Lpage );
bmhd.Hpage = SDL_SwapBE16( bmhd.Hpage );
bmhd.w = SDL_Swap16BE( bmhd.w );
bmhd.h = SDL_Swap16BE( bmhd.h );
bmhd.x = SDL_Swap16BE( bmhd.x );
bmhd.y = SDL_Swap16BE( bmhd.y );
bmhd.tcolor = SDL_Swap16BE( bmhd.tcolor );
bmhd.Lpage = SDL_Swap16BE( bmhd.Lpage );
bmhd.Hpage = SDL_Swap16BE( bmhd.Hpage );
}

if ( !SDL_memcmp( id, "CMAP", 4 ) ) /* palette ( Color Map ) */
Expand Down Expand Up @@ -209,7 +209,7 @@ SDL_Surface *IMG_LoadLBM_IO(SDL_IOStream *src )
}

bytesloaded = size;
viewmodes = SDL_SwapBE32( viewmodes );
viewmodes = SDL_Swap32BE( viewmodes );
if ( viewmodes & 0x0800 )
flagHAM = 1;
if ( viewmodes & 0x0080 )
Expand Down
10 changes: 5 additions & 5 deletions src/IMG_pcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ SDL_Surface *IMG_LoadPCX_IO(SDL_IOStream *src)
error = "file truncated";
goto done;
}
pcxh.Xmin = SDL_SwapLE16(pcxh.Xmin);
pcxh.Ymin = SDL_SwapLE16(pcxh.Ymin);
pcxh.Xmax = SDL_SwapLE16(pcxh.Xmax);
pcxh.Ymax = SDL_SwapLE16(pcxh.Ymax);
pcxh.BytesPerLine = SDL_SwapLE16(pcxh.BytesPerLine);
pcxh.Xmin = SDL_Swap16LE(pcxh.Xmin);
pcxh.Ymin = SDL_Swap16LE(pcxh.Ymin);
pcxh.Xmax = SDL_Swap16LE(pcxh.Xmax);
pcxh.Ymax = SDL_Swap16LE(pcxh.Ymax);
pcxh.BytesPerLine = SDL_Swap16LE(pcxh.BytesPerLine);

#if 0
printf("Manufacturer = %d\n", pcxh.Manufacturer);
Expand Down

0 comments on commit bda40af

Please sign in to comment.