diff --git a/readme.md b/readme.md index 45aa9e65d..ac470dc06 100644 --- a/readme.md +++ b/readme.md @@ -20,7 +20,7 @@ You can download the game [from here](https://www.classicube.net/download/) and * It does not reimplement Minecraft Classic versions before 0.30 #### System requirements -* Windows: 98 or later +* Windows: 95 or later * macOS: 10.5 or later (can be compiled to work with 10.3/10.4 though) * Linux: libcurl and libopenal * Android: 2.3 or later diff --git a/src/Graphics_D3D9.c b/src/Graphics_D3D9.c index 97d1cff50..0bb2476a6 100644 --- a/src/Graphics_D3D9.c +++ b/src/Graphics_D3D9.c @@ -793,12 +793,6 @@ void Gfx_EndFrame(void) { IDirect3DDevice9_EndScene(device); cc_result res = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - /* Direct3D9Ex returns S_PRESENT_OCCLUDED when e.g.window is minimised */ - if (res == S_PRESENT_OCCLUDED) { - TickReducedPerformance(); return; - } - EndReducedPerformance(); - if (res) { if (res != D3DERR_DEVICELOST) Logger_Abort2(res, "D3D9_EndFrame"); /* TODO: Make sure this actually works on all graphics cards. */ diff --git a/src/_WindowBase.h b/src/_WindowBase.h index 25d75dc11..7fa4b8864 100644 --- a/src/_WindowBase.h +++ b/src/_WindowBase.h @@ -172,9 +172,11 @@ void GLContext_Create(void) { ctx_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(ctx_display, NULL, NULL); eglBindAPI(EGL_OPENGL_ES_API); - eglChooseConfig(ctx_display, attribs, &ctx_config, 1, &ctx_numConfig); + eglChooseConfig(ctx_display, attribs, &ctx_config, 1, &ctx_numConfig); ctx_context = eglCreateContext(ctx_display, ctx_config, EGL_NO_CONTEXT, context_attribs); + if (!ctx_context) Logger_Abort2(eglGetError(), "Failed to create EGL context"); + GLContext_InitSurface(); } diff --git a/src/interop_ios.m b/src/interop_ios.m index 1773e8303..5b2a1d21c 100644 --- a/src/interop_ios.m +++ b/src/interop_ios.m @@ -105,6 +105,7 @@ static UIInterfaceOrientationMask SupportedOrientations(void) { } static cc_bool kb_active; +static UITextField* kb_widget; - (void)keyboardDidShow:(NSNotification*)notification { NSDictionary* info = notification.userInfo; if (kb_active) return; @@ -116,7 +117,14 @@ static cc_bool kb_active; NSInteger curve = [[info objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]; CGRect kbFrame = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect winFrame = view_handle.frame; - winFrame.origin.y = -kbFrame.size.height; + + cc_bool can_shift = true; + // would the active input widget be pushed offscreen? + if (kb_widget) { + can_shift = kb_widget.frame.origin.y > kbFrame.size.height; + } + if (can_shift) winFrame.origin.y = -kbFrame.size.height; + kb_widget = nil; Platform_LogConst("APPEAR"); [UIView animateWithDuration:interval delay: 0.0 options:curve animations:^{ @@ -128,6 +136,7 @@ static cc_bool kb_active; NSDictionary* info = notification.userInfo; if (!kb_active) return; kb_active = false; + kb_widget = nil; double interval = [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; NSInteger curve = [[info objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]; @@ -725,6 +734,10 @@ static NSString* cellID = @"CC_Cell"; return YES; } +- (void)textFieldDidBeginEditing:(UITextField *)textField { + kb_widget = textField; +} + @end static CCUIController* ui_controller;