Skip to content

Commit

Permalink
Reverted Jooleem to use SW surfaces - it fails with HW
Browse files Browse the repository at this point in the history
  • Loading branch information
pelya committed Jul 30, 2010
1 parent 491e1fc commit 831ee2d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion alienblaster/build.sh
Expand Up @@ -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

Expand Up @@ -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'
Expand Up @@ -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);
}
}
Expand Up @@ -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;
}


Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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() << ")");
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 831ee2d

Please sign in to comment.