mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Android build now uses mojoAL.
Updated SOIL2 and efsw.
This commit is contained in:
@@ -8,7 +8,6 @@ SDL_MAIN_PATH := $(SDL_PATH)/src/main/android/*.c
|
||||
|
||||
EEPP_C_INCLUDES := \
|
||||
$(EEPP_THIRD_PARTY_PATH) \
|
||||
$(EEPP_THIRD_PARTY_PATH)/openal-soft/include/ \
|
||||
$(EEPP_THIRD_PARTY_PATH)/freetype2/include \
|
||||
$(SDL_PATH)/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/chipmunk \
|
||||
@@ -19,7 +18,8 @@ EEPP_C_INCLUDES := \
|
||||
$(EEPP_THIRD_PARTY_PATH)/libvorbis/lib \
|
||||
$(EEPP_THIRD_PARTY_PATH)/libvorbis/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/libogg/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/mbedtls/include
|
||||
$(EEPP_THIRD_PARTY_PATH)/mbedtls/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/mojoAL
|
||||
|
||||
EEPP_C_FLAGS := \
|
||||
-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit \
|
||||
@@ -33,6 +33,7 @@ EEPP_C_FLAGS := \
|
||||
-DEE_SSL_SUPPORT \
|
||||
-DEE_MBEDTLS \
|
||||
-D$(EE_SDL_VERSION) \
|
||||
-DAL_LIBTYPE_STATIC \
|
||||
-I$(EEPP_INC_PATH) \
|
||||
-I$(EEPP_BASE_PATH)
|
||||
|
||||
@@ -59,6 +60,7 @@ CODE_SRCS := \
|
||||
../thirdparty/libogg/src/*.c \
|
||||
../thirdparty/libvorbis/lib/*.c \
|
||||
../thirdparty/mbedtls/library/*.c \
|
||||
../thirdparty/mojoAL/*.c \
|
||||
system/*.cpp \
|
||||
system/platform/posix/*.cpp \
|
||||
network/*.cpp \
|
||||
@@ -88,7 +90,7 @@ LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES)
|
||||
|
||||
LOCAL_SRC_FILES := $(foreach F, $(CODE_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := openal SDL2 chipmunk freetype
|
||||
LOCAL_STATIC_LIBRARIES := SDL2 chipmunk freetype
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#*************** EEPP ***************
|
||||
@@ -135,50 +137,6 @@ LOCAL_SRC_FILES += $(foreach F, $(APP_SUBDIRS), $(addprefix $(F)/,$(notdir $(w
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#*************** FREETYPE ***************
|
||||
|
||||
#*************** OPENAL *****************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_PATH := $(EEPP_THIRD_PARTY_PATH)/openal-soft
|
||||
|
||||
LOCAL_MODULE := openal
|
||||
|
||||
LOCAL_CFLAGS := -O3 -DHAVE_CONFIG_H -DAL_ALEXT_PROTOTYPES -DHAVE_OPENSL
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ $(LOCAL_PATH)/include $(LOCAL_PATH)/OpenAL32/Include $(LOCAL_PATH)/Alc $(LOCAL_PATH)/common
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(subst $(LOCAL_PATH)/,, \
|
||||
$(wildcard $(LOCAL_PATH)/OpenAL32/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/common/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/Alc/effects/*.c) \
|
||||
$(LOCAL_PATH)/Alc/ALc.c \
|
||||
$(LOCAL_PATH)/Alc/alconfig.c \
|
||||
$(LOCAL_PATH)/Alc/ALu.c \
|
||||
$(LOCAL_PATH)/Alc/ambdec.c \
|
||||
$(LOCAL_PATH)/Alc/bformatdec.c \
|
||||
$(LOCAL_PATH)/Alc/bs2b.c \
|
||||
$(LOCAL_PATH)/Alc/converter.c \
|
||||
$(LOCAL_PATH)/Alc/helpers.c \
|
||||
$(LOCAL_PATH)/Alc/hrtf.c \
|
||||
$(LOCAL_PATH)/Alc/mastering.c \
|
||||
$(LOCAL_PATH)/Alc/mixer_c.c \
|
||||
$(LOCAL_PATH)/Alc/mixer.c \
|
||||
$(LOCAL_PATH)/Alc/nfcfilter.c \
|
||||
$(LOCAL_PATH)/Alc/panning.c \
|
||||
$(LOCAL_PATH)/Alc/ringbuffer.c \
|
||||
$(LOCAL_PATH)/Alc/uhjfilter.c \
|
||||
$(LOCAL_PATH)/Alc/backends/base.c \
|
||||
$(LOCAL_PATH)/Alc/backends/opensl.c \
|
||||
$(LOCAL_PATH)/Alc/backends/loopback.c \
|
||||
$(LOCAL_PATH)/Alc/backends/wave.c \
|
||||
$(LOCAL_PATH)/Alc/backends/null.c \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/android/*.c))
|
||||
|
||||
LOCAL_LDLIBS := -llog -lOpenSLES
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
#*************** OPENAL *****************
|
||||
|
||||
#**************** SDL 2 ***************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -226,4 +184,3 @@ LOCAL_SRC_FILES := \
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#**************** SDL 2 ***************
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ public class SDLActivity extends Activity {
|
||||
*/
|
||||
protected String[] getLibraries() {
|
||||
return new String[] {
|
||||
"openal",
|
||||
"main"
|
||||
};
|
||||
}
|
||||
@@ -208,19 +207,20 @@ public class SDLActivity extends Activity {
|
||||
|
||||
setContentView(mLayout);
|
||||
|
||||
/*
|
||||
* Per SDL_androidwindow.c, Android will only ever have one window, and that window
|
||||
* is always flagged SDL_WINDOW_FULLSCREEN. Let's treat it as an immersive fullscreen
|
||||
/*
|
||||
* Per SDL_androidwindow.c, Android will only ever have one window, and that window
|
||||
* is always flagged SDL_WINDOW_FULLSCREEN. Let's treat it as an immersive fullscreen
|
||||
* window for Android UI purposes, as a result.
|
||||
*/
|
||||
int iFlags =
|
||||
//View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | // Only available since API 19
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
|
||||
getWindow().getDecorView().setSystemUiVisibility(iFlags);
|
||||
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;
|
||||
getWindow().getDecorView().setSystemUiVisibility(flags);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
|
||||
// Get filename from "Open with" of another application
|
||||
Intent intent = getIntent();
|
||||
@@ -451,7 +451,7 @@ public class SDLActivity extends Activity {
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
|
||||
|
||||
|
||||
mScreenKeyboardShown = false;
|
||||
}
|
||||
break;
|
||||
@@ -522,7 +522,7 @@ public class SDLActivity extends Activity {
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
* This is a static method for JNI convenience, it calls a non-static method
|
||||
* so that is can be overridden
|
||||
* so that is can be overridden
|
||||
*/
|
||||
public static void setOrientation(int w, int h, boolean resizable, String hint)
|
||||
{
|
||||
@@ -530,11 +530,11 @@ public class SDLActivity extends Activity {
|
||||
mSingleton.setOrientationBis(w, h, resizable, hint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can be overridden
|
||||
*/
|
||||
public void setOrientationBis(int w, int h, boolean resizable, String hint)
|
||||
public void setOrientationBis(int w, int h, boolean resizable, String hint)
|
||||
{
|
||||
int orientation = -1;
|
||||
|
||||
@@ -575,7 +575,7 @@ public class SDLActivity extends Activity {
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static boolean isScreenKeyboardShown()
|
||||
public static boolean isScreenKeyboardShown()
|
||||
{
|
||||
if (mTextEdit == null) {
|
||||
return false;
|
||||
@@ -631,7 +631,7 @@ public class SDLActivity extends Activity {
|
||||
}
|
||||
}
|
||||
/* environment variables set! */
|
||||
return true;
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
Log.v("SDL", "exception " + e.toString());
|
||||
}
|
||||
@@ -688,12 +688,12 @@ public class SDLActivity extends Activity {
|
||||
}
|
||||
|
||||
public static boolean isTextInputEvent(KeyEvent event) {
|
||||
|
||||
|
||||
// Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT
|
||||
if (android.os.Build.VERSION.SDK_INT >= 11) {
|
||||
if (event.isCtrlPressed()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;
|
||||
@@ -1009,7 +1009,7 @@ public class SDLActivity extends Activity {
|
||||
public static boolean clipboardHasText() {
|
||||
return mClipboardHandler.clipboardHasText();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
@@ -1023,7 +1023,7 @@ public class SDLActivity extends Activity {
|
||||
public static void clipboardSetText(String string) {
|
||||
mClipboardHandler.clipboardSetText(string);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
@@ -1442,7 +1442,7 @@ class DummyEdit extends View implements View.OnKeyListener {
|
||||
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
/*
|
||||
/*
|
||||
* This handles the hardware keyboard input
|
||||
*/
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
@@ -1562,7 +1562,7 @@ class SDLInputConnection extends BaseInputConnection {
|
||||
while (beforeLength-- > 0) {
|
||||
boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
|
||||
&& sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
|
||||
ret = ret && ret_key;
|
||||
ret = ret && ret_key;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1581,7 +1581,7 @@ interface SDLClipboardHandler {
|
||||
|
||||
|
||||
class SDLClipboardHandler_API11 implements
|
||||
SDLClipboardHandler,
|
||||
SDLClipboardHandler,
|
||||
android.content.ClipboardManager.OnPrimaryClipChangedListener {
|
||||
|
||||
protected android.content.ClipboardManager mClipMgr;
|
||||
@@ -1612,7 +1612,7 @@ class SDLClipboardHandler_API11 implements
|
||||
mClipMgr.setText(string);
|
||||
mClipMgr.addPrimaryClipChangedListener(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPrimaryClipChanged() {
|
||||
SDLActivity.onNativeClipboardChanged();
|
||||
@@ -1622,9 +1622,9 @@ class SDLClipboardHandler_API11 implements
|
||||
|
||||
class SDLClipboardHandler_Old implements
|
||||
SDLClipboardHandler {
|
||||
|
||||
|
||||
protected android.text.ClipboardManager mClipMgrOld;
|
||||
|
||||
|
||||
SDLClipboardHandler_Old() {
|
||||
mClipMgrOld = (android.text.ClipboardManager) SDL.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
}
|
||||
@@ -1649,4 +1649,3 @@ class SDLClipboardHandler_Old implements
|
||||
mClipMgrOld.setText(string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ cd $(dirname "$0")
|
||||
|
||||
./gradlew build
|
||||
|
||||
#adb install -r app/build/outputs/apk/app-debug.apk
|
||||
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
|
||||
#ndk-gdb --force --start --verbose
|
||||
|
||||
@@ -322,11 +322,10 @@ void EETest::onShowMenu( const Event* Event ) {
|
||||
UIPushButton* PB = static_cast<UIPushButton*>( Event->getNode() );
|
||||
|
||||
if ( Menu->show() ) {
|
||||
Vector2f pos( Vector2f::Zero );
|
||||
Vector2f pos( Vector2f( PB->getSize().getWidth(), 0 ) );
|
||||
PB->nodeToWorld( pos );
|
||||
pos = PixelDensity::pxToDp( pos );
|
||||
pos.y -= Menu->getSize().y;
|
||||
Menu->setPosition( pos );
|
||||
UIMenu::fixMenuPos( pos, Menu );
|
||||
Menu->setPixelsPosition( pos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,6 +557,7 @@ void EETest::createBaseUI() {
|
||||
Menu->addEventListener( Event::OnItemClicked, cb::Make1( this, &EETest::onItemClick ) );
|
||||
Menu->getItem( "Quit" )->addEventListener( Event::MouseUp,
|
||||
cb::Make1( this, &EETest::onQuitClick ) );
|
||||
|
||||
SceneManager::instance()->getUISceneNode()->addEventListener(
|
||||
Event::MouseClick, cb::Make1( this, &EETest::onMainClick ) );
|
||||
|
||||
@@ -572,15 +572,12 @@ void EETest::createBaseUI() {
|
||||
Sizef screenSize = SceneManager::instance()->getUISceneNode()->getSize();
|
||||
|
||||
mShowMenu = UIPushButton::New();
|
||||
mShowMenu->setLayoutSizeRules( LayoutSizeRule::WrapContent, LayoutSizeRule::WrapContent );
|
||||
mShowMenu->setPadding( Rectf( 16, 0, 16, 0 ) );
|
||||
mShowMenu->setSkin( nSkin );
|
||||
|
||||
Sizef skinSize = mShowMenu->getSkinSize();
|
||||
|
||||
mShowMenu->setSize( skinSize )
|
||||
->setPosition( screenSize.getWidth() - skinSize.getWidth() - 40,
|
||||
screenSize.getHeight() - skinSize.getHeight() - 10 );
|
||||
|
||||
mShowMenu->setText( "Show Menu" );
|
||||
mShowMenu->setPosition( screenSize.getWidth() - mShowMenu->getSize().getWidth() - 32,
|
||||
screenSize.getHeight() - mShowMenu->getSize().getHeight() - 9 );
|
||||
mShowMenu->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM );
|
||||
mShowMenu->addEventListener( Event::MouseClick, cb::Make1( this, &EETest::onShowMenu ) );
|
||||
#endif
|
||||
@@ -1262,8 +1259,7 @@ void EETest::showMenu() {
|
||||
if ( NULL != Menu && Menu->show() ) {
|
||||
Vector2f Pos = mWindow->getInput()->getMousePosf();
|
||||
UIMenu::fixMenuPos( Pos, Menu );
|
||||
Menu->setPosition( Vector2f( Pos.x / PixelDensity::getPixelDensity(),
|
||||
Pos.y / PixelDensity::getPixelDensity() ) );
|
||||
Menu->setPixelsPosition( Pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
src/thirdparty/SOIL2
vendored
2
src/thirdparty/SOIL2
vendored
Submodule src/thirdparty/SOIL2 updated: 2488385abc...d6886e006e
2
src/thirdparty/efsw
vendored
2
src/thirdparty/efsw
vendored
Submodule src/thirdparty/efsw updated: 33d6ce34a5...dbe4093835
Reference in New Issue
Block a user