Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 5000 → Rev 4999

/polymer/eduke32/Android.mk
26,7 → 26,7
 
#-DUSE_LIBPNG
 
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
 
#LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
 
34,7 → 34,7
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 += $(TOP_DIR)/ $(TOP_DIR)/Libraries/liboggvorbis/include $(TOP_DIR)/Libraries/ $(TOP_DIR)/Libraries/SDL2/include $(TOP_DIR)/Libraries/SDL2_mixer/include $(TOP_DIR)/Libraries/libpng/include $(TOP_DIR)/Libraries/TinyXML/include $(TOP_DIR)/TouchControls $(TOP_DIR)/Libraries/libvpx/include
LOCAL_C_INCLUDES += $(TOP_DIR)/ $(TOP_DIR)/Libraries/liboggvorbis/include $(TOP_DIR)/Libraries/ $(TOP_DIR)/Libraries/SDL2/include $(TOP_DIR)/Libraries/SDL2_mixer/include $(TOP_DIR)/Libraries/libpng/include $(TOP_DIR)/Libraries/TinyXML/include $(TOP_DIR)/TouchControls
 
ANDROID_SRC = \
source/android/android-jni.cpp \
83,7 → 83,6
source/actors.c \
source/anim.c \
source/animsounds.c \
source/animvpx.c \
source/common.c \
source/config.c \
source/demo.c \
134,8 → 133,8
LOCAL_SRC_FILES = $(ANDROID_SRC) $(JAUDIO_SRC) $(JMACT_SRC) $(GAME_SRC) $(BUILD_SRC)
 
LOCAL_LDLIBS := -lGLESv1_CM -lEGL -ldl -llog -lOpenSLES -lz -L$(TOP_DIR)/openssl/libs/
LOCAL_STATIC_LIBRARIES := libpng crypto
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer libvpx
LOCAL_STATIC_LIBRARIES := libpng crypto
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer
# SDL2_image
 
ifeq ($(GP_LIC),1)
/polymer/eduke32/build/src/sdlayer.c
344,10 → 344,7
{
case SDL_APP_TERMINATING:
// yes, this calls into the game, ugh
if (mobile_halted == 1)
G_Shutdown();
 
mobile_halted = 1;
G_Shutdown();
return 0;
case SDL_APP_LOWMEMORY:
gltexinvalidatetype(INVALIDATE_ALL);
/polymer/eduke32/source/android/android-jni.cpp
97,9 → 97,6
 
touchcontrols::Button *inv_buttons[GET_MAX];
 
std::string obbPath;
std::string gamePath;
 
void openGLStart()
{
if (curRenderer == REND_GL)
388,12 → 385,12
*/
}
 
void initControls(int width, int height, const char *graphics_path)
void initControls(int width, int height, const char *graphics_path, const char *settings_file)
{
touchcontrols::GLScaleWidth = (float)width;
touchcontrols::GLScaleHeight = (float)-height;
touchcontrols::GLScaleHeight = (float)height;
 
LOGI("initControls %d x %d,x path = %s", width, height, graphics_path);
LOGI("initControls %d x %d,x path = %s, settings = %s", width, height, graphics_path, settings_file);
 
if (!controlsCreated)
{
424,9 → 421,9
///////////////////////// YES NO SCREEN /////////////////////
 
tcYesNo->addControl(
new touchcontrols::Button("enter", touchcontrols::RectF(16, 9, 18, 11), "yes", SDL_SCANCODE_RETURN));
new touchcontrols::Button("enter", touchcontrols::RectF(16, 8, 19, 11), "yes", SDL_SCANCODE_RETURN));
tcYesNo->addControl(
new touchcontrols::Button("esc", touchcontrols::RectF(8, 9, 10, 11), "no", SDL_SCANCODE_ESCAPE));
new touchcontrols::Button("esc", touchcontrols::RectF(7, 8, 10, 11), "no", SDL_SCANCODE_ESCAPE));
tcYesNo->signal_button.connect(sigc::ptr_fun(&menuButton)); // Just reuse the menuButton function
 
 
443,13 → 440,12
"arrow_right", SDL_SCANCODE_RIGHT, true));
tcMenuMain->addControl(new touchcontrols::Button("enter", touchcontrols::RectF(0,14,2,16), "enter",
SDL_SCANCODE_RETURN));
tcMenuMain->addControl(new touchcontrols::Button("esc", touchcontrols::RectF(0,12,2,14), "esc",
SDL_SCANCODE_ESCAPE));
tcMenuMain->signal_button.connect( sigc::ptr_fun(&menuButton) );
tcMenuMain->setAlpha(1);
*/
 
tcMenuMain->addControl(new touchcontrols::Button("arrow_left", touchcontrols::RectF(0, 2, 2, 4), "arrow_left",
SDL_SCANCODE_ESCAPE));
tcMenuMain->signal_button.connect(sigc::ptr_fun(&menuButton));
 
touchcontrols::MultitouchMouse *mouseMenu =
new touchcontrols::MultitouchMouse("mouse", touchcontrols::RectF(0, 0, 26, 16), "");
mouseMenu->setHideGraphics(true);
464,11 → 460,7
//////////////////////////// GAME SCREEN /////////////////////
tcGameMain->setAlpha(droidinput.gameControlsAlpha);
controlsContainer.editButtonAlpha = droidinput.gameControlsAlpha;
tcGameMain->addControl(
new touchcontrols::Button("game_menu", touchcontrols::RectF(0, 0, 2, 2), "settings_bars", MENU_BACK));
 
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));
590,9 → 582,10
tcGameWeapons->setAlpha(droidinput.gameControlsAlpha);
tcMenuMain->setAlpha(droidinput.gameControlsAlpha);
 
