Merge branch 'origin/master'
This commit is contained in:
commit
85895074aa
@ -44,13 +44,12 @@ and extract it to stk-code/lib. It contains sources of libraries that are used
|
|||||||
in STK, but are not availiable in stk-code repository (curl, freetype, openal).
|
in STK, but are not availiable in stk-code repository (curl, freetype, openal).
|
||||||
|
|
||||||
You need also Android SDK for android-19 platform (the API for Android 4.4) and
|
You need also Android SDK for android-19 platform (the API for Android 4.4) and
|
||||||
Android NDK. Note that NDK >= r15b is atm. not supported. Version r12b is
|
Android NDK. Note that NDK >= r15 is atm. not supported. Version r12b is
|
||||||
strongly recommended, because it's known that it works without issues.
|
strongly recommended, because it's known that it works without issues.
|
||||||
|
|
||||||
You need to create proper "android-sdk" and "android-ndk" symlinks in the
|
You need to create proper "android-sdk" and "android-ndk" symlinks in the
|
||||||
directory with Android project, so that the compilation script will have access
|
directory with Android project, so that the compilation script will have access
|
||||||
to the SDK and NDK. These paths can be also set in SDK_PATH and NDK_PATH
|
to the SDK and NDK.
|
||||||
environmental variables.
|
|
||||||
|
|
||||||
Before running the compilation, run the generate_assets script, so that
|
Before running the compilation, run the generate_assets script, so that
|
||||||
selected assets will be copied to "assets" directory, and then included in the
|
selected assets will be copied to "assets" directory, and then included in the
|
||||||
@ -67,22 +66,6 @@ If the assets directory is already prepared, you can run "./make.sh" command to
|
|||||||
build the project and create an apk file. Note that all arguments are passed to
|
build the project and create an apk file. Note that all arguments are passed to
|
||||||
the make command, so that you can run "./make.sh -j5" for multi-threaded build.
|
the make command, so that you can run "./make.sh -j5" for multi-threaded build.
|
||||||
|
|
||||||
If you want to prepare a package for particular architecture, you can choose it
|
|
||||||
by setting the COMPILE_ARCH environmental variable. At this stage, supported
|
|
||||||
architectures are "armv7", "x86" and "aarch64". The default is "armv7".
|
|
||||||
|
|
||||||
You can choose build type by setting BUILD_TYPE environment variable to "debug"
|
|
||||||
or "release". The default is debug build. Note that if you choose release build,
|
|
||||||
you have to manually sign the apk with your key and run zipalign.
|
|
||||||
|
|
||||||
Additionally you can choose the build tool by setting BUILD_TOOL environment
|
|
||||||
variable to "gradle" or "ant". Note that ant has been already removed from
|
|
||||||
Android SDK, so you have to use SDK <= 25.2.5 for building with ant. By default
|
|
||||||
the BUILD_TOOL is set to "gradle".
|
|
||||||
|
|
||||||
You can override the SDK build-tools version by setting the BUILD_TOOLS_VER
|
|
||||||
environment variable.
|
|
||||||
|
|
||||||
Basically if all dependencies are installed in the system, it should be enough
|
Basically if all dependencies are installed in the system, it should be enough
|
||||||
to just run:
|
to just run:
|
||||||
|
|
||||||
@ -93,6 +76,33 @@ to just run:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
ENVIRONMENT VARIABLES
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
COMPILE_ARCH - Allows to choose CPU architecture for which the package will
|
||||||
|
be compiled.
|
||||||
|
Possible values: armv7, aarch64, x86, x86_64.
|
||||||
|
Default is: armv7.
|
||||||
|
|
||||||
|
BUILD_TYPE - Allows to set build type.
|
||||||
|
Possible values: debug, release, beta.
|
||||||
|
Default is: debug.
|
||||||
|
|
||||||
|
BUILD_TOOL - Allows to choose a tool that is used for creating package.
|
||||||
|
Note that ant has been already removed from Android SDK, so
|
||||||
|
you have to use SDK <= 25.2.5 for building with ant.
|
||||||
|
Possible values: ant, gradle.
|
||||||
|
Default is: gradle.
|
||||||
|
|
||||||
|
BUILD_TOOLS_VER - Allows to override the SDK build-tools version.
|
||||||
|
|
||||||
|
SDK_PATH - Path to SDK directory
|
||||||
|
|
||||||
|
NDK_PATH - Path to NDK directory
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
RELEASE BUILD
|
RELEASE BUILD
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 87 KiB |
@ -26,6 +26,14 @@ export MIN_SDK_VERSION_ARMV7=19
|
|||||||
export TARGET_SDK_VERSION_ARMV7=21
|
export TARGET_SDK_VERSION_ARMV7=21
|
||||||
export COMPILE_SDK_VERSION_ARMV7=21
|
export COMPILE_SDK_VERSION_ARMV7=21
|
||||||
|
|
||||||
|
export NDK_ABI_AARCH64=arm64-v8a
|
||||||
|
export ARCH_AARCH64=arm64
|
||||||
|
export HOST_AARCH64=aarch64-linux-android
|
||||||
|
export NDK_PLATFORM_AARCH64=android-21
|
||||||
|
export MIN_SDK_VERSION_AARCH64=21
|
||||||
|
export TARGET_SDK_VERSION_AARCH64=21
|
||||||
|
export COMPILE_SDK_VERSION_AARCH64=21
|
||||||
|
|
||||||
export NDK_ABI_X86=x86
|
export NDK_ABI_X86=x86
|
||||||
export ARCH_X86=x86
|
export ARCH_X86=x86
|
||||||
export HOST_X86=i686-linux-android
|
export HOST_X86=i686-linux-android
|
||||||
@ -34,13 +42,13 @@ export MIN_SDK_VERSION_X86=19
|
|||||||
export TARGET_SDK_VERSION_X86=21
|
export TARGET_SDK_VERSION_X86=21
|
||||||
export COMPILE_SDK_VERSION_X86=21
|
export COMPILE_SDK_VERSION_X86=21
|
||||||
|
|
||||||
export NDK_ABI_AARCH64=arm64-v8a
|
export NDK_ABI_X86_64=x86_64
|
||||||
export ARCH_AARCH64=arm64
|
export ARCH_X86_64=x86_64
|
||||||
export HOST_AARCH64=aarch64-linux-android
|
export HOST_X86_64=x86_64-linux-android
|
||||||
export NDK_PLATFORM_AARCH64=android-21
|
export NDK_PLATFORM_X86_64=android-21
|
||||||
export MIN_SDK_VERSION_AARCH64=21
|
export MIN_SDK_VERSION_X86_64=21
|
||||||
export TARGET_SDK_VERSION_AARCH64=21
|
export TARGET_SDK_VERSION_X86_64=21
|
||||||
export COMPILE_SDK_VERSION_AARCH64=21
|
export COMPILE_SDK_VERSION_X86_64=21
|
||||||
|
|
||||||
export APP_NAME_RELEASE="SuperTuxKart"
|
export APP_NAME_RELEASE="SuperTuxKart"
|
||||||
export PACKAGE_NAME_RELEASE="org.supertuxkart.stk"
|
export PACKAGE_NAME_RELEASE="org.supertuxkart.stk"
|
||||||
@ -105,14 +113,6 @@ if [ "$COMPILE_ARCH" = "armv7" ]; then
|
|||||||
export MIN_SDK_VERSION=$MIN_SDK_VERSION_ARMV7
|
export MIN_SDK_VERSION=$MIN_SDK_VERSION_ARMV7
|
||||||
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_ARMV7
|
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_ARMV7
|
||||||
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_ARMV7
|
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_ARMV7
|
||||||
elif [ "$COMPILE_ARCH" = "x86" ]; then
|
|
||||||
export NDK_PLATFORM=$NDK_PLATFORM_X86
|
|
||||||
export NDK_ABI=$NDK_ABI_X86
|
|
||||||
export ARCH=$ARCH_X86
|
|
||||||
export HOST=$HOST_X86
|
|
||||||
export MIN_SDK_VERSION=$MIN_SDK_VERSION_X86
|
|
||||||
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_X86
|
|
||||||
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_X86
|
|
||||||
elif [ "$COMPILE_ARCH" = "aarch64" ]; then
|
elif [ "$COMPILE_ARCH" = "aarch64" ]; then
|
||||||
export NDK_PLATFORM=$NDK_PLATFORM_AARCH64
|
export NDK_PLATFORM=$NDK_PLATFORM_AARCH64
|
||||||
export NDK_ABI=$NDK_ABI_AARCH64
|
export NDK_ABI=$NDK_ABI_AARCH64
|
||||||
@ -121,9 +121,25 @@ elif [ "$COMPILE_ARCH" = "aarch64" ]; then
|
|||||||
export MIN_SDK_VERSION=$MIN_SDK_VERSION_AARCH64
|
export MIN_SDK_VERSION=$MIN_SDK_VERSION_AARCH64
|
||||||
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_AARCH64
|
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_AARCH64
|
||||||
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_AARCH64
|
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_AARCH64
|
||||||
|
elif [ "$COMPILE_ARCH" = "x86" ]; then
|
||||||
|
export NDK_PLATFORM=$NDK_PLATFORM_X86
|
||||||
|
export NDK_ABI=$NDK_ABI_X86
|
||||||
|
export ARCH=$ARCH_X86
|
||||||
|
export HOST=$HOST_X86
|
||||||
|
export MIN_SDK_VERSION=$MIN_SDK_VERSION_X86
|
||||||
|
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_X86
|
||||||
|
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_X86
|
||||||
|
elif [ "$COMPILE_ARCH" = "x86_64" ]; then
|
||||||
|
export NDK_PLATFORM=$NDK_PLATFORM_X86_64
|
||||||
|
export NDK_ABI=$NDK_ABI_X86_64
|
||||||
|
export ARCH=$ARCH_X86_64
|
||||||
|
export HOST=$HOST_X86_64
|
||||||
|
export MIN_SDK_VERSION=$MIN_SDK_VERSION_X86_64
|
||||||
|
export TARGET_SDK_VERSION=$TARGET_SDK_VERSION_X86_64
|
||||||
|
export COMPILE_SDK_VERSION=$COMPILE_SDK_VERSION_X86_64
|
||||||
else
|
else
|
||||||
echo "Unknow COMPILE_ARCH: $COMPILE_ARCH. Possible values are: " \
|
echo "Unknow COMPILE_ARCH: $COMPILE_ARCH. Possible values are: " \
|
||||||
"armv7, aarch64, x86"
|
"armv7, aarch64, x86, x86_64"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -10,10 +10,13 @@
|
|||||||
<box id="filter_box" width="97%" height="75" layout="vertical-row" align="center">
|
<box id="filter_box" width="97%" height="75" layout="vertical-row" align="center">
|
||||||
<div x="0" y="0" width="98%" height="100%" layout="horizontal-row" align="center">
|
<div x="0" y="0" width="98%" height="100%" layout="horizontal-row" align="center">
|
||||||
<textbox id="filter_name" proportion="7" align="center" />
|
<textbox id="filter_name" proportion="7" align="center" />
|
||||||
<spacer width="10" />
|
<spacer width="20" />
|
||||||
<label text="Updated" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only recently updated items"/>
|
<label text="Updated" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only recently updated items"/>
|
||||||
|
<spacer width="10" />
|
||||||
<spinner id="filter_date" proportion="8" align="center" min_value="0" wrap_around="true"/>
|
<spinner id="filter_date" proportion="8" align="center" min_value="0" wrap_around="true"/>
|
||||||
|
<spacer width="10" />
|
||||||
<label text="Rating >=" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only items with good rating"/>
|
<label text="Rating >=" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only items with good rating"/>
|
||||||
|
<spacer width="10" />
|
||||||
<spinner id="filter_rating" proportion="5" align="center" min_value="0" wrap_around="true"/>
|
<spinner id="filter_rating" proportion="5" align="center" min_value="0" wrap_around="true"/>
|
||||||
<icon-button id="filter_search" height="100%" icon="gui/search.png"/>
|
<icon-button id="filter_search" height="100%" icon="gui/search.png"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<spacer width="20" height="13" />
|
<spacer width="20" height="13" />
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<tabs width="100%" height="25" id="trackgroups">
|
<tabs width="100%" height="5%" id="trackgroups">
|
||||||
<button id="standard" I18N="track group" text="Standard"/>
|
<button id="standard" I18N="track group" text="Standard"/>
|
||||||
<button id="addons" I18N="track group" text="Add-Ons"/>
|
<button id="addons" I18N="track group" text="Add-Ons"/>
|
||||||
<button id="all" I18N="track group" text="All"/>
|
<button id="all" I18N="track group" text="All"/>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<spacer width="20" height="13" />
|
<spacer width="20" height="13" />
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<tabs width="100%" height="25" id="trackgroups">
|
<tabs width="100%" height="5%" id="trackgroups">
|
||||||
<button id="standard" I18N="track group" text="Standard"/>
|
<button id="standard" I18N="track group" text="Standard"/>
|
||||||
<button id="addons" I18N="track group" text="Add-Ons"/>
|
<button id="addons" I18N="track group" text="Add-Ons"/>
|
||||||
<button id="all" I18N="track group" text="All"/>
|
<button id="all" I18N="track group" text="All"/>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</box>
|
</box>
|
||||||
|
|
||||||
<!-- Populated dynamically at runtime -->
|
<!-- Populated dynamically at runtime -->
|
||||||
<tabs width="100%" height="30" id="trackgroups"> </tabs>
|
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||||
|
|
||||||
<spacer height="50" />
|
<spacer height="50" />
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</box>
|
</box>
|
||||||
|
|
||||||
<!-- Populated dynamically at runtime -->
|
<!-- Populated dynamically at runtime -->
|
||||||
<tabs width="100%" height="30" id="gpgroups"> </tabs>
|
<tabs width="100%" height="5%" id="gpgroups"> </tabs>
|
||||||
|
|
||||||
<spacer height="20" />
|
<spacer height="20" />
|
||||||
|
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
|
<div x="2%" y="2%" width="96%" height="96%" layout="vertical-row" >
|
||||||
|
|
||||||
<spacer height="2%" width="25"/>
|
<spacer height="2%" width="25"/>
|
||||||
<box width="100%" height="fit" padding="10" layout="vertical-row">
|
<box width="100%" height="75%" padding="10" layout="vertical-row">
|
||||||
<bright width="100%" text="Select a type of control that you prefer" align="center" text_align="left" />
|
<bright width="100%" text="Select a type of control that you prefer" align="center" text_align="left" />
|
||||||
|
|
||||||
<spacer height="15%" width="10"/>
|
<spacer height="15%" width="10"/>
|
||||||
|
|
||||||
<ribbon id="control_type" height="135" width="100%" align="center">
|
<ribbon id="control_type" height="60%" width="100%" align="center">
|
||||||
<icon-button id="accelerometer" width="128" height="128" icon="gui/difficulty_medium.png"
|
<icon-button id="accelerometer" width="fit" height="fit" icon="gui/difficulty_medium.png"
|
||||||
I18N="Control type" text="Accelerometer"/>
|
I18N="Control type" text="Accelerometer"/>
|
||||||
<icon-button id="steering_wheel" width="128" height="128" icon="gui/difficulty_hard.png"
|
<icon-button id="steering_wheel" width="fit" height="fit" icon="gui/difficulty_hard.png"
|
||||||
I18N="Control type" text="Steering wheel"/>
|
I18N="Control type" text="Steering wheel"/>
|
||||||
</ribbon>
|
</ribbon>
|
||||||
</box>
|
</box>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</box>
|
</box>
|
||||||
|
|
||||||
<!-- Groups will be added dynamically at runtime -->
|
<!-- Groups will be added dynamically at runtime -->
|
||||||
<tabs width="98%" x="1%" height="25" id="kartgroups">
|
<tabs width="98%" x="1%" height="5%" id="kartgroups">
|
||||||
</tabs>
|
</tabs>
|
||||||
<spacer width="100%" height="2%"/>
|
<spacer width="100%" height="2%"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
<div proportion="1" height="fit" layout="horizontal-row" >
|
||||||
<spacer width="40" height="100%" />
|
<spacer width="40" height="100%" />
|
||||||
<!-- FIXME: don't hardcode height -->
|
<!-- FIXME: don't hardcode height -->
|
||||||
<checkbox id="music_enabled" width="40" height="40"/>
|
<checkbox id="music_enabled"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
<div proportion="1" height="fit" layout="horizontal-row" >
|
||||||
<spacer width="40" height="100%" />
|
<spacer width="40" height="100%" />
|
||||||
<!-- FIXME: don't hardcode height -->
|
<!-- FIXME: don't hardcode height -->
|
||||||
<checkbox id="sfx_enabled" width="40" height="40"/>
|
<checkbox id="sfx_enabled"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div width="75%" height="fit" layout="horizontal-row" >
|
<div width="75%" height="fit" layout="horizontal-row" >
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
<box width="100%" height="40%" padding="10" layout="vertical-row">
|
<box width="100%" height="40%" padding="10" layout="vertical-row">
|
||||||
<bright width="100%" text="Select a difficulty" align="center" text_align="left" />
|
<bright width="100%" text="Select a difficulty" align="center" text_align="left" />
|
||||||
|
|
||||||
<ribbon id="difficulty" height="135" width="100%" align="center">
|
<ribbon id="difficulty" height="60%" width="100%" align="center">
|
||||||
<icon-button id="novice" width="128" height="128" icon="gui/difficulty_easy.png"
|
<icon-button id="novice" width="fit" height="fit" icon="gui/difficulty_easy.png"
|
||||||
I18N="Difficulty" text="Novice"/>
|
I18N="Difficulty" text="Novice"/>
|
||||||
<icon-button id="intermediate" width="128" height="128" icon="gui/difficulty_medium.png"
|
<icon-button id="intermediate" width="fit" height="fit" icon="gui/difficulty_medium.png"
|
||||||
I18N="Difficulty" text="Intermediate"/>
|
I18N="Difficulty" text="Intermediate"/>
|
||||||
<icon-button id="expert" width="128" height="128" icon="gui/difficulty_hard.png"
|
<icon-button id="expert" width="fit" height="fit" icon="gui/difficulty_hard.png"
|
||||||
I18N="Difficulty" text="Expert"/>
|
I18N="Difficulty" text="Expert"/>
|
||||||
<icon-button id="best" width="128" height="128" icon="gui/difficulty_best.png"
|
<icon-button id="best" width="fit" height="fit" icon="gui/difficulty_best.png"
|
||||||
I18N="Difficulty" text="SuperTux"/>
|
I18N="Difficulty" text="SuperTux"/>
|
||||||
</ribbon>
|
</ribbon>
|
||||||
</box>
|
</box>
|
||||||
@ -24,8 +24,8 @@
|
|||||||
<box width="100%" height="40%" padding="10" layout="vertical-row">
|
<box width="100%" height="40%" padding="10" layout="vertical-row">
|
||||||
<bright width="100%" text="Select a game mode" align="center" text_align="left" />
|
<bright width="100%" text="Select a game mode" align="center" text_align="left" />
|
||||||
|
|
||||||
<scrollable_toolbar id="gamemode" height="135" width="85%" label_location="bottom" align="center"
|
<scrollable_toolbar id="gamemode" height="60%" width="85%" label_location="bottom" align="center"
|
||||||
child_width="135" child_height="135" />
|
child_width="256" child_height="256" />
|
||||||
<spacer proportion="1" width="25" />
|
<spacer proportion="1" width="25" />
|
||||||
</box>
|
</box>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
||||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||||
label_location="bottom" align="center" max_rows="4"
|
label_location="bottom" align="center" max_rows="3"
|
||||||
child_width="160" child_height="120" />
|
child_width="160" child_height="120" />
|
||||||
<spacer width="20" height="13" />
|
<spacer width="20" height="13" />
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<!-- Populated dynamically at runtime -->
|
<!-- Populated dynamically at runtime -->
|
||||||
<tabs width="100%" height="25" id="trackgroups"> </tabs>
|
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||||
|
|
||||||
<spacer width="100%" height="2%" />
|
<spacer width="100%" height="2%" />
|
||||||
<box id="rect-box" width="100%" height="20%" padding="15" layout="vertical-row">
|
<box id="rect-box" width="100%" height="20%" padding="15" layout="vertical-row">
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
||||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||||
label_location="bottom" align="center" max_rows="4"
|
label_location="bottom" align="center" max_rows="3"
|
||||||
child_width="160" child_height="120" />
|
child_width="160" child_height="120" />
|
||||||
<spacer width="20" height="13" />
|
<spacer width="20" height="13" />
|
||||||
</box>
|
</box>
|
||||||
|
|
||||||
<!-- Populated dynamically at runtime -->
|
<!-- Populated dynamically at runtime -->
|
||||||
<tabs width="100%" height="25" id="trackgroups"> </tabs>
|
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||||
|
|
||||||
<spacer width="100%" height="2%" />
|
<spacer width="100%" height="2%" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
<box proportion="1" width="98%" layout="vertical-row">
|
<box proportion="1" width="98%" layout="vertical-row">
|
||||||
|
|
||||||
<spacer height="15" width="10"/>
|
<spacer height="2%" width="10"/>
|
||||||
|
|
||||||
<scrollable_ribbon id="players" height="120" y="10" x="10" width="98%" align="center" label_location="each"
|
<scrollable_ribbon id="players" height="18%" y="10" x="10" width="98%" align="center" label_location="each"
|
||||||
square_items="true" child_width="128" child_height="128" />
|
square_items="true" child_width="128" child_height="128" />
|
||||||
|
|
||||||
<spacer height="15" width="10"/>
|
<spacer height="2%" width="10"/>
|
||||||
<div width="90%" align="center" layout="vertical-row" proportion="1">
|
<div width="90%" align="center" layout="vertical-row" proportion="1">
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox width="fit" id="online" I18N="In the user screen" text_align="left"/>
|
<checkbox width="fit" id="online" I18N="In the user screen" text_align="left"/>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
I18N="In the user screen" text="Username"/>
|
I18N="In the user screen" text="Username"/>
|
||||||
<textbox id="username" proportion="2" height="fit" I18N="In the user screen"/>
|
<textbox id="username" proportion="2" height="fit" I18N="In the user screen"/>
|
||||||
</div>
|
</div>
|
||||||
<spacer height="20" width="20"/>
|
<spacer height="10%" width="20"/>
|
||||||
|
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<label id="label_password" width="40%" height="100%" text_align="left"
|
<label id="label_password" width="40%" height="100%" text_align="left"
|
||||||
@ -45,30 +45,30 @@
|
|||||||
<textbox id="password" proportion="2" height="fit" I18N="In the user screen"/>
|
<textbox id="password" proportion="2" height="fit" I18N="In the user screen"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<spacer height="20" width="20"/>
|
<spacer height="5%" width="20"/>
|
||||||
|
|
||||||
<label id="message" width="100%" text_align="center"/>
|
<label id="message" width="100%" text_align="center"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<spacer width="20" proportion="1"/>
|
<spacer width="20" height="2%"/>
|
||||||
|
|
||||||
<div width="90%" align="center" layout="vertical-row" height="fit">
|
<div width="90%" align="center" layout="vertical-row" height="18%">
|
||||||
<buttonbar id="options" width="100%" height="80" align="center">
|
<buttonbar id="options" width="100%" height="100%" align="center">
|
||||||
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
|
<icon-button id="ok" width="fit" height="fit" icon="gui/green_check.png"
|
||||||
I18N="In the user screen" text="OK" label_location="bottom"/>
|
I18N="In the user screen" text="OK" label_location="bottom"/>
|
||||||
<icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png"
|
<icon-button id="new_user" width="fit" height="fit" icon="gui/blue_plus.png"
|
||||||
I18N="In the user screen" text="Add user" label_location="bottom"/>
|
I18N="In the user screen" text="Add user" label_location="bottom"/>
|
||||||
<icon-button id="delete" width="64" height="64" icon="gui/remove.png"
|
<icon-button id="delete" width="fit" height="fit" icon="gui/remove.png"
|
||||||
I18N="In the user screen" text="Delete" label_location="bottom"/>
|
I18N="In the user screen" text="Delete" label_location="bottom"/>
|
||||||
<icon-button id="rename" width="64" height="64" icon="gui/rename.png"
|
<icon-button id="rename" width="fit" height="fit" icon="gui/rename.png"
|
||||||
I18N="In the user screen" text="Rename" label_location="bottom"/>
|
I18N="In the user screen" text="Rename" label_location="bottom"/>
|
||||||
<icon-button id="default_kart_color" width="64" height="64" icon="gui/edit.png"
|
<icon-button id="default_kart_color" width="fit" height="fit" icon="gui/edit.png"
|
||||||
I18N="In the user screen" text="Default kart color" label_location="bottom"/>
|
I18N="In the user screen" text="Default kart color" label_location="bottom"/>
|
||||||
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
|
<icon-button id="cancel" width="fit" height="fit" icon="gui/main_quit.png"
|
||||||
I18N="In the user screen" text="Cancel" label_location="bottom"/>
|
I18N="In the user screen" text="Cancel" label_location="bottom"/>
|
||||||
</buttonbar>
|
</buttonbar>
|
||||||
</div>
|
</div>
|
||||||
<spacer width="20" height="25"/>
|
<spacer width="20" height="5%"/>
|
||||||
</box>
|
</box>
|
||||||
<spacer width="20" height="15"/>
|
<spacer width="20" height="15"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,15 +14,15 @@
|
|||||||
<icon-button id="tab_controls" width="128" height="128" icon="gui/options_input.png"/>
|
<icon-button id="tab_controls" width="128" height="128" icon="gui/options_input.png"/>
|
||||||
</tabs>
|
</tabs>
|
||||||
|
|
||||||
<box proportion="1" width="100%" layout="vertical-row">
|
<box proportion="1" width="98%" layout="vertical-row">
|
||||||
|
|
||||||
<spacer height="15" width="10"/>
|
<spacer height="2%" width="10"/>
|
||||||
|
|
||||||
<scrollable_ribbon id="players" height="120" y="10" x="10" width="98%" align="center" label_location="each"
|
<scrollable_ribbon id="players" height="18%" y="10" x="10" width="98%" align="center" label_location="each"
|
||||||
square_items="true" child_width="128" child_height="128" />
|
square_items="true" child_width="128" child_height="128" />
|
||||||
|
|
||||||
<spacer height="15" width="10"/>
|
<spacer height="2%" width="10"/>
|
||||||
<div width="90%" align="center" layout="vertical-row" height="fit">
|
<div width="90%" align="center" layout="vertical-row" proportion="1">
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox width="fit" id="online" I18N="In the user screen" text_align="left"/>
|
<checkbox width="fit" id="online" I18N="In the user screen" text_align="left"/>
|
||||||
<spacer width="10"/>
|
<spacer width="10"/>
|
||||||
@ -31,48 +31,55 @@
|
|||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<checkbox width="fit" id="remember-user" I18N="In the user screen" text_align="left"/>
|
<checkbox width="fit" id="remember-user" I18N="In the user screen" text_align="left"/>
|
||||||
<spacer width="10"/>
|
<spacer width="10"/>
|
||||||
<label id="label_remember" proportion="1" height="100%" text_align="left"
|
<label proportion="1" id="label_remember" height="100%" text_align="left"
|
||||||
I18N="In the user screen" text="Remember password"/>
|
I18N="In the user screen" text="Remember password"/>
|
||||||
</div>
|
</div>
|
||||||
<!-- Disable guest accounts for now
|
<!-- Disable guest accounts for now
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<label id="label_guest" proportion="1" height="100%" text_align="left"
|
<label width="40%" id="label_guest" height="100%" text_align="left"
|
||||||
I18N="In the user screen" text="Guest login"/>
|
I18N="In the user screen" text="Guest login"/>
|
||||||
<checkbox id="guest" I18N="In the user screen" text_align="left"/>
|
<checkbox id="guest" I18N="In the user screen" text_align="left"/>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<label id="label_username" width="40%" height="100%" text_align="left"
|
<label width="40%" id="label_username" height="100%" text_align="left"
|
||||||
I18N="In the user screen" text="Username"/>
|
I18N="In the user screen" text="Username"/>
|
||||||
<textbox id="username" proportion="2" height="fit" I18N="In the user screen"/>
|
<textbox id="username" proportion="2" height="fit" I18N="In the user screen"/>
|
||||||
</div>
|
</div>
|
||||||
<spacer height="20" width="20"/>
|
<spacer height="10%" width="20"/>
|
||||||
|
|
||||||
<div width="100%" height="fit" layout="horizontal-row" >
|
<div width="100%" height="fit" layout="horizontal-row" >
|
||||||
<label id="label_password" width="40%" height="100%" text_align="left"
|
<label id="label_password" width="40%" height="100%" text_align="left"
|
||||||
I18N="In the registration dialog" text="Password"/>
|
I18N="In the user screen" text="Password"/>
|
||||||
<textbox id="password" proportion="2" height="fit" I18N="In the registration dialog"/>
|
<textbox id="password" proportion="2" height="fit" I18N="In the user screen"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<spacer height="5%" width="20"/>
|
||||||
|
|
||||||
|
<label id="message" width="100%" text_align="center"/>
|
||||||
</div>
|
</div>
|
||||||
<div width="80%" align="center" layout="vertical-row" height="fit">
|
|
||||||
<label id="message" width="80%" align="center" text_align="left"/>
|
<spacer width="20" height="2%"/>
|
||||||
</div>
|
|
||||||
<spacer width="20" height="25"/>
|
<div width="90%" align="center" layout="vertical-row" height="18%">
|
||||||
<buttonbar id="options" width="90%" height="13%" align="center">
|
<buttonbar id="options" width="100%" height="100%" align="center">
|
||||||
<icon-button id="ok" width="64" height="64" icon="gui/green_check.png"
|
<icon-button id="ok" width="fit" height="fit" icon="gui/green_check.png"
|
||||||
I18N="In the user screen" text="OK" label_location="bottom"/>
|
I18N="In the user screen" text="OK" label_location="bottom"/>
|
||||||
<icon-button id="new_user" width="64" height="64" icon="gui/blue_plus.png"
|
<icon-button id="new_user" width="fit" height="fit" icon="gui/blue_plus.png"
|
||||||
I18N="In the user screen" text="Add user" label_location="bottom"/>
|
I18N="In the user screen" text="Add user" label_location="bottom"/>
|
||||||
<icon-button id="delete" width="64" height="64" icon="gui/remove.png"
|
<icon-button id="delete" width="fit" height="fit" icon="gui/remove.png"
|
||||||
I18N="In the user screen" text="Delete" label_location="bottom"/>
|
I18N="In the user screen" text="Delete" label_location="bottom"/>
|
||||||
<icon-button id="rename" width="64" height="64" icon="gui/rename.png"
|
<icon-button id="rename" width="fit" height="fit" icon="gui/rename.png"
|
||||||
I18N="In the user screen" text="Rename" label_location="bottom"/>
|
I18N="In the user screen" text="Rename" label_location="bottom"/>
|
||||||
<icon-button id="default_kart_color" width="64" height="64" icon="gui/edit.png"
|
<icon-button id="default_kart_color" width="fit" height="fit" icon="gui/edit.png"
|
||||||
I18N="In the user screen" text="Default kart color" label_location="bottom"/>
|
I18N="In the user screen" text="Default kart color" label_location="bottom"/>
|
||||||
<icon-button id="cancel" width="64" height="64" icon="gui/main_quit.png"
|
<icon-button id="cancel" width="fit" height="fit" icon="gui/main_quit.png"
|
||||||
I18N="In the user screen" text="Cancel" label_location="bottom"/>
|
I18N="In the user screen" text="Cancel" label_location="bottom"/>
|
||||||
</buttonbar>
|
</buttonbar>
|
||||||
|
</div>
|
||||||
|
<spacer width="20" height="5%"/>
|
||||||
</box>
|
</box>
|
||||||
|
<spacer width="20" height="15"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
|
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
|
||||||
|
@ -48,6 +48,8 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
|
|||||||
: CIrrDeviceStub(param),
|
: CIrrDeviceStub(param),
|
||||||
Accelerometer(0),
|
Accelerometer(0),
|
||||||
Gyroscope(0),
|
Gyroscope(0),
|
||||||
|
AccelerometerActive(false),
|
||||||
|
GyroscopeActive(false),
|
||||||
IsMousePressed(false),
|
IsMousePressed(false),
|
||||||
GamepadAxisX(0),
|
GamepadAxisX(0),
|
||||||
GamepadAxisY(0),
|
GamepadAxisY(0),
|
||||||
@ -246,14 +248,14 @@ bool CIrrDeviceAndroid::run()
|
|||||||
accEvent.AccelerometerEvent.X = event.acceleration.x;
|
accEvent.AccelerometerEvent.X = event.acceleration.x;
|
||||||
accEvent.AccelerometerEvent.Y = event.acceleration.y;
|
accEvent.AccelerometerEvent.Y = event.acceleration.y;
|
||||||
}
|
}
|
||||||
accEvent.AccelerometerEvent.Z = event.acceleration.z;
|
|
||||||
|
|
||||||
if (accEvent.AccelerometerEvent.X < 0)
|
if (accEvent.AccelerometerEvent.X < 0)
|
||||||
{
|
{
|
||||||
accEvent.AccelerometerEvent.X *= -1;
|
accEvent.AccelerometerEvent.X *= -1;
|
||||||
accEvent.AccelerometerEvent.Y *= -1;
|
accEvent.AccelerometerEvent.Y *= -1;
|
||||||
accEvent.AccelerometerEvent.Z *= -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
accEvent.AccelerometerEvent.Z = event.acceleration.z;
|
||||||
|
|
||||||
postEventFromUser(accEvent);
|
postEventFromUser(accEvent);
|
||||||
break;
|
break;
|
||||||
@ -769,7 +771,7 @@ s32 CIrrDeviceAndroid::handleGamepad(AInputEvent* androidEvent)
|
|||||||
{
|
{
|
||||||
event.KeyInput.PressedDown = true;
|
event.KeyInput.PressedDown = true;
|
||||||
event.KeyInput.Key = axis_x < 0 ? IRR_KEY_BUTTON_LEFT
|
event.KeyInput.Key = axis_x < 0 ? IRR_KEY_BUTTON_LEFT
|
||||||
: IRR_KEY_BUTTON_RIGHT;
|
: IRR_KEY_BUTTON_RIGHT;
|
||||||
postEventFromUser(event);
|
postEventFromUser(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -790,7 +792,7 @@ s32 CIrrDeviceAndroid::handleGamepad(AInputEvent* androidEvent)
|
|||||||
{
|
{
|
||||||
event.KeyInput.PressedDown = true;
|
event.KeyInput.PressedDown = true;
|
||||||
event.KeyInput.Key = axis_y < 0 ? IRR_KEY_BUTTON_UP
|
event.KeyInput.Key = axis_y < 0 ? IRR_KEY_BUTTON_UP
|
||||||
: IRR_KEY_BUTTON_DOWN;
|
: IRR_KEY_BUTTON_DOWN;
|
||||||
postEventFromUser(event);
|
postEventFromUser(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1210,12 +1212,19 @@ bool CIrrDeviceAndroid::activateAccelerometer(float updateInterval)
|
|||||||
DefaultOrientation = getDefaultOrientation();
|
DefaultOrientation = getDefaultOrientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
ASensorEventQueue_enableSensor(SensorEventQueue, Accelerometer);
|
int err = ASensorEventQueue_enableSensor(SensorEventQueue, Accelerometer);
|
||||||
ASensorEventQueue_setEventRate(SensorEventQueue, Accelerometer,
|
|
||||||
|
if (err == 0)
|
||||||
|
{
|
||||||
|
AccelerometerActive = true;
|
||||||
|
|
||||||
|
ASensorEventQueue_setEventRate(SensorEventQueue, Accelerometer,
|
||||||
(int32_t)(updateInterval*1000.f*1000.f)); // in microseconds
|
(int32_t)(updateInterval*1000.f*1000.f)); // in microseconds
|
||||||
|
|
||||||
|
os::Printer::log("Activated accelerometer", ELL_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
os::Printer::log("Activated accelerometer", ELL_DEBUG);
|
return AccelerometerActive;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::deactivateAccelerometer()
|
bool CIrrDeviceAndroid::deactivateAccelerometer()
|
||||||
@ -1223,15 +1232,20 @@ bool CIrrDeviceAndroid::deactivateAccelerometer()
|
|||||||
if (!Accelerometer)
|
if (!Accelerometer)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ASensorEventQueue_disableSensor(SensorEventQueue, Accelerometer);
|
int err = ASensorEventQueue_disableSensor(SensorEventQueue, Accelerometer);
|
||||||
Accelerometer = 0;
|
|
||||||
os::Printer::log("Deactivated accelerometer", ELL_DEBUG);
|
if (err == 0)
|
||||||
return true;
|
{
|
||||||
|
AccelerometerActive = false;
|
||||||
|
os::Printer::log("Deactivated accelerometer", ELL_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !AccelerometerActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::isAccelerometerActive()
|
bool CIrrDeviceAndroid::isAccelerometerActive()
|
||||||
{
|
{
|
||||||
return (Accelerometer != NULL);
|
return AccelerometerActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::isAccelerometerAvailable()
|
bool CIrrDeviceAndroid::isAccelerometerAvailable()
|
||||||
@ -1250,12 +1264,19 @@ bool CIrrDeviceAndroid::activateGyroscope(float updateInterval)
|
|||||||
if (!isGyroscopeAvailable())
|
if (!isGyroscopeAvailable())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ASensorEventQueue_enableSensor(SensorEventQueue, Gyroscope);
|
int err = ASensorEventQueue_enableSensor(SensorEventQueue, Gyroscope);
|
||||||
ASensorEventQueue_setEventRate(SensorEventQueue, Gyroscope,
|
|
||||||
|
if (err == 0)
|
||||||
|
{
|
||||||
|
GyroscopeActive = true;
|
||||||
|
|
||||||
|
ASensorEventQueue_setEventRate(SensorEventQueue, Gyroscope,
|
||||||
(int32_t)(updateInterval*1000.f*1000.f)); // in microseconds
|
(int32_t)(updateInterval*1000.f*1000.f)); // in microseconds
|
||||||
|
|
||||||
os::Printer::log("Activated gyroscope", ELL_DEBUG);
|
os::Printer::log("Activated gyroscope", ELL_DEBUG);
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
return GyroscopeActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::deactivateGyroscope()
|
bool CIrrDeviceAndroid::deactivateGyroscope()
|
||||||
@ -1263,15 +1284,20 @@ bool CIrrDeviceAndroid::deactivateGyroscope()
|
|||||||
if (!Gyroscope)
|
if (!Gyroscope)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ASensorEventQueue_disableSensor(SensorEventQueue, Gyroscope);
|
int err = ASensorEventQueue_disableSensor(SensorEventQueue, Gyroscope);
|
||||||
Gyroscope = 0;
|
|
||||||
os::Printer::log("Deactivated gyroscope", ELL_DEBUG);
|
if (err == 0)
|
||||||
return true;
|
{
|
||||||
|
GyroscopeActive = false;
|
||||||
|
os::Printer::log("Deactivated gyroscope", ELL_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !GyroscopeActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::isGyroscopeActive()
|
bool CIrrDeviceAndroid::isGyroscopeActive()
|
||||||
{
|
{
|
||||||
return (Gyroscope != NULL);
|
return GyroscopeActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceAndroid::isGyroscopeAvailable()
|
bool CIrrDeviceAndroid::isGyroscopeAvailable()
|
||||||
|
@ -111,6 +111,8 @@ namespace irr
|
|||||||
ASensorEventQueue* SensorEventQueue;
|
ASensorEventQueue* SensorEventQueue;
|
||||||
const ASensor* Accelerometer;
|
const ASensor* Accelerometer;
|
||||||
const ASensor* Gyroscope;
|
const ASensor* Gyroscope;
|
||||||
|
bool AccelerometerActive;
|
||||||
|
bool GyroscopeActive;
|
||||||
|
|
||||||
static bool IsPaused;
|
static bool IsPaused;
|
||||||
static bool IsFocused;
|
static bool IsFocused;
|
||||||
|
@ -991,88 +991,105 @@ bool CIrrDeviceLinux::createWindow()
|
|||||||
Atom wmDelete;
|
Atom wmDelete;
|
||||||
wmDelete = XInternAtom(display, wmDeleteWindow, True);
|
wmDelete = XInternAtom(display, wmDeleteWindow, True);
|
||||||
XSetWMProtocols(display, window, &wmDelete, 1);
|
XSetWMProtocols(display, window, &wmDelete, 1);
|
||||||
|
|
||||||
if (CreationParams.Fullscreen)
|
if (CreationParams.Fullscreen)
|
||||||
{
|
{
|
||||||
if (netWM)
|
// Some window managers don't respect values from XCreateWindow and
|
||||||
|
// place window in random position. This may cause that fullscreen
|
||||||
|
// window is showed in wrong screen. It doesn't matter for vidmode
|
||||||
|
// which displays cloned image in all devices.
|
||||||
|
#ifdef _IRR_LINUX_X11_RANDR_
|
||||||
|
XMoveResizeWindow(display, window, crtc_x, crtc_y, Width, Height);
|
||||||
|
XRaiseWindow(display, window);
|
||||||
|
XFlush(display);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int display_width = XDisplayWidth(display, screennr);
|
||||||
|
unsigned int display_height = XDisplayHeight(display, screennr);
|
||||||
|
|
||||||
|
bool has_display_size = (Width == display_width && Height == display_height);
|
||||||
|
|
||||||
|
if (netWM && (CreationParams.Fullscreen || has_display_size))
|
||||||
|
{
|
||||||
|
Atom WMStateAtom = XInternAtom(display, "_NET_WM_STATE", true);
|
||||||
|
Atom WMStateAtom1 = None;
|
||||||
|
Atom WMStateAtom2 = None;
|
||||||
|
|
||||||
|
if (CreationParams.Fullscreen)
|
||||||
{
|
{
|
||||||
// Some window managers don't respect values from XCreateWindow and
|
WMStateAtom1 = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", true);
|
||||||
// place window in random position. This may cause that fullscreen
|
|
||||||
// window is showed in wrong screen. It doesn't matter for vidmode
|
|
||||||
// which displays cloned image in all devices.
|
|
||||||
#ifdef _IRR_LINUX_X11_RANDR_
|
|
||||||
XMoveResizeWindow(display, window, crtc_x, crtc_y, Width, Height);
|
|
||||||
XRaiseWindow(display, window);
|
|
||||||
XFlush(display);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set the fullscreen mode via the window manager. This allows alt-tabing, volume hot keys & others.
|
|
||||||
// Get the needed atom from there freedesktop names
|
|
||||||
Atom WMStateAtom = XInternAtom(display, "_NET_WM_STATE", true);
|
|
||||||
Atom WMFullscreenAtom = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", true);
|
|
||||||
|
|
||||||
XEvent xev = {0}; // The event should be filled with zeros before setting its attributes
|
|
||||||
xev.type = ClientMessage;
|
|
||||||
xev.xclient.window = window;
|
|
||||||
xev.xclient.message_type = WMStateAtom;
|
|
||||||
xev.xclient.format = 32;
|
|
||||||
xev.xclient.data.l[0] = 1;
|
|
||||||
xev.xclient.data.l[1] = WMFullscreenAtom;
|
|
||||||
XSendEvent(display, RootWindow(display, visual->screen), false,
|
|
||||||
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
|
|
||||||
|
|
||||||
XFlush(display);
|
|
||||||
|
|
||||||
// Wait until window state is already changed to fullscreen
|
|
||||||
bool fullscreen = false;
|
|
||||||
for (int i = 0; i < 500; i++)
|
|
||||||
{
|
|
||||||
Atom type;
|
|
||||||
int format;
|
|
||||||
unsigned long numItems, bytesAfter;
|
|
||||||
Atom* atoms = NULL;
|
|
||||||
|
|
||||||
int s = XGetWindowProperty(display, window, WMStateAtom,
|
|
||||||
0l, 1024, False, XA_ATOM, &type,
|
|
||||||
&format, &numItems, &bytesAfter,
|
|
||||||
(unsigned char**)&atoms);
|
|
||||||
|
|
||||||
if (s == Success)
|
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < numItems; ++i)
|
|
||||||
{
|
|
||||||
if (atoms[i] == WMFullscreenAtom)
|
|
||||||
{
|
|
||||||
fullscreen = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
XFree(atoms);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fullscreen == true)
|
|
||||||
break;
|
|
||||||
|
|
||||||
usleep(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fullscreen)
|
|
||||||
{
|
|
||||||
os::Printer::log("Warning! Got timeout while checking fullscreen sate", ELL_WARNING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
XSetInputFocus(display, window, RevertToParent, CurrentTime);
|
WMStateAtom1 = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", true);
|
||||||
int grabKb = XGrabKeyboard(display, window, True, GrabModeAsync,
|
WMStateAtom2 = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", true);
|
||||||
GrabModeAsync, CurrentTime);
|
|
||||||
IrrPrintXGrabError(grabKb, "XGrabKeyboard");
|
|
||||||
int grabPointer = XGrabPointer(display, window, True, ButtonPressMask,
|
|
||||||
GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
|
|
||||||
IrrPrintXGrabError(grabPointer, "XGrabPointer");
|
|
||||||
XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XEvent xev = {0}; // The event should be filled with zeros before setting its attributes
|
||||||
|
xev.type = ClientMessage;
|
||||||
|
xev.xclient.window = window;
|
||||||
|
xev.xclient.message_type = WMStateAtom;
|
||||||
|
xev.xclient.format = 32;
|
||||||
|
xev.xclient.data.l[0] = 1;
|
||||||
|
xev.xclient.data.l[1] = WMStateAtom1;
|
||||||
|
xev.xclient.data.l[2] = WMStateAtom2;
|
||||||
|
|
||||||
|
XSendEvent(display, RootWindow(display, visual->screen), false,
|
||||||
|
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
|
||||||
|
|
||||||
|
XFlush(display);
|
||||||
|
|
||||||
|
// Wait until window state is already changed
|
||||||
|
bool changed = false;
|
||||||
|
for (int i = 0; i < 500; i++)
|
||||||
|
{
|
||||||
|
Atom type;
|
||||||
|
int format;
|
||||||
|
unsigned long numItems, bytesAfter;
|
||||||
|
Atom* atoms = NULL;
|
||||||
|
|
||||||
|
int s = XGetWindowProperty(display, window, WMStateAtom,
|
||||||
|
0l, 1024, False, XA_ATOM, &type,
|
||||||
|
&format, &numItems, &bytesAfter,
|
||||||
|
(unsigned char**)&atoms);
|
||||||
|
|
||||||
|
if (s == Success)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < numItems; ++i)
|
||||||
|
{
|
||||||
|
if (atoms[i] == WMStateAtom1)
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
XFree(atoms);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed == true)
|
||||||
|
break;
|
||||||
|
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!changed)
|
||||||
|
{
|
||||||
|
os::Printer::log("Warning! Got timeout when changing window state", ELL_WARNING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!netWM && CreationParams.Fullscreen)
|
||||||
|
{
|
||||||
|
XSetInputFocus(display, window, RevertToParent, CurrentTime);
|
||||||
|
int grabKb = XGrabKeyboard(display, window, True, GrabModeAsync,
|
||||||
|
GrabModeAsync, CurrentTime);
|
||||||
|
IrrPrintXGrabError(grabKb, "XGrabKeyboard");
|
||||||
|
int grabPointer = XGrabPointer(display, window, True, ButtonPressMask,
|
||||||
|
GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
|
||||||
|
IrrPrintXGrabError(grabPointer, "XGrabPointer");
|
||||||
|
XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -331,6 +331,12 @@ void FontWithFace::setDPI()
|
|||||||
{
|
{
|
||||||
const int screen_width = irr_driver->getFrameSize().Width;
|
const int screen_width = irr_driver->getFrameSize().Width;
|
||||||
const int screen_height = irr_driver->getFrameSize().Height;
|
const int screen_height = irr_driver->getFrameSize().Height;
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
float scale = screen_height / 480.0f;
|
||||||
|
m_face_dpi = getScalingFactorTwo() * getScalingFactorOne() * scale;
|
||||||
|
|
||||||
|
#else
|
||||||
float scale = std::max(0, screen_width - 640) / 564.0f;
|
float scale = std::max(0, screen_width - 640) / 564.0f;
|
||||||
|
|
||||||
// attempt to compensate for small screens
|
// attempt to compensate for small screens
|
||||||
@ -341,6 +347,7 @@ void FontWithFace::setDPI()
|
|||||||
|
|
||||||
m_face_dpi = unsigned((getScalingFactorOne() + 0.2f * scale) *
|
m_face_dpi = unsigned((getScalingFactorOne() + 0.2f * scale) *
|
||||||
getScalingFactorTwo());
|
getScalingFactorTwo());
|
||||||
|
#endif
|
||||||
|
|
||||||
} // setDPI
|
} // setDPI
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "config/user_config.hpp"
|
#include "config/user_config.hpp"
|
||||||
#include "graphics/material.hpp"
|
#include "graphics/material.hpp"
|
||||||
#include "graphics/particle_kind_manager.hpp"
|
#include "graphics/particle_kind_manager.hpp"
|
||||||
|
#include "graphics/sp/sp_texture_manager.hpp"
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "io/xml_node.hpp"
|
#include "io/xml_node.hpp"
|
||||||
#include "modes/profile_world.hpp"
|
#include "modes/profile_world.hpp"
|
||||||
@ -55,6 +56,10 @@ MaterialManager::MaterialManager()
|
|||||||
*/
|
*/
|
||||||
MaterialManager::~MaterialManager()
|
MaterialManager::~MaterialManager()
|
||||||
{
|
{
|
||||||
|
#ifndef SERVER_ONLY
|
||||||
|
SP::SPTextureManager::get()->stopThreads();
|
||||||
|
#endif
|
||||||
|
|
||||||
for(unsigned int i=0; i<m_materials.size(); i++)
|
for(unsigned int i=0; i<m_materials.size(); i++)
|
||||||
{
|
{
|
||||||
delete m_materials[i];
|
delete m_materials[i];
|
||||||
|
@ -574,6 +574,7 @@ void init()
|
|||||||
void destroy()
|
void destroy()
|
||||||
{
|
{
|
||||||
g_dy_dc.clear();
|
g_dy_dc.clear();
|
||||||
|
SPTextureManager::get()->stopThreads();
|
||||||
SPShaderManager::destroy();
|
SPShaderManager::destroy();
|
||||||
g_glow_shader = NULL;
|
g_glow_shader = NULL;
|
||||||
g_normal_visualizer = NULL;
|
g_normal_visualizer = NULL;
|
||||||
|
@ -78,16 +78,7 @@ SPTextureManager::SPTextureManager()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
SPTextureManager::~SPTextureManager()
|
SPTextureManager::~SPTextureManager()
|
||||||
{
|
{
|
||||||
m_max_threaded_load_obj.store(0);
|
assert(m_threaded_load_obj.empty());
|
||||||
std::unique_lock<std::mutex> ul(m_thread_obj_mutex);
|
|
||||||
m_threaded_functions.push_back([](){ return true; });
|
|
||||||
m_thread_obj_cv.notify_all();
|
|
||||||
ul.unlock();
|
|
||||||
for (std::thread& t : m_threaded_load_obj)
|
|
||||||
{
|
|
||||||
t.join();
|
|
||||||
}
|
|
||||||
m_threaded_load_obj.clear();
|
|
||||||
removeUnusedTextures();
|
removeUnusedTextures();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
for (auto p : m_textures)
|
for (auto p : m_textures)
|
||||||
|
@ -85,6 +85,20 @@ public:
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
~SPTextureManager();
|
~SPTextureManager();
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
void stopThreads()
|
||||||
|
{
|
||||||
|
m_max_threaded_load_obj.store(0);
|
||||||
|
std::unique_lock<std::mutex> ul(m_thread_obj_mutex);
|
||||||
|
m_threaded_functions.push_back([](){ return true; });
|
||||||
|
m_thread_obj_cv.notify_all();
|
||||||
|
ul.unlock();
|
||||||
|
for (std::thread& t : m_threaded_load_obj)
|
||||||
|
{
|
||||||
|
t.join();
|
||||||
|
}
|
||||||
|
m_threaded_load_obj.clear();
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
void removeUnusedTextures();
|
void removeUnusedTextures();
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void addThreadedFunction(std::function<bool()> threaded_function)
|
void addThreadedFunction(std::function<bool()> threaded_function)
|
||||||
|
@ -1163,14 +1163,26 @@ namespace GUIEngine
|
|||||||
// ---- some menus may need updating
|
// ---- some menus may need updating
|
||||||
if (gamestate != GAME)
|
if (gamestate != GAME)
|
||||||
{
|
{
|
||||||
if (ModalDialog::isADialogActive())
|
if (ScreenKeyboard::isActive())
|
||||||
|
{
|
||||||
|
ScreenKeyboard::getCurrent()->onUpdate(dt);
|
||||||
|
}
|
||||||
|
else if (ModalDialog::isADialogActive())
|
||||||
|
{
|
||||||
ModalDialog::getCurrent()->onUpdate(dt);
|
ModalDialog::getCurrent()->onUpdate(dt);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
getCurrentScreen()->onUpdate(elapsed_time);
|
getCurrentScreen()->onUpdate(elapsed_time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ModalDialog::isADialogActive())
|
if (ScreenKeyboard::isActive())
|
||||||
|
{
|
||||||
|
ScreenKeyboard::getCurrent()->onUpdate(dt);
|
||||||
|
}
|
||||||
|
else if (ModalDialog::isADialogActive())
|
||||||
{
|
{
|
||||||
ModalDialog::getCurrent()->onUpdate(dt);
|
ModalDialog::getCurrent()->onUpdate(dt);
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,23 @@ typedef std::string KeyboardLayout[KEYBOARD_ROWS_NUM][KEYBOARD_COLS_NUM];
|
|||||||
|
|
||||||
KeyboardLayout layout_lower =
|
KeyboardLayout layout_lower =
|
||||||
{{"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "123" },
|
{{"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "123" },
|
||||||
{"a", "s", "d", "f", "g", "h", "j", "k", "l", "Back", "Shift"},
|
{"a", "s", "d", "f", "g", "h", "j", "k", "l", "Shift", "Back" },
|
||||||
{"z", "x", "c", "v", "b", "n", "m", ",", ".", "Space", "Enter"}};
|
{"z", "x", "c", "v", "b", "n", "m", ",", ".", "Space", "Enter"}};
|
||||||
|
|
||||||
KeyboardLayout layout_upper =
|
KeyboardLayout layout_upper =
|
||||||
{{"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "123" },
|
{{"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "123" },
|
||||||
{"A", "S", "D", "F", "G", "H", "J", "K", "L", "Back", "Shift"},
|
{"A", "S", "D", "F", "G", "H", "J", "K", "L", "Shift", "Back" },
|
||||||
{"Z", "X", "C", "V", "B", "N", "M", ",", ".", "Space", "Enter"}};
|
{"Z", "X", "C", "V", "B", "N", "M", ",", ".", "Space", "Enter"}};
|
||||||
|
|
||||||
KeyboardLayout layout_digits =
|
KeyboardLayout layout_digits =
|
||||||
{{"1", "2", "3", "!", "@", "#", "$", "%", "^", "&", "Text" },
|
{{"1", "2", "3", "!", "@", "#", "$", "%", "^", "&", "Text" },
|
||||||
{"4", "5", "6", "*", "(", ")", "-", "_", "=", "Back", "Shift"},
|
{"4", "5", "6", "*", "(", ")", "-", "+", "?", "Shift", "Back" },
|
||||||
{"7", "8", "9", "0", "+", "/", "?", ",", ".", "Space", "Enter"}};
|
{"7", "8", "9", "0", "\"", ";", ":", ",", ".", "Space", "Enter"}};
|
||||||
|
|
||||||
KeyboardLayout layout_digits2 =
|
KeyboardLayout layout_digits2 =
|
||||||
{{"1", "2", "3", "[", "]", "{", "}", ";", ":", "\\", "Text" },
|
{{"1", "2", "3", "[", "]", "{", "}", "~", "`", "\\", "Text" },
|
||||||
{"4", "5", "6", "|", "\'", "\"", "<", ">", "`", "Back", "Shift"},
|
{"4", "5", "6", "|", "<", ">", "_", "=", "/", "Shift", "Back" },
|
||||||
{"7", "8", "9", "0", "~", "/", "?", ",", ".", "Space", "Enter"}};
|
{"7", "8", "9", "0", "\'", ";", ":", ",", ".", "Space", "Enter"}};
|
||||||
|
|
||||||
ScreenKeyboard* ScreenKeyboard::m_screen_keyboard = NULL;
|
ScreenKeyboard* ScreenKeyboard::m_screen_keyboard = NULL;
|
||||||
|
|
||||||
@ -81,6 +81,8 @@ ScreenKeyboard::ScreenKeyboard(float percent_width, float percent_height,
|
|||||||
m_percent_height = std::min(std::max(percent_height, 0.0f), 1.0f);
|
m_percent_height = std::min(std::max(percent_height, 0.0f), 1.0f);
|
||||||
m_irrlicht_window = NULL;
|
m_irrlicht_window = NULL;
|
||||||
m_edit_box = edit_box;
|
m_edit_box = edit_box;
|
||||||
|
m_back_button = NULL;
|
||||||
|
m_repeat_time = 0;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
} // ScreenKeyboard
|
} // ScreenKeyboard
|
||||||
@ -135,6 +137,10 @@ void ScreenKeyboard::init()
|
|||||||
|
|
||||||
createButtons();
|
createButtons();
|
||||||
assignButtons(BUTTONS_LOWER);
|
assignButtons(BUTTONS_LOWER);
|
||||||
|
|
||||||
|
Widget* button_widget = getWidget<ButtonWidget>("Back");
|
||||||
|
assert(button_widget != NULL);
|
||||||
|
m_back_button = button_widget->getIrrlichtElement<IGUIButton>();
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -179,6 +185,37 @@ void ScreenKeyboard::createButtons()
|
|||||||
addWidgetsRecursively(m_widgets);
|
addWidgetsRecursively(m_widgets);
|
||||||
} // createButtons
|
} // createButtons
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
std::wstring ScreenKeyboard::getKeyName(std::string key_id)
|
||||||
|
{
|
||||||
|
std::wstring key_name;
|
||||||
|
|
||||||
|
if (key_id == "Enter")
|
||||||
|
{
|
||||||
|
key_name = L"\u23CE";
|
||||||
|
}
|
||||||
|
else if (key_id == "Shift")
|
||||||
|
{
|
||||||
|
key_name = L"\u21E7";
|
||||||
|
}
|
||||||
|
else if (key_id == "Back")
|
||||||
|
{
|
||||||
|
key_name = L"\u232B";
|
||||||
|
}
|
||||||
|
else if (key_id == "Space")
|
||||||
|
{
|
||||||
|
key_name = L"\u2423";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::wstring tmp(key_id.begin(), key_id.end());
|
||||||
|
key_name = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return key_name;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** A function that allows to select one of the available buttons layout
|
/** A function that allows to select one of the available buttons layout
|
||||||
* \param buttons_type One of the available buttons type
|
* \param buttons_type One of the available buttons type
|
||||||
@ -213,14 +250,52 @@ void ScreenKeyboard::assignButtons(ButtonsType buttons_type)
|
|||||||
for (int j = 0; j < KEYBOARD_COLS_NUM; j++)
|
for (int j = 0; j < KEYBOARD_COLS_NUM; j++)
|
||||||
{
|
{
|
||||||
std::string key = keys != NULL ? (*keys)[i][j] : "?";
|
std::string key = keys != NULL ? (*keys)[i][j] : "?";
|
||||||
|
std::wstring key_name = getKeyName(key);
|
||||||
|
|
||||||
ButtonWidget* button = m_buttons[i * KEYBOARD_COLS_NUM + j];
|
ButtonWidget* button = m_buttons[i * KEYBOARD_COLS_NUM + j];
|
||||||
button->setText(key.c_str());
|
|
||||||
|
button->setText(key_name.c_str());
|
||||||
button->m_properties[PROP_ID] = key;
|
button->m_properties[PROP_ID] = key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // assignButtons
|
} // assignButtons
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void ScreenKeyboard::onUpdate(float dt)
|
||||||
|
{
|
||||||
|
if (m_back_button->isPressed())
|
||||||
|
{
|
||||||
|
const unsigned int repeat_rate = 40;
|
||||||
|
const unsigned int repeat_delay = 400;
|
||||||
|
|
||||||
|
SEvent event;
|
||||||
|
event.KeyInput.Key = IRR_KEY_BACK;
|
||||||
|
event.KeyInput.Char = 0;
|
||||||
|
event.EventType = EET_KEY_INPUT_EVENT;
|
||||||
|
event.KeyInput.PressedDown = true;
|
||||||
|
event.KeyInput.Control = false;
|
||||||
|
event.KeyInput.Shift = false;
|
||||||
|
|
||||||
|
if (m_repeat_time == 0)
|
||||||
|
{
|
||||||
|
m_edit_box->OnEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (m_repeat_time > repeat_delay + repeat_rate)
|
||||||
|
{
|
||||||
|
m_edit_box->OnEvent(event);
|
||||||
|
m_repeat_time -= repeat_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_repeat_time += (unsigned int)(dt * 1000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_repeat_time = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** A function that handles buttons events
|
/** A function that handles buttons events
|
||||||
* \param eventSource Button ID
|
* \param eventSource Button ID
|
||||||
@ -272,9 +347,7 @@ EventPropagation ScreenKeyboard::processEvent(const std::string& eventSource)
|
|||||||
}
|
}
|
||||||
else if (eventSource == "Back")
|
else if (eventSource == "Back")
|
||||||
{
|
{
|
||||||
event.KeyInput.Key = IRR_KEY_BACK;
|
send_event = false;
|
||||||
event.KeyInput.Char = 0;
|
|
||||||
send_event = true;
|
|
||||||
}
|
}
|
||||||
else if (eventSource == "Space")
|
else if (eventSource == "Space")
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#ifndef HEADER_SCREEN_KEYBOARD_HPP
|
#ifndef HEADER_SCREEN_KEYBOARD_HPP
|
||||||
#define HEADER_SCREEN_KEYBOARD_HPP
|
#define HEADER_SCREEN_KEYBOARD_HPP
|
||||||
|
|
||||||
|
#include <IGUIButton.h>
|
||||||
#include <IGUIWindow.h>
|
#include <IGUIWindow.h>
|
||||||
|
|
||||||
#include "guiengine/abstract_top_level_container.hpp"
|
#include "guiengine/abstract_top_level_container.hpp"
|
||||||
@ -67,9 +68,15 @@ namespace GUIEngine
|
|||||||
* that is used by the keyboard */
|
* that is used by the keyboard */
|
||||||
float m_percent_height;
|
float m_percent_height;
|
||||||
|
|
||||||
|
/** A time for repeat key feature */
|
||||||
|
unsigned int m_repeat_time;
|
||||||
|
|
||||||
/** The edit box that is assigned to the keyboard */
|
/** The edit box that is assigned to the keyboard */
|
||||||
CGUIEditBox* m_edit_box;
|
CGUIEditBox* m_edit_box;
|
||||||
|
|
||||||
|
/** A button that is used as backspace key */
|
||||||
|
irr::gui::IGUIButton* m_back_button;
|
||||||
|
|
||||||
/** Remembers currently selected button type */
|
/** Remembers currently selected button type */
|
||||||
ButtonsType m_buttons_type;
|
ButtonsType m_buttons_type;
|
||||||
|
|
||||||
@ -88,6 +95,7 @@ namespace GUIEngine
|
|||||||
void init();
|
void init();
|
||||||
void createButtons();
|
void createButtons();
|
||||||
void assignButtons(ButtonsType buttons_type);
|
void assignButtons(ButtonsType buttons_type);
|
||||||
|
std::wstring getKeyName(std::string key_id);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LEAK_CHECK()
|
LEAK_CHECK()
|
||||||
@ -100,7 +108,6 @@ namespace GUIEngine
|
|||||||
|
|
||||||
static void dismiss();
|
static void dismiss();
|
||||||
static bool onEscapePressed();
|
static bool onEscapePressed();
|
||||||
|
|
||||||
/** Returns pointer to the created keyboard or NULL if keyboard was
|
/** Returns pointer to the created keyboard or NULL if keyboard was
|
||||||
* not created */
|
* not created */
|
||||||
static ScreenKeyboard* getCurrent() {return m_screen_keyboard;}
|
static ScreenKeyboard* getCurrent() {return m_screen_keyboard;}
|
||||||
@ -108,6 +115,9 @@ namespace GUIEngine
|
|||||||
/** Returns true if keyboard is created */
|
/** Returns true if keyboard is created */
|
||||||
static bool isActive() {return m_screen_keyboard != NULL;}
|
static bool isActive() {return m_screen_keyboard != NULL;}
|
||||||
|
|
||||||
|
/** Override to be notified of updates */
|
||||||
|
virtual void onUpdate(float dt);
|
||||||
|
|
||||||
/** Get irrlicht window used by the keyboard widget */
|
/** Get irrlicht window used by the keyboard widget */
|
||||||
irr::gui::IGUIWindow* getIrrlichtElement() {return m_irrlicht_window;}
|
irr::gui::IGUIWindow* getIrrlichtElement() {return m_irrlicht_window;}
|
||||||
|
|
||||||
|
@ -809,7 +809,7 @@ void InputManager::dispatchInput(Input::InputType type, int deviceID,
|
|||||||
Controller* controller = pk->getController();
|
Controller* controller = pk->getController();
|
||||||
if (controller != NULL) controller->action(action, abs(value));
|
if (controller != NULL) controller->action(action, abs(value));
|
||||||
}
|
}
|
||||||
else if (race_manager->isWatchingReplay())
|
else if (race_manager->isWatchingReplay() && !GUIEngine::ModalDialog::isADialogActive())
|
||||||
{
|
{
|
||||||
// Get the first ghost kart
|
// Get the first ghost kart
|
||||||
World::getWorld()->getKart(0)
|
World::getWorld()->getKart(0)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
AssetsAndroid::AssetsAndroid(FileManager* file_manager)
|
AssetsAndroid::AssetsAndroid(FileManager* file_manager)
|
||||||
{
|
{
|
||||||
m_file_manager = file_manager;
|
m_file_manager = file_manager;
|
||||||
|
m_progress_bar = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -203,8 +204,13 @@ void AssetsAndroid::init()
|
|||||||
// Extract data directory from apk if it's needed
|
// Extract data directory from apk if it's needed
|
||||||
if (needs_extract_data)
|
if (needs_extract_data)
|
||||||
{
|
{
|
||||||
|
m_progress_bar = new ProgressBarAndroid();
|
||||||
|
m_progress_bar->draw(0.01f);
|
||||||
|
|
||||||
removeData();
|
removeData();
|
||||||
extractData();
|
extractData();
|
||||||
|
|
||||||
|
delete m_progress_bar;
|
||||||
|
|
||||||
if (!m_file_manager->fileExists(m_stk_dir + "/.extracted"))
|
if (!m_file_manager->fileExists(m_stk_dir + "/.extracted"))
|
||||||
{
|
{
|
||||||
@ -262,8 +268,6 @@ void AssetsAndroid::extractData()
|
|||||||
file.clear();
|
file.clear();
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
ProgressBarAndroid* progress_bar = new ProgressBarAndroid();
|
|
||||||
progress_bar->draw(0.0f);
|
|
||||||
unsigned int current_line = 1;
|
unsigned int current_line = 1;
|
||||||
|
|
||||||
while (!file.eof())
|
while (!file.eof())
|
||||||
@ -277,10 +281,11 @@ void AssetsAndroid::extractData()
|
|||||||
success = extractDir(dir_name);
|
success = extractDir(dir_name);
|
||||||
|
|
||||||
assert(lines_count > 0);
|
assert(lines_count > 0);
|
||||||
progress_bar->draw((float)(current_line) / lines_count);
|
float pos = 0.01f + (float)(current_line) / lines_count * 0.99f;
|
||||||
|
m_progress_bar->draw(pos);
|
||||||
current_line++;
|
current_line++;
|
||||||
|
|
||||||
if (progress_bar->closeEventReceived())
|
if (m_progress_bar->closeEventReceived())
|
||||||
{
|
{
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
@ -288,8 +293,6 @@ void AssetsAndroid::extractData()
|
|||||||
if (!success)
|
if (!success)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete progress_bar;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -21,11 +21,13 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class FileManager;
|
class FileManager;
|
||||||
|
class ProgressBarAndroid;
|
||||||
|
|
||||||
class AssetsAndroid
|
class AssetsAndroid
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
FileManager* m_file_manager;
|
FileManager* m_file_manager;
|
||||||
|
ProgressBarAndroid* m_progress_bar;
|
||||||
std::string m_stk_dir;
|
std::string m_stk_dir;
|
||||||
|
|
||||||
void extractData();
|
void extractData();
|
||||||
|
@ -511,20 +511,16 @@ void Attachment::update(int ticks)
|
|||||||
int slow_flashes = stk_config->time2Ticks(3.0f);
|
int slow_flashes = stk_config->time2Ticks(3.0f);
|
||||||
if (is_shield && m_ticks_left < slow_flashes)
|
if (is_shield && m_ticks_left < slow_flashes)
|
||||||
{
|
{
|
||||||
int flashes_per_second = 4;
|
int ticks_per_flash = stk_config->time2Ticks(0.2f);
|
||||||
int ticks_per_flash = stk_config->time2Ticks(0.25f);
|
|
||||||
|
|
||||||
int fast_flashes = stk_config->time2Ticks(0.5f);
|
int fast_flashes = stk_config->time2Ticks(0.5f);
|
||||||
if (m_ticks_left < fast_flashes)
|
if (m_ticks_left < fast_flashes)
|
||||||
{
|
{
|
||||||
flashes_per_second = 12;
|
ticks_per_flash = stk_config->time2Ticks(0.07f);
|
||||||
ticks_per_flash = stk_config->time2Ticks(1.0f/12);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//int divisor = 2;
|
int division = (m_ticks_left / ticks_per_flash);
|
||||||
//int mod = (int)(m_ticks_left * flashes_per_second * 2) % divisor;
|
m_node->setVisible((division & 0x1) == 0);
|
||||||
int mod = m_ticks_left % ticks_per_flash;
|
|
||||||
m_node->setVisible(mod > ticks_per_flash);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float dt = stk_config->ticks2Time(ticks);
|
float dt = stk_config->ticks2Time(ticks);
|
||||||
|
@ -893,6 +893,7 @@ void LinearWorld::checkForWrongDirection(unsigned int i, int ticks)
|
|||||||
|
|
||||||
if (wrongway_counter > stk_config->time2Ticks(1.0f))
|
if (wrongway_counter > stk_config->time2Ticks(1.0f))
|
||||||
{
|
{
|
||||||
|
m_race_gui->cleanupMessages(0.0f);
|
||||||
m_race_gui->addMessage(_("WRONG WAY!"), kart,
|
m_race_gui->addMessage(_("WRONG WAY!"), kart,
|
||||||
/* time */ -1.0f,
|
/* time */ -1.0f,
|
||||||
video::SColor(255,255,255,255),
|
video::SColor(255,255,255,255),
|
||||||
|
@ -43,7 +43,6 @@ GhostReplayInfoDialog::GhostReplayInfoDialog(unsigned int replay_id)
|
|||||||
(m_rd.m_filename) : m_rd.m_filename).c_str()), false);
|
(m_rd.m_filename) : m_rd.m_filename).c_str()), false);
|
||||||
|
|
||||||
m_back_widget = getWidget<IconButtonWidget>("back");
|
m_back_widget = getWidget<IconButtonWidget>("back");
|
||||||
m_back_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
|
||||||
|
|
||||||
// Non-deletable for custom (standard) replay file
|
// Non-deletable for custom (standard) replay file
|
||||||
getWidget<IconButtonWidget>("remove")->setActive(!m_rd.m_custom_replay_file);
|
getWidget<IconButtonWidget>("remove")->setActive(!m_rd.m_custom_replay_file);
|
||||||
@ -62,6 +61,8 @@ GhostReplayInfoDialog::GhostReplayInfoDialog(unsigned int replay_id)
|
|||||||
m_record_widget->setState(false);
|
m_record_widget->setState(false);
|
||||||
m_watch_widget->setState(false);
|
m_watch_widget->setState(false);
|
||||||
|
|
||||||
|
m_action_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||||
|
m_action_widget->select("start", PLAYER_ID_GAME_MASTER);
|
||||||
} // GhostReplayInfoDialog
|
} // GhostReplayInfoDialog
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -185,7 +185,6 @@ protected:
|
|||||||
|
|
||||||
RaceGUIMultitouch* m_multitouch_gui;
|
RaceGUIMultitouch* m_multitouch_gui;
|
||||||
|
|
||||||
void cleanupMessages(const float dt);
|
|
||||||
//void createMarkerTexture();
|
//void createMarkerTexture();
|
||||||
void createRegularPolygon(unsigned int n, float radius,
|
void createRegularPolygon(unsigned int n, float radius,
|
||||||
const core::vector2df ¢er,
|
const core::vector2df ¢er,
|
||||||
@ -248,6 +247,8 @@ public:
|
|||||||
const core::recti &viewport,
|
const core::recti &viewport,
|
||||||
const core::vector2df &scaling) {};
|
const core::vector2df &scaling) {};
|
||||||
|
|
||||||
|
void cleanupMessages(const float dt);
|
||||||
|
|
||||||
}; // RaceGUIBase
|
}; // RaceGUIBase
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -156,8 +156,8 @@ void BaseUserScreen::init()
|
|||||||
m_new_registered_data = false;
|
m_new_registered_data = false;
|
||||||
if (m_auto_login)
|
if (m_auto_login)
|
||||||
{
|
{
|
||||||
login();
|
|
||||||
m_auto_login = false;
|
m_auto_login = false;
|
||||||
|
login();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_auto_login = false;
|
m_auto_login = false;
|
||||||
@ -403,7 +403,14 @@ void BaseUserScreen::eventCallback(Widget* widget,
|
|||||||
*/
|
*/
|
||||||
void BaseUserScreen::closeScreen()
|
void BaseUserScreen::closeScreen()
|
||||||
{
|
{
|
||||||
StateManager::get()->popMenu();
|
if (StateManager::get()->getMenuStackSize() > 1)
|
||||||
|
{
|
||||||
|
StateManager::get()->popMenu();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||||
|
}
|
||||||
} // closeScreen
|
} // closeScreen
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -122,6 +122,7 @@ enum DebugMenuCommand
|
|||||||
DEBUG_GUI_CAM_NORMAL,
|
DEBUG_GUI_CAM_NORMAL,
|
||||||
DEBUG_GUI_CAM_SMOOTH,
|
DEBUG_GUI_CAM_SMOOTH,
|
||||||
DEBUG_GUI_CAM_ATTACH,
|
DEBUG_GUI_CAM_ATTACH,
|
||||||
|
DEBUG_VIEW_KART_PREVIOUS,
|
||||||
DEBUG_VIEW_KART_ONE,
|
DEBUG_VIEW_KART_ONE,
|
||||||
DEBUG_VIEW_KART_TWO,
|
DEBUG_VIEW_KART_TWO,
|
||||||
DEBUG_VIEW_KART_THREE,
|
DEBUG_VIEW_KART_THREE,
|
||||||
@ -130,6 +131,7 @@ enum DebugMenuCommand
|
|||||||
DEBUG_VIEW_KART_SIX,
|
DEBUG_VIEW_KART_SIX,
|
||||||
DEBUG_VIEW_KART_SEVEN,
|
DEBUG_VIEW_KART_SEVEN,
|
||||||
DEBUG_VIEW_KART_EIGHT,
|
DEBUG_VIEW_KART_EIGHT,
|
||||||
|
DEBUG_VIEW_KART_NEXT,
|
||||||
DEBUG_HIDE_KARTS,
|
DEBUG_HIDE_KARTS,
|
||||||
DEBUG_THROTTLE_FPS,
|
DEBUG_THROTTLE_FPS,
|
||||||
DEBUG_VISUAL_VALUES,
|
DEBUG_VISUAL_VALUES,
|
||||||
@ -244,6 +246,7 @@ LightNode* findNearestLight()
|
|||||||
|
|
||||||
bool handleContextMenuAction(s32 cmd_id)
|
bool handleContextMenuAction(s32 cmd_id)
|
||||||
{
|
{
|
||||||
|
unsigned int kart_num = Camera::getActiveCamera()->getKart()->getWorldKartId();
|
||||||
|
|
||||||
World *world = World::getWorld();
|
World *world = World::getWorld();
|
||||||
Physics *physics = Physics::getInstance();
|
Physics *physics = Physics::getInstance();
|
||||||
@ -603,6 +606,19 @@ bool handleContextMenuAction(s32 cmd_id)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DEBUG_VIEW_KART_PREVIOUS:
|
||||||
|
{
|
||||||
|
if (kart_num == 0)
|
||||||
|
{
|
||||||
|
kart_num += World::getWorld()->getNumKarts() - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kart_num--;
|
||||||
|
}
|
||||||
|
Camera::getActiveCamera()->setKart(World::getWorld()->getKart(kart_num));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DEBUG_VIEW_KART_ONE:
|
case DEBUG_VIEW_KART_ONE:
|
||||||
changeCameraTarget(1);
|
changeCameraTarget(1);
|
||||||
break;
|
break;
|
||||||
@ -627,6 +643,20 @@ bool handleContextMenuAction(s32 cmd_id)
|
|||||||
case DEBUG_VIEW_KART_EIGHT:
|
case DEBUG_VIEW_KART_EIGHT:
|
||||||
changeCameraTarget(8);
|
changeCameraTarget(8);
|
||||||
break;
|
break;
|
||||||
|
case DEBUG_VIEW_KART_NEXT:
|
||||||
|
{
|
||||||
|
if (kart_num == World::getWorld()->getNumKarts() - 1)
|
||||||
|
{
|
||||||
|
kart_num = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kart_num++;
|
||||||
|
}
|
||||||
|
Camera::getActiveCamera()->setKart(World::getWorld()->getKart(kart_num));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case DEBUG_PRINT_START_POS:
|
case DEBUG_PRINT_START_POS:
|
||||||
if (!world) return false;
|
if (!world) return false;
|
||||||
for (unsigned int i = 0; i<world->getNumKarts(); i++)
|
for (unsigned int i = 0; i<world->getNumKarts(); i++)
|
||||||
@ -893,6 +923,7 @@ bool onEvent(const SEvent &event)
|
|||||||
|
|
||||||
mnu->addItem(L"Change camera target >",-1,true, true);
|
mnu->addItem(L"Change camera target >",-1,true, true);
|
||||||
sub = mnu->getSubMenu(5);
|
sub = mnu->getSubMenu(5);
|
||||||
|
sub->addItem(L"To previous kart (Ctrl + F5)", DEBUG_VIEW_KART_PREVIOUS);
|
||||||
sub->addItem(L"To kart one", DEBUG_VIEW_KART_ONE);
|
sub->addItem(L"To kart one", DEBUG_VIEW_KART_ONE);
|
||||||
sub->addItem(L"To kart two", DEBUG_VIEW_KART_TWO);
|
sub->addItem(L"To kart two", DEBUG_VIEW_KART_TWO);
|
||||||
sub->addItem(L"To kart three", DEBUG_VIEW_KART_THREE);
|
sub->addItem(L"To kart three", DEBUG_VIEW_KART_THREE);
|
||||||
@ -901,6 +932,7 @@ bool onEvent(const SEvent &event)
|
|||||||
sub->addItem(L"To kart six", DEBUG_VIEW_KART_SIX);
|
sub->addItem(L"To kart six", DEBUG_VIEW_KART_SIX);
|
||||||
sub->addItem(L"To kart seven", DEBUG_VIEW_KART_SEVEN);
|
sub->addItem(L"To kart seven", DEBUG_VIEW_KART_SEVEN);
|
||||||
sub->addItem(L"To kart eight", DEBUG_VIEW_KART_EIGHT);
|
sub->addItem(L"To kart eight", DEBUG_VIEW_KART_EIGHT);
|
||||||
|
sub->addItem(L"To next kart (Ctrl + F6)", DEBUG_VIEW_KART_NEXT);
|
||||||
|
|
||||||
mnu->addItem(L"Font >",-1,true, true);
|
mnu->addItem(L"Font >",-1,true, true);
|
||||||
sub = mnu->getSubMenu(6);
|
sub = mnu->getSubMenu(6);
|
||||||
@ -970,6 +1002,7 @@ bool onEvent(const SEvent &event)
|
|||||||
|
|
||||||
bool handleStaticAction(int key)
|
bool handleStaticAction(int key)
|
||||||
{
|
{
|
||||||
|
unsigned int kart_num = Camera::getActiveCamera()->getKart()->getWorldKartId();
|
||||||
if (key == IRR_KEY_F1)
|
if (key == IRR_KEY_F1)
|
||||||
{
|
{
|
||||||
handleContextMenuAction(DEBUG_GUI_CAM_FREE);
|
handleContextMenuAction(DEBUG_GUI_CAM_FREE);
|
||||||
@ -985,6 +1018,32 @@ bool handleStaticAction(int key)
|
|||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (key == IRR_KEY_F5)
|
||||||
|
{
|
||||||
|
if (kart_num == 0)
|
||||||
|
{
|
||||||
|
kart_num += World::getWorld()->getNumKarts() - 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kart_num--;
|
||||||
|
}
|
||||||
|
Camera::getActiveCamera()->setKart(World::getWorld()->getKart(kart_num));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (key == IRR_KEY_F6)
|
||||||
|
{
|
||||||
|
if (kart_num == World::getWorld()->getNumKarts() - 1)
|
||||||
|
{
|
||||||
|
kart_num = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kart_num++;
|
||||||
|
}
|
||||||
|
Camera::getActiveCamera()->setKart(World::getWorld()->getKart(kart_num));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// TODO: create more keyboard shortcuts
|
// TODO: create more keyboard shortcuts
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
for track in abyss cocoa_temple fortmagma greenvalley lighthouse olivermath snowmountain stk_enterprise zengarden hacienda mansion snowtuxpeak farm mines sandtrack city gran_paradiso_island minigolf scotland xr591; do
|
for track in abyss candela_city cocoa_temple cornfield_crossing fortmagma gran_paradiso_island greenvalley hacienda lighthouse mansion mines minigolf olivermath sandtrack scotland snowmountain snowtuxpeak stk_enterprise volcano_island xr591 zengarden; do
|
||||||
echo "Testing $track"
|
echo "Testing $track"
|
||||||
$1 --log=0 -R \
|
$1 --log=0 -R \
|
||||||
--ai=nolok,nolok,nolok,nolok,nolok,nolok,nolok,nolok \
|
--ai=nolok,nolok,nolok,nolok,nolok,nolok,nolok,nolok \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user