Commit 48c0bbf6 authored by kenan's avatar kenan

opt code

parent 28f0198d
...@@ -61,12 +61,13 @@ bool Game::Initialize() { ...@@ -61,12 +61,13 @@ bool Game::Initialize() {
params.Bits = 24; params.Bits = 24;
params.ZBufferBits = 16; params.ZBufferBits = 16;
params.AntiAlias = 0; params.AntiAlias = 0;
int w = 1024.0*xScale; int w = (int)(1024.0*xScale);
int h = 640.0*yScale; int h = (int)(640.0*yScale);
params.WindowSize = irr::core::dimension2d<u32>(0, 0); params.WindowSize = irr::core::dimension2d<u32>(w, h);
//每一个元素得left和top都需要改 //每一个元素得left和top都需要改
xStart = (screenH - w)/2.0; xStart = (float)((screenH - w)/2.0);
yStart = (screenW - h)/2.0; yStart = (float)((screenW - h)/2.0);
params.WindowPosition = core::position2di((s32)xStart, (s32)yStart);
#else #else
if(gameConf.use_d3d) if(gameConf.use_d3d)
params.DriverType = irr::video::EDT_DIRECT3D9; params.DriverType = irr::video::EDT_DIRECT3D9;
......
...@@ -51,8 +51,6 @@ namespace irr ...@@ -51,8 +51,6 @@ namespace irr
UsePerformanceTimer(true), UsePerformanceTimer(true),
SDK_version_do_not_use(IRRLICHT_SDK_VERSION), SDK_version_do_not_use(IRRLICHT_SDK_VERSION),
PrivateData(0), PrivateData(0),
WindowLeft(0),
WindowTop(0),
#ifdef _IRR_COMPILE_WITH_IPHONE_DEVICE_ #ifdef _IRR_COMPILE_WITH_IPHONE_DEVICE_
OGLES2ShaderPath("") OGLES2ShaderPath("")
#elif defined(_IRR_ANDROID_PLATFORM_) #elif defined(_IRR_ANDROID_PLATFORM_)
...@@ -119,10 +117,6 @@ namespace irr ...@@ -119,10 +117,6 @@ namespace irr
//! Size of the window or the video mode in fullscreen mode. Default: 800x600 //! Size of the window or the video mode in fullscreen mode. Default: 800x600
core::dimension2d<u32> WindowSize; core::dimension2d<u32> WindowSize;
int WindowLeft;
int WindowTop;
//! Position of the window on-screen. Default: (-1, -1) or centered. //! Position of the window on-screen. Default: (-1, -1) or centered.
core::position2di WindowPosition; core::position2di WindowPosition;
......
...@@ -38,7 +38,7 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param) ...@@ -38,7 +38,7 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CIrrDeviceAndroid"); setDebugName("CIrrDeviceAndroid");
#endif #endif
startPoint = core::position2di(param.WindowLeft, param.WindowTop);
// Get the interface to the native Android activity. // Get the interface to the native Android activity.
Android = (ANDROID_APP)(param.PrivateData); Android = (ANDROID_APP)(param.PrivateData);
...@@ -189,7 +189,7 @@ void CIrrDeviceAndroid::restoreWindow() ...@@ -189,7 +189,7 @@ void CIrrDeviceAndroid::restoreWindow()
core::position2di CIrrDeviceAndroid::getWindowPosition() core::position2di CIrrDeviceAndroid::getWindowPosition()
{ {
return startPoint; return core::position2di(0,0);
} }
E_DEVICE_TYPE CIrrDeviceAndroid::getType() const E_DEVICE_TYPE CIrrDeviceAndroid::getType() const
......
...@@ -75,8 +75,6 @@ namespace irr ...@@ -75,8 +75,6 @@ namespace irr
bool Focused; bool Focused;
bool Initialized; bool Initialized;
bool Paused; bool Paused;
core::position2di startPoint;
JNIEnv* JNIEnvAttachedToVM; JNIEnv* JNIEnvAttachedToVM;
......
...@@ -79,8 +79,7 @@ repositories { ...@@ -79,8 +79,7 @@ repositories {
} }
dependencies { dependencies {
implementation 'junit:junit:4.12' implementation 'junit:junit:4.12'
debugImplementation project(':libygo') implementation project(':libcore')
releaseImplementation project(':libcore')
//support-annotations,support-vector-drawable //support-annotations,support-vector-drawable
// implementation 'com.android.support:appcompat-v7:' + rootProject.ext.supportVersion // implementation 'com.android.support:appcompat-v7:' + rootProject.ext.supportVersion
// implementation 'com.android.support:recyclerview-v7:' + rootProject.ext.supportVersion // implementation 'com.android.support:recyclerview-v7:' + rootProject.ext.supportVersion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment