Skip to content

Commit

Permalink
Merge branch 'master' of github.com:supertuxkart/stk-code
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Dec 31, 2017
2 parents f783be4 + 7c10a55 commit 28bc8c8
Show file tree
Hide file tree
Showing 63 changed files with 1,165 additions and 330 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -60,6 +60,7 @@ android/bin
android/build
android/libs
android/obj
android/res
android/.gradle
android-*
*.apk
Expand Down
35 changes: 0 additions & 35 deletions android/README.ANDROID
Expand Up @@ -143,38 +143,3 @@ you have to run:
and then:

zipalign -v 4 SuperTuxKart-release-unsigned.apk SuperTuxKart-release.apk



--------------------------------------------------------------------------------
KNOWN ISSUES
--------------------------------------------------------------------------------

1. It's not possible to compile STK for Android < 4.4 due to missing GLES 3.0
functions. It is technically possible to do - check GLES context version,
load OpenGL functions dynamically using EGL, and if they are not loaded
properly, then fallback to GLES 2.0.

2. It never ocurred for me, but it's possible that EGL context is lost in some
cases. SuperTuxKart is not designed to re-create all textures at any moment,
so this is a "Wontfix", at least for now.

3. We use "exit(0)" at the end of main function. We shouldn't do it and we
should just return from the main function. But STK uses some global
variables and their values are remembered when the game is restarted. We
should properly clear them or re-initialize on startup. Using the "exit(0)"
is not-that-bad workaround, but it may cause a crash on exit sometimes.
It seems to affect only Android 5.0. More information about the crash:
https://code.google.com/p/android/issues/detail?id=160824

4. STK crashes on startup on some devices when aarch64 build is made using
Android r13 NDK. The r13 version has rather big modifications (it uses clang
instead of gcc by default). This is probably a bug in NDK/compiler/OS, but
for this reason using NDK r12 for 64-bit arm compilation is preferred.

5. Angelscript doesn't have full support for aarch64 builds, so that scripting
won't work on this platform.

6. Turning left/right using accelerometer is available, but at this stage the
default screen orientation is not automatically detected and user must
manually choose if he needs "phone" or "tablet" accelerometer.
Binary file added android/icon-dbg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
37 changes: 37 additions & 0 deletions android/make.sh
Expand Up @@ -36,6 +36,13 @@ export HOST_AARCH64=aarch64-linux-android
export NDK_PLATFORM_AARCH64=android-21
export SDK_VERSION_AARCH64=21

export APP_NAME_RELEASE="SuperTuxKart"
export APP_NAME_DEBUG="SuperTuxKart Debug"
export PACKAGE_NAME_RELEASE="org.supertuxkart.stk"
export PACKAGE_NAME_DEBUG="org.supertuxkart.stk_dev"
export APP_ICON_RELEASE="$DIRNAME/icon.png"
export APP_ICON_DEBUG="$DIRNAME/icon-dbg.png"


# A helper function that checks if error ocurred
check_error()
Expand All @@ -52,6 +59,7 @@ if [ ! -z "$1" ] && [ "$1" = "clean" ]; then
rm -rf build
rm -rf libs
rm -rf obj
rm -rf res
rm -rf .gradle
exit
fi
Expand Down Expand Up @@ -108,10 +116,16 @@ if [ "$BUILD_TYPE" = "debug" ] || [ "$BUILD_TYPE" = "Debug" ]; then
export ANT_BUILD_TYPE="debug"
export GRADLE_BUILD_TYPE="assembleDebug"
export IS_DEBUG_BUILD=1
export APP_NAME="$APP_NAME_DEBUG"
export PACKAGE_NAME="$PACKAGE_NAME_DEBUG"
export APP_ICON="$APP_ICON_DEBUG"
elif [ "$BUILD_TYPE" = "release" ] || [ "$BUILD_TYPE" = "Release" ]; then
export ANT_BUILD_TYPE="release"
export GRADLE_BUILD_TYPE="assembleRelease"
export IS_DEBUG_BUILD=0
export APP_NAME="$APP_NAME_RELEASE"
export PACKAGE_NAME="$PACKAGE_NAME_RELEASE"
export APP_ICON="$APP_ICON_RELEASE"
else
echo "Unsupported BUILD_TYPE: $BUILD_TYPE. Possible values are: " \
"debug, release"
Expand Down Expand Up @@ -342,8 +356,31 @@ check_error
# Build apk
echo "Building APK"

mkdir -p "$DIRNAME/res/drawable/"
mkdir -p "$DIRNAME/res/drawable-hdpi/"
mkdir -p "$DIRNAME/res/drawable-mdpi/"
mkdir -p "$DIRNAME/res/drawable-xhdpi/"
mkdir -p "$DIRNAME/res/drawable-xxhdpi/"
mkdir -p "$DIRNAME/res/values/"

STRINGS_FILE="$DIRNAME/res/values/strings.xml"

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>" > "$STRINGS_FILE"
echo "<resources>" >> "$STRINGS_FILE"
echo " <string name=\"app_name\">$APP_NAME</string>" >> "$STRINGS_FILE"
echo "</resources>" >> "$STRINGS_FILE"

sed -i "s/minSdkVersion=\".*\"/minSdkVersion=\"$SDK_VERSION\"/g" \
"$DIRNAME/AndroidManifest.xml"

sed -i "s/package=\".*\"/package=\"$PACKAGE_NAME\"/g" \
"$DIRNAME/AndroidManifest.xml"

cp "$APP_ICON" "$DIRNAME/res/drawable/icon.png"
convert -scale 72x72 "$APP_ICON" "$DIRNAME/res/drawable-hdpi/icon.png"
convert -scale 48x48 "$APP_ICON" "$DIRNAME/res/drawable-mdpi/icon.png"
convert -scale 96x96 "$APP_ICON" "$DIRNAME/res/drawable-xhdpi/icon.png"
convert -scale 144x144 "$APP_ICON" "$DIRNAME/res/drawable-xxhdpi/icon.png"


if [ "$BUILD_TOOL" = "gradle" ]; then
Expand Down
Binary file removed android/res/drawable-hdpi/icon.png
Binary file not shown.
Binary file removed android/res/drawable-mdpi/icon.png
Binary file not shown.
Binary file removed android/res/drawable-xhdpi/icon.png
Binary file not shown.
Binary file removed android/res/drawable-xxhdpi/icon.png
Binary file not shown.
4 changes: 0 additions & 4 deletions android/res/values/strings.xml

This file was deleted.

29 changes: 29 additions & 0 deletions data/gui/online/lan.stkgui
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>

<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="Local Networking"/>

<spacer height="5%" width="10"/>
<icon id="logo" align="center" proportion="1" width="100%" icon="gui/logo.png"/>
<spacer height="5%" width="10"/>

<buttonbar id="lan" proportion="1" width="90%" align="center">
<icon-button id="find_lan_server" width="128" height="128"
icon="gui/online/menu_find_server.png" focus_icon="gui/online/menu_find_server_hover.png"
I18N="In the online multiplayer screen" text="Find Server"/>
<icon-button id="create_lan_server" width="128" height="128"
icon="gui/online/menu_create_server.png" focus_icon="gui/online/menu_create_server_hover.png"
I18N="In the online multiplayer screen" text="Create Server"/>
<!--
<icon-button id="manage_user" width="128" height="128"
icon="gui/options_players.png"
I18N="In the online multiplayer screen" text="Users"/>
-->
</buttonbar>

<spacer height="10%" width="10"/>

</div>
</stkgui>
29 changes: 29 additions & 0 deletions data/gui/online/online.stkgui
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="0" y="0" width="100%" height="100%" layout="vertical-row" >
<header text_align="center" width="80%" align="center" text="Online"/>
<spacer height="15" width="10"/>
<button id="user-id" width="20%" height="fit" align="center"/>
<spacer height="15" width="10"/>
<icon id="logo" align="center" proportion="4" width="100%" icon="gui/logo.png"/>

<spacer height="15" width="10"/>

