mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +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
|
||||
|
||||
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_CPPFLAGS := -std=gnu++03
|
||||
|
||||
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
|
||||
TARGET_LDFLAGS += -Wl,--no-warn-mismatch -lm_hard
|
||||
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
|
||||
|
@ -142,11 +150,6 @@ LOCAL_STATIC_LIBRARIES := libpng crypto
|
|||
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer libvpx
|
||||
# SDL2_image
|
||||
|
||||
ifeq ($(GP_LIC),1)
|
||||
LOCAL_STATIC_LIBRARIES += s-setup
|
||||
LOCAL_CFLAGS += -DGP_LIC
|
||||
endif
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
#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;
|
||||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,10 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "TouchControlsContainer.h"
|
||||
#include "JNITouchControlsUtils.h"
|
||||
|
||||
#ifdef GP_LIC
|
||||
#include "s-setup/s-setup.h"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#define DEFAULT_FADE_FRAMES 10
|
||||
|
||||
|
@ -88,6 +84,7 @@ droidsysinfo_t droidinfo;
|
|||
static int curRenderer;
|
||||
|
||||
static bool hideTouchControls = true;
|
||||
static bool hasTouch = false;
|
||||
static int weaponWheelVisible = false;
|
||||
|
||||
|
||||
|
@ -197,6 +194,9 @@ void gameSettingsButton(int state)
|
|||
|
||||
void showWeaponsInventory(bool show)
|
||||
{
|
||||
if (!controlsCreated)
|
||||
return;
|
||||
|
||||
if (show)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (!controlsCreated)
|
||||
return;
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case gamefunc_Fire:
|
||||
|
@ -312,7 +320,7 @@ void blankTapButton(int state, int code)
|
|||
|
||||
void weaponWheelSelected(int enabled) {
|
||||
showWeaponsInventory(enabled ? true : false);
|
||||
PortableTimer(enabled ? 30 : 120);
|
||||
PortableTimer(enabled ? 0 : 120);
|
||||
}
|
||||
|
||||
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("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(
|
||||
new touchcontrols::Button("jump", touchcontrols::RectF(23, 6, 26, 9), "jump", gamefunc_Jump));
|
||||
tcGameMain->addControl(
|
||||
|
@ -575,6 +583,8 @@ void initControls(int width, int height, const char *graphics_path)
|
|||
void updateTouchScreenMode(touchscreemode_t mode)
|
||||
{
|
||||
// LOGI("updateTouchScreenModeA %d",mode);
|
||||
if (!controlsCreated)
|
||||
return;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
#ifdef GP_LIC
|
||||
#define GP_LIC_INC 1
|
||||
#include "s-setup/gp_lic_include.h"
|
||||
#endif
|
||||
|
||||
extern char videomodereset;
|
||||
|
||||
void frameControls()
|
||||
|
@ -679,6 +683,9 @@ void frameControls()
|
|||
|
||||
curRenderer = (PortableRead(READ_RENDERER) != REND_CLASSIC);
|
||||
|
||||
if (!controlsCreated)
|
||||
return;
|
||||
|
||||
updateTouchScreenMode((touchscreemode_t)PortableRead(READ_SCREEN_MODE));
|
||||
|
||||
setHideSticks(droidinput.hideStick);
|
||||
|
@ -696,21 +703,16 @@ void frameControls()
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
// 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
|
||||
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.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 audio_rate, jint audio_buffer_size,
|
||||
jobjectArray argsArray, jint renderer,
|
||||
jobjectArray argsArray,
|
||||
jstring jduke3d_path)
|
||||
{
|
||||
env_ = env;
|
||||
|
||||
#ifdef GP_LIC
|
||||
getGlobalClasses(env_);
|
||||
#endif
|
||||
|
||||
droidinfo.audio_sample_rate = audio_rate;
|
||||
droidinfo.audio_buffer_size = audio_buffer_size;
|
||||
|
||||
// curRenderer = renderer;
|
||||
curRenderer = REND_GL;
|
||||
|
||||
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
|
||||
// FIXME: potentially conflicts with chdirs in -game_dir support
|
||||
chdir(getGamePath());
|
||||
char timidity_env[512];
|
||||
|
||||
sprintf(timidity_env, "TIMIDITY_CFG=%s/../timidity.cfg", getGamePath());
|
||||
putenv(timidity_env);
|
||||
|
||||
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());
|
||||
|
||||
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);
|
||||
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
// gamepadButtonPressed();
|
||||
if (hideTouchControls && tcGameMain)
|
||||
if (controlsCreated && hideTouchControls && tcGameMain)
|
||||
{
|
||||
if (tcGameMain->isEnabled())
|
||||
tcGameMain->animateOut(30);
|
||||
tcGameMain->setEnabled(false);
|
||||
|
||||
if (tcGameWeapons && tcGameWeapons->isEnabled())
|
||||
tcGameWeapons->animateOut(30);
|
||||
tcGameWeapons->setEnabled(false);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
PortableLookJoystick(yaw, pitch);
|
||||
}
|
||||
|
||||
void EXPORT_ME
|
||||
|
@ -920,9 +893,4 @@ jint EXPORT_ME Java_com_voidpoint_duke3d_engine_NativeLib_getScreenshot(JNIEnv *
|
|||
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)
|
||||
{
|
||||
LOGI("PortableKeyEvent %d %d %d",state,(SDL_Scancode)code,unicode);
|
||||
|
||||
SDL_SendKeyboardKey(state ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)code);
|
||||
SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE);
|
||||
|
||||
|
@ -117,11 +116,6 @@ void changeActionState(int state, int 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)
|
||||
{
|
||||
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
|
||||
/// 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
|
||||
if (droidinput.toggleCrouch)
|
||||
{
|
||||
|
@ -343,7 +332,6 @@ void CONTROL_Android_SetLastWeapon(int w)
|
|||
|
||||
void CONTROL_Android_ClearButton(int32_t whichbutton)
|
||||
{
|
||||
BUTTONCLEAR(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->dx = (int32_t)nearbyintf(droidinput.sidemove * ANDROIDMOVEFACTOR) >> 5;
|
||||
info->dpitch =
|
||||
(int32_t)nearbyint(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK);
|
||||
(int32_t)nearbyintf(droidinput.pitch * ANDROIDLOOKFACTOR + droidinput.pitch_joystick * ANDROIDPITCHFACTORJOYSTICK);
|
||||
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;
|
||||
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 AndroidSetConsoleShown(int onf);
|
||||
void AndroidShowKeyboard(int onf);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -745,14 +745,14 @@ static void CONTROL_ButtonFunctionState(int32_t *p1)
|
|||
|
||||
void CONTROL_ClearButton(int32_t whichbutton)
|
||||
{
|
||||
if (CONTROL_CheckRange(whichbutton)) return;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
CONTROL_Android_ClearButton(whichbutton);
|
||||
#else
|
||||
if (CONTROL_CheckRange(whichbutton)) return;
|
||||
#endif
|
||||
|
||||
BUTTONCLEAR(whichbutton);
|
||||
CONTROL_Flags[whichbutton].cleared = TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CONTROL_ProcessBinds(void)
|
||||
|
@ -805,12 +805,9 @@ void CONTROL_GetInput(ControlInfo *info)
|
|||
CONTROL_Android_PollDevices(info);
|
||||
#else
|
||||
CONTROL_PollDevices(info);
|
||||
|
||||
CONTROL_GetFunctionInput();
|
||||
|
||||
inputchecked = 1;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
||||
SDL_StartTextInput();
|
||||
// SDL_StartTextInput();
|
||||
AndroidShowKeyboard(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
FORCE_INLINE void WithSDL2_StopTextInput()
|
||||
{
|
||||
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
|
||||
SDL_StopTextInput();
|
||||
// SDL_StopTextInput();
|
||||
AndroidShowKeyboard(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1318,4 +1318,9 @@ void G_InitDynamicTiles(void)
|
|||
WeaponPickupSprites[9] = FREEZESPRITE;
|
||||
WeaponPickupSprites[10] = HEAVYHBOMB;
|
||||
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