Reverted Jooleem to use SW surfaces - it fails with HW

This commit is contained in:
pelya
2010-07-30 14:59:31 +03:00
parent 491e1fcda4
commit 831ee2ddb5
5 changed files with 11 additions and 22 deletions

View File

@@ -3,5 +3,5 @@
# Set here your own NDK path if needed
# export PATH=$PATH:~/src/endless_space/android-ndk-r4
cd project && nice -n5 ndk-build V=1 && ant debug && cd bin && adb install -r DemoActivity-debug.apk
cd project && nice -n5 ndk-build -j2 V=1 && ant debug && cd bin && adb install -r DemoActivity-debug.apk

View File

@@ -9,8 +9,8 @@ AppUsesMouse=y
AppNeedsArrowKeys=n
AppUsesJoystick=n
MultiABI=n
AppVersionCode=01404
AppVersionName="0.1.4.04"
AppVersionCode=01403
AppVersionName="0.1.4.03"
CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
AppCflags='-finline-functions -O2'
ReadmeText='^You may press "Home" now - the data will be downloaded in background'

View File

@@ -138,4 +138,4 @@ void UIProgressBar::Draw(SDL_Surface *screen)
SDL_BlitSurface(m_flashingSurface, &m_clipRect, screen, &rect);
else
SDL_BlitSurface(m_normalSurface, &m_clipRect, screen, &rect);
}
}

View File

@@ -52,19 +52,16 @@ SDL_Surface* SurfaceManager::AddSurface(string ID, string fileName)
// Load the image:
SDL_Surface *surface = IMG_Load(fileName.c_str());
TRAP(surface == NULL, "SurfaceManager::AddSurface() - Could not open " << fileName);
SDL_Surface *surface2 = SDL_DisplayFormat(surface);
SDL_FreeSurface(surface);
surface = surface2;
TRAP(surface == NULL, "SurfaceManager::AddSurface() - Could not convert to HW surface " << fileName);
// Convert it to the framebuffer's display format:
//SDL_Surface *converted = SDL_DisplayFormatAlpha(surface);
//SDL_FreeSurface(surface);
SDL_Surface *converted = SDL_DisplayFormatAlpha(surface);
SDL_FreeSurface(surface);
m_map[ID] = surface;
m_map[ID] = converted;
return surface;
return converted;
}

View File

@@ -143,7 +143,7 @@ void Engine::Run()
m_stateStack.back()->Update(this);
// Redraw only if necessary:
//if (m_redraw)
if (m_redraw)
m_stateStack.back()->Draw(this);
m_redraw = false;
@@ -277,7 +277,7 @@ void Engine::InitSDL()
// Set the video mode:
if((m_screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, vidInfo->vfmt->BitsPerPixel,
SDL_HWSURFACE|SDL_DOUBLEBUF)) == 0) /* The code does not support SDL_DOUBLEBUF, I wonder how it worked before */
SDL_SWSURFACE )) == 0) /* The code does not support SDL_DOUBLEBUF, I wonder how it worked before */
{
ERR("Engine::InitSDL() - SDL_SetVideoMode failed (" << SDL_GetError() << ")");
}
@@ -306,14 +306,6 @@ void Engine::ShowLoadingScreen()
TRAP(surface == NULL, "Engine::ShowLoadingScreen() - File not found");
SDL_FillRect(m_screen, NULL, 0x000000);
SDL_Surface *surface2 = SDL_DisplayFormat(surface);
SDL_FreeSurface(surface);
surface = surface2;
SDL_BlitSurface(surface, NULL, m_screen, NULL);
SDL_Flip(m_screen);
SDL_BlitSurface(surface, NULL, m_screen, NULL);