Reverted Jooleem to use SW surfaces - it fails with HW
This commit is contained in:
@@ -3,5 +3,5 @@
|
|||||||
# Set here your own NDK path if needed
|
# Set here your own NDK path if needed
|
||||||
# export PATH=$PATH:~/src/endless_space/android-ndk-r4
|
# 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
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ AppUsesMouse=y
|
|||||||
AppNeedsArrowKeys=n
|
AppNeedsArrowKeys=n
|
||||||
AppUsesJoystick=n
|
AppUsesJoystick=n
|
||||||
MultiABI=n
|
MultiABI=n
|
||||||
AppVersionCode=01404
|
AppVersionCode=01403
|
||||||
AppVersionName="0.1.4.04"
|
AppVersionName="0.1.4.03"
|
||||||
CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
|
CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
|
||||||
AppCflags='-finline-functions -O2'
|
AppCflags='-finline-functions -O2'
|
||||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||||
|
|||||||
@@ -138,4 +138,4 @@ void UIProgressBar::Draw(SDL_Surface *screen)
|
|||||||
SDL_BlitSurface(m_flashingSurface, &m_clipRect, screen, &rect);
|
SDL_BlitSurface(m_flashingSurface, &m_clipRect, screen, &rect);
|
||||||
else
|
else
|
||||||
SDL_BlitSurface(m_normalSurface, &m_clipRect, screen, &rect);
|
SDL_BlitSurface(m_normalSurface, &m_clipRect, screen, &rect);
|
||||||
}
|
}
|
||||||
@@ -52,19 +52,16 @@ SDL_Surface* SurfaceManager::AddSurface(string ID, string fileName)
|
|||||||
|
|
||||||
// Load the image:
|
// Load the image:
|
||||||
SDL_Surface *surface = IMG_Load(fileName.c_str());
|
SDL_Surface *surface = IMG_Load(fileName.c_str());
|
||||||
|
|
||||||
TRAP(surface == NULL, "SurfaceManager::AddSurface() - Could not open " << fileName);
|
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:
|
// Convert it to the framebuffer's display format:
|
||||||
//SDL_Surface *converted = SDL_DisplayFormatAlpha(surface);
|
SDL_Surface *converted = SDL_DisplayFormatAlpha(surface);
|
||||||
//SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
|
|
||||||
m_map[ID] = surface;
|
m_map[ID] = converted;
|
||||||
|
|
||||||
return surface;
|
return converted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void Engine::Run()
|
|||||||
m_stateStack.back()->Update(this);
|
m_stateStack.back()->Update(this);
|
||||||
|
|
||||||
// Redraw only if necessary:
|
// Redraw only if necessary:
|
||||||
//if (m_redraw)
|
if (m_redraw)
|
||||||
m_stateStack.back()->Draw(this);
|
m_stateStack.back()->Draw(this);
|
||||||
|
|
||||||
m_redraw = false;
|
m_redraw = false;
|
||||||
@@ -277,7 +277,7 @@ void Engine::InitSDL()
|
|||||||
|
|
||||||
// Set the video mode:
|
// Set the video mode:
|
||||||
if((m_screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, vidInfo->vfmt->BitsPerPixel,
|
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() << ")");
|
ERR("Engine::InitSDL() - SDL_SetVideoMode failed (" << SDL_GetError() << ")");
|
||||||
}
|
}
|
||||||
@@ -306,14 +306,6 @@ void Engine::ShowLoadingScreen()
|
|||||||
TRAP(surface == NULL, "Engine::ShowLoadingScreen() - File not found");
|
TRAP(surface == NULL, "Engine::ShowLoadingScreen() - File not found");
|
||||||
|
|
||||||
SDL_FillRect(m_screen, NULL, 0x000000);
|
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);
|
SDL_BlitSurface(surface, NULL, m_screen, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user