Commit Graph

1187 Commits

Author SHA1 Message Date
Andrei Drexler 3c8611f604 Reset pointers to sky textures on map unload/game change
This fixes a crash when loading a skyless map after one with a sky.
( From: https://github.com/Novum/vkQuake/pull/339 )
2021-08-10 01:00:02 +03:00
Ozkan Sezer bd8615c235 snd_umx.c: revise sanity checks and check returned values from FS layer. 2021-07-14 03:37:00 +03:00
Ozkan Sezer 96b07d712d mingw makefiles: -lm is not needed. 2021-07-09 14:56:00 +03:00
Axel Gneiting 3fc32bf7fe Merge surface mark & cull optimization from vkQuake
* Remove separate surface culling pass. Instead always build texture chains every frame & cull in mark surfaces.
* Optimize R_CullBox & R_BackFaceCull
2021-07-07 23:55:50 +03:00
Ozkan Sezer d6e68b6f19 minor tweak to the ow makefile 2021-07-07 23:55:50 +03:00
Ozkan Sezer 57748db955 add arm64 target to Makefile.darwin
SDL2 and music codec builds for arm64 should come later.
2021-06-28 03:01:02 +03:00
Ozkan Sezer 78323635a0 silence a few macOS deprecation warnings.
The IOHID deprecation (its use is in in_sdl.c for the mouse acceleration
hack) still needs addressing:

in_sdl.c:163:7: warning: 'IOHIDGetAccelerationWithKey' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                if (IOHIDGetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), &originalMouseSpeed) == kIOReturnSuccess)
                    ^
/opt/MacOSX11.3.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDLib.h:96:1: note: 'IOHIDGetAccelerationWithKey' has been explicitly marked deprecated here
IOHIDGetAccelerationWithKey( io_connect_t handle, CFStringRef key, double * acceleration ) __attribute__((availability(macos,introduced=10.0,deprecated=10.12)));
^
in_sdl.c:165:8: warning: 'IOHIDSetAccelerationWithKey' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                        if (IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), -1.0) != kIOReturnSuccess)
                            ^
/opt/MacOSX11.3.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDLib.h:99:1: note: 'IOHIDSetAccelerationWithKey' has been explicitly marked deprecated here
IOHIDSetAccelerationWithKey( io_connect_t handle, CFStringRef key, double acceleration ) __attribute__((availability(macos,introduced=10.0,deprecated=10.12)));
^
in_sdl.c:190:7: warning: 'IOHIDSetAccelerationWithKey' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                if (IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), originalMouseSpeed) != kIOReturnSuccess)
                    ^
