同步
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
signingConfigs {
|
||||
config {
|
||||
keyAlias 'snowball'
|
||||
keyPassword 'joychina'
|
||||
storeFile file("../key/snowball")
|
||||
storePassword 'joychina'
|
||||
}
|
||||
}
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion "28.0.0"
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
@@ -9,8 +17,8 @@ android {
|
||||
applicationId "com.layabox.conch6"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 28
|
||||
versionCode 17
|
||||
versionName "release-2.9.0"
|
||||
versionCode 19
|
||||
versionName "release-2.11.0"
|
||||
}
|
||||
sourceSets.main{
|
||||
jniLibs.srcDir 'libs'
|
||||
@@ -19,11 +27,13 @@ android {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
debug {
|
||||
debuggable true
|
||||
jniDebuggable true
|
||||
renderscriptDebuggable true
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
}
|
||||
/* externalNativeBuild {
|
||||
|
||||
@@ -9,8 +9,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 28
|
||||
versionCode 17
|
||||
versionName "release-2.9.0"
|
||||
versionCode 19
|
||||
versionName "release-2.11.0"
|
||||
}
|
||||
sourceSets.main{
|
||||
jniLibs.srcDir 'libs'
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2835,6 +2835,7 @@ class GLCommandEncoder {
|
||||
}
|
||||
getExtension(name) {
|
||||
var extention = this._layagl._nativeObj.getStringEx(0x1F03);
|
||||
let version = this._layagl._nativeObj.getStringEx(0x1F02);
|
||||
let extentions = extention.split(' ');
|
||||
function supports(extention) {
|
||||
for (let ext of extentions) {
|
||||
@@ -2860,7 +2861,7 @@ class GLCommandEncoder {
|
||||
(extention.indexOf('GL_EXT_shader_texture_lod') != -1 || extention.indexOf('GL_ARB_shader_texture_lod') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'OES_element_index_uint' && extention.indexOf('GL_OES_element_index_uint') != -1) {
|
||||
else if (name === 'OES_element_index_uint' && (extention.indexOf('GL_OES_element_index_uint') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'EXT_sRGB' && extention.indexOf('GL_EXT_sRGB') != -1) {
|
||||
@@ -2915,13 +2916,16 @@ class GLCommandEncoder {
|
||||
TEXTURE_MAX_ANISOTROPY_EXT: 34046,
|
||||
};
|
||||
}
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && (conchConfig.glCaps & GL_CAPS.INSTANCEING)) {
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && ((extention.indexOf('_instanced_arrays') != -1) || version.indexOf("OpenGL ES 3.") != -1)) {
|
||||
return new ANGLEInstancedArrays(this);
|
||||
}
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && extention.indexOf('GL_OES_vertex_array_object') != -1) {
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && (extention.indexOf('GL_OES_vertex_array_object') != -1)) {
|
||||
return new OESVertexArrayObject(this);
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && extention.indexOf('GL_OES_texture_half_float') != -1) {
|
||||
else if (name.indexOf('OES_texture_float') != -1 && extention.indexOf('GL_OES_texture_float') != -1) {
|
||||
return {};
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && (extention.indexOf('GL_OES_texture_half_float') != -1)) {
|
||||
return { HALF_FLOAT_OES: 36193 };
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float_linear') != -1 && extention.indexOf('GL_OES_texture_half_float_linear') != -1) {
|
||||
|
||||
+3
-3
@@ -955,7 +955,7 @@ public class ExportJavaFunction
|
||||
m_Handler.post(new _Runnable(nCmd, nParam1, nParam2));
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
public static String getWifiMac()
|
||||
/*public static String getWifiMac()
|
||||
{
|
||||
ExportJavaFunction exp = ExportJavaFunction.GetInstance();
|
||||
if(exp==null )
|
||||
@@ -967,7 +967,7 @@ public class ExportJavaFunction
|
||||
return (wifi==null)?"":wifi;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}*/
|
||||
//------------------------------------------------------------------------------
|
||||
public static String getAndroidModel()
|
||||
{
|
||||
@@ -1103,7 +1103,7 @@ public class ExportJavaFunction
|
||||
int temp[]=pDevID.GetResolutionArray();
|
||||
obj.put("dpi", temp[2]);
|
||||
obj.put("resolution",temp[1]+"*"+temp[0]);
|
||||
obj.put("guid",pDevID.GetWifiMac());
|
||||
//obj.put("guid",pDevID.GetWifiMac());
|
||||
obj.put("imei", imeiArr);
|
||||
obj.put("imsi", imsiArr);
|
||||
obj.put("os", "android");
|
||||
|
||||
+10
-1
@@ -1,5 +1,7 @@
|
||||
package layaair.game.browser;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
@@ -40,7 +42,13 @@ public class TouchFilter
|
||||
m_vTouches[i].m_nLastMoveY = 0;
|
||||
m_vTouches[i].m_nTouchState = TouchPoint.PTSTATE_NOTOUCH;
|
||||
}
|
||||
setMoveRangeMM( 0.8f );
|
||||
setMoveRangeMM( getScreenDPI() * 2 );
|
||||
|
||||
}
|
||||
public int getScreenDPI() {
|
||||
ExportJavaFunction exp = ExportJavaFunction.GetInstance();
|
||||
DisplayMetrics metrics = ((Activity)exp.m_pEngine.mCtx).getApplicationContext().getResources().getDisplayMetrics();
|
||||
return (int)(metrics.density * 160f);
|
||||
}
|
||||
|
||||
//外部设置移动的偏差毫米为单位
|
||||
@@ -49,6 +57,7 @@ public class TouchFilter
|
||||
//毫米转英寸
|
||||
float fInch = (float) (p_fMM/10.0f*0.3937008);
|
||||
m_nMovRange = Math.round( fInch );
|
||||
Log.i("LayaBox", "TouchFilter getScreenDPI() " + getScreenDPI() + " TouchFilter m_nMovRange " + m_nMovRange);
|
||||
}
|
||||
|
||||
TouchPoint GetTouchPt(int p_nID)
|
||||
|
||||
+4
-4
@@ -30,11 +30,11 @@ public class DevID
|
||||
String devsn = GetDevSerial();
|
||||
if( devsn!=null && devsn.length()>0)
|
||||
return devsn;
|
||||
String wifimac = GetWifiMac();
|
||||
/*String wifimac = GetWifiMac();
|
||||
if( wifimac !=null && wifimac.length()>0 )
|
||||
{
|
||||
return wifimac.replace(":", "");
|
||||
}
|
||||
}*/
|
||||
String androidid = GetAndroidID();
|
||||
if( androidid!=null && androidid.length()>0 )
|
||||
return androidid;
|
||||
@@ -139,13 +139,13 @@ public class DevID
|
||||
} else return "NA";
|
||||
return res;
|
||||
}
|
||||
public String GetWifiMac()
|
||||
/*public String GetWifiMac()
|
||||
{
|
||||
String mac= getMac();
|
||||
return mac;
|
||||
//WifiManager wm = (WifiManager) m_Context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
//return wm.getConnectionInfo().getMacAddress();
|
||||
}
|
||||
}*/
|
||||
|
||||
private static String parseByte(byte b) {
|
||||
String s = "00" + Integer.toHexString(b)+":";
|
||||
|
||||
@@ -801,7 +801,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 17;
|
||||
CURRENT_PROJECT_VERSION = 19;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = MH4ZKZTS68;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -823,7 +823,7 @@
|
||||
../../../../ThirdParty/curl/lib/ios,
|
||||
../../../../ThirdParty/bullet/lib/ios,
|
||||
);
|
||||
MARKETING_VERSION = "release-2.9.0";
|
||||
MARKETING_VERSION = "release-2.11.0";
|
||||
OTHER_CFLAGS = "-I../../../include/conchRuntime";
|
||||
OTHER_LDFLAGS = (
|
||||
"-lcurl",
|
||||
@@ -859,7 +859,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 17;
|
||||
CURRENT_PROJECT_VERSION = 19;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = MH4ZKZTS68;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -882,7 +882,7 @@
|
||||
../../../../ThirdParty/curl/lib/ios,
|
||||
../../../../ThirdParty/bullet/lib/ios,
|
||||
);
|
||||
MARKETING_VERSION = "release-2.9.0";
|
||||
MARKETING_VERSION = "release-2.11.0";
|
||||
OTHER_CFLAGS = "-I../../../include/conchRuntime";
|
||||
OTHER_LDFLAGS = (
|
||||
"-lcurl",
|
||||
|
||||
@@ -26,12 +26,12 @@ static ViewController* g_pIOSMainViewController = nil;
|
||||
[super viewDidLoad];
|
||||
//保持屏幕常亮,可以通过脚本设置
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
|
||||
self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||
/*self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||
if (self->m_pGLContext)
|
||||
{
|
||||
NSLog(@"iOS OpenGL ES 3.0 context created");
|
||||
}
|
||||
else
|
||||
else*/
|
||||
{
|
||||
self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||
if (self->m_pGLContext)
|
||||
|
||||
@@ -2835,6 +2835,7 @@ class GLCommandEncoder {
|
||||
}
|
||||
getExtension(name) {
|
||||
var extention = this._layagl._nativeObj.getStringEx(0x1F03);
|
||||
let version = this._layagl._nativeObj.getStringEx(0x1F02);
|
||||
let extentions = extention.split(' ');
|
||||
function supports(extention) {
|
||||
for (let ext of extentions) {
|
||||
@@ -2860,7 +2861,7 @@ class GLCommandEncoder {
|
||||
(extention.indexOf('GL_EXT_shader_texture_lod') != -1 || extention.indexOf('GL_ARB_shader_texture_lod') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'OES_element_index_uint' && extention.indexOf('GL_OES_element_index_uint') != -1) {
|
||||
else if (name === 'OES_element_index_uint' && (extention.indexOf('GL_OES_element_index_uint') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'EXT_sRGB' && extention.indexOf('GL_EXT_sRGB') != -1) {
|
||||
@@ -2915,13 +2916,16 @@ class GLCommandEncoder {
|
||||
TEXTURE_MAX_ANISOTROPY_EXT: 34046,
|
||||
};
|
||||
}
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && (conchConfig.glCaps & GL_CAPS.INSTANCEING)) {
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && ((extention.indexOf('_instanced_arrays') != -1) || version.indexOf("OpenGL ES 3.") != -1)) {
|
||||
return new ANGLEInstancedArrays(this);
|
||||
}
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && extention.indexOf('GL_OES_vertex_array_object') != -1) {
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && (extention.indexOf('GL_OES_vertex_array_object') != -1)) {
|
||||
return new OESVertexArrayObject(this);
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && extention.indexOf('GL_OES_texture_half_float') != -1) {
|
||||
else if (name.indexOf('OES_texture_float') != -1 && extention.indexOf('GL_OES_texture_float') != -1) {
|
||||
return {};
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && (extention.indexOf('GL_OES_texture_half_float') != -1)) {
|
||||
return { HALF_FLOAT_OES: 36193 };
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float_linear') != -1 && extention.indexOf('GL_OES_texture_half_float_linear') != -1) {
|
||||
|
||||
@@ -104,20 +104,27 @@ namespace laya
|
||||
JSStringRef jsLinePropertyName = JSStringCreateWithUTF8CString("line");
|
||||
JSStringRef jsColumnPropertyName = JSStringCreateWithUTF8CString("column");
|
||||
JSStringRef jsUrlPropertyName = JSStringCreateWithUTF8CString("sourceURL");
|
||||
JSStringRef jsStackPropertyName = JSStringCreateWithUTF8CString("stack");
|
||||
JSObjectRef exObject = JSValueToObject( pContext, exception, NULL );
|
||||
JSValueRef line = JSObjectGetProperty( pContext, exObject, jsLinePropertyName, NULL );
|
||||
JSValueRef column = JSObjectGetProperty( pContext, exObject, jsColumnPropertyName, NULL );
|
||||
JSValueRef url = JSObjectGetProperty( pContext, exObject, jsUrlPropertyName, NULL );
|
||||
JSValueRef stack = JSObjectGetProperty( pContext, exObject, jsStackPropertyName, NULL );
|
||||
char *pEx = __ToCppString(exception,pContext);
|
||||
char *pLine = __ToCppString(line,pContext);
|
||||
char *pColumn = __ToCppString(column,pContext);
|
||||
char *pUrl = __ToCppString(url,pContext);
|
||||
|
||||
if (stack != NULL && JSValueGetType(pContext, stack) == kJSTypeString)
|
||||
{
|
||||
pStack = __ToCppString(stack,pContext);
|
||||
}
|
||||
//通知全局错误处理脚本
|
||||
|
||||
std::string kBuf = "if(conch.onerror){conch.onerror('";
|
||||
kBuf += UrlEncode(pEx);
|
||||
kBuf += "','undefined','";
|
||||
kBuf += "','";
|
||||
kBuf += UrlEncode(pStack.c_str());
|
||||
kBuf += "','";
|
||||
kBuf += UrlEncode(pLine);
|
||||
kBuf += "','";
|
||||
kBuf += UrlEncode(pColumn);
|
||||
@@ -142,6 +149,7 @@ namespace laya
|
||||
JSStringRelease(jsLinePropertyName);
|
||||
JSStringRelease(jsColumnPropertyName);
|
||||
JSStringRelease(jsUrlPropertyName);
|
||||
JSStringRelease(jsStackPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -646,6 +646,13 @@ pointer_t WASM_EXP AllConvexResultCallback_get_m_collisionObjects(pointer_t ptr)
|
||||
}
|
||||
|
||||
//btCollisionShape
|
||||
|
||||
int WASM_EXP btCollisionShape_getShapeType(pointer_t ptr)
|
||||
{
|
||||
btCollisionShape *shape = (btCollisionShape *)ptr;
|
||||
return shape->getShapeType();
|
||||
}
|
||||
|
||||
pointer_t WASM_EXP btCollisionShape_getLocalScaling(pointer_t ptr)
|
||||
{
|
||||
btCollisionShape *shape = (btCollisionShape *)ptr;
|
||||
@@ -676,7 +683,18 @@ pointer_t WASM_EXP btBoxShape_create(pointer_t boxHalfExtents)
|
||||
return (pointer_t) new btBoxShape(*(btVector3 *)boxHalfExtents);
|
||||
}
|
||||
|
||||
void WASM_EXP btBoxShape_getAabb(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax)
|
||||
{
|
||||
btBoxShape *shape = (btBoxShape *)ptr;
|
||||
shape->getAabb(*(btTransform *)t, *(btVector3 *)aabbMin, *(btVector3 *)aabbMax);
|
||||
}
|
||||
|
||||
pointer_t WASM_EXP btBoxShape_getHalfExtentsWithMargin(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax)
|
||||
{
|
||||
btBoxShape *shape = (btBoxShape *)ptr;
|
||||
tempbtVector3 = shape->getHalfExtentsWithMargin();
|
||||
return (pointer_t)&tempbtVector3;
|
||||
}
|
||||
|
||||
//btCapsuleShape
|
||||
pointer_t WASM_EXP btCapsuleShape_create(btScalar radius, btScalar height)
|
||||
@@ -1256,6 +1274,18 @@ void WASM_EXP btKinematicCharacterController_setStepHeight(pointer_t ptr, btScal
|
||||
character->setStepHeight(h);
|
||||
}
|
||||
|
||||
void WASM_EXP btKinematicCharacterController_setMaxPenetrationDepth(pointer_t ptr, btScalar d)
|
||||
{
|
||||
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
|
||||
character->setMaxPenetrationDepth(d);
|
||||
}
|
||||
|
||||
btScalar WASM_EXP btKinematicCharacterController_getMaxPenetrationDepth(pointer_t ptr)
|
||||
{
|
||||
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
|
||||
return character->getMaxPenetrationDepth();
|
||||
}
|
||||
|
||||
void WASM_EXP btKinematicCharacterController_destroy(pointer_t ptr)
|
||||
{
|
||||
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
|
||||
|
||||
@@ -154,11 +154,15 @@ namespace laya
|
||||
pointer_t AllConvexResultCallback_get_m_hitPointWorld(pointer_t ptr);
|
||||
pointer_t AllConvexResultCallback_get_m_hitFractions(pointer_t ptr);
|
||||
pointer_t AllConvexResultCallback_get_m_collisionObjects(pointer_t ptr);
|
||||
|
||||
int btCollisionShape_getShapeType(pointer_t ptr);
|
||||
pointer_t btCollisionShape_getLocalScaling(pointer_t ptr);
|
||||
void btCollisionShape_setLocalScaling(pointer_t ptr, pointer_t scaling);
|
||||
void btCollisionShape_calculateLocalInertia(pointer_t ptr, btScalar mass, pointer_t inertia);
|
||||
void btCollisionShape_destroy(pointer_t ptr);
|
||||
pointer_t btBoxShape_create(pointer_t boxHalfExtents);
|
||||
void btBoxShape_getAabb(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax);
|
||||
pointer_t btBoxShape_getHalfExtentsWithMargin(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax);
|
||||
pointer_t btCapsuleShape_create(btScalar radius, btScalar height);
|
||||
pointer_t btCapsuleShapeX_create(btScalar radius, btScalar height);
|
||||
pointer_t btCapsuleShapeZ_create(btScalar radius, btScalar height);
|
||||
@@ -220,6 +224,8 @@ namespace laya
|
||||
void btRigidBody_setGravity(pointer_t ptr, pointer_t acceleration);
|
||||
void btKinematicCharacterController_setUp(pointer_t ptr, pointer_t up);
|
||||
void btKinematicCharacterController_setStepHeight(pointer_t ptr, btScalar h);
|
||||
void btKinematicCharacterController_setMaxPenetrationDepth(pointer_t ptr, btScalar d);
|
||||
btScalar btKinematicCharacterController_getMaxPenetrationDepth(pointer_t ptr);
|
||||
void btCollisionObject_setInterpolationWorldTransform(pointer_t ptr, pointer_t worldTrans);
|
||||
void btCollisionObject_setWorldTransform(pointer_t ptr, pointer_t worldTrans);
|
||||
pointer_t btRigidBody_getTotalForce(pointer_t ptr);
|
||||
|
||||
@@ -321,13 +321,14 @@ namespace laya
|
||||
m_sGUID = CToObjectCGetGUID();
|
||||
return m_sGUID.c_str();
|
||||
#elif ANDROID
|
||||
CToJavaBridge::JavaRet kRet;
|
||||
/*CToJavaBridge::JavaRet kRet;
|
||||
if (CToJavaBridge::GetInstance()->callMethod(CToJavaBridge::JavaClass.c_str(), "getWifiMac", kRet))
|
||||
{
|
||||
m_sGUID = CToJavaBridge::GetInstance()->getJavaString(kRet.pJNI, kRet.strRet);
|
||||
}
|
||||
LOGI("getGuid::get_Value=%s", m_sGUID.c_str());
|
||||
return m_sGUID.c_str();
|
||||
return m_sGUID.c_str();*/
|
||||
return "android";
|
||||
#elif WIN32
|
||||
return "window";
|
||||
#endif
|
||||
@@ -335,11 +336,11 @@ namespace laya
|
||||
const char* JSConchConfig::getRuntimeVersion()
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return "ios-conch6-release-2.9.0";
|
||||
return "ios-conch6-release-2.11.0";
|
||||
#elif ANDROID
|
||||
return "android-conch6-release-2.9.0";
|
||||
return "android-conch6-release-2.11.0";
|
||||
#elif WIN32
|
||||
return "window-conch6-release-2.9.0";
|
||||
return "window-conch6-release-2.11.0";
|
||||
#endif
|
||||
}
|
||||
const char* JSConchConfig::getAppVersion()
|
||||
|
||||
@@ -1303,7 +1303,7 @@ class GLCommandEncoder
|
||||
getExtension(name:string):any
|
||||
{
|
||||
var extention:string = this._layagl._nativeObj.getStringEx(0x1F03);/*GL_EXTENSIONS*/
|
||||
|
||||
let version:string = this._layagl._nativeObj.getStringEx(0x1F02);
|
||||
let extentions:string[] = extention.split(' ');
|
||||
function supports(extention:string)
|
||||
{
|
||||
@@ -1337,7 +1337,7 @@ class GLCommandEncoder
|
||||
{
|
||||
return {};
|
||||
}
|
||||
else if (name === 'OES_element_index_uint' && extention.indexOf('GL_OES_element_index_uint') != -1)
|
||||
else if (name === 'OES_element_index_uint' && (extention.indexOf('GL_OES_element_index_uint') != -1))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
@@ -1400,15 +1400,19 @@ class GLCommandEncoder
|
||||
TEXTURE_MAX_ANISOTROPY_EXT : 34046,
|
||||
};
|
||||
}
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && (conchConfig.glCaps & GL_CAPS.INSTANCEING))
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && ((extention.indexOf('_instanced_arrays') != -1) || version.indexOf("OpenGL ES 3.") != -1))
|
||||
{
|
||||
return new ANGLEInstancedArrays(this);
|
||||
}
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && extention.indexOf('GL_OES_vertex_array_object') != -1)
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && (extention.indexOf('GL_OES_vertex_array_object') != -1))
|
||||
{
|
||||
return new OESVertexArrayObject(this);
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && extention.indexOf('GL_OES_texture_half_float') != -1)
|
||||
else if (name.indexOf('OES_texture_float') != -1 && extention.indexOf('GL_OES_texture_float') != -1)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && (extention.indexOf('GL_OES_texture_half_float') != -1))
|
||||
{
|
||||
return {HALF_FLOAT_OES: 36193};
|
||||
}
|
||||
|
||||
@@ -824,13 +824,12 @@ namespace laya
|
||||
{
|
||||
case GL_UNPACK_ALIGNMENT:
|
||||
case GL_PACK_ALIGNMENT:
|
||||
return;
|
||||
::glPixelStorei(pname, param);
|
||||
break;
|
||||
case 0x9240://UNPACK_FLIP_Y_WEBGL
|
||||
m_bFlipY = (param != 0);
|
||||
break;
|
||||
}
|
||||
::glPixelStorei(pname, param);
|
||||
#ifdef DEBUG_WEBGL
|
||||
LOGI("pixelStorei name=%d,param=%d", pname, param);
|
||||
getError();
|
||||
@@ -948,7 +947,7 @@ namespace laya
|
||||
void JCLayaGL::_texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
|
||||
{
|
||||
if (format != GL_RGBA) {
|
||||
::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
// ::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
}
|
||||
if (pixels == NULL)
|
||||
{
|
||||
@@ -974,7 +973,7 @@ namespace laya
|
||||
|
||||
}
|
||||
if (format != GL_RGBA) {
|
||||
::glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
// ::glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
}
|
||||
}
|
||||
void JCLayaGL::flipY(GLenum format, GLsizei width, GLsizei height, void* pixels)
|
||||
@@ -1026,9 +1025,9 @@ namespace laya
|
||||
}
|
||||
if (format != GL_RGBA)
|
||||
{
|
||||
::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
//::glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
||||
::glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
//::glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2835,6 +2835,7 @@ class GLCommandEncoder {
|
||||
}
|
||||
getExtension(name) {
|
||||
var extention = this._layagl._nativeObj.getStringEx(0x1F03);
|
||||
let version = this._layagl._nativeObj.getStringEx(0x1F02);
|
||||
let extentions = extention.split(' ');
|
||||
function supports(extention) {
|
||||
for (let ext of extentions) {
|
||||
@@ -2860,7 +2861,7 @@ class GLCommandEncoder {
|
||||
(extention.indexOf('GL_EXT_shader_texture_lod') != -1 || extention.indexOf('GL_ARB_shader_texture_lod') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'OES_element_index_uint' && extention.indexOf('GL_OES_element_index_uint') != -1) {
|
||||
else if (name === 'OES_element_index_uint' && (extention.indexOf('GL_OES_element_index_uint') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'EXT_sRGB' && extention.indexOf('GL_EXT_sRGB') != -1) {
|
||||
@@ -2915,13 +2916,16 @@ class GLCommandEncoder {
|
||||
TEXTURE_MAX_ANISOTROPY_EXT: 34046,
|
||||
};
|
||||
}
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && (conchConfig.glCaps & GL_CAPS.INSTANCEING)) {
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && ((extention.indexOf('_instanced_arrays') != -1) || version.indexOf("OpenGL ES 3.") != -1)) {
|
||||
return new ANGLEInstancedArrays(this);
|
||||
}
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && extention.indexOf('GL_OES_vertex_array_object') != -1) {
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && (extention.indexOf('GL_OES_vertex_array_object') != -1)) {
|
||||
return new OESVertexArrayObject(this);
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && extention.indexOf('GL_OES_texture_half_float') != -1) {
|
||||
else if (name.indexOf('OES_texture_float') != -1 && extention.indexOf('GL_OES_texture_float') != -1) {
|
||||
return {};
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && (extention.indexOf('GL_OES_texture_half_float') != -1)) {
|
||||
return { HALF_FLOAT_OES: 36193 };
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float_linear') != -1 && extention.indexOf('GL_OES_texture_half_float_linear') != -1) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -25,12 +25,12 @@ static ViewController* g_pIOSMainViewController = nil;
|
||||
[super viewDidLoad];
|
||||
//保持屏幕常亮,可以通过脚本设置
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
|
||||
self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||
/*self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
|
||||
if (self->m_pGLContext)
|
||||
{
|
||||
NSLog(@"iOS OpenGL ES 3.0 context created");
|
||||
}
|
||||
else
|
||||
else*/
|
||||
{
|
||||
self->m_pGLContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||
if (self->m_pGLContext)
|
||||
|
||||
@@ -2835,6 +2835,7 @@ class GLCommandEncoder {
|
||||
}
|
||||
getExtension(name) {
|
||||
var extention = this._layagl._nativeObj.getStringEx(0x1F03);
|
||||
let version = this._layagl._nativeObj.getStringEx(0x1F02);
|
||||
let extentions = extention.split(' ');
|
||||
function supports(extention) {
|
||||
for (let ext of extentions) {
|
||||
@@ -2860,7 +2861,7 @@ class GLCommandEncoder {
|
||||
(extention.indexOf('GL_EXT_shader_texture_lod') != -1 || extention.indexOf('GL_ARB_shader_texture_lod') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'OES_element_index_uint' && extention.indexOf('GL_OES_element_index_uint') != -1) {
|
||||
else if (name === 'OES_element_index_uint' && (extention.indexOf('GL_OES_element_index_uint') != -1)) {
|
||||
return {};
|
||||
}
|
||||
else if (name === 'EXT_sRGB' && extention.indexOf('GL_EXT_sRGB') != -1) {
|
||||
@@ -2915,13 +2916,16 @@ class GLCommandEncoder {
|
||||
TEXTURE_MAX_ANISOTROPY_EXT: 34046,
|
||||
};
|
||||
}
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && (conchConfig.glCaps & GL_CAPS.INSTANCEING)) {
|
||||
else if (name.indexOf('ANGLE_instanced_arrays') != -1 && ((extention.indexOf('_instanced_arrays') != -1) || version.indexOf("OpenGL ES 3.") != -1)) {
|
||||
return new ANGLEInstancedArrays(this);
|
||||
}
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && extention.indexOf('GL_OES_vertex_array_object') != -1) {
|
||||
else if (name.indexOf('OES_vertex_array_object') != -1 && (extention.indexOf('GL_OES_vertex_array_object') != -1)) {
|
||||
return new OESVertexArrayObject(this);
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && extention.indexOf('GL_OES_texture_half_float') != -1) {
|
||||
else if (name.indexOf('OES_texture_float') != -1 && extention.indexOf('GL_OES_texture_float') != -1) {
|
||||
return {};
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float') != -1 && (extention.indexOf('GL_OES_texture_half_float') != -1)) {
|
||||
return { HALF_FLOAT_OES: 36193 };
|
||||
}
|
||||
else if (name.indexOf('OES_texture_half_float_linear') != -1 && extention.indexOf('GL_OES_texture_half_float_linear') != -1) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user