Commit 48c0bbf6 authored by kenan's avatar kenan

opt code

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