/opt/MacOSX11.3.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDLib.h:99:1: note: 'IOHIDSetAccelerationWithKey' has been explicitly marked deprecated here
IOHIDSetAccelerationWithKey( io_connect_t handle, CFStringRef key, double acceleration ) __attribute__((availability(macos,introduced=10.0,deprecated=10.12)));
^
2021-06-28 03:01:02 +03:00
Ozkan Sezer 848aa26b3c silence opengl deprecation warnings from newer mac sdks. 2021-06-28 03:01:02 +03:00
Ozkan Sezer 824f01031e silence misleading indentation warnings from clang. 2021-06-28 03:01:02 +03:00
Ozkan Sezer 9ca7d499e5 fixed -Wshadow warnings. 2021-06-23 04:37:10 +03:00
Ozkan Sezer 9fc38410dd VID_InitModelist (SDL-1.2): zero the whole format,
.. instead of only setting its palette fiel to NULL. This makes it work
with sdl12-compat (see: https://github.com/libsdl-org/sdl12-compat.git)
2021-04-12 12:37:04 +03:00
Ozkan Sezer f88bdb7d0b fix rendering bug when cl_bobcycle was set to zero (sf.net bug/41)
fix taken from Kevin Shanahan's Tyr-Quake
2021-03-31 23:51:10 +03:00
Ozkan Sezer 81adf62374 Updates for tracker music:
- New console command music_jump: Jump to given order in music,
  like Unreal's music change.  Only for module (tracker) music.
- stream layer: Store the loop setting.
- umx reader: Replaced questionable byte-swap.
- libxmp backend: Handled the loop setting through libxmp apis.
- mikmod backend: Enabled in-module loops. Respect global loop
  setting. More compatible reader callback structure.
2021-02-04 23:28:00 +03:00
Ozkan Sezer 75e9bc385f snd_xmp.c updates. 2021-01-31 20:50:00 +03:00
Ozkan Sezer 66df5d09f4 Merge /u/smcvittie/quakespasm/ branch cross-pkg-config into master
https://sourceforge.net/p/quakespasm/quakespasm/merge-requests/2/
2021-01-07 14:55:24 +00:00
Helmut Grohne a7503e2be2 Make pkg-config substitutable
This helps with cross-compilation. When cross-compiling, the environment
variable PKG_CONFIG is typically set to a version of pkg-config that is
configured to look in appropriate locations for the cross architecture.

For example, a build for 64-bit ARM might use:

    make \
        CC=aarch64-linux-gnu-gcc \
        STRIP=aarch64-linux-gnu-strip \
        PKG_CONFIG=aarch64-linux-gnu-pkg-config \
        release

On a Debian system, this would look in
/usr/lib/aarch64-linux-gnu/pkgconfig for details of 64-bit ARM Opus
libraries.

Bug-Debian: https://bugs.debian.org/900217
2020-12-22 12:17:31 +00:00
Stephen Kitt 9bd1cc8d1d Spelling fixes 2020-12-22 12:05:37 +00:00
Ozkan Sezer 15a41d2169 host_cmd.c (Host_SavegameComment): Remove CR/LFs from level name.
Avoids broken saves, e.g. with autumn_sp map.  See:
https://celephais.net/board/view_thread.php?id=60452&start=3666
2020-09-08 14:00:00 +03:00
Axel Gneiting 6e4f29a22f Remove mtexinfo_t::mipadjust (software raster remnant) 2020-07-05 21:01:10 +03:00
Eric Wasylishen ad3aadb373 Replace some uses of 9999/-9999, and 999999/-999999 with FLT_MAX/-FLT_MAX
Was sent a sample map where the texture scale was such that the
CalcSurfaceExtents mins/maxs were calculated incorrectly because of the
use of 999999 not being large enough magnitude, leading to a crash later
(maxs-mins was negative).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1671 af15c1b1-3010-417e-b628-4374ebc0bcbd
2020-03-28 05:09:09 +00:00
Eric Wasylishen be4dbdb29c Mod_LoadAliasFrame, Mod_LoadAliasGroup: error if posenum >= MAXALIASFRAMES
See: https://sourceforge.net/p/quakespasm/bugs/37/

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1670 af15c1b1-3010-417e-b628-4374ebc0bcbd
2020-03-28 05:09:07 +00:00
Eric Wasylishen bda9912002 gl_sky.c (skybox_name): lazily increase array size from 32 to 1024.
See: https://sourceforge.net/p/quakespasm/bugs/38/

Also move its initializer to Sky_Init() and use q_strlcpy() instead
of strcpy() for copying to it in Sky_LoadSkyBox().

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1669 af15c1b1-3010-417e-b628-4374ebc0bcbd
2020-03-28 05:09:06 +00:00
Ozkan Sezer 65825de11a snd_mp3tag.c: check for false positives if id3v1 is not at file's end.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1665 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-29 16:50:06 +00:00
Ozkan Sezer a1eff43d80 snd_mp3tags: let it consume all the tags at file end.
We do not know the order of ape, or lyrics3, or musicmatch tags,
so we loop until we consume all, scanning for each tag type once.
I don't yet care about freaky broken mp3 files with double tags.

<rant> MP3 standard has no metadata format, so everyone invented
their own thing, even with extensions, until ID3v2 became dominant:
Hence the impossible mess there.</rant>

Also remove inline directive from a few detection procedures there.

(updates from my code in SDL_mixer.)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1664 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-23 21:35:16 +00:00
Eric Wasylishen 42c0491e92 r_world.c: workaround Intel UHD 600 driver bug
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1662 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-15 23:52:13 +00:00
Ozkan Sezer e0e2d16ca2 snd_mpg123.c: use mp3_skiptags(). tidy-up a little.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1661 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-12 14:10:14 +00:00
Ozkan Sezer 17209fd330 snd_mp3tag.c: tidy-up return code. add a failsafe for fshandle_t.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1660 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-12 14:04:01 +00:00
Ozkan Sezer 386e56258d snd_mp3.c: move skiptags() call to codecopen(), print error if it fails.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1659 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-12 14:01:02 +00:00
Ozkan Sezer ffe43cf024 snd_mp3.c: moved mp3 tag stuff into a separate module snd_mp3tag.c
so that it can be used in snd_mpg123.c, too, if needed.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1658 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-12 11:37:32 +00:00
Ozkan Sezer b2bf251a32 snd_mp3.c: removed unnecessary file rewind calls in tag detection code.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1657 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-12 08:23:12 +00:00
Ozkan Sezer 3b4a07ca87 snd_mp3.c: Tag detection fixes, updates, and clean-ups:
- Updates from my code in SDL_mixer:
- Fix APE header presence detection: APEv2 doesn't guarantee header.
  We rely on bit31 of the flags field of the header/footer, instead.
- Add code to skip Lyrics3 v1 / v2 tags.
- Remove the non-standard 'Extended ID3v1' tag support: None of the
  significant libraries like getID3, taglib or libid3tag support it.
  Not supported in most, if not all mp3 players, either.
- The 'APE before ID3v1' was duplicated code because we removed the
  TAG+ support: removed it.
- Add a FIXME note about handling possible double-ID3v1 tags.
- Add a FIXME note about order of tags at the end of the file.
- A few minor tidy-ups.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1656 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-12-08 14:00:50 +00:00
Eric Wasylishen 361c66d06a Reject lit files if they're the wrong size (eg hipnotic/start.bsp vs id1/start.lit or just a bsp that no longer has any coloured lits, etc).
From Spike.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1654 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-11-20 02:47:04 +00:00
Ozkan Sezer 6abf2afbe6 lodepng.c: fix LODEPNG_RESTRICT for gcc
previously, it ignored any gcc with __GNUC_MINOR__ == 0.
(patch submitted to upstream at github as PR/120)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1652 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-11-18 09:47:04 +00:00
Ozkan Sezer c2dbafef4b lodepng.c: minor update (cf. mainstream PR/119)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1648 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-11-11 22:14:22 +00:00
Ozkan Sezer 8ebb9dc117 lodepng.c (lodepng_zlib_compress): Fix alloc fail check.
From https://github.com/lvandeve/lodepng/pull/118

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1646 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-11-11 09:37:06 +00:00
Ozkan Sezer da43c6a57b r_brush.c (AllocBlock): add a FIXME note about a valgrind warning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1645 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-11-11 09:35:19 +00:00
Ozkan Sezer 21915e956c snd_sdl.c: pass NULL as the 'obtained' spec to SDL_OpenAudio():
this way, SDL will convert to hardware format for us if needed.
most of the times we do get what we want. however, for example,
the WASAPI backend of SDL2 returns AUDIO_F32LSB as the obtained
format (which is not an SDL thing but a WASAPI thing) and we do
not support that. the SDL2.dll we ship with has WASAPI disabled,
but if the user replaces our dll with a one with WASAPI enabled
(official libsdl.org build or his own build) then we refuse the
obtained AUDIO_F32LSB format and run without sound.  after this
patch, such a thing is transparent to us.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1639 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-20 18:40:00 +00:00
Ozkan Sezer e04c0b49af remove Steve's name from quit menu message too, per his request.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1638 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-18 09:39:00 +00:00
Ozkan Sezer 196f89a239 GL_BuildLightmaps: minor warning fixes. more accurate developer warning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1637 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-18 09:17:24 +00:00
Ozkan Sezer 57ad299dfa r_brush.c (AllocBlock): add casts to malloc and realloc
( in case someone wants to build using C++ compilers. )

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1634 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-16 11:00:38 +00:00
Ozkan Sezer 13d8e8f704 bump version to 0.93.2, update changelog.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1631 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 12:36:59 +00:00
Ozkan Sezer 39b4fccb44 move LMBLOCK_WIDTH/HEIGHT from bspfile.h to glquake.h
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1630 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 12:34:12 +00:00
Ozkan Sezer 0a6a5c62c8 minor simplification
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1629 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 12:33:02 +00:00
Eric Wasylishen e041b958c7 r_brush.c: dynamically allocate lightmaps, from QuakeSpasm-Spike
This raises LMBLOCK_WIDTH/HEIGHT from 128 to 256 which should
be supported everywhere and decrease draw calls

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1628 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 06:49:35 +00:00
Eric Wasylishen f2930ef460 r_brush.c: rename BLOCK_WIDTH/HEIGHT to LMBLOCK_WIDTH/HEIGHT to match QSS
(no other changes)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1627 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 06:49:27 +00:00
Eric Wasylishen 12e781ba46 raise MAXALIASTRIS from 2048 to 4096 so SlayerTest mdl's load.
TODO: look at switching to Spike's mdl code from QSS
TODO: add "exceeds standard limit" warnings

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1626 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 04:06:57 +00:00
Eric Wasylishen 6924a94fa6 Mod_LoadAliasModel: don't corrupt memory if MAXALIASTRIS exceeded
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1625 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 04:06:55 +00:00
Eric Wasylishen 429b29a669 Sky_NewMap: avoid stack buffer underflow on the "remove trailing spaces"
line that happened if a map had an empty string worldspawn key,
detected by ASan on macOS with demo_map.bsp from SlayerTest.

Also prevent the strcpy's from overflowing the buffers in case of long
keys.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1624 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 04:06:54 +00:00
Ozkan Sezer 0e6c4f27cc update lodepng to 20190824 version from mainstream.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1623 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-08-28 00:10:02 +00:00
Ozkan Sezer e4eae98ab4 watcom makefiles: make wlink quiet
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1622 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-08-28 00:01:04 +00:00