Commit graph

405 commits

Author SHA1 Message Date
Zack Middleton
2660bb4a03 Add support for overriding basegame to web client
List files for multiple games in a single client-config.json file so
that com_basegame argument can pick different game data.

Use ioquake3.html?com_basegame=demoq3 (or tademo) to run the Quake 3 or
Team Arena demo. They require new QVMs from baseq3/missionpack to run.
2024-06-11 04:40:08 -04:00
Zack Middleton
8365ea7ed2 Customize the web client HTML file
Modify the client HTML file when copying it to the build directory to
apply current CLIENTBIN and BASEGAME. It always loads engine/data from
the current directory (no need to try to locate the build directory).
2024-06-11 04:40:08 -04:00
Zack Middleton
e6c0776d98 Allow web client to use unzipped QVMs
Compile the QVMs and automatically uses them when not using --preload-file.
2024-06-11 04:40:08 -04:00
Zack Middleton
41ec9ae05f Make emscripten --preload-file opt-in 2024-06-11 04:40:08 -04:00
Zack Middleton
ab8f7eb0bd Clean up emscripten in Makefile
- Remove emscripten build steps from Makefile (see readme)
- USE_CURL=0 has no effect
- HAVE_VM_COMPILED=false has no effect
- WebGL 1 and 2 are supported by the OpenGL2 renderer
- FULL_ES2 (client-side arrays) isn't needed
- Rename EMSCRIPTENOBJ to GENERATEDTARGETS and separate it from
  TARGETS so it's more readable.
2024-06-11 04:40:08 -04:00
Zack Middleton
b14c5a3d9c Add BUILD_RENDERER_OPENGL1 to disable opengl1
Have emscripten disable BUILD_RENDERER_OPENGL1 instead of hardcoded to
disable opengl1 client.
2024-06-11 04:40:08 -04:00
Zack Middleton
198c92b9f8 Add DEPEND_MAKEFILE to disable rebuild on Makefile edit 2024-06-11 04:40:08 -04:00
James Darpinian
f2169ed0b4 Support debug Emscripten build 2024-06-09 22:10:52 -04:00
James Darpinian
9348dbf643 Silence compiler warnings 2024-06-09 22:10:52 -04:00
James Darpinian
6fe061c36e Fix build when specifying PLATFORM=emscripten manually instead of using emmake 2024-06-09 22:10:52 -04:00
James Darpinian
2765cd5398 Get rid of "Nothing to be done for _.zip" message 2024-06-09 22:10:52 -04:00
James Darpinian
db24dfe13f ioquake3.html replaces Emscripten-generated HTML shell
This enables several things:
* Optionally load pk3 files from a web server at runtime instead of bundling them with Emscripten at build time
* Set command line arguments via URL param
* It's not ugly
2024-06-09 22:10:52 -04:00
James Darpinian
e247b316a7 Rebuild every target if Makefile changes 2024-06-09 22:10:52 -04:00
Zack Middleton
413be19a8d Add -ffast-math for emscripten to match other platforms
Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton
25a680ab6e Allow building for emscripten with "emmake make"
Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton
17cadb5369 Fix using emscripten 3.1.27+
emscripten 3.1.27 reduced the stack size from 5MB to 64KB. This caused
run-time errors: Uncaught RuntimeError: index out of bounds

Co-authored-by: James Darpinian <jdarpinian@gmail.com>
2024-06-09 22:10:52 -04:00
Zack Middleton
6f5c038947 Use BASEGAME for emscripten assets 2024-06-08 23:28:09 -04:00
Zack Middleton
4fc059b940 Fix emscripten build directions 2024-06-07 19:11:40 -04:00
Zack Middleton
f41bd37fde Add minimal emscripten support 2024-06-06 20:51:44 -04:00
rilysh
735d987303 Makefile: fix compilation on FreeBSD 2024-05-18 12:48:44 +01:00
Zack Middleton
78359180a4 Build QVMs even if there is no QVM JIT
The QVM interpreter works on all platforms. If building QVMs is an
issue, that should probably be handled separate from whether there
is a QVM JIT compiler.

