diff --git a/project/jni/application/teeworlds/src/engine/client/ec_inp.cpp b/project/jni/application/teeworlds/src/engine/client/ec_inp.cpp index 75b502dba..2ffc0e33a 100644 --- a/project/jni/application/teeworlds/src/engine/client/ec_inp.cpp +++ b/project/jni/application/teeworlds/src/engine/client/ec_inp.cpp @@ -46,6 +46,11 @@ void inp_mouse_absolute(int *x, int *y) SDL_GetMouseState(x, y); } +void inp_warp_mouse(int x, int y) +{ + SDL_WarpMouse(x,y); +} + enum { INPUT_BUFFER_SIZE=32 diff --git a/project/jni/application/teeworlds/src/engine/e_config_variables.h b/project/jni/application/teeworlds/src/engine/e_config_variables.h index 0d4e9d5b5..eed66cb3a 100644 --- a/project/jni/application/teeworlds/src/engine/e_config_variables.h +++ b/project/jni/application/teeworlds/src/engine/e_config_variables.h @@ -52,9 +52,15 @@ MACRO_CONFIG_INT(gfx_clear, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Clear screen MACRO_CONFIG_INT(gfx_vsync, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Vertical sync") MACRO_CONFIG_INT(gfx_display_all_modes, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(gfx_texture_compression, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use texture compression") +#ifdef ANDROID +MACRO_CONFIG_INT(gfx_high_detail, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "High detail") +MACRO_CONFIG_INT(gfx_texture_quality, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") +MACRO_CONFIG_INT(gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples") +#else MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "High detail") MACRO_CONFIG_INT(gfx_texture_quality, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(gfx_fsaa_samples, 0, 0, 16, CFGFLAG_SAVE|CFGFLAG_CLIENT, "FSAA Samples") +#endif MACRO_CONFIG_INT(gfx_refresh_rate, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen refresh rate") MACRO_CONFIG_INT(gfx_finish, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") diff --git a/project/jni/application/teeworlds/src/engine/e_if_inp.h b/project/jni/application/teeworlds/src/engine/e_if_inp.h index aeee9ed16..9277d8302 100644 --- a/project/jni/application/teeworlds/src/engine/e_if_inp.h +++ b/project/jni/application/teeworlds/src/engine/e_if_inp.h @@ -246,6 +246,7 @@ void inp_update(); void inp_init(); void inp_mouse_mode_absolute(); void inp_mouse_mode_relative(); +void inp_warp_mouse(int x, int y); #ifdef __cplusplus } diff --git a/project/jni/application/teeworlds/src/game/client/components/controls.cpp b/project/jni/application/teeworlds/src/game/client/components/controls.cpp index 422b074ad..bc001cb57 100644 --- a/project/jni/application/teeworlds/src/game/client/components/controls.cpp +++ b/project/jni/application/teeworlds/src/game/client/components/controls.cpp @@ -179,7 +179,16 @@ bool CONTROLS::on_mousemove(float x, float y) return false; mouse_pos += vec2(x, y); // TODO: ugly #ifdef ANDROID - mouse_pos = vec2(x, y); + + if(gameclient.snap.spectate) + { + if( inp_key_down(KEY_MOUSE_1) ) + mouse_pos += vec2((x - gfx_screenwidth()/2) * 2, (y - gfx_screenheight()/2) * 2); + } + else + { + mouse_pos = vec2((x - gfx_screenwidth()/2) * 2, (y - gfx_screenheight()/2) * 2); + } #endif // @@ -208,6 +217,15 @@ bool CONTROLS::on_mousemove(float x, float y) mouse_pos = normalize(mouse_pos)*mouse_max; l = mouse_max; } + +#ifdef ANDROID + if(l * 2.0f > mouse_max) + { + if(input_data.fire&1 != 1) + input_data.fire++; + input_data.fire &= INPUT_STATE_MASK; + } +#endif //float offset_amount = max(l-deadzone, 0.0f) * follow_factor; //if(l > 0.0001f) // make sure that this isn't 0