Subversion Repositories eduke32

Compare Revisions

Regard whitespace Rev 4999 → Rev 5000

/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
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
 
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
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
 
ANDROID_SRC = \
source/android/android-jni.cpp \
83,6 → 83,7
source/actors.c \
source/anim.c \
source/animsounds.c \
source/animvpx.c \
source/common.c \
source/config.c \
source/demo.c \
134,7 → 135,7
 
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
LOCAL_SHARED_LIBRARIES := touchcontrols ogg vorbis SDL2 SDL2_mixer libvpx
# SDL2_image
 
ifeq ($(GP_LIC),1)
/polymer/eduke32/build/src/sdlayer.c
344,7 → 344,10
{
case SDL_APP_TERMINATING:
// yes, this calls into the game, ugh
if (mobile_halted == 1)
G_Shutdown();
 
mobile_halted = 1;
return 0;
case SDL_APP_LOWMEMORY:
gltexinvalidatetype(INVALIDATE_ALL);
/polymer/eduke32/source/android/android-jni.cpp
97,6 → 97,9
 
touchcontrols::Button *inv_buttons[GET_MAX];
 
std::string obbPath;
std::string gamePath;
 
void openGLStart()
{
if (curRenderer == REND_GL)
385,12 → 388,12
*/
}
 
void initControls(int width, int height, const char *graphics_path, const char *settings_file)
void initControls(int width, int height, const char *graphics_path)
{
touchcontrols::GLScaleWidth = (float)width;
touchcontrols::GLScaleHeight = (float)height;
touchcontrols::GLScaleHeight = (float)-height;
 
LOGI("initControls %d x %d,x path = %s, settings = %s", width, height, graphics_path, settings_file);
LOGI("initControls %d x %d,x path = %s", width, height, graphics_path);
 
if (!controlsCreated)
{
421,9 → 424,9
///////////////////////// YES NO SCREEN /////////////////////
 
tcYesNo->addControl(
new touchcontrols::Button("enter", touchcontrols::RectF(16, 8, 19, 11), "yes", SDL_SCANCODE_RETURN));
new touchcontrols::Button("enter", touchcontrols::RectF(16, 9, 18, 11), "yes", SDL_SCANCODE_RETURN));
tcYesNo->addControl(
new touchcontrols::Button("esc", touchcontrols::RectF(7, 8, 10, 11), "no", SDL_SCANCODE_ESCAPE));
new touchcontrols::Button("esc", touchcontrols::RectF(8, 9, 10, 11), "no", SDL_SCANCODE_ESCAPE));
tcYesNo->signal_button.connect(sigc::ptr_fun(&menuButton)); // Just reuse the menuButton function
 
 
440,12 → 443,13
"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);
460,7 → 464,11
//////////////////////////// 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));
582,10 → 590,9
tcGameWeapons->setAlpha(droidinput.gameControlsAlpha);
tcMenuMain->setAlpha(droidinput.gameControlsAlpha);
 
 
tcGameMain->setXMLFile((std::string)graphics_path + "/game.xml");
tcGameWeapons->setXMLFile((std::string)graphics_path + "/weapons.xml");
tcAutomap->setXMLFile((std::string)graphics_path + "/automap.xml");
tcGameMain->setXMLFile(gamePath + "/control_layout_main.xml");
tcGameWeapons->setXMLFile(gamePath + "/control_layout_weapons.xml");
tcAutomap->setXMLFile(gamePath + "/control_layout_automap.xml");
// tcInventory->setXMLFile((std::string)graphics_path + "/inventory.xml");
 
setControlsContainer(&controlsContainer);
748,10 → 755,8
 
int argc = 1;
const char *argv[32];
std::string graphicpath;
std::string duke3d_path;
 
static inline const char *getGamePath() { return duke3d_path.c_str(); }
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,
781,7 → 786,7
argc++;
}
 
duke3d_path = (char *)(env)->GetStringUTFChars(jduke3d_path, 0);
gamePath = std::string(env->GetStringUTFChars(jduke3d_path, NULL));
 
// Change working dir, save games etc
// FIXME: potentially conflicts with chdirs in -game_dir support
794,11 → 799,12
LOGI("duke3d_path = %s", getGamePath());
 
const char *p = env->GetStringUTFChars(graphics_dir, NULL);
graphicpath = std::string(p);
obbPath = std::string(p);
 
initControls(droidinfo.screen_width, -droidinfo.screen_height, graphicpath.c_str(),
(graphicpath + "/touch_controls.xml").c_str());
LOGI("obbPath = %s", obbPath.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 sdl_code [] = { SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT,
int const 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,13 → 19,12
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,6 → 20,7
*/
//-------------------------------------------------------------------------
 
#include "compat.h"
#include "duke3d.h"
#include "renderlayer.h"
#include "net.h"
259,6 → 260,9
 
 
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 );
284,15 → 288,21
};
 
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
4254,15 → 4264,13
return MOUSEACTIVECONDITIONAL(!m_mousecaught && mousepressstate == Mouse_Released);
}
 
#if !defined __ANDROID__
#if !defined EDUKE32_TOUCH_DEVICES
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;
4276,7 → 4284,6
 
static int32_t M_RunMenuInput_MouseReturn(void)
{
#if !defined __ANDROID__
#if !defined EDUKE32_TOUCH_DEVICES
if (!MOUSEACTIVECONDITION)
{
4283,7 → 4290,6
M_RunMenuInput_MouseReturn_status = 0;
return 0;
}
#endif
 
if (g_currentMenu == MENU_MAIN)
return 0;
4298,6 → 4304,7
 
M_RunMenuInput_MouseReturn_status = 0;
#endif
 
return 0;
}
 
4559,7 → 4566,7
}
}
 
#if !defined __ANDROID__
#if !defined EDUKE32_TOUCH_DEVICES
M_RunMenu_MouseReturn(cm, origin);
#endif
}