<buttonbar id="menu_toprow" proportion="3" width="90%" align="center">
<icon-button id="lan" width="128" height="128"
icon="gui/menu_multi.png" focus_icon="gui/menu_multi_focus.png"
I18N="Networking menu button" text="Local Networking"/>
<icon-button id="wan" width="128" height="128"
icon="gui/menu_multi.png" focus_icon="gui/menu_multi_focus.png"
I18N="Networking menu button" text="Global Networking"/>
<icon-button id="online" width="128" height="128"
icon="gui/menu_online.png" focus_icon="gui/menu_online_focus.png"
I18N="Networking menu button" text="Your profile"/>
</buttonbar>

<spacer height="10%" width="10"/>

</div>

<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>
1 change: 0 additions & 1 deletion data/gui/online/profile_achievements_tab.stkgui
Expand Up @@ -9,7 +9,6 @@
<spacer height="25" width="10"/>

<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_servers" width="128" height="128" icon="gui/main_network.png"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/gp_copy.png"
I18N="Section in the profile screen" text="Achievements"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png"/>
Expand Down
1 change: 0 additions & 1 deletion data/gui/online/profile_friends.stkgui
Expand Up @@ -9,7 +9,6 @@
<spacer height="25" width="10"/>

<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_servers" width="128" height="128" icon="gui/main_network.png"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/gp_copy.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png"
I18N="Section in the profile screen" text="Friends"/>
Expand Down
74 changes: 20 additions & 54 deletions data/gui/online/profile_servers.stkgui
Expand Up @@ -3,59 +3,25 @@
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>

<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header id="title" text_align="center" width="80%" align="center" text="..."/>

<spacer height="25" width="10"/>

<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_servers" width="128" height="128" icon="gui/main_network.png" I18N="Section in the profile screen" text="Servers"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/gp_copy.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" />
<icon-button id="tab_settings" width="128" height="128" icon="gui/main_options.png" />
</tabs>

<box proportion="1" width="100%" layout="vertical-row">
<div x="1%" y="2%" width="98%" height="96%" layout="vertical-row" >

<spacer height="5%" width="25"/>

<box width="100%" proportion="1" padding="10" layout="vertical-row">
<bright width="100%" text="Local Networking" align="center" text_align="left" />

<buttonbar id="lan" proportion="2" width="90%" align="center">
<icon-button id="find_lan_server" width="128" height="128"
icon="gui/online/menu_find_server.png" focus_icon="gui/online/menu_find_server_hover.png"
I18N="In the online multiplayer screen" text="Find Server"/>
<icon-button id="create_lan_server" width="128" height="128"
icon="gui/online/menu_create_server.png" focus_icon="gui/online/menu_create_server_hover.png"
I18N="In the online multiplayer screen" text="Create Server"/>
<!--
<icon-button id="manage_user" width="128" height="128"
icon="gui/options_players.png"
I18N="In the online multiplayer screen" text="Users"/>
-->
</buttonbar>
</box>

<spacer height="5%" width="25"/>

<box width="100%" proportion="1" padding="10" layout="vertical-row">
<bright width="100%" text="Global Networking" align="center" text_align="left" />

<buttonbar id="wan" proportion="2" width="90%" align="center">
<icon-button id="find_wan_server" width="128" height="128"
icon="gui/online/menu_find_server.png" focus_icon="gui/online/menu_find_server_hover.png"
I18N="In the online multiplayer screen" text="Find Server"/>
<icon-button id="create_wan_server" width="128" height="128"
icon="gui/online/menu_create_server.png" focus_icon="gui/online/menu_create_server_hover.png"
I18N="In the online multiplayer screen" text="Create Server"/>
<icon-button id="quick_wan_play" width="128" height="128"
icon="gui/online/menu_quick_play.png" focus_icon="gui/online/menu_quick_play_hover.png"
I18N="In the online multiplayer screen" text="Quick Play"/>
</buttonbar>
</box>

</div>
</box>
<header id="title" text_align="center" width="80%" align="center" text="Global Networking"/>

<spacer height="5%" width="10"/>
<icon id="logo" align="center" proportion="1" width="100%" icon="gui/logo.png"/>
<spacer height="5%" width="10"/>

