Skip to content

Commit

Permalink
fix quake2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
glKarin committed Dec 28, 2024
1 parent af95efa commit b92ff55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.changelog
Original file line number Diff line number Diff line change
@@ -1 +1 @@
z
z2
6 changes: 4 additions & 2 deletions Q3E/src/main/jni/quake2/yquake2/src/backends/android/gles.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// OpenGL attributes
int gl_format = 0x8888;
int gl_depth_bits = 24;
int gl_msaa = 0;
int screen_width = 640;
int screen_height = 480;
Expand Down Expand Up @@ -61,11 +62,12 @@ void RI_SetResolution(int aw,int ah)
printf("[Harmattan]: RI_SetResolution(%d, %d).\n", aw, ah);
}

void RI_SetGLParms(int f, int msaa)
void RI_SetGLParms(int f, int msaa, int depthBits)
{
gl_format = f;
gl_msaa = msaa;
printf( "[Harmattan]: RI_SetGLParms(0x%X, %d).\n", gl_format, msaa);
gl_depth_bits = depthBits;
printf( "[Harmattan]: RI_SetGLParms(0x%X, %d, %d).\n", gl_format, gl_msaa, gl_depth_bits);
}
#pragma GCC visibility pop

Expand Down
6 changes: 4 additions & 2 deletions Q3E/src/main/jni/quake2/yquake2/src/backends/android/gles3.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// OpenGL attributes
int gl_format = 0x8888;
int gl_depth_bits = 24;
int gl_msaa = 0;
int screen_width = 640;
int screen_height = 480;
Expand Down Expand Up @@ -61,11 +62,12 @@ void RI_SetResolution(int aw,int ah)
printf("[Harmattan]: RI_SetResolution(%d, %d).\n", aw, ah);
}

void RI_SetGLParms(int f, int msaa)
void RI_SetGLParms(int f, int msaa, int depthBits)
{
gl_format = f;
gl_msaa = msaa;
printf( "[Harmattan]: RI_SetGLParms(0x%X, %d).\n", gl_format, msaa);
gl_depth_bits = depthBits;
printf( "[Harmattan]: RI_SetGLParms(0x%X, %d, %d).\n", gl_format, gl_msaa, gl_depth_bits);
}
#pragma GCC visibility pop

Expand Down
5 changes: 3 additions & 2 deletions Q3E/src/main/jni/quake2/yquake2/src/backends/android/glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,20 @@ extern int screen_height;

extern int gl_format;
extern int gl_msaa;
extern int gl_depth_bits;

extern volatile ANativeWindow * Android_GetWindow(void);

void (* GLref_AndroidInit)(volatile ANativeWindow *w);
void (* GLref_AndroidQuit)(void);
typedef void (*RI_SetGLParms)(int f, int msaa);
typedef void (*RI_SetGLParms)(int f, int msaa, int depthBits);
typedef void (*RI_SetResolution)(int aw,int ah);

void GLimp_SetRef(void *init, void *quit, void *setGLParms, void *setResolution)
{
GLref_AndroidInit = init;
GLref_AndroidQuit = quit;
((RI_SetGLParms)setGLParms)(gl_format, gl_msaa);
((RI_SetGLParms)setGLParms)(gl_format, gl_msaa, gl_depth_bits);
((RI_SetResolution)setResolution)(screen_width, screen_height);
}

Expand Down

0 comments on commit b92ff55

Please sign in to comment.