Skip to content

Commit

Permalink
Merge branch 'sdl_android' of github.com:pelya/commandergenius into a…
Browse files Browse the repository at this point in the history
…ndroid
  • Loading branch information
pelya committed Oct 1, 2012
2 parents 2be7538 + 63eaf5b commit fba7f61
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
12 changes: 8 additions & 4 deletions project/jni/application/fheroes2/AndroidAppSettings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ForceRelativeMouseMode=n
AppNeedsArrowKeys=n
AppNeedsTextInput=n
AppUsesJoystick=n
AppHandlesJoystickSensitivity=n
AppUsesAccelerometer=n
AppUsesMultitouch=n
NonBlockingSwapBuffers=n
RedefinedKeys="LCTRL T NO_REMAP NO_REMAP H"
Expand All @@ -34,14 +34,18 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions=''
FirstStartMenuOptions=''
MultiABI=n
AppVersionCode=286220
AppVersionName="2862.20"
AppVersionCode=288220
AppVersionName="2882.20"
ResetSdlConfigForThisVersion=n
DeleteFilesOnUpgrade="libsdl-DownloadFinished-5.flag libsdl-DownloadFinished-6.flag libsdl-DownloadFinished-7.flag libsdl-DownloadFinished-8.flag libsdl-DownloadFinished-9.flag libsdl-DownloadFinished-10.flag libsdl-DownloadFinished-11.flag libsdl-DownloadFinished-12.flag libsdl-DownloadFinished-13.flag libsdl-DownloadFinished-14.flag"
CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl"
CustomBuildScript=n
AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_DEBUG -DWITH_EDITOR'
AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_DEBUG -DWITH_EDITOR -frtti'
AppLdflags=''
AppSubdirsBuild='fheroes2/src/engine fheroes2/src/xmlccwrap fheroes2/src/fheroes2/agg fheroes2/src/fheroes2/ai fheroes2/src/fheroes2/ai/simple fheroes2/src/fheroes2/army fheroes2/src/fheroes2/battle fheroes2/src/fheroes2/castle fheroes2/src/fheroes2/dialog fheroes2/src/fheroes2/editor fheroes2/src/fheroes2/game fheroes2/src/fheroes2/gui fheroes2/src/fheroes2/heroes fheroes2/src/fheroes2/image fheroes2/src/fheroes2/kingdom fheroes2/src/fheroes2/maps fheroes2/src/fheroes2/monster fheroes2/src/fheroes2/objects fheroes2/src/fheroes2/pocketpc fheroes2/src/fheroes2/resource fheroes2/src/fheroes2/spell fheroes2/src/fheroes2/system fheroes2/src/fheroes2/test'
AppCmdline='fheroes2'
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
MinimumScreenSize=s
AdmobPublisherId=n
AdmobTestDeviceId=
AdmobBannerSize=
2 changes: 1 addition & 1 deletion project/jni/application/openarena/AndroidAppSettings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SdlVideoResizeKeepAspect=n
CompatibilityHacks=n
CompatibilityHacksStaticInit=n
CompatibilityHacksTextInputEmulatesHwKeyboard=n
AppUsesMouse=y
AppUsesMouse=n
AppNeedsTwoButtonMouse=n
ShowMouseCursor=n
ForceRelativeMouseMode=n
Expand Down
17 changes: 16 additions & 1 deletion project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ void SDL_ANDROID_VideoContextRecreated()
{
// Allocate HW texture
Uint32 format = PixelFormatEnumColorkey; // 1-bit alpha for color key, every surface will have colorkey so it's easier for us
int flags = HwSurfaceList[i]->flags;
if( HwSurfaceList[i]->format->Amask )
format = PixelFormatEnumAlpha;
if( HwSurfaceList[i] == SDL_CurrentVideoSurface )
Expand All @@ -1104,7 +1105,21 @@ void SDL_ANDROID_VideoContextRecreated()
}
if( SDL_ANDROID_VideoLinearFilter )
SDL_SetTextureScaleMode((SDL_Texture *)HwSurfaceList[i]->hwdata, SDL_SCALEMODE_SLOW);
ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics
if (flags & SDL_SRCALPHA)
{
int alpha = HwSurfaceList[i]->format->alpha;
ANDROID_SetHWAlpha(NULL, HwSurfaceList[i], alpha);
ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics
}
else if (flags & SDL_SRCCOLORKEY)
{
int colorkey = HwSurfaceList[i]->format->colorkey;
ANDROID_SetHWColorKey(NULL, HwSurfaceList[i], colorkey);
}
else
{
ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics
}
}
}
};
Expand Down

0 comments on commit fba7f61

Please sign in to comment.