Skip to content

Commit

Permalink
Fixed compile errors in example programs.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Dec 25, 2014
1 parent e8467cb commit 97e8766
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/testgamecontroller.c
Expand Up @@ -214,7 +214,7 @@ WatchGameController(SDL_GameController * gamecontroller)
emscripten_set_main_loop_arg(loop, gamecontroller, 0, 1);
#else
while (!done) {
loop(gamecontroler);
loop(gamecontroller);
}
#endif

Expand Down
12 changes: 5 additions & 7 deletions test/testgesture.c
Expand Up @@ -269,6 +269,9 @@ void loop()

int main(int argc, char* argv[])
{
window = NULL;
screen = NULL;
quitting = SDL_FALSE;

/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
Expand All @@ -279,13 +282,8 @@ int main(int argc, char* argv[])

if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;

if (!(screen = initScreen(WIDTH,HEIGHT)))
{
SDL_Quit();
return 1;
}

if (!(window = initWindow(NULL,WIDTH,HEIGHT)))
if (!(window = initWindow(window, WIDTH, HEIGHT)) ||
!(screen = SDL_GetWindowSurface(window)))
{
SDL_Quit();
return 1;
Expand Down
13 changes: 13 additions & 0 deletions test/testmultiaudio.c
Expand Up @@ -54,7 +54,9 @@ void
loop()
{
if(cbd[0].done) {
#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop();
#endif
SDL_PauseAudioDevice(cbd[0].dev, 1);
SDL_CloseAudioDevice(cbd[0].dev);
SDL_FreeWAV(sound);
Expand Down Expand Up @@ -145,6 +147,17 @@ test_multi_audio(int devcount)

SDL_Delay(100);
}

#ifndef __EMSCRIPTEN__
for (i = 0; i < devcount; i++) {
if (cbd[i].dev) {
SDL_PauseAudioDevice(cbd[i].dev, 1);
SDL_CloseAudioDevice(cbd[i].dev);
}
}

SDL_Log("All done!\n");
#endif
}


Expand Down

0 comments on commit 97e8766

Please sign in to comment.