diff --git a/engine/client/sys_sdl.c b/engine/client/sys_sdl.c index 37d486816..a2afe009e 100644 --- a/engine/client/sys_sdl.c +++ b/engine/client/sys_sdl.c @@ -118,9 +118,6 @@ qboolean Sys_remove (char *path) //someone used the 'quit' command void Sys_Quit (void) { - if (VID_ForceUnlockedAndReturnState) - VID_ForceUnlockedAndReturnState (); - Host_Shutdown(); exit (0); diff --git a/engine/d3d/vid_d3d.c b/engine/d3d/vid_d3d.c index 0f08ae8c0..668a497f4 100644 --- a/engine/d3d/vid_d3d.c +++ b/engine/d3d/vid_d3d.c @@ -720,25 +720,6 @@ static void (D3D9_VID_DeInit) (void) mainwindow = NULL; } } -static void (D3D9_VID_LockBuffer) (void) -{ -} -static void (D3D9_VID_UnlockBuffer) (void) -{ -} -static void (D3D9_D_BeginDirectRect) (int x, int y, qbyte *pbitmap, int width, int height) -{ -} -static void (D3D9_D_EndDirectRect) (int x, int y, int width, int height) -{ -} -static void (D3D9_VID_ForceLockState) (int lk) -{ -} -static int (D3D9_VID_ForceUnlockedAndReturnState) (void) -{ - return 0; -} static void (D3D9_VID_SetPalette) (unsigned char *palette) { diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index a9f797ea0..1dba8efbf 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -1904,8 +1904,9 @@ static void BE_SubmitMeshChain(void) int startv, starti, endv, endi; int m; mesh_t *mesh; - extern cvar_t temp1; - if (temp1.ival) + +/* + if (qglLockArraysEXT) { endv = 0; startv = 0x7fffffff; @@ -1921,7 +1922,7 @@ static void BE_SubmitMeshChain(void) } qglLockArraysEXT(startv, endv); } - +*/ for (m = 0, mesh = shaderstate.meshes[0]; m < shaderstate.meshcount; ) { startv = mesh->vbofirstvert; @@ -1947,8 +1948,10 @@ static void BE_SubmitMeshChain(void) qglDrawRangeElements(GL_TRIANGLES, startv, endv, endi-starti, GL_INDEX_TYPE, shaderstate.sourcevbo->indicies + starti); } - if (temp1.ival) +/* + if (qglUnlockArraysEXT) qglUnlockArraysEXT(); +*/ } static void DrawPass(const shaderpass_t *pass) diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index fd03cd470..952f69678 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -899,11 +899,13 @@ static void Shaderpass_Map (shader_t *shader, shaderpass_t *pass, char **ptr) } else if (!Q_stricmp (token, "$upperoverlay")) { + shader->flags |= SHADER_HASTOPBOTTOM; pass->texgen = T_GEN_UPPEROVERLAY; pass->tcgen = TC_GEN_BASE; } else if (!Q_stricmp (token, "$loweroverlay")) { + shader->flags |= SHADER_HASTOPBOTTOM; pass->texgen = T_GEN_LOWEROVERLAY; pass->tcgen = TC_GEN_BASE; } @@ -2358,17 +2360,23 @@ void R_BuildDefaultTexnums(texnums_t *tn, shader_t *shader) if (!TEXVALID(tn->base)) tn->base = R_LoadHiResTexture(shader->name, NULL, IF_NOALPHA); - if (!TEXVALID(tn->bump) && gl_bump.ival) - tn->bump = R_LoadHiResTexture(va("%s_norm", shader->name), NULL, IF_NOALPHA); - if (!TEXVALID(tn->bump) && gl_bump.ival) - tn->bump = R_LoadHiResTexture(va("%s_bump", shader->name), NULL, IF_NOALPHA); - if (!TEXVALID(tn->bump) && gl_bump.ival) - tn->bump = R_LoadHiResTexture(va("normalmaps/%s", shader->name), NULL, IF_NOALPHA); + if (gl_bump.ival) + { + if (!TEXVALID(tn->bump)) + tn->bump = R_LoadHiResTexture(va("%s_norm", shader->name), NULL, IF_NOALPHA); + if (!TEXVALID(tn->bump)) + tn->bump = R_LoadHiResTexture(va("%s_bump", shader->name), NULL, IF_NOALPHA); + if (!TEXVALID(tn->bump)) + tn->bump = R_LoadHiResTexture(va("normalmaps/%s", shader->name), NULL, IF_NOALPHA); + } - if (!TEXVALID(tn->loweroverlay)) - tn->loweroverlay = R_LoadHiResTexture(va("%s_pants", shader->name), NULL, 0); /*how rude*/ - if (!TEXVALID(tn->upperoverlay)) - tn->upperoverlay = R_LoadHiResTexture(va("%s_shirt", shader->name), NULL, 0); + if (shader->flags & SHADER_HASTOPBOTTOM) + { + if (!TEXVALID(tn->loweroverlay)) + tn->loweroverlay = R_LoadHiResTexture(va("%s_pants", shader->name), NULL, 0); /*how rude*/ + if (!TEXVALID(tn->upperoverlay)) + tn->upperoverlay = R_LoadHiResTexture(va("%s_shirt", shader->name), NULL, 0); + } shader->defaulttextures = *tn; } diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 4e95fed85..99434a776 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -306,25 +306,6 @@ qboolean GLInitialise (char *renderer) return true; } -// direct draw software compatability stuff - -void GLVID_ForceLockState (int lk) -{ -} - -void GLVID_LockBuffer (void) -{ -} - -void GLVID_UnlockBuffer (void) -{ -} - -int GLVID_ForceUnlockedAndReturnState (void) -{ - return 0; -} - void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify) { // RECT rect; diff --git a/engine/gl/gltod3d/gl_fakegl.cpp b/engine/gl/gltod3d/gl_fakegl.cpp index 70e707b67..54ae6b9a1 100644 --- a/engine/gl/gltod3d/gl_fakegl.cpp +++ b/engine/gl/gltod3d/gl_fakegl.cpp @@ -4149,12 +4149,6 @@ rendererinfo_t d3drendererinfo = { D3DVID_Init, GLVID_DeInit, - GLVID_LockBuffer, - GLVID_UnlockBuffer, - GLD_BeginDirectRect, - GLD_EndDirectRect, - GLVID_ForceLockState, - GLVID_ForceUnlockedAndReturnState, GLVID_SetPalette, GLVID_ShiftPalette, GLVID_GetRGBInfo, diff --git a/engine/gl/shader.h b/engine/gl/shader.h index eae962dc2..bb0178b17 100644 --- a/engine/gl/shader.h +++ b/engine/gl/shader.h @@ -309,7 +309,8 @@ struct shader_s SHADER_NODRAW = 1 << 14, //parsed only to pee off developers when they forget it on no-pass shaders. SHADER_NODLIGHT = 1 << 15, //from surfaceflags - SHADER_HASLIGHTMAP = 1 << 16 + SHADER_HASLIGHTMAP = 1 << 16, + SHADER_HASTOPBOTTOM = 1 << 17 } flags; union {