Skip to content

Commit 49b42b9

Browse files
committed
Engine: Apply Serenity fixes
A few fixes to get this running on Serenity. -The call to `mremap` has been removed -First video mode is hardcoded as video options crash the game -RESOURCE_LIBDIR has been hardcoded to /usr/local/lib/ -Remove Linux specific headers -Fix SDL2 include path in source files -Replace stricmp with strcmp for now
1 parent 470365f commit 49b42b9

File tree

6 files changed

+271
-243
lines changed

6 files changed

+271
-243
lines changed

src/linux/net_udp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ int NET_Socket (char *net_interface, int port)
496496
return 0;
497497
}
498498

499-
if (!net_interface || !net_interface[0] || !stricmp(net_interface, "localhost"))
499+
if (!net_interface || !net_interface[0] || !strcmp(net_interface, "localhost"))
500500
address.sin_addr.s_addr = INADDR_ANY;
501501
else
502502
NET_StringToSockaddr (net_interface, (struct sockaddr *)&address);

src/linux/q_shlinux.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ int Hunk_End (void)
9797
n = munmap(unmap_base, unmap_len) + membase;
9898
}
9999
#endif
100-
#if defined(__linux__)
101-
n = mremap(membase, maxhunksize, curhunksize + sizeof(int), 0);
100+
// HACK: This code crashes Quake2 on launch in Serenity.
101+
// It works just fine without it, but this should _definitely_ be implemented eventually.
102+
#if defined(__linux__) || defined(__serenity__)
103+
//n = mremap(membase, maxhunksize, curhunksize + sizeof(int), 0);
102104
#endif
103-
if (n != membase)
104-
Sys_Error("Hunk_End: Could not remap virtual block (%d)", errno);
105+
//if (n != membase)
106+
//Sys_Error("Hunk_End: Could not remap virtual block (%d)", errno);
105107
*((int *)membase) = curhunksize + sizeof(int);
106108

107109
return curhunksize;

src/linux/rw_sdl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <string.h>
2121
#include <sys/mman.h>
2222

23-
#include <SDL.h>
23+
#include <SDL2/SDL.h>
2424

2525
#ifdef OPENGL
2626
#include <GL/gl.h>

src/linux/snd_sdl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
snd_sdl.c
33
44
Sound code taken from SDLQuake and modified to work with Quake2
5-
Robert Bäuml 2001-12-25
5+
Robert B�uml 2001-12-25
66
77
This program is free software; you can redistribute it and/or
88
modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@
2525
$Id: snd_sdl.c,v 1.2 2002/02/09 20:29:38 relnev Exp $
2626
*/
2727

28-
#include <SDL.h>
28+
#include <SDL2/SDL.h>
2929

3030
#include "../client/client.h"
3131
#include "../client/snd_loc.h"

0 commit comments

Comments
 (0)