tcGameMain->setXMLFile(gamePath + "/control_layout_main.xml");
tcGameWeapons->setXMLFile(gamePath + "/control_layout_weapons.xml");
tcAutomap->setXMLFile(gamePath + "/control_layout_automap.xml");
 
tcGameMain->setXMLFile((std::string)graphics_path + "/game.xml");
tcGameWeapons->setXMLFile((std::string)graphics_path + "/weapons.xml");
tcAutomap->setXMLFile((std::string)graphics_path + "/automap.xml");
// tcInventory->setXMLFile((std::string)graphics_path + "/inventory.xml");
 
setControlsContainer(&controlsContainer);
755,8 → 748,10
 
int argc = 1;
const char *argv[32];
std::string graphicpath;
std::string duke3d_path;
 
static inline const char *getGamePath() { return gamePath.c_str(); }
static inline const char *getGamePath() { return duke3d_path.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,
786,7 → 781,7
argc++;
}
 
gamePath = std::string(env->GetStringUTFChars(jduke3d_path, NULL));
duke3d_path = (char *)(env)->GetStringUTFChars(jduke3d_path, 0);
 
// Change working dir, save games etc
// FIXME: potentially conflicts with chdirs in -game_dir support
799,12 → 794,11
LOGI("duke3d_path = %s", getGamePath());
 
const char *p = env->GetStringUTFChars(graphics_dir, NULL);
obbPath = std::string(p);
graphicpath = std::string(p);
 
LOGI("obbPath = %s", obbPath.c_str());
initControls(droidinfo.screen_width, -droidinfo.screen_height, graphicpath.c_str(),
(graphicpath + "/touch_controls.xml").c_str());
 
initControls(droidinfo.screen_width, droidinfo.screen_height, (obbPath + "/assets/").c_str());
 
PortableInit(argc, argv);
 
return 0;
/polymer/eduke32/source/android/in_android.c
105,9 → 105,9
 
if (action >= MENU_UP && action <= MENU_BACK)
{
// if (PortableRead(READ_SCREEN_MODE) == TOUCH_SCREEN_MENU)
if (PortableRead(READ_SCREEN_MODE) == TOUCH_SCREEN_MENU)
{
int const sdl_code [] = { SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT,
int sdl_code [] = { SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT,
SDL_SCANCODE_RIGHT, SDL_SCANCODE_RETURN, SDL_SCANCODE_ESCAPE };
PortableKeyEvent(state, sdl_code[action-MENU_UP], 0);
return;
/polymer/eduke32/source/gameexec.c
19,12 → 19,13
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
 
#include <time.h>
#include <stdlib.h>
#include <math.h> // sqrt
 
#include "compat.h"
 
#include "build.h"
 
#include "duke3d.h"
/polymer/eduke32/source/menus.c
20,7 → 20,6
*/
//-------------------------------------------------------------------------
 
#include "compat.h"
#include "duke3d.h"
#include "renderlayer.h"
#include "net.h"
260,9 → 259,6
 
 
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
#ifdef DROIDMENU
MAKE_MENU_TOP_ENTRYLINK( "Resume Game", MEF_MainMenu, MAIN_RESUMEGAME, MENU_CLOSE );
#endif
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
288,21 → 284,15
};
 
static MenuEntry_t *MEL_MAIN_INGAME[] = {
#ifdef DROIDMENU
&ME_MAIN_RESUMEGAME,
#else
&ME_MAIN_NEWGAME_INGAME,
#endif
&ME_MAIN_SAVEGAME,
&ME_MAIN_LOADGAME,
&ME_MAIN_OPTIONS,
#ifndef DROIDMENU
&ME_MAIN_HELP,
#endif
&ME_MAIN_QUITTOTITLE,
&ME_MAIN_QUITGAME,
#else
&ME_MAIN_QUITTOTITLE,
#endif
};
 
// Episode and Skill will be dynamically generated after CONs are parsed
4264,13 → 4254,15
return MOUSEACTIVECONDITIONAL(!m_mousecaught && mousepressstate == Mouse_Released);
}
 
#if !defined EDUKE32_TOUCH_DEVICES
#if !defined __ANDROID__
static int32_t M_RunMenuInput_MouseReturn_status;
 
static void M_RunMenu_MouseReturn(Menu_t *cm, const vec2_t origin)
{
#if !defined EDUKE32_TOUCH_DEVICES
if (!MOUSEACTIVECONDITION)
return;
#endif
 
if (cm->menuID == MENU_MAIN)
return;
4284,6 → 4276,7
 
static int32_t M_RunMenuInput_MouseReturn(void)
{
#if !defined __ANDROID__
#if !defined EDUKE32_TOUCH_DEVICES
if (!MOUSEACTIVECONDITION)
{
4290,6 → 4283,7
M_RunMenuInput_MouseReturn_status = 0;
return 0;
}
#endif
 
if (g_currentMenu == MENU_MAIN)
return 0;
4304,7 → 4298,6
 
M_RunMenuInput_MouseReturn_status = 0;
#endif
 
return 0;
}
 
4566,7 → 4559,7
}
}
 
#if !defined EDUKE32_TOUCH_DEVICES
#if !defined __ANDROID__
M_RunMenu_MouseReturn(cm, origin);
#endif
}