Commit graph

1081 commits

Author SHA1 Message Date
Ozkan Sezer
b08e7b1168 Some more image.c / lodepng / stb_image_write clean-ups:
image.c: define LODEPNG_NO_COMPILE_CPP for lodepng.c.
image.c: define STB_IMAGE_WRITE_STATIC for stb_image_write.h
image.c: minor whitespace tidy-up.
stb_image_write.h: remove extern declaration for now non-existing
 stbi_write_tga_with_rle (missed in commit r1468).
stb_image_write.h: comment out stbi_write_jpg_to_func() which quakespasm
 doesn't use.
lodepng.c (lodepng_save_file): remove unneeded (char*) cast from buffer.
lodepng.c (lodepng_read32bitInt): make it static.
lodepng.c (lodepng_get_raw_size_lct): make it static, and move below to
 the place it is actually used.
lodepng.c (lodepng_info_swap): remove (unused function).
lodepng.c (readChunk_zTXt,readChunk_iTXt,addChunk_zTXt, addChunk_iTXt):
 add missing const to casts on const pointers in zlib_compress() calls.
 (see: https://github.com/lvandeve/lodepng/pull/34).
lodepng.c (inflateHuffmanBlock): wrong error code if huffmanDecodeSymbol
 fail. (see: https://github.com/lvandeve/lodepng/pull/52).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1471 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-09 20:00:08 +00:00
Ozkan Sezer
9bf21b932f Makefiles: replace '$^' with '$<' in build rules. add dependency list for image.o.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1469 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-09 12:10:13 +00:00
Ozkan Sezer
1e728fa2ad - stb_image_write.h: keep only the jpg writer, the only thing we use
in quakespasm, and remove all others.
- image.c: disable decoder, ancillary chunks and error text support
  by defining the relevant LODEPNG_NO_??? macros.
  (Image_WritePNG): make use of upsidedown parameter for symmetry
  with Image_WriteJPG(). print an error message in case of encoding
  failure if error text support is enabled.
  (Image_WriteSTB): rename to Image_WriteJPG, adjust for jpg writing
  only. remove the old Image_WriteJPG wrapper.
  (enum imageformat_t): remove.
  (CopyFlipped): constify the data parameter.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1468 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-09 11:33:44 +00:00
Eric Wasylishen
f364c9864c Image_WritePNG: switch to lodepng, configure for fast compression
~3x faster than stb_image_write and similar file size

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1467 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-09 06:23:42 +00:00
Ozkan Sezer
1eb57d8cbe stb_image_write.h: fix build with watcom
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1466 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-08 09:37:06 +00:00
Eric Wasylishen
4a02827fe6 SCR_ScreenShot_f: change default format to png, using stb_image_write
Add optional format and quality args to "screenshot" command,
can specify tga, png, jpg

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1465 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-08 05:07:56 +00:00
Ozkan Sezer
10ed2c85dc kill annoying warnings. remove commented pakfile/progs.dat testing code from Modlist_Init().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1464 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-04 20:36:59 +00:00
Eric Wasylishen
6b2affaebc r_alias: add MF_HOLEY (0x4000) model flag, from QSS.
(MarkV compatible).
For more info see: http://celephais.net/board/view_thread.php?id=61351&start=1&end=1

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1463 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-04 19:45:11 +00:00
Eric Wasylishen
a2fb8317cb gl_vidsdl.c: restore vid_refreshrate from fitz 0.85; SDL2 supports it
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1461 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-03 06:43:38 +00:00
Eric Wasylishen
3b5f3794cb gl_vidsdl.c: fix indentation
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1460 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-30 22:55:51 +00:00
Eric Wasylishen
9a37377cf4 gl_vidsdl.c: fix bug where vid_desktopfullscreen would get set to 1
when entering fullscreen. Fix VID_GetDesktopFullscreen() which
was incorrectly returning "true" in regular fullscreen mode.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1459 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-30 22:46:34 +00:00
Ozkan Sezer
6c885849d2 in_sdl.c: OW1.9 doesn't have powf() and sqrtf(). use pow/sqrt, instead.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1458 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 07:00:50 +00:00
Ozkan Sezer
005650abf4 sdl, win32, watcom: generate our own import lib instead of using vc6 lib
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1456 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 05:55:26 +00:00
Ozkan Sezer
01b01c0a13 SDL windows: move SDL_main sources into their own directory
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1455 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 05:36:30 +00:00
Ozkan Sezer
586447e449 net_wins.c: disable WSA*BlockingHook() stuff for winsock2 builds
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1454 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 00:35:03 +00:00
Ozkan Sezer
78ebe4ff0a add SDL2 stuff to watcom makefile
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1453 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-29 00:33:02 +00:00
Eric Wasylishen
bb8debf18f sv_move.c: add explicit int cast to a float argument to abs().
Previously, the cast was implicit since abs() takes an int,
so there is no change in behaviour.
Suppresses a clang warning that we might want fabs().

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1451 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:50:25 +00:00
Eric Wasylishen
3d594fc4d4 PL_ErrorDialog: fix clang warning about format string not a literal
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1450 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:50:18 +00:00
Eric Wasylishen
0a5cd3c2ad Modlist_Init: fix unused variable warning
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1449 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:50:11 +00:00
Eric Wasylishen
7df6ca7bd1 snd_mix.c: Fix clang warnings about bit-shifting negative numbers
(which is implementation-defined)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1448 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:50:03 +00:00
Ozkan Sezer
b99a823965 noreturn functions: use the 'aborts' aux pragma with Watcom
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1447 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:11:03 +00:00
Ozkan Sezer
386cb1a720 add win32 makefile for watcom. it builds and runs.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1446 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:10:03 +00:00
Ozkan Sezer
be437dd258 r_alias.c: change *AttrIndex into macros instead of static const vars.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1443 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:01:19 +00:00
Ozkan Sezer
c671916fc7 sv_main.c (SV_Init): use a return instead of a dummy assignment after Sys_Error to silence compiler
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1442 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:00:56 +00:00
Ozkan Sezer
e2d1800b12 r_part.c (R_ReadPointFile_f): silence pesky compiler warnings
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1441 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:00:32 +00:00
Ozkan Sezer
3cf6946ebd revise the function attributes usage: do not use the gcc __attribute__
directly, but define proper macros for each attribute we do or may use.
also support MSC along the way for example with the noreturn attribute.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1440 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 12:50:10 +00:00
Eric Wasylishen
f13af4d0e5 in_sdl.c: raise joy_deadzone_trigger to 0.2.
Previous value of 0.001 was probably too low, may have caused
"stuck" triggers:
http://celephais.net/board/view_thread.php?id=60452&start=2935

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1439 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-27 22:55:08 +00:00
Ozkan Sezer
72d5f11278 bump version to 0.93.0 (there has been enough changes), update changelog.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1437 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-27 15:56:58 +00:00
Ozkan Sezer
6793c30712 change QUAKESPASM_VER_SUFFIX to be a string literal and adjust
QUAKESPASM_VER_STRING for it.  revise the QS_STRINGIFY macros.
fixes "the not enough actual parameters for macro QS_STRINGIFY"
warnings from my VS2005.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1436 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-27 14:32:31 +00:00
Ozkan Sezer
d1f391b383 remove all libmodplug code
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1435 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-27 12:50:17 +00:00
Eric Wasylishen
e87a1b8d9d drop MAX_MAP_LEAFS limit and move 4 static buffers to use realloc().
4 buffers were: mod_novis, decompressed, checkpvs, and fatpvs.

Also fix fatbytes calculation in SV_FatPVS to match the other PVS
buffers, was (numleafs+31)>>3, changed to (numleafs+7)>>3.
I am assuming the previous was a bug/typo.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1434 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-26 04:27:16 +00:00
Eric Wasylishen
f5fdc1867d raise CON_TEXTSIZE from 64KB to 1MB
useful for capturing debug info e.g. "entities" command which prints
a lot.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1431 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-22 01:56:38 +00:00
Eric Wasylishen
e24916cfc0 Add "find" as an alias for "apropos" (for consistency with MarkV)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1428 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-19 05:40:54 +00:00
Eric Wasylishen
737b6e9eb4 Host_Randmap_f: print the map being started
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1427 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-19 05:40:37 +00:00
Eric Wasylishen
af62037fde raise MAX_MAP_LEAFS to 80000 to handle ad_sepulcher.bsp
TODO: maybe switch to malloc'ed pvs arrays now?

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1420 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-24 07:23:46 +00:00
Eric Wasylishen
8d2d2cc8b3 host_cmd.c: Add "randmap" command, requested by Barnak
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1418 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-23 23:22:00 +00:00
Eric Wasylishen
50c52ae0eb Com_game_f: try execing quake.rc automatically..
Not convinced there are any issues with this, and it solves these
problems:
- change to new gamedir without execing quake.rc and exit: the
  config.cfg in the new gamedir will be clobbered with the settings
  from the previous gamedir.
- discrepancy between -game command line arg and "game" command.

Video mode is locked during the "exec quake.rc" to prevent the mode
from changing.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1417 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-23 22:02:49 +00:00
Eric Wasylishen
d8719d6e4f Modlist_Init: relax tests for mod directories
Consider any subdirectories of the com_basedir as mods, except for
.app bundles on posix systems. Previous code was too strict
as it required progs.dat or pak files, so it excluded map packs, etc.
(useful mods could contain almost anything, e.g. just a music directory,
just a config...)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1416 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-23 22:02:40 +00:00
Ozkan Sezer
3405b87ee0 pr_exec.c, MAX_STACK_DEPTH: increase from 32 to 64
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1415 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-23 15:47:01 +00:00
Eric Wasylishen
d61095a0e0 PF_lightstyle: make invalid style a warning instead of a Host_Error
Allows loading start.bsp in xmen TC again.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1414 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-22 03:32:14 +00:00
Eric Wasylishen
e30910131c Move filelist_item_t struct to quakedef.h, instead of redefining
it in console.c and host_cmd.c

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1411 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-06-12 02:18:55 +00:00
Eric Wasylishen
d09bbd2cd7 console.c: use q_snprintf for printing version number
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1409 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-29 06:54:14 +00:00
Eric Wasylishen
e45de4c68a Add QUAKESPASM_VER_SUFFIX macro for marking betas/dev builds.
Refactor printing of QUAKESPASM_VERSION/QUAKESPASM_VER_PATCH to use a new
QUAKESPASM_VER_STRING macro.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1408 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-29 04:17:49 +00:00
Eric Wasylishen
ebe31714b2 VID_SetMode: SDL2: stay on the current display when changing modes
This allows you to move the QS window to a different monitor and
then go fullscreen on that monitor. QS will still always start on
the primary monitor.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1407 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-27 07:29:49 +00:00
Eric Wasylishen
0a681bd7cd new r_scale cvar, for rendering the 3D view at 1/2, 1/3, or 1/4 res.
This is for emulating a low-resolution pixellated look,
or possibly as a performance boost on slow graphics cards.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1406 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-26 20:37:48 +00:00
Eric Wasylishen
c827ccaa66 Host_Loadgame_f: fix for arrow characters appearing in multiline messages
on Windows, a regression introduced in the Host_Loadgame_f rewrite r1398

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1405 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-09 00:01:41 +00:00
Ozkan Sezer
3d3d46887a tiny tidy-ups to snd_flac
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1404 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-30 08:51:34 +00:00
Eric Wasylishen
4bea6d51e2 UDP_Init: don't bother calling gethostbyname() if our hostname ends in ".local"
(a macOS thing), because it blocks for a few seconds and then fails
(on my system anyway), so it's pointless.

Fixes an annoying startup pause on macOS, which was reported as
https://sourceforge.net/p/quakespasm/bugs/15/

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1403 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-26 01:38:38 +00:00
Eric Wasylishen
f92ce77fc9 PF_VarString: throttle "exceeds standard limit" warning message
Prevents console spam on "developer 1" if a mod calls PF_VarString often (e.g. In the Shadows textbooks).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1402 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-25 20:07:34 +00:00
Eric Wasylishen
3e4b9f8f6c Cbuf_Init: raise cmd_text from 8k to 256k to handle large .cfgs, from QS-Spike
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1400 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-21 20:43:05 +00:00