diff --git a/src/Formats.c b/src/Formats.c index ce654860d..61dac9f66 100644 --- a/src/Formats.c +++ b/src/Formats.c @@ -1383,6 +1383,7 @@ cc_result Cw_Save(struct Stream* stream) { cur = Nbt_WriteUInt16(cur, "Y", World.Height); cur = Nbt_WriteUInt16(cur, "Z", World.Length); + /* TODO: Maybe keep real spawn too? */ cur = Nbt_WriteDict(cur, "Spawn"); { cur = Nbt_WriteUInt16(cur, "X", (cc_uint16)p->Base.Position.X); diff --git a/src/_WindowBase.h b/src/_WindowBase.h index 7fa4b8864..18407d9bf 100644 --- a/src/_WindowBase.h +++ b/src/_WindowBase.h @@ -146,7 +146,7 @@ void GLContext_Create(void) { #else static EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE }; #endif - static EGLint attribs[19] = { + static EGLint attribs[] = { EGL_RED_SIZE, 0, EGL_GREEN_SIZE, 0, EGL_BLUE_SIZE, 0, EGL_ALPHA_SIZE, 0, EGL_DEPTH_SIZE, GLCONTEXT_DEFAULT_DEPTH, @@ -174,9 +174,14 @@ void GLContext_Create(void) { eglBindAPI(EGL_OPENGL_ES_API); eglChooseConfig(ctx_display, attribs, &ctx_config, 1, &ctx_numConfig); + if (!ctx_config) { + attribs[9] = 16; // some older devices only support 16 bit depth buffer + eglChooseConfig(ctx_display, attribs, &ctx_config, 1, &ctx_numConfig); + } + if (!ctx_config) Window_ShowDialog("Warning", "Failed to choose EGL config, ClassiCube may be unable to start"); + 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(); }