<buttonbar id="wan" proportion="1" width="90%" align="center">
<icon-button id="find_wan_server" width="128" height="128"
icon="gui/online/menu_find_server.png" focus_icon="gui/online/menu_find_server_hover.png"
I18N="In the online multiplayer screen" text="Find Server"/>
<icon-button id="create_wan_server" width="128" height="128"
icon="gui/online/menu_create_server.png" focus_icon="gui/online/menu_create_server_hover.png"
I18N="In the online multiplayer screen" text="Create Server"/>
<icon-button id="quick_wan_play" width="128" height="128"
icon="gui/online/menu_quick_play.png" focus_icon="gui/online/menu_quick_play_hover.png"
I18N="In the online multiplayer screen" text="Quick Play"/>
</buttonbar>

<spacer height="10%" width="10"/>

</div>
</stkgui>
1 change: 0 additions & 1 deletion data/gui/online/profile_settings.stkgui
Expand Up @@ -8,7 +8,6 @@
<spacer height="25" width="10"/>

<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_servers" width="128" height="128" icon="gui/main_network.png"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/gp_copy.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" />
<icon-button id="tab_settings" width="128" height="128" icon="gui/main_options.png"
Expand Down
1 change: 1 addition & 0 deletions lib/irrlicht/include/IAnimatedMeshSceneNode.h
Expand Up @@ -182,6 +182,7 @@ namespace scene
virtual s32 getAnimationSet() const = 0;
virtual void addAnimationSet(u32 start, u32 end) = 0;
virtual void useAnimationSet(u32 set_num) = 0;
virtual void removeAllAnimationSet() = 0;
};

} // end namespace scene
Expand Down
1 change: 1 addition & 0 deletions lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.h
Expand Up @@ -167,6 +167,7 @@ namespace scene
m_animation_set.push_back(start);
m_animation_set.push_back(end);
}
virtual void removeAllAnimationSet() { m_animation_set.clear(); }
virtual void useAnimationSet(u32 set_num);
virtual void setFrameLoopOnce(s32 begin, s32 end);
protected:
Expand Down
6 changes: 6 additions & 0 deletions lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp
Expand Up @@ -694,6 +694,12 @@ bool CIrrDeviceLinux::createWindow()
visualAttrBuffer[17] = 0;
visualAttrBuffer[19] = 0;
}

if (CreationParams.HandleSRGB == false)
{
visualAttrBuffer[21] = GLX_DONT_CARE;
}

// first round with unchanged values
{
configList=glxChooseFBConfig(display, screennr, visualAttrBuffer,&nitems);
Expand Down
2 changes: 1 addition & 1 deletion lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp
Expand Up @@ -68,7 +68,7 @@ namespace scene

//! constructor
CSkinnedMesh::CSkinnedMesh()
: SkinningBuffers(0), AnimationFrames(0.f), FramesPerSecond(25.f),
: AnimationFrames(0.f), SkinningBuffers(0), FramesPerSecond(25.f),
LastAnimatedFrame(-1), SkinnedLastFrame(false),
InterpolationMode(EIM_LINEAR),
HasAnimation(false), PreparedForSkinning(false),
Expand Down
3 changes: 2 additions & 1 deletion lib/irrlicht/source/Irrlicht/CSkinnedMesh.h
Expand Up @@ -175,6 +175,8 @@ namespace scene

u32 getTotalJoints() const { return m_total_joints; }

f32 AnimationFrames;

private:
void toStaticPose();

Expand Down Expand Up @@ -215,7 +217,6 @@ namespace scene

core::aabbox3d<f32> BoundingBox;

f32 AnimationFrames;
f32 FramesPerSecond;

f32 LastAnimatedFrame;
Expand Down
2 changes: 1 addition & 1 deletion sources.cmake
@@ -1,5 +1,5 @@
# Modify this file to change the last-modified date when you add/remove a file.
# This will then trigger a new cmake run automatically.
# This will then trigger a new cmake run automatically.
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")
Expand Down

0 comments on commit 28bc8c8

Please sign in to comment.