mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Don't bother checking return result for DrawIndexedPrimitives
This commit is contained in:
parent
ed4bfe31bc
commit
f4c797f13e
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 };
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user