mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Android crap. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5625 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
facae6f175
commit
5672004ba1
8 changed files with 57 additions and 98 deletions
|
@ -20,15 +20,23 @@ LOCAL_MODULE := duke
|
||||||
|
|
||||||
# -O2 -fvisibility=hidden
|
# -O2 -fvisibility=hidden
|
||||||
|
|
||||||
LOCAL_CFLAGS := -x c++ -std=gnu++11 -fvisibility=hidden -fPIC -O2 -DNDEBUG -DUSING_LTO -flto -fno-stack-protector -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=0 -pthread -DHAVE_INTTYPES -D_GNU_SOURCE=1 -D_REENTRANT
|
LOCAL_CFLAGS := -x c++ -std=gnu++11 -fvisibility=hidden -fPIC -fno-stack-protector -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=0 -pthread -DHAVE_INTTYPES -D_GNU_SOURCE=1 -D_REENTRANT
|
||||||
|
|
||||||
|
ifeq ($(NDK_DEBUG), 1)
|
||||||
|
LOCAL_CFLAGS += -O0 -ggdb -fno-omit-frame-pointer
|
||||||
|
else
|
||||||
|
LOCAL_CFLAGS += -O2 -DNDEBUG -DUSING_LTO -flto
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_CFLAGS += -W -Werror-implicit-function-declaration -Wpointer-arith -Wextra -Wno-unused-result -Wno-char-subscripts -Wno-strict-overflow -Wno-attributes -Wno-write-strings
|
LOCAL_CFLAGS += -W -Werror-implicit-function-declaration -Wpointer-arith -Wextra -Wno-unused-result -Wno-char-subscripts -Wno-strict-overflow -Wno-attributes -Wno-write-strings
|
||||||
LOCAL_CPPFLAGS := -std=gnu++03
|
LOCAL_CPPFLAGS := -std=gnu++03
|
||||||
|
|
||||||
LOCAL_CFLAGS += -DHAVE_SDL -DHAVE_VORBIS -DHAVE_JWZGLES -DHAVE_ANDROID -DRENDERTYPESDL=1 -DUSE_OPENGL -DNETCODE_DISABLE -DUSE_LIBVPX
|
LOCAL_CFLAGS += -DHAVE_SDL -DHAVE_VORBIS -DHAVE_JWZGLES -DHAVE_ANDROID -DRENDERTYPESDL=1 -DUSE_OPENGL -DNETCODE_DISABLE -DUSE_LIBVPX
|
||||||
|
|
||||||
#LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
||||||
|
|
||||||
LOCAL_LDFLAGS := -fuse-ld=bfd
|
LOCAL_LDFLAGS := -fuse-ld=bfd
|
||||||
|
TARGET_LDFLAGS += -Wl,--no-warn-mismatch -lm_hard
|
||||||
LOCAL_ARM_NEON = true
|
LOCAL_ARM_NEON = true
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/source $(LOCAL_PATH)/source/jmact $(LOCAL_PATH)/source/jaudiolib/include $(LOCAL_PATH)/source/enet/include $(LOCAL_PATH)/build/include
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/source $(LOCAL_PATH)/source/jmact $(LOCAL_PATH)/source/jaudiolib/include $(LOCAL_PATH)/source/enet/include $(LOCAL_PATH)/build/include
|
||||||
|
@ -142,11 +150,6 @@ LOCAL_STATIC_LIBRARIES := libpng crypto
|
||||||
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer libvpx
|
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer libvpx
|
||||||
# SDL2_image
|
# SDL2_image
|
||||||
|
|
||||||
ifeq ($(GP_LIC),1)
|
|
||||||
LOCAL_STATIC_LIBRARIES += s-setup
|
|
||||||
LOCAL_CFLAGS += -DGP_LIC
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -677,9 +677,6 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t intexfmt, int32_t texfmt
|
||||||
bglTexSubImage2D(GL_TEXTURE_2D,0,0,0,siz.x,siz.y,texfmt,GL_UNSIGNED_BYTE,pic); //overwrite old texture
|
bglTexSubImage2D(GL_TEXTURE_2D,0,0,0,siz.x,siz.y,texfmt,GL_UNSIGNED_BYTE,pic); //overwrite old texture
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA8,xsiz,ysiz,texfmt,GL_UNSIGNED_BYTE,pic); //Needs C++ to link?
|
|
||||||
#elif 1
|
|
||||||
vec2_t siz2 = siz;
|
vec2_t siz2 = siz;
|
||||||
|
|
||||||
for (int j=1; (siz2.x > 1) || (siz2.y > 1); j++)
|
for (int j=1; (siz2.x > 1) || (siz2.y > 1); j++)
|
||||||
|
@ -739,7 +736,6 @@ void uploadtexture(int32_t doalloc, vec2_t siz, int32_t intexfmt, int32_t texfmt
|
||||||
|
|
||||||
siz2 = siz3;
|
siz2 = siz3;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "TouchControlsContainer.h"
|
#include "TouchControlsContainer.h"
|
||||||
#include "JNITouchControlsUtils.h"
|
#include "JNITouchControlsUtils.h"
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#include "s-setup/s-setup.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#define DEFAULT_FADE_FRAMES 10
|
#define DEFAULT_FADE_FRAMES 10
|
||||||
|
|
||||||
|
@ -88,6 +84,7 @@ droidsysinfo_t droidinfo;
|
||||||
static int curRenderer;
|
static int curRenderer;
|
||||||
|
|
||||||
static bool hideTouchControls = true;
|
static bool hideTouchControls = true;
|
||||||
|
static bool hasTouch = false;
|
||||||
static int weaponWheelVisible = false;
|
static int weaponWheelVisible = false;
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,6 +194,9 @@ void gameSettingsButton(int state)
|
||||||
|
|
||||||
void showWeaponsInventory(bool show)
|
void showWeaponsInventory(bool show)
|
||||||
{
|
{
|
||||||
|
if (!controlsCreated)
|
||||||
|
return;
|
||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
for (int n = 0; n < 10; n++)
|
for (int n = 0; n < 10; n++)
|
||||||
|
@ -216,8 +216,16 @@ void showWeaponsInventory(bool show)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AndroidShowKeyboard(int onf)
|
||||||
|
{
|
||||||
|
showKeyboard(onf);
|
||||||
|
}
|
||||||
|
|
||||||
void gameButton(int state, int code)
|
void gameButton(int state, int code)
|
||||||
{
|
{
|
||||||
|
if (!controlsCreated)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (code)
|
switch (code)
|
||||||
{
|
{
|
||||||
case gamefunc_Fire:
|
case gamefunc_Fire:
|
||||||
|
@ -312,7 +320,7 @@ void blankTapButton(int state, int code)
|
||||||
|
|
||||||
void weaponWheelSelected(int enabled) {
|
void weaponWheelSelected(int enabled) {
|
||||||
showWeaponsInventory(enabled ? true : false);
|
showWeaponsInventory(enabled ? true : false);
|
||||||
PortableTimer(enabled ? 30 : 120);
|
PortableTimer(enabled ? 0 : 120);
|
||||||
}
|
}
|
||||||
|
|
||||||
void weaponWheelChosen(int segment)
|
void weaponWheelChosen(int segment)
|
||||||
|
@ -452,7 +460,7 @@ void initControls(int width, int height, const char *graphics_path)
|
||||||
|
|
||||||
tcGameMain->addControl(new touchcontrols::Button("use", touchcontrols::RectF(20, 4, 23, 7), "use", gamefunc_Open));
|
tcGameMain->addControl(new touchcontrols::Button("use", touchcontrols::RectF(20, 4, 23, 7), "use", gamefunc_Open));
|
||||||
tcGameMain->addControl(
|
tcGameMain->addControl(
|
||||||
new touchcontrols::Button("attack", touchcontrols::RectF(20, 7, 23, 10), "fire2", gamefunc_Fire));
|
new touchcontrols::Button("fire", touchcontrols::RectF(20, 7, 23, 10), "fire2", gamefunc_Fire));
|
||||||
tcGameMain->addControl(
|
tcGameMain->addControl(
|
||||||
new touchcontrols::Button("jump", touchcontrols::RectF(23, 6, 26, 9), "jump", gamefunc_Jump));
|
new touchcontrols::Button("jump", touchcontrols::RectF(23, 6, 26, 9), "jump", gamefunc_Jump));
|
||||||
tcGameMain->addControl(
|
tcGameMain->addControl(
|
||||||
|
@ -575,6 +583,8 @@ void initControls(int width, int height, const char *graphics_path)
|
||||||
void updateTouchScreenMode(touchscreemode_t mode)
|
void updateTouchScreenMode(touchscreemode_t mode)
|
||||||
{
|
{
|
||||||
// LOGI("updateTouchScreenModeA %d",mode);
|
// LOGI("updateTouchScreenModeA %d",mode);
|
||||||
|
if (!controlsCreated)
|
||||||
|
return;
|
||||||
|
|
||||||
static touchscreemode_t lastMode = TOUCH_SCREEN_BLANK;
|
static touchscreemode_t lastMode = TOUCH_SCREEN_BLANK;
|
||||||
|
|
||||||
|
@ -649,12 +659,6 @@ void updateTouchScreenMode(touchscreemode_t mode)
|
||||||
inv_buttons[i]->setAlpha(tcGameWeapons->getFadedAlpha() * ((inv & (1 << i)) ? 1.f : 0.3f));
|
inv_buttons[i]->setAlpha(tcGameWeapons->getFadedAlpha() * ((inv & (1 << i)) ? 1.f : 0.3f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#define GP_LIC_INC 1
|
|
||||||
#include "s-setup/gp_lic_include.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char videomodereset;
|
extern char videomodereset;
|
||||||
|
|
||||||
void frameControls()
|
void frameControls()
|
||||||
|
@ -679,6 +683,9 @@ void frameControls()
|
||||||
|
|
||||||
curRenderer = (PortableRead(READ_RENDERER) != REND_CLASSIC);
|
curRenderer = (PortableRead(READ_RENDERER) != REND_CLASSIC);
|
||||||
|
|
||||||
|
if (!controlsCreated)
|
||||||
|
return;
|
||||||
|
|
||||||
updateTouchScreenMode((touchscreemode_t)PortableRead(READ_SCREEN_MODE));
|
updateTouchScreenMode((touchscreemode_t)PortableRead(READ_SCREEN_MODE));
|
||||||
|
|
||||||
setHideSticks(droidinput.hideStick);
|
setHideSticks(droidinput.hideStick);
|
||||||
|
@ -696,21 +703,16 @@ void frameControls()
|
||||||
}
|
}
|
||||||
|
|
||||||
controlsContainer.draw();
|
controlsContainer.draw();
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#undef GP_LIC_INC
|
|
||||||
#define GP_LIC_INC 2
|
|
||||||
#include "s-setup/gp_lic_include.h"
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTouchSettings(int other)
|
void setTouchSettings(int other)
|
||||||
{
|
{
|
||||||
// TODO: defined names for these values
|
// TODO: defined names for these values
|
||||||
hideTouchControls = other & 0x80000000 ? true : false;
|
hasTouch = other & 0x4000 ? true : false;
|
||||||
|
hideTouchControls = other & 0x8000 ? true : false;
|
||||||
|
|
||||||
// keep in sync with Duke3d/res/values/strings.xml
|
// keep in sync with Duke3d/res/values/strings.xml
|
||||||
int doubletap_options[5] = { -1, gamefunc_Quick_Kick, gamefunc_AutoRun, gamefunc_MedKit, gamefunc_Jetpack };
|
int doubletap_options[4] = { -1, gamefunc_Quick_Kick, gamefunc_MedKit, gamefunc_Jetpack };
|
||||||
|
|
||||||
droidinput.left_double_action = doubletap_options[((other >> 4) & 0xF)];
|
droidinput.left_double_action = doubletap_options[((other >> 4) & 0xF)];
|
||||||
droidinput.right_double_action = doubletap_options[((other >> 8) & 0xF)];
|
droidinput.right_double_action = doubletap_options[((other >> 8) & 0xF)];
|
||||||
|
@ -729,19 +731,14 @@ static inline const char *getGamePath() { return gamePath.c_str(); }
|
||||||
|
|
||||||
jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_init(JNIEnv *env, jobject thiz, jstring graphics_dir,
|
jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_init(JNIEnv *env, jobject thiz, jstring graphics_dir,
|
||||||
jint audio_rate, jint audio_buffer_size,
|
jint audio_rate, jint audio_buffer_size,
|
||||||
jobjectArray argsArray, jint renderer,
|
jobjectArray argsArray,
|
||||||
jstring jduke3d_path)
|
jstring jduke3d_path)
|
||||||
{
|
{
|
||||||
env_ = env;
|
env_ = env;
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
getGlobalClasses(env_);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
droidinfo.audio_sample_rate = audio_rate;
|
droidinfo.audio_sample_rate = audio_rate;
|
||||||
droidinfo.audio_buffer_size = audio_buffer_size;
|
droidinfo.audio_buffer_size = audio_buffer_size;
|
||||||
|
|
||||||
// curRenderer = renderer;
|
|
||||||
curRenderer = REND_GL;
|
curRenderer = REND_GL;
|
||||||
|
|
||||||
argv[0] = "eduke32";
|
argv[0] = "eduke32";
|
||||||
|
@ -760,10 +757,6 @@ jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_init(JNIEnv *env, jobj
|
||||||
// Change working dir, save games etc
|
// Change working dir, save games etc
|
||||||
// FIXME: potentially conflicts with chdirs in -game_dir support
|
// FIXME: potentially conflicts with chdirs in -game_dir support
|
||||||
chdir(getGamePath());
|
chdir(getGamePath());
|
||||||
char timidity_env[512];
|
|
||||||
|
|
||||||
sprintf(timidity_env, "TIMIDITY_CFG=%s/../timidity.cfg", getGamePath());
|
|
||||||
putenv(timidity_env);
|
|
||||||
|
|
||||||
LOGI("duke3d_path = %s", getGamePath());
|
LOGI("duke3d_path = %s", getGamePath());
|
||||||
|
|
||||||
|
@ -772,24 +765,14 @@ jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_init(JNIEnv *env, jobj
|
||||||
|
|
||||||
LOGI("obbPath = %s", obbPath.c_str());
|
LOGI("obbPath = %s", obbPath.c_str());
|
||||||
|
|
||||||
initControls(droidinfo.screen_width, droidinfo.screen_height, (obbPath + "/assets/").c_str());
|
if (hasTouch)
|
||||||
|
initControls(droidinfo.screen_width, droidinfo.screen_height, (obbPath + "/assets/").c_str());
|
||||||
|
|
||||||
PortableInit(argc, argv);
|
PortableInit(argc, argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_frame(JNIEnv *env, jobject thiz)
|
|
||||||
{
|
|
||||||
LOGI("Java_com_voidpoint_duke3d_engine_NativeLib_frame");
|
|
||||||
|
|
||||||
// frameControls();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
__attribute__((visibility("default"))) jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
__attribute__((visibility("default"))) jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||||
{
|
{
|
||||||
LOGI("JNI_OnLoad");
|
LOGI("JNI_OnLoad");
|
||||||
|
@ -827,36 +810,26 @@ void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_doAction(JNIEnv *env,
|
||||||
LOGI("doAction %d %d", state, action);
|
LOGI("doAction %d %d", state, action);
|
||||||
|
|
||||||
// gamepadButtonPressed();
|
// gamepadButtonPressed();
|
||||||
if (hideTouchControls && tcGameMain)
|
if (controlsCreated && hideTouchControls && tcGameMain)
|
||||||
{
|
{
|
||||||
if (tcGameMain->isEnabled())
|
if (tcGameMain->isEnabled())
|
||||||
tcGameMain->animateOut(30);
|
tcGameMain->setEnabled(false);
|
||||||
|
|
||||||
if (tcGameWeapons && tcGameWeapons->isEnabled())
|
if (tcGameWeapons && tcGameWeapons->isEnabled())
|
||||||
tcGameWeapons->animateOut(30);
|
tcGameWeapons->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
PortableAction(state, action);
|
PortableAction(state, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogFwd(JNIEnv *env, jobject obj, jfloat v)
|
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogMove(JNIEnv *env, jobject obj, jfloat fwd, jfloat strafe)
|
||||||
{
|
{
|
||||||
PortableMove(v, NAN);
|
PortableMove(fwd, strafe);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogSide(JNIEnv *env, jobject obj, jfloat v)
|
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogLook(JNIEnv *env, jobject obj, jfloat pitch, jfloat yaw)
|
||||||
{
|
{
|
||||||
PortableMove(NAN, v);
|
PortableLookJoystick(yaw, pitch);
|
||||||
}
|
|
||||||
|
|
||||||
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogPitch(JNIEnv *env, jobject obj, jint mode, jfloat v)
|
|
||||||
{
|
|
||||||
PortableLookJoystick(NAN, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_analogYaw(JNIEnv *env, jobject obj, jint mode, jfloat v)
|
|
||||||
{
|
|
||||||
PortableLookJoystick(v, NAN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXPORT_ME
|
void EXPORT_ME
|
||||||
|
@ -920,9 +893,4 @@ jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_getScreenshot(JNIEnv *
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#undef GP_LIC_INC
|
|
||||||
#define GP_LIC_INC 3
|
|
||||||
#include "s-setup/gp_lic_include.h"
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ int PortableTimer(int tics) { G_InitTimer(tics); }
|
||||||
int PortableKeyEvent(int state, int code,int unicode)
|
int PortableKeyEvent(int state, int code,int unicode)
|
||||||
{
|
{
|
||||||
LOGI("PortableKeyEvent %d %d %d",state,(SDL_Scancode)code,unicode);
|
LOGI("PortableKeyEvent %d %d %d",state,(SDL_Scancode)code,unicode);
|
||||||
|
|
||||||
SDL_SendKeyboardKey(state ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)code);
|
SDL_SendKeyboardKey(state ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)code);
|
||||||
SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
|
SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
|
||||||
|
|
||||||
|
@ -117,11 +116,6 @@ void changeActionState(int state, int action)
|
||||||
droidinput.functionHeld &= ~((uint64_t) 1<<((uint64_t) (action)));
|
droidinput.functionHeld &= ~((uint64_t) 1<<((uint64_t) (action)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#define GP_LIC_INC 4
|
|
||||||
#include "s-setup/gp_lic_include.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void PortableAction(int state, int action)
|
void PortableAction(int state, int action)
|
||||||
{
|
{
|
||||||
LOGI("PortableAction action = %d, state = %d", action, state);
|
LOGI("PortableAction action = %d, state = %d", action, state);
|
||||||
|
@ -141,11 +135,6 @@ void PortableAction(int state, int action)
|
||||||
//if (PortableRead(READ_SCREEN_MODE) != TOUCH_SCREEN_GAME) //If not in game don't do any of this
|
//if (PortableRead(READ_SCREEN_MODE) != TOUCH_SCREEN_GAME) //If not in game don't do any of this
|
||||||
/// return;
|
/// return;
|
||||||
|
|
||||||
#ifdef GP_LIC
|
|
||||||
#define GP_LIC_INC 5
|
|
||||||
#include "s-setup/gp_lic_include.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Special toggle for crouch, NOT when using jetpack or in water
|
//Special toggle for crouch, NOT when using jetpack or in water
|
||||||
if (droidinput.toggleCrouch)
|
if (droidinput.toggleCrouch)
|
||||||
{
|
{
|
||||||
|
@ -343,7 +332,6 @@ void CONTROL_Android_SetLastWeapon(int w)
|
||||||
|
|
||||||
void CONTROL_Android_ClearButton(int32_t whichbutton)
|
void CONTROL_Android_ClearButton(int32_t whichbutton)
|
||||||
{
|
{
|
||||||
BUTTONCLEAR(whichbutton);
|
|
||||||
droidinput.functionHeld &= ~((uint64_t)1<<((uint64_t)(whichbutton)));
|
droidinput.functionHeld &= ~((uint64_t)1<<((uint64_t)(whichbutton)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,9 +343,9 @@ void CONTROL_Android_PollDevices(ControlInfo *info)
|
||||||
info->dz = (int32_t)nearbyintf(-droidinput.forwardmove * ANDROIDMOVEFACTOR);
|
info->dz = (int32_t)nearbyintf(-droidinput.forwardmove * ANDROIDMOVEFACTOR);
|
||||||
info->dx = (int32_t)nearbyintf(droidinput.sidemove * ANDROIDMOVEFACTOR) >> 5;
|
info->dx = (int32_t)nearbyintf(droidinput.sidemove * ANDROIDMOVEFACTOR) >> 5;
|
||||||
info->dpitch =
|
info->dpitch =
|
||||||
(int32_t)nearbyint(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK);
|
(int32_t)nearbyintf(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK);
|
||||||
info->dyaw =
|
info->dyaw =
|
||||||
(int32_t)nearbyint(-droidinput.yaw * ANDROIDLOOKFACTOR - droidinput.yaw_joystick * ANDROIDYAWFACTORJOYSTICK);
|
(int32_t)nearbyintf(-droidinput.yaw * ANDROIDLOOKFACTOR - droidinput.yaw_joystick * ANDROIDYAWFACTORJOYSTICK);
|
||||||
|
|
||||||
droidinput.pitch = droidinput.yaw = 0.f;
|
droidinput.pitch = droidinput.yaw = 0.f;
|
||||||
CONTROL_ButtonState = droidinput.functionSticky | droidinput.functionHeld;
|
CONTROL_ButtonState = droidinput.functionSticky | droidinput.functionHeld;
|
||||||
|
|
|
@ -118,7 +118,7 @@ void PortableAutomapControl(float zoom,float dx,float dy);
|
||||||
|
|
||||||
void PortableInit(int argc, const char ** argv);
|
void PortableInit(int argc, const char ** argv);
|
||||||
|
|
||||||
void AndroidSetConsoleShown(int onf);
|
void AndroidShowKeyboard(int onf);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -745,14 +745,14 @@ static void CONTROL_ButtonFunctionState(int32_t *p1)
|
||||||
|
|
||||||
void CONTROL_ClearButton(int32_t whichbutton)
|
void CONTROL_ClearButton(int32_t whichbutton)
|
||||||
{
|
{
|
||||||
|
if (CONTROL_CheckRange(whichbutton)) return;
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
CONTROL_Android_ClearButton(whichbutton);
|
CONTROL_Android_ClearButton(whichbutton);
|
||||||
#else
|
#endif
|
||||||
if (CONTROL_CheckRange(whichbutton)) return;
|
|
||||||
BUTTONCLEAR(whichbutton);
|
BUTTONCLEAR(whichbutton);
|
||||||
CONTROL_Flags[whichbutton].cleared = TRUE;
|
CONTROL_Flags[whichbutton].cleared = TRUE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CONTROL_ProcessBinds(void)
|
void CONTROL_ProcessBinds(void)
|
||||||
|
@ -805,12 +805,9 @@ void CONTROL_GetInput(ControlInfo *info)
|
||||||
CONTROL_Android_PollDevices(info);
|
CONTROL_Android_PollDevices(info);
|
||||||
#else
|
#else
|
||||||
CONTROL_PollDevices(info);
|
CONTROL_PollDevices(info);
|
||||||
|
|
||||||
CONTROL_GetFunctionInput();
|
CONTROL_GetFunctionInput();
|
||||||
|
|
||||||
inputchecked = 1;
|
inputchecked = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CONTROL_Startup(controltype which, int32_t(*TimeFunction)(void), int32_t ticspersecond)
|
int32_t CONTROL_Startup(controltype which, int32_t(*TimeFunction)(void), int32_t ticspersecond)
|
||||||
|
|
|
@ -51,14 +51,16 @@ extern int32_t voting;
|
||||||
FORCE_INLINE void WithSDL2_StartTextInput()
|
FORCE_INLINE void WithSDL2_StartTextInput()
|
||||||
{
|
{
|
||||||
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
||||||
SDL_StartTextInput();
|
// SDL_StartTextInput();
|
||||||
|
AndroidShowKeyboard(1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE void WithSDL2_StopTextInput()
|
FORCE_INLINE void WithSDL2_StopTextInput()
|
||||||
{
|
{
|
||||||
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
||||||
SDL_StopTextInput();
|
// SDL_StopTextInput();
|
||||||
|
AndroidShowKeyboard(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1318,4 +1318,9 @@ void G_InitDynamicTiles(void)
|
||||||
WeaponPickupSprites[9] = FREEZESPRITE;
|
WeaponPickupSprites[9] = FREEZESPRITE;
|
||||||
WeaponPickupSprites[10] = HEAVYHBOMB;
|
WeaponPickupSprites[10] = HEAVYHBOMB;
|
||||||
WeaponPickupSprites[11] = SHRINKERSPRITE;
|
WeaponPickupSprites[11] = SHRINKERSPRITE;
|
||||||
|
|
||||||
|
// ouch... the big background image takes up a fuckload of memory and takes a second to load!
|
||||||
|
#ifdef EDUKE32_GLES
|
||||||
|
MENUSCREEN = LOADSCREEN = BETASCREEN;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue