Skip to content

Commit ffa2a51

Browse files
authored
Remove unused code from library_sdl.js. NFC (#18986)
This came out of the work I'm doing on #18979 - SDL_malloc/SDL_free are not declared in the SDL header but instead defined to malloc/free (because we define HAVE_MALLOC). - Mix_PlayChannel is defined to Mix_PlayChannelTimes in the header. - SDL_BlitScaled/SDL_BlitSurface are defined to SDL_UpperBlitScaled and SDL_UpperBlit respectively. - SDL_UnlockMutex and SDL_LockMutex are defined to SDL_mutexV and SDL_mutexP. - SDL_LoadBMP is defined as SDL_LoadBMP_RW
1 parent 31702da commit ffa2a51

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

src/library_sdl.js

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,18 +1845,6 @@ var LibrarySDL = {
18451845

18461846
SDL_SetError: function() {},
18471847

1848-
SDL_malloc__sig: 'ii',
1849-
SDL_malloc__deps: ['malloc'],
1850-
SDL_malloc: function(size) {
1851-
return _malloc(size);
1852-
},
1853-
1854-
SDL_free__sig: 'vi',
1855-
SDL_free__deps: ['free'],
1856-
SDL_free: function(ptr) {
1857-
_free(ptr);
1858-
},
1859-
18601848
SDL_CreateRGBSurface__deps: ['malloc', 'free'],
18611849
SDL_CreateRGBSurface__proxy: 'sync',
18621850
SDL_CreateRGBSurface__sig: 'iiiiiiiii',
@@ -1990,18 +1978,6 @@ var LibrarySDL = {
19901978
return 0;
19911979
},
19921980

1993-
SDL_BlitSurface__proxy: 'sync',
1994-
SDL_BlitSurface__sig: 'iiiii',
1995-
SDL_BlitSurface: function(src, srcrect, dst, dstrect) {
1996-
return SDL.blitSurface(src, srcrect, dst, dstrect, false);
1997-
},
1998-
1999-
SDL_BlitScaled__proxy: 'sync',
2000-
SDL_BlitScaled__sig: 'iiiii',
2001-
SDL_BlitScaled: function(src, srcrect, dst, dstrect) {
2002-
return SDL.blitSurface(src, srcrect, dst, dstrect, true);
2003-
},
2004-
20051981
zoomSurface: function(src, x, y, smooth) {
20061982
var srcData = SDL.surfaces[src];
20071983
var w = srcData.width * x;
@@ -2400,7 +2376,6 @@ var LibrarySDL = {
24002376
cleanup();
24012377
}
24022378
},
2403-
SDL_LoadBMP: 'IMG_Load',
24042379
SDL_LoadBMP_RW: 'IMG_Load_RW',
24052380

24062381
IMG_Load__deps: ['IMG_Load_RW', 'SDL_RWFromFile'],
@@ -2682,8 +2657,6 @@ var LibrarySDL = {
26822657
SDL_UnlockAudio: function() {},
26832658

26842659
SDL_CreateMutex: function() { return 0 },
2685-
SDL_LockMutex: function() {},
2686-
SDL_UnlockMutex: function() {},
26872660
SDL_mutexP: function() { return 0 },
26882661
SDL_mutexV: function() { return 0 },
26892662
SDL_DestroyMutex: function() {},
@@ -2931,9 +2904,9 @@ var LibrarySDL = {
29312904
Mix_ReserveChannels: function(num) {
29322905
SDL.channelMinimumNumber = num;
29332906
},
2934-
Mix_PlayChannel__proxy: 'sync',
2935-
Mix_PlayChannel__sig: 'iiii',
2936-
Mix_PlayChannel: function(channel, id, loops) {
2907+
Mix_PlayChannelTimed__proxy: 'sync',
2908+
Mix_PlayChannelTimed__sig: 'iiii',
2909+
Mix_PlayChannelTimed: function(channel, id, loops) {
29372910
// TODO: handle fixed amount of N loops. Currently loops either 0 or infinite times.
29382911

29392912
// Get the audio element associated with the ID
@@ -2984,7 +2957,6 @@ var LibrarySDL = {
29842957
audio.play();
29852958
return channel;
29862959
},
2987-
Mix_PlayChannelTimed: 'Mix_PlayChannel', // XXX ignore Timing
29882960

29892961
Mix_FadingChannel: function(channel) {
29902962
return 0; // MIX_NO_FADING, TODO

0 commit comments

Comments
 (0)