Skip to content

Commit

Permalink
add idtech5 patch, remove deprecated warframe patch
Browse files Browse the repository at this point in the history
  • Loading branch information
GloriousEggroll authored and strycore committed Oct 27, 2017
1 parent 82ac752 commit e09b7a5
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions runners/wine/patches/idtech5.patch
@@ -0,0 +1,44 @@
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index b73920cb25..7140dfa3ca 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -250,6 +250,31 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
return ret;
}

+static
+const int* remove_profile_mask(const int *attribs)
+{
+ int* ret = NULL;
+ int i = 0;
+ int j = 0;
+ int attr_num = 0;
+ int profile_mask = 0;
+ for (i = 0; attribs[i] != NULL; i += 2) {
+ if (attribs[i] == WGL_CONTEXT_PROFILE_MASK_ARB)
+ profile_mask = 1;
+ ++attr_num;
+ }
+ if (profile_mask == 0) return attribs;
+ ret = calloc(attr_num*2 - 1, sizeof(int));
+ for (i = 0; attribs[i] != NULL; i += 2) {
+ if (attribs[i] != WGL_CONTEXT_PROFILE_MASK_ARB) {
+ ret[j] = attribs[i];
+ ret[j+1] = attribs[i+1];
+ j += 2;
+ }
+ }
+ return ret;
+}
+
/***********************************************************************
* wglCreateContextAttribsARB
*
@@ -262,6 +287,7 @@ HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attrib
struct wgl_handle *share_ptr = NULL;
struct opengl_context *context;
struct opengl_funcs *funcs = get_dc_funcs( hdc );
+ attribs = remove_profile_mask(attribs);

if (!funcs)
{

0 comments on commit e09b7a5

Please sign in to comment.