summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 10:40:11 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-29 10:40:11 +0200
commit677ce3960cd13cbf994311c76d75b343b22fd480 (patch)
treeee2bab43ec29cdf94d8c1173ee022fe95c2a0222 /src/app
parent77952a85e63ca13dd9cfc93c7b6a271d7c91e59a (diff)
downloadcolobot-677ce3960cd13cbf994311c76d75b343b22fd480.tar.gz
colobot-677ce3960cd13cbf994311c76d75b343b22fd480.tar.bz2
colobot-677ce3960cd13cbf994311c76d75b343b22fd480.zip
Some fixes and optimizations
- fixed 2nd texture setting - added padding to some structs for faster access - changed rendering primitives to glDrawArrays() - optimized texture modesetting calls - fixed some valgrind errors
Diffstat (limited to 'src/app')
-rw-r--r--src/app/app.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp
index 00977d1..0b9aae6 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -357,7 +357,7 @@ bool CApplication::Create()
/* SDL initialization sequence */
- Uint32 initFlags = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER;
+ Uint32 initFlags = SDL_INIT_VIDEO | SDL_INIT_TIMER;
if (SDL_Init(initFlags) < 0)
{
@@ -368,6 +368,12 @@ bool CApplication::Create()
return false;
}
+ // This is non-fatal and besides seems to fix some memory leaks
+ if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
+ {
+ GetLogger()->Warn("Joystick subsystem init failed\nJoystick(s) will not be available\n");
+ }
+
if ((IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG) == 0)
{
m_errorMessage = std::string("SDL_Image initialization error:\n") +
@@ -398,10 +404,6 @@ bool CApplication::Create()
SDL_JoystickEventState(SDL_IGNORE);
- // For now, enable joystick for testing
- SetJoystickEnabled(true);
-
-
// The video is ready, we can create and initalize the graphics device
m_device = new Gfx::CGLDevice(m_deviceConfig);
if (! m_device->Create() )