This enables building QVMs by default on Linux arm64.
2023-10-22 22:21:07 -04:00
Zack Middleton
819e9830d8 Update macOS UB1 to SDL 2.0.22
Fix crash when scrolling using touchpad on macOS 10.6 (I fixed it
in SDL 2.0.18) and fix failing to start on x86 due to ioq3 SDL dylib
having absolute path instead of "@executable_path/libSDL2-2.0.0.dylib".

SDL 2.24.0 removed macOS 10.6 support (last with x86). Offically at
least, they also dropped x86_64 on macOS 10.7 and 10.8. So ioq3 UB1
is limited to SDL 2.0.22.

- Update x86 and x86_64 to SDL 2.0.22. Compiled with 10.13 SDK as
  10.14 SDK dropped running on older than macOS 10.9 and I ran
  "strip -x" on the libraries. Ad-hoc signed with PyOxidizer rcodesign.
- PPC is still MAN-AT-ARMS' SDL 2.0.1 build but I ran "strip -x"
  on it to reduce the file size.
- ARM64 build was removed from UB1 as UB2 with SDL 2.24.0 should
  be used instead.
2023-02-19 13:08:36 -05:00
Zack Middleton
02a12f2dec Update to SDL 2.24.0 and add separate macOS UB2 dylib
Update mingw and macOS SDL libraries to 2.24.0. (MSVC .lib files and
Xcode project haven't been updated.)

There is now a separate SDL dylib for macOS Universal Binary 1 and 2
because SDL 2.24.0 dropped support for macOS 10.6 (which is last to
support x86). Documentation says SDL 2.24.0 also dropped macOS 10.7
and 10.8 too. So UB2 is now 10.9 or later while 10.5 to 10.8 live in
UB1.

Compiled using osxcross with macOS 11.3 SDK. Ran "strip -x" on Windows
and macOS libraries. Ad-hoc signed dylib using PyOxidizer rcodesign to
fix digest checksums after strip.
2023-02-19 13:08:36 -05:00
Zack Middleton
9543cf24df Fix compiling on older macOS
ranlib errors on older macOS because of arm64 arch in code/libs/macosx/-
libSDL2main.a. Use lipo to extract the library for the specific arch
that is being linked.
2021-11-19 15:04:11 -05:00
Zack Middleton
68ac81316d Fix error when cross-compiling for macOS arm64 using Makefile
Fix "Architecture arm64 is not supported when cross compiling" and
also be more be more flexible for manually specifying CC or the
osxcross darwin version (which corresponds with a macOS SDK version
to build against).
2021-11-06 23:50:20 -04:00
Zack Middleton
7dd90123b7 Make macOS arm64 default to target macOS 11 in Makefile 2021-11-06 23:35:54 -04:00
Tom Kidd
6133df65fc Added shell script to compile Universal 2 binary (x86_64+arm64) 2021-07-06 17:30:27 -05:00
Tom Kidd
52a43ae1c4 Upgrades to Xcode project and Apple Silicon support
- Reorganized Xcode project
- Added missionpack support to Xcode project
- Incorporated changes from MaddTheSane for Apple Silicon support https://github.com/maddthesane/ioq3
- Built SDL 2.0.14 for Apple Siicon, added to existing SDL dylib
- Built SDLMain for Apple Silicon, added to existing libSDL2main.a
2021-07-06 17:30:27 -05:00
Tim Angus
05180e32dc Use the correct compiler for tools when cross building under cygwin 2020-12-26 21:54:58 +00:00
Tim Angus
44270f7557 Fix use of TOOLS_CC being reported as CC 2020-12-25 21:34:49 +00:00
Tim Angus
b388535307 Add TOOLS_CFLAGS to build preamble 2020-12-25 20:28:40 +00:00
Tim Angus
8e74119d0f Avoid platform sed differences 2020-09-08 13:25:50 +01:00
Tim Angus
2ec57b3a0e Fix shader stringify 2020-09-08 10:46:18 +01:00
Tim Angus
c0d797f308 Simplify glsl -> C stringification 2020-08-29 21:40:57 +01:00
Zack Middleton
302f12b8f6 Don't use host pkg-config when cross-compiling
Fix cross-compiling using mingw-w64 on Ubuntu 18.04.

pkg-config --cflags libcurl is now pulling in a Linux include directory
which breaks compiling.
2018-10-01 23:48:45 -05:00
Simon McVittie
fb4b206709 Allow pkg-config binary to be overridden with PKG_CONFIG
This is one of the de facto standard interfaces used in Linux
distributions for cross-compilation (alongside overriding CC and
similar variables), and in particular is used in Debian and its
derivatives.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-06-12 11:27:42 +01:00
Zack Middleton
f4db711024 Use SDL 2.0.1 headers for macOS ppc64
The libSDL2-2.0.0.dylib in repo doesn't support ppc64 though.

Based on patch by MAN-AT-ARMS.
2018-05-12 13:41:35 -05:00
Zack Middleton
ffd9ce1902 Limit -maltivec to specific source files on OpenBSD too (untested) 2018-05-12 13:30:40 -05:00
Simon McVittie
5909b9a1cf Isolate the Altivec code so non-Altivec PPC targets can use the same binary.
Moved all the code using Altivec intrinsics to separate files. This 
means we can optionally use GCC's -maltivec on just these files, which
are chosen at runtime if the CPU supports Altivec, and compile the rest
without it, making a single binary that has Altivec optimizations but
can still work on G3.

Unlike SSE and similar extensions on x86, there does not seem to be
a way to enable conditional, targeted use of Altivec based on runtime
detection (which is what ioquake3 wants to do) without also giving the
compiler permission to use Altivec in code generation; so to not crash
on CPUs that do not implement Altivec, we'll have to turn it off
altogether, except in translation units that are only entered when
runtime Altivec detection is successful.

This has been tested on Linux PPC (on an Altivec-enabled CPU),
but we may need further work after testing trickles out to other
PowerPC devices and ancient Mac OS X builds.

I did a little work on this patch, but the majority of the effort belongs 
to Simon McVittie (thanks!).
2018-05-12 14:14:47 -04:00
Zack Middleton
1caf1fb875 Fix compiling Makefile (broke in macOS frameworks commit) 2018-04-26 11:47:11 -05:00
Zack Middleton
3bc3fa1b3b Fix compiling against macOS system OpenAL and SDL2 frameworks 2018-04-26 11:23:47 -05:00
Zack Middleton
45af2594a0 Add SDL 2.0.1 headers for macOS PPC
code/libs/macosx/libSDL2-2.0.0.dylib has 2.0.8 for x86 and x86_64 and
2.0.1 for PPC. Add 2.0.1 headers for PPC with modifed SDL_platform.h to
allow compiling using macOS 10.5 SDK. Using separate headers allows the
engine to check the SDL version for enabling newer SDL features.
2018-04-26 11:21:36 -05:00
Zack Middleton
1284205012 Remove duplicate setting of FREETYPE_CFLAGS in Makefile 2018-04-03 20:11:53 -05:00
Zack Middleton
acef71af5e Rename (already updated) opusfile-0.8 to opusfile-0.9 2018-03-16 13:29:20 -05:00
Zack Middleton
8611eb421d Rename (already updated) opus-1.1.4 to opus-1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton
cb24c59567 Update opus from 1.1.4 to 1.2.1 2018-03-16 13:29:19 -05:00
Zack Middleton
c38c823a2a Rename (already updated) libvorbis-1.3.5 to libvorbis-1.3.6 2018-03-16 13:29:19 -05:00
Zack Middleton
ebd3d516ac Rename (already updated) libogg-1.3.2 to libogg-1.3.3 2018-03-16 13:11:27 -05:00
Zack Middleton
d4e7d987a3 Fix MAC_OS_X_VERSION_MIN_REQUIRED for macOS 10.10 and later
Manually specifying MACOSX_VERSION_MIN=10.10 or later would use the
wrong value for MAC_OS_X_VERSION_MIN_REQUIRED define. 1100 instead of
101000.
2018-02-08 10:23:44 -06:00
Zack Middleton
7166a3cd39 Enable compiler optimization on all macOS architectures
It seems to improve framerate and still work on x86 and x86_64. I
haven't tested ppc64 as I don't have the hardware. ppc64 isn't built
into the universal bundle either.

I noticed this because compiling opus warns it may be slow due to
optimization being disabled.
2017-12-16 12:51:56 -06:00