1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 12:25:12 +03:00

Proper SDL library initialization for Audio and Joystick subsystems (ported from master)

This commit is contained in:
Damjan Adamic 2015-04-25 17:27:31 +02:00
parent df2318a45d
commit 2a667d1d53
5 changed files with 55 additions and 5 deletions

View file

@ -42,6 +42,9 @@
#include "opentx.h"
#include <time.h>
#include <ctype.h>
#if defined(SIMU_AUDIO)
#include <SDL.h>
#endif
#if LCD_W > 212
#define LCD_ZOOM 1
@ -95,6 +98,10 @@ Open9xSim::Open9xSim(FXApp* a):
memset(displayBuf, 0, DISPLAY_BUFER_SIZE);
bmp = new FXPPMImage(getApp(),NULL,IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2);
#if defined(SIMU_AUDIO)
SDL_Init(SDL_INIT_AUDIO);
#endif
FXHorizontalFrame *hf11=new FXHorizontalFrame(this,LAYOUT_CENTER_X);
FXHorizontalFrame *hf1=new FXHorizontalFrame(this,LAYOUT_FILL_X);
@ -152,6 +159,10 @@ Open9xSim::~Open9xSim()
}
delete bmf;
#if defined(SIMU_AUDIO)
SDL_Quit();
#endif
}
void Open9xSim::makeSnapshot(const FXDrawable* drawable)