mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 07:01:21 +02:00
- added screenshot file format to options menu
- more cleanup from things discovered with valgrind. - added an environment variable to use with openal so it is possible to specify which sound device to use if needed down the road
This commit is contained in:
@@ -31,19 +31,23 @@ ContextGl::ContextGl() : Context() {
|
||||
|
||||
}
|
||||
|
||||
void ContextGl::init(){
|
||||
void ContextGl::init() {
|
||||
pcgl.init(colorBits, depthBits, stencilBits, (hardware_acceleration != 0), (fullscreen_anti_aliasing != 0));
|
||||
}
|
||||
|
||||
void ContextGl::end(){
|
||||
ContextGl::~ContextGl() {
|
||||
end();
|
||||
}
|
||||
|
||||
void ContextGl::end() {
|
||||
pcgl.end();
|
||||
}
|
||||
|
||||
void ContextGl::makeCurrent(){
|
||||
void ContextGl::makeCurrent() {
|
||||
pcgl.makeCurrent();
|
||||
}
|
||||
|
||||
void ContextGl::swapBuffers(){
|
||||
void ContextGl::swapBuffers() {
|
||||
pcgl.swapBuffers();
|
||||
}
|
||||
|
||||
|
@@ -78,6 +78,8 @@
|
||||
LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * data)
|
||||
{
|
||||
struct xmlparser parser;
|
||||
memset(&parser,0,sizeof(parser));
|
||||
|
||||
/* xmlparser object */
|
||||
parser.xmlstart = buffer;
|
||||
parser.xmlsize = bufsize;
|
||||
|
@@ -42,6 +42,7 @@ ParseNameValue(const char * buffer, int bufsize,
|
||||
struct NameValueParserData * data)
|
||||
{
|
||||
struct xmlparser parser;
|
||||
memset(&parser,0,sizeof(parser));
|
||||
LIST_INIT(&(data->head));
|
||||
/* init xmlparser object */
|
||||
parser.xmlstart = buffer;
|
||||
|
@@ -38,21 +38,7 @@ PlatformContextGl::PlatformContextGl() {
|
||||
PlatformContextGl::~PlatformContextGl() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(icon != NULL) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
SDL_FreeSurface(icon);
|
||||
icon = NULL;
|
||||
}
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(screen != NULL) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
SDL_FreeSurface(screen);
|
||||
screen = NULL;
|
||||
}
|
||||
end();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
@@ -131,6 +117,25 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool
|
||||
}
|
||||
|
||||
void PlatformContextGl::end() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(icon != NULL) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
SDL_FreeSurface(icon);
|
||||
icon = NULL;
|
||||
}
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(screen != NULL) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
SDL_FreeSurface(screen);
|
||||
screen = NULL;
|
||||
}
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void PlatformContextGl::makeCurrent() {
|
||||
|
@@ -322,7 +322,10 @@ bool SoundPlayerOpenAL::init(const SoundPlayerParams* params) {
|
||||
this->params = *params;
|
||||
|
||||
try {
|
||||
device = alcOpenDevice(0);
|
||||
// Allows platforms to specify which sound device to use
|
||||
// using the environment variable: MEGAGLEST_SOUND_DEVICE
|
||||
char *deviceName = getenv("MEGAGLEST_SOUND_DEVICE");
|
||||
device = alcOpenDevice(deviceName);
|
||||
if(device == 0) {
|
||||
printOpenALInfo();
|
||||
throw std::runtime_error("Couldn't open audio device.");
|
||||
|
@@ -291,6 +291,12 @@ SystemFlags::~SystemFlags() {
|
||||
SystemFlags::cleanupHTTP(&curl_handle, true);
|
||||
curl_handle = NULL;
|
||||
}
|
||||
if(SystemFlags::curl_global_init_called == true) {
|
||||
SystemFlags::curl_global_init_called = false;
|
||||
curl_global_cleanup();
|
||||
//printf("In [%s::%s Line %d] curl_global_cleanup called\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user