diff --git a/src/Graphics.c b/src/Graphics.c index e4651a21d..9f9bee81a 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -802,26 +802,23 @@ void Gfx_SetDynamicVbData(GfxResourceID vb, void* vertices, int vCount) { } void Gfx_DrawVb_Lines(int verticesCount) { - ReturnCode res = IDirect3DDevice9_DrawPrimitive(device, D3DPT_LINELIST, 0, verticesCount >> 1); - if (res) Logger_Abort2(res, "D3D9_DrawVb_Lines"); + /* NOTE: Skip checking return result for Gfx_DrawXYZ for performance */ + IDirect3DDevice9_DrawPrimitive(device, D3DPT_LINELIST, 0, verticesCount >> 1); } void Gfx_DrawVb_IndexedTris(int verticesCount) { - ReturnCode res = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, + IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, verticesCount, 0, verticesCount >> 1); - if (res) Logger_Abort2(res, "D3D9_DrawVb_IndexedTris"); } void Gfx_DrawVb_IndexedTris_Range(int verticesCount, int startVertex) { - ReturnCode res = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, + IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, startVertex, 0, verticesCount, 0, verticesCount >> 1); - if (res) Logger_Abort2(res, "D3D9_DrawVb_IndexedTris"); } void Gfx_DrawIndexedVb_TrisT2fC4b(int verticesCount, int startVertex) { - ReturnCode res = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, + IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, startVertex, 0, verticesCount, 0, verticesCount >> 1); - if (res) Logger_Abort2(res, "D3D9_DrawIndexedVb_TrisT2fC4b"); } diff --git a/src/Gui.h b/src/Gui.h index 61c3de528..ba1a1cac9 100644 --- a/src/Gui.h +++ b/src/Gui.h @@ -62,7 +62,8 @@ struct ScreenVTABLE { bool HandlesAllInput; /* Whether this screen handles all input. Prevents user interacting with the world. */ \ bool BlocksWorld; /* Whether this screen completely and opaquely covers the game world behind it. */ \ bool HidesHUD; /* Whether this screen hides the normal in-game HUD. */ \ - bool RenderHUDOver; /* Whether the normal in-game HUD should be drawn over the top of this screen. */ + bool RenderHUDOver; /* Whether the normal in-game HUD should be drawn over the top of this screen. */ \ + bool Closable; /* Whether this screen is automatically closed when pressing Escape */ /* Represents a container of widgets and other 2D elements. May cover entire window. */ struct Screen { Screen_Layout }; diff --git a/src/InputHandler.c b/src/InputHandler.c index ce21f231f..8771c3e68 100644 --- a/src/InputHandler.c +++ b/src/InputHandler.c @@ -463,6 +463,8 @@ static void InputHandler_KeyDown(void* obj, int key, bool was) { Game_ScreenshotRequested = true; return; } else if (Elem_HandlesKeyDown(active, key, was)) { return; + } else if (key == KEY_ESCAPE && active->Closable) { + Gui_CloseActive(); } else if ((key == KEY_ESCAPE || key == KEY_PAUSE) && !active->HandlesAllInput) { Gui_FreeActive(); Gui_SetActive(PauseScreen_MakeInstance()); return; diff --git a/src/Menus.c b/src/Menus.c index ceb39f4f0..4f5dfa6cd 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -3131,14 +3131,14 @@ struct Screen* TexIdsOverlay_MakeInstance(void) { static struct UrlWarningOverlay UrlWarningOverlay_Instance; static void UrlWarningOverlay_OpenUrl(void* screen, void* b) { struct UrlWarningOverlay* s = screen; - Gui_FreeOverlay(s); Process_StartOpen(&s->Url); + Gui_FreeOverlay(s); } static void UrlWarningOverlay_AppendUrl(void* screen, void* b) { struct UrlWarningOverlay* s = screen; - Gui_FreeOverlay(s); if (Gui_ClickableChat) { HUDScreen_AppendInput(Gui_HUD, &s->Url); } + Gui_FreeOverlay(s); } static void UrlWarningOverlay_ContextRecreated(void* screen) { diff --git a/src/Resources.c b/src/Resources.c index 44beabb6e..5c68c6ece 100644 --- a/src/Resources.c +++ b/src/Resources.c @@ -111,8 +111,8 @@ void Resources_CheckExistence(void) { struct ResourceFile Resources_Files[4] = { { "classic jar", "http://launcher.mojang.com/mc/game/c0.30_01c/client/54622801f5ef1bcc1549a842c5b04cb5d5583005/client.jar", 291 }, { "1.6.2 jar", "http://launcher.mojang.com/mc/game/1.6.2/client/b6cb68afde1d9cf4a20cbf27fa90d0828bf440a4/client.jar", 4621 }, - { "gui.png patch", "http://static.classicube.net/terrain-patch2.png", 7 }, - { "terrain.png patch", "http://static.classicube.net/gui.png", 21 } + { "terrain.png patch", "http://static.classicube.net/terrain-patch2.png", 7 }, + { "gui.png patch", "http://static.classicube.net/gui.png", 21 } }; struct ResourceTexture Resources_Textures[20] = {